Pyright

Latest version: v1.1.390

Safety actively analyzes 685838 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 71 of 81

1.0.58

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](https://github.com/microsoft/pyright/blob/master/docs/type-stubs.md).

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.

1.0.57

New Feature: Implemented "Rename Symbol" functionality in VS Code extension.
Enhancement: Added support for type completion entries that differ by case or by a small edit distance.
Enhancement: Added support for imported "pyd" files in the import resolver.
Bug Fix: Fixed Windows-specific bug where built-in collections type stub file wasn't recognized because of assumptions with slashes.

1.0.56

New Feature: Implemented "Go To Symbol in File..." feature in VS Code extension.
New Feature: Added new setting "pyright.disableLanguageServices" in VS Code extension that disables all language service features except hover.
Bug Fix: Fixed bug where references to classes declared in conditional scope (e.g. in an "if" statement) were incorrectly reported as unbound.
Bug Fix: Fixed handling of dataclass declarations that provide a custom __init__ method, overriding the synthesized __init__.
Bug Fix: Fixed type checker's handling of async generators.
Bug Fix: Fixed recent regression that caused break statements within for and while loops to report code as being unreachable.
Bug Fix: Fixed bug in type checker where it wasn't properly handling Type[X] when used as base class in class declaration.

1.0.55

New Feature: Added 'reportUnnecessaryIsInstance' switch. When enabled, the type checker reports any cases where isinstance() is used and the result is provably always true or false. At best, these represent unnecessary runtime overhead and more commonly represent bugs.
Enhancement: Made a bunch of suggested improvements to the type completion provider in the VS Code extension.
Enhancement: Improved responsiveness of VS Code extension, especially when files are being analyzed in the background.
Enhancement: Added unreachable code reporting after 'break' statements.
Bug Fix: Improved type constraint logic when the 'continue' keyword is used within a loop.
Bug Fix: Added support for properties whose type is defined using a generic TypeVar type.

1.0.54

Enhancement: Added special-case handling of `__all__` assignments so referenced symbols are marked as accessed.
Enhancement: Added support for class declarations that include base classes that are declared in terms of a variable with a "Type[X]" type annotation.
Enhancement: Changed logic in type completion provider to sort suggestions such that dunder names (magic types) appear after other names (under the assumption that the former are more rare).
Bug Fix: Fixed bug in type completion logic that prevented members from super-classes from being included in the suggestion list.
Bug Fix: Fixed missing check in type constraint logic that resulted in an "internal error" when "is" operator was used with LHS expression that included an index.
Bug Fix: Added support in type checker for dictionary expansion entries in a dictionary literal expression.

1.0.53

New Feature: Implemented NewType type support.
Enhancement: Improved type analyzer in case where class is passed in a context where a function is expected. The analyzer now synthesizes a function that corresponds to the class's constructor and/or init routine.
Enhancement: Added function documentation support in signature provider.
Enhancement: Made a bunch of suggested improvements to the completion provider including support for built-in types and selection details.
Bug Fix: Fixed bug in docstring processing where the entire docstring is on a single line.
Bug Fix: Fixed bug in type analyzer. It was incorrectly reporting that "yield" statements were not allowed in async functions. Only "yield from" should be flagged as errors.

Page 71 of 81

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.