npm pyright 1.0.58
Published 1.0.58

latest releases: 1.1.360, 1.1.359, 1.1.358...
4 years ago

This was a longer-than-usual delay between new versions because I was traveling and had no internet connectivity for the past two weeks. I implemented a bunch of important bug fixes and new features in the meantime.

New Feature: Type completion now supports auto-import! When you select one of these completion items from the menu, pyright will emit an import statement (or update an existing import statement). Imports are inserted intelligently according to PEP8 import ordering rules.

New Feature: A new Organize Imports command will sort and reflow all of the imports at the top of a source file, grouping them and alphabetizing them according the rules specified in PEP8. The command can be invoked from the command palette or by right-clicking in the source text and choosing "Source Action...".

New Feature: A new Create Type Stub feature will generate a "first draft" of type stub files for an imported third-party library. This is available in the VS Code extension as a "quick action" when clicking on a "type stub not found" error message. It's also available in the command-line version using the "--createstub" command-line switch. For more details see this documentation.

Enhancement: Improved type completion feature by allowing "fuzzy matches" (differences in capitalization or missing/added characters) for keywords and import names or symbols.

Enhancement: Improved type completion feature by adding more intelligence to the sorting of completion recommendations. It now takes into account the type of the completion (e.g. keyword, local variable, etc.) and whether that completion was selected recently.

Enhancement: Improved type checker's code flow engine. It now fully handles break and continue statements.

Enhancement: Improved analysis performance by 10-15% on average, sometimes much more.

Enhancement: Improved output of "--dependencies" feature in command-line version. It's now more concise, unless you combine it with "--verbose".

Enhancement: Implemented type checking for the unpack operator.

Enhancement: Improved type checking for exception classes provided in a raise statement -- especially when an iterator is used to specify multiple exception types.

Enhancement: Added optional verbose output for "--stats" option in command-line version. To view, combine "--stats" with "--verbose". The additional information includes analysis pass counts for each file.

Bug Fix: Fixed bug in "find references" and "rename symbol" features where some instances of a symbol were skipped.

Bug Fix: Fixed bug that caused type completion menu to appear when pressing "." within a doc string comment.

Bug Fix: Fixed bug in type analyzer relating to data classes (or classes derived from NamedTuple) where one or more fields use an annotated type with a default value assigned.

Bug Fix: Fixed unicode definitions so Korean (Hangul) characters and several other allowed unicode ranges are accepted in python identifiers.

Bug Fix: Fixed bug in logic that synthesizes methods for dataclass classes. In particular, the new method should be more generic to accommodate dataclass class hierarchies.

Bug Fix: Fixed bug in handling of class decorators that use overloads.

Bug Fix: Fixed bug in code flow analysis logic that allowed "break" statements to propagate beyond an inner loop, sometimes causing the type checker to make wrong assumptions about code reachability.

Don't miss a new pyright release

NewReleases is sending notifications on new releases.