Skip to content

Releases: microsoft/pyright

Published 1.0.65

24 Sep 05:35
Compare
Choose a tag to compare

New Feature: Added support for PEP 589 (TypedDict).

Enhancement: Updated all typestub files to the latest from the typeshed repo.

Bug Fix: Fixed issue that caused public member variables with annotated Literal types to not accept a literal assigned value.

Bug FIx: Fixed several bugs in type checker's logic that caused some type violations not to be reported.

Bug Fix: Changed Tuple (with no type arguments) to default to Tuple[...] rather than Tuple[].

Bug Fix: Fixed issue with Literal type arguments. String literals were being parsed as forward-declared types, and some strings generated tokenizer and parser errors.

Bug Fix: Fixed type checker bug where functions and classes were flagged as not being assignable to 'object'.

Published 1.0.64

22 Sep 19:33
Compare
Choose a tag to compare

Enhancement: Added check within type checker to emit an error when code attempts to assign a value to a generic type (e.g. "Dict[str, str] = {}").

Enhancement: Implemented support in type checker for Python's "comparison chaining" feature (e.g. "3 < a < 4").

Enhancement: Augmented static expression evaluation to handle "and" and "or" expressions.

Bug Fix: Fixed a bunch of misspellings in error and warning text.

Bug Fix: Fixed a bug in the auto-complete feature that caused new import symbols to be inserted in the wrong place if the previous symbol (alphabetically) had an "as" clause.

Bug Fix: Fixed a bug in the auto-complete feature that caused bad performance for really large code bases.

Published 1.0.63

18 Sep 07:13
Compare
Choose a tag to compare

Enhancement: Added support for constraining the type of the RHS of an assignment statement based on the expected type of the LHS.

Enhancement: Suppressed return type check for functions whose implementations consist only of "...".

Enhancement: Changed heuristic about whether to strip literal values from inferred class or instance member type. If it's not a constant or private member, I now use the more general type (not the literal).

Bug Fix: Changed tuple type expression evaluation to retain literals rather than strip them.

Bug Fix: Fixed recursion check that caused stack overflow during type evaluation.

Bug Fix: Removed assumption in type stub generation logic that __all__ assignment would appear after all imports in the file.

Published 1.0.62

15 Sep 23:11
Compare
Choose a tag to compare

Enhancement: Improved responsiveness of language services in VS Code extension.

Enhancement: Made a number of significant performance improvements in type analyzer. Some of these required major internal changes to the type engine, so there's a higher-than-normal risk of regressions.

Enhancement: Made improvements to type completion suggestions for import symbols.

Bug Fix: Added support for dataclass inheritance hierarchies.

Published 1.0.61

12 Sep 05:46
Compare
Choose a tag to compare

New Feature: Added workspace symbol provider (command-T in VS Code) that allows for global symbol searches across the entire project.

New Feature: Diagnostic output (errors and warnings) now include the name of the rule that generated the diagnostic.

New Feature: Added support for mypy "reveal_type" call.

Enhancement: Allow use of unions of generic class types.

Published 1.0.60

11 Sep 04:20
Compare
Choose a tag to compare

New Feature: Added "Add 'Optional'" quick action for default initialization of None.

Enhancement: A bunch of performance enhancements, leading to a ~20% perf improvement for the type analyzer.

Enhancement: Removed two-character limit on auto-import completions based on feedback.

Enhancement: Added support in auto-import feature for implicit imports.

Enhancement: Eliminated reportUnnecessaryIsInstance error reporting for expressions within assert statement.

Bug Fix: Added handling of Unicode BOM (byte order market) at start of file.

Published 1.0.59

06 Sep 16:59
Compare
Choose a tag to compare

Bug Fix: Fixed issue with inaccessible code detection relating to the use of a break statement within a try block.

Enhancement: Changed "Organize Import" feature to separate out relative imports into their own (fourth) group.

New Feature: Added a "reportUnnecessaryCast" switch that detects calls to cast that are unnecessary.

Published 1.0.58

05 Sep 00:54
Compare
Choose a tag to compare

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.

Published 1.0.57

23 Aug 13:38
Compare
Choose a tag to compare

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.

Published 1.0.56

17 Aug 05:59
Compare
Choose a tag to compare

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.