pyright

Static Type Checker for Python

OTHER License

Downloads
2.3M
Stars
13.2K
Committers
119

Bot releases are hidden (Show)

pyright - Published 1.0.62

Published by erictraut about 5 years ago

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.

pyright - Published 1.0.61

Published by erictraut about 5 years ago

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.

pyright - Published 1.0.60

Published by erictraut about 5 years ago

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.

pyright - Published 1.0.59

Published by erictraut about 5 years ago

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.

pyright - Published 1.0.58

Published by erictraut about 5 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.

pyright - Published 1.0.57

Published by erictraut about 5 years ago

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.

pyright - Published 1.0.56

Published by erictraut about 5 years ago

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.

pyright - Published 1.0.55

Published by erictraut about 5 years ago

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.

pyright - Published 1.0.54

Published by erictraut about 5 years ago

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.

pyright - Published 1.0.53

Published by erictraut about 5 years ago

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.

pyright - Published 1.0.52

Published by erictraut about 5 years ago

New Feature: Added "strictParameterNoneValue" rule.
New Feature: Improved type checking for raise and raise/from statements.
Bug Fix: Fixed handling of super() call. It now properly handles zero, one and two-arg versions. Also handles case where target class derives from multiple base classes.

pyright - Published 1.0.51

Published by erictraut about 5 years ago

New Feature: Wildcard characters are now supported for include, exclude, ignore and strict path arrays in the config file. Supported wildcards include ** (matches against one or more directories), * (matches against zero or more characters), and ? (matches against a single character).
New Feature: Added config rule "reportCallInDefaultInitializer" that emits an error or warning when a function call is used within a parameter's default value initialization expression.

pyright - Published 1.0.50

Published by erictraut about 5 years ago

New Feature: Implemented type checking for augmented assignment statements.
New Feature: Implemented minimal support for InitVar class used in dataclass declarations.

pyright - Published 1.0.49

Published by erictraut about 5 years ago

Bug Fix: Added support in type checker for assignment expressions that target tuples that end in an unpack expression. The previous version simply crashed in this case, resulting in an "internal error" message.
Bug Fix: Fixed handling of multi-root workspaces in VS Code extension. The previous version assumed that workspace roots were always peer folders. It now handles nesting.

pyright - Published 1.0.48

Published by erictraut over 5 years ago

Enhancement: Implemented more thorough type checking for assignments — especially assignments to member variables.
Bug Fix: Eliminated some redundant and inconsistent error messages relating to assignments. Added missing information to some error messages.
Bug Fix: Fixed issue that caused duplicate errors to appear for some conditions related to list comprehensions.

pyright - Published 1.0.47

Published by erictraut over 5 years ago

New Feature: Added knowledge of built-in type ModuleType.
New Feature: Added support for per-folder settings in a multi-root workspace.

pyright - Published 1.0.46

Published by erictraut over 5 years ago

Bug Fix: Fixed regression that caused crash in VS Code extension for some users. The regression was introduced as part of the new multi-root workspace support.

pyright - Published 1.0.45

Published by erictraut over 5 years ago

New Feature: Added support for multi-root workspaces.
Bug Fix #167: Fixed bug in parsing of f-string expressions.

pyright - Published 1.0.44

Published by erictraut over 5 years ago

New Feature: Type analyzer now infers a function return type of "NoReturn" if function doesn't return any value and always raises an exception. Methods marked @abstractmethod are exempt. An explicit return type annotation always overrides this inference.
Bug Fix: Fixed logic for try/except/else/finally statements to properly handle code flow analysis. The previous implementation was incorrectly identifying unreachable code.
Bug Fix: Type analyzer wasn't correctly inferring type of set when a set comprehension was used.

pyright - Published 1.0.43

Published by erictraut over 5 years ago

Enhancement: Improved handling of ellipsis.
Bug Fix: Fixed bug that resulted in constant redefinitions not to be flagged as errors if the original assignment had an explicit type annotation.
Bug Fix: Fixed bug that caused type completions to appear within certain string tokens.
Bug Fix: Allow generic type (e.g. Type[T]) to be used as the annotation for a callable parameter or variable.