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.22

Published by erictraut over 5 years ago

Bug Fix: Fixed bad regression introduced in 1.0.20 where imported modules that are imported with the import xyz statement (as opposed to the from xyz import abc form) are reported as 'unbound'. This occurs only if there is no type stub file found for that import.

pyright - Published 1.0.21

Published by erictraut over 5 years ago

New Feature: Added "reportUntypedNamedTuple" config switch for reporting the use of "namedtuple", which is an untyped version of "NamedTuple".
New Feature: Added type inference support for list comprehension statements.
New Feature: Improved type inference when indexing into a tuple type with a constant integer index. It now uses the appropriate type for that tuple entry if it's known.
Bug Fix #101: Type inference engine now infers a return type of Generator[Y] for generator functions rather than Iterator[Y].
Bug Fix: Fixed bug that masked type checking operations for certain built-in types like List and Dict.
Bug Fix: For statements now allow iterators that provide __getitem__, as per PEP 234.
Bug Fix: Fixed an issue where classes defined with NamedTuple were not providing correct type checks.
Bug Fix: Fixed bug in completion handler that caused completion recommendations to appear when pressing period within a comment.
Bug Fix: Pyright was failing to search beyond the first search path when using fall-back paths from the python interpreter.

pyright - Published 1.0.20

Published by erictraut over 5 years ago

This release includes a significant set of changes to the core type engine that are required to enable the next round of functionality. I've done my best to avoid introducing regressions, but they are possible in a change of this size.
One known regression is that unbound or potentially-unbound variables are no longer flagged in many cases.

New Feature: Added new config switch "reportUnknownParameterType" that reports input and return parameters with an unknown type.
New Feature: Added new config switch "reportUnknownVariableType" that reports local variables with an unknown type.
New Feature: Added new config switch "reportUnknownMemberType" that reports class members (instance variables and class variables) with an unknown type.
New Feature: Further improved logging to diagnose import failures.
New Feature: Added "strict mode" that can be enabled on a per-file basis by adding the comment "# pyright: strict". This enables all type-checking configuration flags for that file.
New Feature: Added support in type check engine for expression type constraints involving the "or" operator.
Bug Fix #91: Added code to convert file specs passed to command-line from relative to absolute.
Bug Fix: Added code path lookups for both "lib" and "Lib" within virtual environment to accommodate capitalization convention on Windows.
Bug Fix: Removed limitation that type annotation strings not use bytes, unicode or raw strings.

pyright - Published 1.0.19

Published by erictraut over 5 years ago

New Feature: Types are now validated for assignments that target objects with a __set__ method, including properties with setters.
New Feature: Added key/value type inference for dictionary literal statements.
New Feature: Unreachable code is now detected in cases where a return or raise occurs before the end of a code block.
New Feature: Added verbose diagnostic information for import resolution failures. Added --verbose switch for command-line tool.
New Feature: Type constraint subsystem is now able to handle more complicated code flow inferences.
Bug Fix: Fixed false positive error related to arg/param matching when an unpacked arg is used.

pyright - Published 1.0.18

Published by erictraut over 5 years ago

New Feature: Added type constraint for assert command.
Bug Fix: Fixed bug in parser that allowed an arbitrary number of comma-separated expressions to appear after an assert keyword.
Bug Fix #90: Fixed false error for common arithmetic binary operators that act upon int/float/complex when operand is union with an unknown or any type.
Bug Fix #88: Text completion options shouldn't appear for comments or strings.
Bug Fix: Fixed regression introduced in previous version where the check for max import chain length generated false positives.
Bug Fix: Command-line tool didn't allow the use of "--watch" with a list of specified files.
Bug Fix #89: Fixed regression in tokenizer that caused incorrect line attributes when CR/LF was contained within a string.

pyright - Published 1.0.17

Published by erictraut over 5 years ago

New Feature: Improved formatting of errors and warnings for command-line tool.
New Feature: Started to implement type completion for keywords, local variables, module variables, and class/instance variables.
Bug Fix: FIx for #83: Changed the way type analyzer handles assignment statements with type annotation.
Bug Fix: Fix #85, recursion crash due to long import chains.
Bug Fix: Partial fix for #82 (hang)
Bug Fix: Don't flag invalid as errors string escape sequences in raw strings.
Bug Fix: Removed logo from VS Code README.

pyright - Published 1.0.16

Published by erictraut over 5 years ago

New Feature: Unused code blocks are now displayed as "grayed out" in VS Code.
New Feature: Use of "yield from" generates error for Python <3.3.
New Feature: Scanning of string literals now fully complies with Python spec, including support for all defined escape sequences.
New Feature: Added "reportInvalidStringEscapeSequence" config switch to control whether the analyzer reports errors or warnings for invalid escape sequences.
New Feature: Use of Protocol in a code file is now flagged as illegal for Python <3.7.
New Feature: An attempt to instantiate certain special classes defined in typing (Callable, Generic, etc.) now emits an error.
Fixed bug in import cycle detection logic that could result in slow analysis time and even an infinite loop.

pyright - Published 1.0.15

Published by erictraut over 5 years ago

New Feature: implemented proper type checking for assignments to variables with explicitly declared types.
New Feature: reportUntypedBaseClass enables reporting of base classes that are Unknown type and therefore defeat all type checking for derived types.
New Feature: reportOptionalContextManager enables reporting of Optional types used with "with" statements.
New Feature: reportOptionalOperand enables reporting of Optional types used within unary and binary statements where None is not otherwise permitted.
New Feature: more complete type checking for operand types for unary and binary statements.
New Feature: relaxed type checking of parameters to constructor of NamedTuple factory class if <NTFactory>.__new__.__defaults__ is assigned a value at some point.
Bug Fix: Type[X] wasn't properly specialized in some cases.
Bug Fix: Literal byte strings (e.g. b'hello') are now properly typed as bytes rather than Unknown type.

pyright - Published 1.0.14

Published by erictraut over 5 years ago

New Feature: Added "reportOptionalIterable" config switch to allow reporting of Optional types used as iterables (e.g. in for statements).
New Feature: Added "reportImportCycles" config switch to report cycles in import graph.
New Feature: Added "reportPrivateUsage" config switch to report use of private variables and functions.
New Feature: Type checker now infers the types of list literals.
New Feature: Type checker now understands the unpack operator used within dictionaries, lists, and parameter lists.
New Feature: Type checker now validates types for slice operands.
New Feature: Type checker now understands __getitem__, __setitem__, and __delitem__ magic operators and enforces their presence for subscripting.
Improved performance by restricting implicit imports when using "from X import Y" form of import statement.
Fixed some false positives in reporting of operator overrides for unary and binary operators.
Removed the assumption that "self" and "cls" are the first parameter names for instance and class methods.

pyright - Published 1.0.13

Published by erictraut over 5 years ago

New Feature: Added type checking for generator functions (i.e. functions that contain a 'yield' or 'yield from' statement).
New Feature: Added type checking for coroutine functions (i.e. async functions).
New Feature: Added type checking enforcement for iterators used in 'for' statements (iter or aiter overrides).
New Feature: Added type checking enforcement for 'with' statement (enter or aenter overrides).
New Feature: Added support for NoReturn return type.
New Feature: Replaced "--timing" command-line with "--stats", which now provides more stats than just timing.
Fixed bug where the use of a module as a type argument was not flagged as an error.
Improved type specialization logic for member accesses.

pyright - Published 1.0.12

Published by erictraut over 5 years ago

New Feature: Type checker now supports generators functions. If yield type isn't specified, the checker infers the type from yield clauses.
New Feature: Added support for type hints that use a combination of string and non-string tokens (e.g. Optional['Foo']).
New Feature: Added support for comment-based type hints for assignment statements, since these are used in some typeshed stub files.
New Feature: Added support for class decorators and added a configuration switch "reportUntypedClassDecorator" to allow these to be flagged by the type checker.
New Feature: Type checker now distinguishes between access, set, and delete operations when accessing members of an object and flags errors when that usage is not supported (e.g. writing to a property that has no defined setter).
Enhancement: Improved type checker's ability to track types within while and for loops.
Fixed bug with structural (protocol) type checking that generated false positives.
Deleted Python 2 typeshed fallback stub files since they are never used by Pyright. This reduced the package size by about 100K.

pyright - Published 1.0.11

Published by erictraut over 5 years ago

New Feature: Type checking support for @dataclass, which was introduced in Python 3.7.
New Feature: Type checker now reports incorrect usage of ellipses in various cases.
Fixed #67: Modules are now treated as though they derive from object by the type checker.
Improved responsiveness of VS Code extension.
Improved error reporting for abstract class instantiation; abstract methods are now reported with their containing class.
Fixed #68: Silenced incorrect error for star expression usage (list expansion).
Fixed some edge cases relating to new and init validation.
Fixed #66: Bug caused an infinite loop in type checker.
Fixed automatic detection of python import paths for Python 3.x environments (contribution from @zhangkaizhao)

pyright - Published 1.0.10

Published by erictraut over 5 years ago

New Feature: Partial support for Python 3.7 data classes. Classes must subclass from NamedTuple. Doesn't yet handle @dataclass class decorator. (Contribution from mhzed)
New Feature: Detect and flag attempt to instantiate abstract class or any class that derives from an abstract class that doesn't override all abstract methods.
New Feature: Pyright now retrieves the search paths from the default python interpreter or from the interpreter specified by the python.pythonPath setting in VS Code.
Fixed bug in file URI formatting that caused error messages on Windows.
Fixed exit code reporting in command-line tool.
Provided hover support in VS Code extension for symbols that have unknown types.

pyright - Published 1.0.9

Published by erictraut over 5 years ago

New Feature: Type analyzer now analyzes function decorators rather than ignoring type analysis for all calls to functions that have decorators. Proper analysis requires decorators to be annotated appropriately. A new config switch "reportUntypedFunctionDecorator" to identify decorators that lack the appropriate type annotations and therefore defeat type checking.
New Feature: Type analyzer is now smarter about analyzing while/else statements.
New Feature: Type analyzer handles while True and knows that it will not exit through the bottom of the loop.
New Feature: Pyright VS Code extension is now activated automatically if a pyrightconfig.json file is present in the workspace.
New Feature: Type analyzer now specializes the parameter and return types when analyzing a method on a specialized class.
New Feature: Type analyzer now takes into account parameters to the constructor (including the init method) to infer the specialized type of an object.
New Feature: Variable ${workspaceFolder} is now expanded for paths that come from VS Code settings (like "python.venvPath").
New Feature: "Naked" raise is now flagged as an error if used outside of except clause.
New Feature: Added "--timing" switch to command-line tool to output detailed timing stats. By default, only the total time is reported.
New Feature: Command-line version can now be run with no parameters. It looks in the current working directory for a configuration file called "pyrightconfig.json".
Fixed exit code reporting in command-line version. It now properly exits with a code of zero if no errors or warnings are found.
Fixed bugs related to relative imports, especially with relative imports that consist of only "." or "..".
Fixed several bugs in type analysis engine related to tuples.
Removed "-P" switch from command-line tool. It was deprecated in the previous release.

pyright - Published 1.0.8

Published by erictraut over 5 years ago

New Feature: Added new configuration switches reportOptionalSubscript, reportOptionalMemberAccess and reportOptionalCall to control whether the type checker should report errors for these conditions.
New Feature: Added type analysis for lambdas.
New Feature: Added more comprehensive error reporting for type mismatch errors. These multi-line errors now include hierarchical information and detail about the detected type mismatch, allowing for easier diagnosis.
New Feature: The type checker now reports cases where a non-quoted type forward reference is used within a regular ".py" file. Such forward references are allowed in stub files.
Fixed several bugs in type matching logic related to function (Callable) types.
Fixed bug in handling of special-case types like Dict and FrozenSet when they are used in type annotations with no type arguments.
Added missing support for matrix multiply operator (@).

pyright - Published 1.0.7

Published by erictraut over 5 years ago

New Feature: Added support for PYTHONPATH environment variable for resolving imports.
New Feature: Added type checking for expressions that involve arithmetic, logical, and comparison operators.
Removed support for pythonPath config file entry and VS Code setting because it was confusing everyone.
Fixed type analyzer to not flag imported symbols as missing if they come from an external source file, even though pyright doesn't parse and analyze such files.

pyright - Published 1.0.6

Published by erictraut over 5 years ago

New feature: Progress reporting in VS Code status bar.
New feature: Return type validation is now disabled for methods with @abstractmethod decorator.
New feature: Added JSON schema for pyrightconfig.json file so VS Code provides IntelliSense.
New feature: Added validation of type arguments for specialization of generic types. These are now validated against TypeVar constraints and bounds.
New feature: Added "ignore" settings which silences any errors or warnings generated for specified files or directories.
New feature: Added more validation of venvPath, pythonPath, typingsPath, typeshedPath and other settings to help diagnose configuration problems.
Fixed bug that caused venvPath and pythonPath not to be honored in config file.
Fixed regression that caused unknown symbols used in type annotations not to be flagged as errors.
Fixed bug in expression evaluator that resulted in false positive type errors.
Fixed bug in type constraint logic to invalidate previous constraints when a value is modified through an assignment.
Fixed handling of __new__ magic method when it's called explicitly by name.
Fixed bug in type checking of functions that are passed as parameters.
Fixed logic that specializes generic types when no type parameters are specified (e.g. List or Callable).
Fixed bug that caused the analyzer to crash if a class derived from itself. This is now reported as an error case.
Made analyzer more resilient to internal errors. Rather than getting into an infinite loop of retries, it now flags a source file as complete and moves on.
Started to add tests for type analyzer.
Fixed crash that occurred if an input file or directory was invalid.
Further improved responsiveness of error reporting for files open within the editor.

pyright - Published 1.0.5

Published by erictraut over 5 years ago

Fixed several bugs in type constraint engine.
Improved performance of VS Code extension by increasing analysis batch time.
Added assignment type constraint for instance and class variables.
Fixed special-case type checking rules for int and float.
Fixed handling of type annotations that involve generic classes with no type variables (e.g. "list").

pyright - Published 1.0.4

Published by erictraut over 5 years ago

Added better support for generic type subclass analysis, including support for covariance and contra variance.
Fixed bug that caused type analysis not to converge sometimes, resulting in an infinite loop.
Fixed crashing bug that could occur if typeshed files were not found.
In VS Code extension, filled in "source" string so "pyright" appears in the problems panel.
Added support for a few configuration settings in VS Code that are common to the standard VS Code Python extension.
Added new config setting "reportMissingTypeStubs" to differentiate from "reportMissingImports".
Fixed bug in "isinstance" type constraint handling. Its logic was reversed when checking for subtypes.
Disabled reporting of errors to return type mismatches in generator functions. This will be enabled again once generator and coroutine support is added to the analyzer.
Added an error output when configuration specifies a python version older than 3.0.
Fixed reported type analysis bug that affected built-in types that had aliases defined in the collections.pyi type stub (notably, Deque, DefaultDict and ChainMap).

pyright - Published 1.0.1

Published by erictraut over 5 years ago

Fixed numerous bugs.