pyright

Static Type Checker for Python

OTHER License

Downloads
2.3M
Stars
13.2K
Committers
119

Bot releases are hidden (Show)

pyright - Published 1.1.260

Published by erictraut over 2 years ago

Bug Fix: Fixed regression that caused an internal assertion to fire, leading to a crash when certain forms of nested index expressions are used.

pyright - Published 1.1.259

Published by erictraut over 2 years ago

Enhancement: Enhanced the reportIncompatibleMethodOverride check to handle the case where a method is overridden by an overload and one of the overloads matches the base method.

Performance: Improved analysis performance in cases where variables within a loop have mutual dependencies.

Performance: Added performance optimization for a special case that can occur in code without type annotations. It affects "pseudo-generic" classes that are parameterized recursively.

Performance: Improved analysis performance in some cases by caching return types inferred through call-site inference.

Enhancement: Updated typeshed stubs to the latest version, which eliminates support for Python 3.6.

Enhancement: Added support for type narrowing of TypedDict instances based on assignments to a not-required key.

pyright - Published 1.1.258

Published by erictraut over 2 years ago

Bug Fix: Fixed a bug that resulted in incorrect type narrowing when using an in expression and the LHS operand is of type type. This situation requires some special casing.

Bug Fix: Fixed a bug in the handling of generic type aliases that are parameterized by ParamSpecs in the case where an explicit type argument is not provided. The type argument should default to ... in this case.

Bug Fix: Fixed bug in the expression printer. It was not properly handling a minimal slice (:). This affected certain logging output.

Performance: Added optimization for slice expression evaluation. It can be skipped in cases where the we are speculatively evaluating the type.

Performance: Implemented optimization for type evaluation for index expressions. In cases where there are multiple subexpressions separated by commas, we can skip the check for the __index__ magic method.

Bug Fix: Fixed a bug that resulted in incorrect isinstance type narrowing when one or more of the filter classes was decorated with a class decorator.

Enhancement: Added support for context managers whose __exit__ method is declared to return "Literal[False]". This is now treated the same as if it is declared to return "None".

Performance: Improved performance of type evaluations in certain cases where a union contains multiple types whose class hierarchy contains one or more unknown types.

Bug Fix: Fixed recent regression that resulted in attribution of a type var to the wrong scope when it was used in an __init__ method of a class with a class decorator.

Bug Fix: Fixed bug that results in incorrect type evaluation when a function with a **kwargs parameter is captured by a ParamSpec in certain circumstances.

Bug Fix: Fixed bug that resulted in incorrect type evaluation for values within a TypedDict that derives from a TypedDict that has been specialized.

Bug Fix: Fixed a bug that results in a spurious "argument type is unknown" diagnostic when an unannotated variable used within a loop is also used as the subscript for an index expression.

Bug Fix: Improved handling of incomplete types passed as arguments to magic methods.

Bug Fix: Fixed a bug that resulted in infinite recursion when using auto variance inference with certain recursive types.

Enhancement: Added more complete type validation for __getattr__, setattranddelattr` methods.

Bug Fix: Fixed a bug that resulted in a false positive when resolving a symbol from a multi-part import when a short form of that same multi-part import was also imported.

pyright - Published 1.1.257

Published by erictraut over 2 years ago

Behavior Change: Reverted recent change that resulted in false positive errors when using _ as a placeholder name for methods that are used with @register and similar decorators.

Bug Fix: Fixed regression in isinstance type narrowing when the filter type is a type[x] rather than x.

Performance: Implemented performance optimization related to overload evaluation.

Behavior Change: Changed type_assert diagnostics to fall under reportGeneralTypeIssues diagnostic rule rather than be emitted unconditionally.

Bug Fix: Fixed regression in completion provider by eliminating the recently-added commit characters.

Performance: Improved performance of semantic highlights, hover, and completion suggestions for member access expressions.

Performance: Improved performance in type guard logic by not evaluating a call expression base type until after verifying that the call potentially narrows the reference expression.

Bug Fix: Fixed a bug in the handling of for loops that resulted in incorrect type inference for the target expression.

Bug Fix: Fixed several bugs that resulted in incorrect type evaluations when a property getter or method has an inferred return type that contains a type variable.

Bug Fix: Fixed a bug that resulted in incorrect type evaluation of NewType for versions of python older than 3.8. (In 3.8, NewType was changed from a function to a class.)

Enhancement: Implemented provisional support for proposed PEP 695: Improved Syntax for Type Parameters. The new functionality is available only if you manually configure pyright to assume Python 3.12. It supports the new type parameter syntax, support for "type" statements (for type alias declarations) and support for autovariance.

Enhancement: Updated typeshed stubs to the latest version.

pyright - Published 1.1.256

Published by erictraut over 2 years ago

Enhancement: Improved error message generated when comparing two functions that return TypeGuard return types with incompatible types.

Bug Fix: Fixed false positive that occurs when overriding an abstract method (e.g. a property) with a field from a named tuple when both are used as base classes.

Behavior Change: Moved annotationNotSupported diagnostics under the reportGeneralTypeIssues diagnostic rule so they can be disabled.

Bug Fix: Fixed bug in isinstance type guard logic that resulted in incorrect narrowing when using a dynamic type or types for the second argument.

Bug Fix: Fixed a bug that resulted in a false positive when applying issubclass type narrowing from a type to an abstract class.

Bug Fix: Fixed a few inconsistent behaviors with incompatible redeclaration reporting. In particular, it's now OK to reassign a function if the assigned value is a compatible function. Also tightened up the special-casing for the symbol _, which is allowed to be redeclared only in the case where both declarations are functions (def statements). This exemption is provided for the single dispatch use case.

Bug Fix: Fixed a bug in the handling of dataclass where an existing __eq__ method was being overwritten by a synthesized variant. The same was true for other comparison operators.

Bug Fix: Fixed bug that resulted in a false positive error when handling a generic TypedDict with a literal type argument.

pyright - Published 1.1.255

Published by erictraut over 2 years ago

Bug Fix: Fixed bug that results in a false positive error when evaluating type compatibility of a callable with a *args: Any and **kwargs: Any parameter with a callable that contains a ParamSpec.

Behavior Change: Exempted class members named _ from the "reportIncompatibleMethodOverride" diagnostic check.

Bug Fix: Fixed bug that resulted in missing docstrings on an overloaded method when accessed through a member access expression.

Bug Fix (from Pylance): Auto-import should include import aliases from libraries.

Bug Fix: Fixed a bug that resulted in a false negative when performing protocol matching for a class instance when invariance is enforced.

Enhancement: Added support for overloaded functions that return a TypeGuard or StrictTypeGuard for some overloads.

Bug Fix: Changed heuristics in TypeVar constraint solver to handle a TypeVar bound to LiteralString and allow literal types to be retained when solving for this TypeVar.

Enhancement: Updated typeshed stubs to the latest version.

Bug Fix: Fixed a bug that resulted in a false negative when assigning a union of tuple[Any] | tuple[int] to an incompatible type.

pyright - Published 1.1.254

Published by erictraut over 2 years ago

Enhancement (from Pylance): Use new detail description feature added in 3.17 LSP to show full module path for auto import.

Bug Fix (from Pylance): Make sure file watcher treats a zip file as a file not folder.

Enhancement: Added code to detect and flag usage of # type: xxx comments for for and with statements.

Enhancement: Added new configuration setting called "defineConstant". It allows a configuration to specify one or more identifiers that should be assigned by pyright's binder to be constant anywhere they appear. Values can be boolean (true or false) or a string. If an identifier of this value is used within a conditional statement (like if not DEBUG:) it will affect pyright's reachability analysis for the guarded code blocks.

Bug Fix: Fixed bug that resulted in a false negative when attempting to call pop on a TypedDict with a key that is required.

Enhancement: Added support for new reportTypeCommentUsage diagnostic check. It flag the usage of # type: xxx comments for functions and variables. These are still supported for backward compatibility, but they are increasingly irrelevant and will likely be deprecated in the next few years.

Bug Fix: Fixed a bug that resulted in a false negative when a variable with a declared type is overwritten by an incompatible type by an import statement.

Enhancement: Added code to print the pyright version as part of the CLI output. This is useful for diagnosis.

Bug Fix: Undid previous fix related to circular class dependency detection because it introduced a regression with sqlalchemy stubs. Implemented a different solution to detect circular class dependencies and handle them correctly.

Bug Fix: Changed the handling of partial stub packages to conform with PEP 561. They should always overlay the original package even if that package is marked "py.typed".

Bug Fix: Fixed bug in tokenizer that results in incorrect tokenization when a hex numeric literal is followed by a newline followed by either a 'b' or 'o' character.

pyright - Published 1.1.253

Published by erictraut over 2 years ago

Bug Fix: Fixed a bug that resulted in a false positive error when using an unpacked TypedDict for a **kwargs parameter annotation, and the caller passes an unpacked TypedDict as an argument but the argument is a subclass of the parameter's TypedDict.

Bug Fix: Fixed bug in "--dependencies" command-line option. When used with partial stub files, it was not emitting the correct paths.

Bug Fix: Fixed false positive error that occurs when using an issubclass type guard to narrow a type to an abstract base class. The resulting type should be instantiable without receiving a "cannot instantiate ABC" error.

Bug Fix: Fixed bug in type evaluator related to the handling of a recursive type alias that is self-referential. This resulted in various strange behaviors when this bogus type alias was later used as an annotation.

Enhancement: Enhanced bidirectional type inference for constructor calls to handle the case where a generic class has no __init__ method but has a __new__ method that informs the value of one or more type variables.

Enhancement: Updated typeshed stubs to the latest version.

Bug Fix: Fixed a bug that resulted in incorrect type evaluation when an asymmetric property (where the getter type doesn't match the setter type) also has a deleter.

Bug Fix: Fixed bug in the "reportIncompatibleMethodOverride" check that results in a false positive if the parent class method has one or more keyword-only parameters and the override method has a kwargs of compatible type.

Bug Fix: Fixed a bug in the "reportIncompatibleMethodOverride" check that resulted in a false negatives when the override method accepted too few positional arguments but accepted a **kwargs parameter.

Bug Fix: Fixed a bug that resulted in spurious type evaluation errors when certain circular dependencies existed between class declarations. When evaluated in certain orders, a class type was being partially constructed with a corrupt MRO. This type was then cached and used in subsequent type evaluation steps, resulting in false positive errors.

Bug Fix: Fixed a bug that resulted in a false positive when using a captured variable within an inner function or lambda and the variable has been narrowed based on a NoReturn call within a conditional block.

pyright - Published 1.1.252

Published by erictraut over 2 years ago

Bug Fix: Fixed a false positive error when the special form Unpack is used in a context other than a type annotation.

Bug Fix: Fixed bug that resulted in a crash (due to infinite recursion) in reference provider under certain circumstances involving symbol renames.

Enhancement: Added check for a dataclass member that lacks a type annotation but is assigned a field descriptor. This combination results in a runtime exception in the dataclass implementation.

Behavior Change: Increased maximum number of declarations (assignments) to consider when inferring the type of an unannotated variable. It was previously 16, but it is now 64.

Bug Fix: Fixed bug in lambda type evaluation so it properly detects and reports when its type is incomplete due to recursion.

Bug Fix: Fixed regression in code flow analysis that depends on NoReturn call evaluation.

Bug Fix: Improved handling of calls to overloads that return NoReturn. If all overloads are annotated with NoReturn, the call is now evaluated as NoReturn. Previously, only the last overload was considered.

Bug Fix: Fixed bug that causes false positive when the evaluated type of a default argument used within a base class must be specialized for a derived class.

Bug Fix: Reduced the max number of recursive inferred function return results from 16 to 12 to address a crash (stack overflow) that appears in the pylance telemetry.

pyright - Published 1.1.251

Published by erictraut over 2 years ago

Bug Fix: Fixed a bug that results in a false positive when the return type annotation of a function requires code flow analysis to evaluate and a call expression is located on a code path between the function and the declared type referenced by the return type annotation. The fix is to skip "NoReturn" analysis in the code flow engine in this case (and several other similar cases) because it's not necessary. This has the added benefit of improving performance.

Bug Fix: Fixed misleading diagnostic message associated with reportUnnecessaryComparison check when != operator is used in the expression.

Bug Fix: Added logic to better handle the case where a symbol is defined multiple times with a TypeAlias declaration. This is an error condition, but it does occur in some stdlib type stubs if pyright is configured to use "All" for the "pythonPlatform" setting.

Enhancement: Improved type verifier so it can target submodules that are installed using an editable install mechanism.

Performance: Added small performance enhancement for protocol matching. When a protocol mismatch is detected, the remainder of the members are skipped if the caller hasn't requested detailed diagnostic information.

Performance: Added protocol matching optimization for the case where the source type and the destination protocol are both non-generic classes. In this case, we can safely cache the protocol relationship and shortcut future checks.

Bug Fix: Fixed bug in type narrowing logic for expressions of the form "X not in Y".

Bug Fix: Fixed a bug in the isinstance and issubclass type narrowing code paths. They were not handling nested tuples for the second argument.

Enhancement: Extended the "X in Y" type narrowing to support dict, defaultdict and OrderedDict classes.

Bug Fix: Fixed bug that resulted in a false positive error when using == or != operator with type(None).

Bug Fix: Fixed a bug that led to a false negative in some instances when assigning an inappropriate type to a TypedDict key.

Bug Fix: Fixed a bug that led to a false positive when assigning a value to an index expression where the base type of the index was inferred rather than declared.

Bug Fix: Fixed a bug in completion provider that resulted in incomplete member suggestions when a LiteralString type is used.

Bug Fix: Fixed a bug that resulted in a false positive error when evaluating an expression a + b where a is a LiteralString. For purposes of binary expression evaluation, LiteralString should act like a str.

pyright - Published 1.1.250

Published by erictraut over 2 years ago

Behavior Change: Removed the assumption that deferred evaluation of annotations is enabled by default in Python 3.11. It looks like this won't be the case.

Bug Fix: Fixed bug that resulted in false negative when using a variable in a type annotation if the type of that variable evaluated to Unknown.

Bug Fix: Fixed bug in code flow engine that caused type narrowing to fail in some cases where a conditional check was nested at least two loops deep.

Enhancement: Enhanced TypedDict support in completion provider to support unions that contain TypedDicts.

Bug Fix: Fixed bug that resulted in false negative when dunder methods are assigned as instance variables rather than class variables.

Bug Fix: Fixed bug that caused __slots__ entries to be treated as instance variables rather than class variables when looking up dundered methods.

Bug Fix: Fixed a bug that led to a false positive error when using a variable or parameter of type type[T] in a class pattern for a case statement.

Bug Fix: Fixed bug that resulted in a false negative when assigning a union that included an Unknown or Any to another type when invariance was enforced (e.g. list[Any | str] was considered assignable to list[int]).

Enhancement: Updated typeshed stubs to the latest version.

Bug Fix: Fixed bug that resulted in incorrect type evaluation for a recursive call to a generic function.

pyright - Published 1.1.249

Published by erictraut over 2 years ago

Bug Fix: Fixed bug that resulted in incorrect type evaluation of a specialized type alias when the type argument contained a literal type. The literal was incorrectly widened to its non-literal form.

Bug Fix: Fixed bug that resulted in the incorrect type evaluation of member access expressions where the base type is type(None) (i.e. the NoneType class).

Enhancement: Enhanced the reportInvalidTypeVarUse check to report cases where a TypeVar found within a return type may go unsolved because it appears only within input parameters that have default argument values specified as .... In this situation, it is recommended that an overload is provided that specifies the return type when the default argument value is used by a caller.

Bug Fix: Fixed bug that resulted in a false positive when assigning a function or callable containing position-only parameters to a callable with a TypeVarTuple.

Bug Fix: Fixed bug that caused docstrings to be truncated to 32 characters when generating stubs.

Enhancement: Enhanced reportInvalidTypeVarUse to detect cases where a constructor (__init__ method) includes class-scoped TypeVars that may go unsolved because they are associated only with parameters that have default argument values.

pyright - Published 1.1.248

Published by erictraut over 2 years ago

Enhancement: Added more complete validation of types used within a PEP 604-style union. Previously, the use of a P.args or P.kwargs type was not flagged as an error as it should be.

Bug Fix: Fixed bug that resulted in a false positive error when an await keyword was used with an operand that evaluated to a bound type variable.

Bug Fix: Fixed a bug that resulted in a false positive when using *args or **kwargs within a class argument list.

Enhancement: Improved special-case code for functools.totalordering so it enforces the operand type in the provided __lt__ method.

Bug Fix (from pylance): Honor the "hasWatchFileRelativePathCapabilities" of the client and don't use this facility if it's unsupported.

Bug Fix: Fixed a bug that caused dataclass_transform to fail when used on an overloaded function if it was not applied to the first overload.

Enhancement: Improved parse recovery for member access expressions that are missing the member name. This allows completion suggestions to work when a member access expression is used within a list comprehension.

Behavior Change: Changed reportInvalidStubStatement rule so it doesn't complain about call and augmented assignment expressions that perform allowed manipulations of the __all__ symbol.

Bug Fix: Fixed false positive type error that occurred when evaluating a call to a generic function parameterized with a ParamSpec and called within a loop construct.

Bug Fix: Fixed a bug that resulted in inconsistent type evaluation for a captured variable within a lambda or inner function when found within a loop.

Behavior Change: Updated dataclass_transform to support parameter name field_specifiers, which replaces the older parameter named field_descriptors. For now, we'll support both to retain backward compatibility with libraries that shipped with the older form.

Bug Fix: Fixed a bug that affected type evaluation of member access expressions when the LHS was a dataclass (or dataclass-like) class and the member was a field declared as a descriptor type.

Bug Fix: Fixed regression that resulted in a false positive error when checking for incompatible method overrides when the method contained local TypeVars.

Bug Fix: Fixed false positive "code too complex" error caused by a recent regression.

Bug Fix: Fixed bug in completion provider where it was emitting four spaces rather than using the predominant tab sequence when generating a multi-line completion suggestion for a method override.

Bug Fix: Fixed bug that resulted in a false positive error when using a super() call to invoke a constructor with a default argument value and a parameter that is annotated with a TypeVar.

Bug Fix: Fixed bug that resulted in incorrect type evaluation for a property access within a class when that property's getter has a generic return type.

Enhancement: Updated typeshed stubs to the latest version.

pyright - Published 1.1.247

Published by erictraut over 2 years ago

Bug Fix: Fixed bug in symbol resolution when a symbol is associated with a class scope but not yet assigned a value. In this case, the runtime looks in the global (module) scope for the symbol rather than following the normal scope hierarchy.

Bug Fix: Fixed a bug that led to a false negative when calling a Callable callback with a generic parameter and passing a non-generic argument.

Bug Fix: Changed the behavior of the type evaluator for generic functions and constructors where a TypeVar is unsolved. Previously, the TypeVar was "leaked". Now it is transformed into an "Unknown" type.

Performance: Added small performance and memory optimization in binder that avoids some extra work related to member access expressions.

Performance: Added code to detect execution flows with long straight-line code flow graph segments. This is not captured in the cyclical code complexity calculations that we normally use to determine if code is too complex to analyze.

Enhancement: Improved handling of context managers that swallow exceptions. The type of the context manager is now evaluated using the full type analyzer. The previous technique used some special-case handling which covered about 95% of the cases but left some cases unhandled.

Enhancement: Updated typeshed stubs to the latest version.

Bug Fix: Adjusted heuristics for TypeVar constraint solver to better handle the case where a union is assigned to a union of TypeVars and the number of subtypes in these two unions is the same.

Bug Fix: Fixed a bug that resulted in a false negative when doing protocol matching with a generic class that calls its own constructor.

pyright - Published 1.1.246

Published by erictraut over 2 years ago

Bug Fix: Fixed a bug in the reportUninitializedInstanceVariable check that results in a false positive error with TypedDict classes.

Bug Fix: Fixed a bug in the logic for synthesizing __init__ methods within a dataclass when a __slots__ definition is present. It was using the order of the slots entries rather than the order of the field declarations.

Enhancement: Added new verbose output for CLI when combined with '--stats' that outputs the total analysis time of each source file. This will help us narrow down performance problems.

Enhancement: Added check for an attempt to overwrite a method that is marked @final.

Bug Fix: Fixed a bug that resulted in a false positive reportUnknownVariableType diagnostic when using from .A import B statement. The symbol A was flagged as an "unknown" type even though it is not a symbol within the module's symbol table (unless the file is an __init__.py[i]).

Enhancement: Updated typeshed stubs to the latest.

pyright - Published 1.1.245

Published by erictraut over 2 years ago

Enhancement (from pylance): Added completion support for class variables inherited from a parent class.

Bug Fix: Fixed a bug that resulted in a stack overflow in rare cases where an unannotated decorator was used on hundreds of functions or methods within the same file.

Enhancement (from pylance): Improved completion suggestions for dict key names within an fstring expression. Double or single quotes are now chosen to avoid conflicting with the outer fstring quote type.

Bug Fix: Fixed bug that resulted in false positive error when using a member access expression within a list of base classes in a class declaration statement.

Behavior Change: Changed the heuristics in the TypeVar constraint solver to preserve literals when solving for a TypeVar in a Callable return type in cases where the source function has a declared return type with a literal annotation in it. It doesn't apply in cases involving an inferred return type or generic types that are specialized with literals.

Bug Fix: Fixed a bug in the reportUninitializedInstanceVariable check that results in a false positive when used with a dataclass or dataclass-like class. Seemingly-uninitialized class variables are implicitly overwritten by the synthesized __init__ method in a dataclass.

Performance: Fixed performance issue that occurred in certain situations involving deeply nested loops and many unannotated variables that are dependent on each other.

Enhancement: Added support for generic TypedDict classes.

pyright - Published 1.1.244

Published by erictraut over 2 years ago

Bug Fix: Fixed bug that resulted in a false positive when a callback protocol used a method-scoped ParamSpec in its __call__ method.

Enhancement: Improved error message for a call expression that uses a named argument when the target callable has no such named parameter.

Enhancement: Enhanced the reportUninitializedInstanceVariable check to detect cases where a class variable is declared but not initialized in the class body and no instance variable of the same name is assigned in the __init__ method.

Bug Fix: Fixed bug that resulted in the incorrect inferred type for an exception group that results when using a Python 3.11 except* statement.

Bug Fix: Fixed a bug that resulted in a crash when overflowing the type cache. It is implemented with a Map, which has a limit of 2^24 entries. The fix is to empty the cache if we approach this limit.

Bug Fix: Changed heuristic for type matching when source is a concrete type and destination is a union of that type and a TypeVar. The old heuristic attempted to solve the TypeVar, but the new heuristic leaves it unsolved. This eliminates a false positive error in certain edge cases and more closely matches the behavior of mypy in this case.

Bug Fix: Fixed bug that resulted in incorrect type analysis for dataclasses when a field declaration was within a conditional block.

Enhancement: Added support for generic NamedTuple classes, which are now supported in Python 3.11.

Bug Fix: Fixed bug that resulted in incorrect type evaluation of a dictionary key when assigning a dictionary expression to a dict with a generic key type.

Enhancement: Improved error message for incompatible field types in a TypedDict.

Enhancement: Added basic support for generic TypedDict classes, which are supported in Python 3.11. Assignment to a specialized generic TypedDict is now supported, but support for TypeVar solving is not yet in place.

pyright - Published 1.1.243

Published by erictraut over 2 years ago

Bug Fix: Fixed bug that resulted in incorrect type evaluation when referencing a descriptor object that is stored as an instance variable.

Bug Fix: Fixed a bug that resulted in incorrect import resolution in a library that you are debugging locally if that library is also installed in the current Python environment and the library includes stub (".pyi") files.

Bug Fix: Fixed a bug that resulted in false positive errors during protocol matching when a generic protocol derives from another generic protocol.

Bug Fix: Fixed a long-standing bug in protocol matching where results were evaluation-order-dependent in cases where a generic source class included a method with an inferred return type that was dependent on one or more TypeVars. If the return type was not inferred and cached prior to protocol matching, it was improperly specialized.

Enhancement: Added check for illegal use of ClassVar within a TypeAlias declaration.

Bug Fix: Fixed a bug that resulted in a false positive error when performing protocol matching with a property whose getter included a custom type annotation for its self parameter.

Bug Fix: Fixed a recent regression that broke list and dictionary inference in cases where bidirectional type inference was used with an expected type that included a TypeVar that was bound to a literal type or a union of literals.

Bug Fix: Fixed bug that resulted in incorrect type evaluation when function return type inference resulted in various recursive cases.

Bug Fix: Fixed long-standing bug that resulted in incorrect code flow analysis and type evaluation when handling some forms of NoReturn calls. There are still some limitations though; for example, it doesn't handle overloaded functions that return NoReturn for some argument lists.

pyright - Published 1.1.242

Published by erictraut over 2 years ago

Performance: Improved performance of import cycle check by adding caching.

Enhancement: Removed limitation that Literal must be imported directly from typing or typing_extensions. It can now be re-exported from another library, although analysis performance will suffer a bit in that case.

Enhancement: Improved error message for CLI version of pyright when it is passed a file that is not a Python source file.

Bug Fix: Fixed bug that resulted in infinite recursion and a crash in rare circumstances involving a self parameter annotation that referred to its own class.

Bug Fix: Fixed a bug that resulted in inconsistent type evaluation depending on evaluation ordering when a parameter or return type annotation involved a | (union) operator.

Bug Fix: Fixed bug that resulted in wrong ordering of type parameters in a generic protocol if Protocol[...] was meant to specify an explicit ordering, similar to the way Generic[...] specify an explicit ordering.

Bug Fix: Fixed bug that led to inconsistent type evaluation results when the code flow engine determined that an expression was unreachable. The results differed depending on whether there was a branch between the expression and point of the graph that was unreachable.

Bug Fix: Fixed bug in stub generator that resulted in code that was syntactically incorrect when an index subscript contained an extra "hanging" comma.

Bug Fix: Fixed a bug in the stub generator logic that produced syntactically incorrect code when the source file contained a function with a position-only separator in its signature.

Bug Fix: Fixed a bug that led to a false positive "reportOverlappingOverload" error when the return type of two overlapping overloads both used a generic return type.

Enhancement: Extended type guard for discriminated literal fields to support properties.

Bug Fix: Fixed bug in expression printer for lambda expressions. It was not properly printing a position-only separator.

Bug Fix: Fixed bug that resulted in incorrect type evaluation when using a generic type alias with an instantiable class (as opposed to a class instance) when the TypeVar used within that type alias was bound to a type[x].

Enhancement: Updated typeshed stubs to the latest version.

pyright - Published 1.1.241

Published by erictraut over 2 years ago

This is a quick-spin release that addresses two regressions introduced in the previous release:

Bug Fix: Fixed regression in "reportUnnecessaryComparison" diagnostic check that resulted in false positives when the LHS or RHS evaluated to Never.

Bug Fix: Restored compatibility with node 12.x. A dependency was updated in the previous build that assumed node 14 or newer, resulting in a crash when running on older versions of node.