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

Published by erictraut almost 3 years ago

"The Christmas Edition"

Enhancement: Added type checking support for functools.partial. This advanced support does not work with overloads or argument lists that include list or dictionary unpack operators.

Bug Fix: Fixed a bug that resulted in a ParamSpec used within a generic function from becoming Unknown in some circumstances.

Bug Fix: Fixed a bug that resulted in an incorrect specialized return type in certain cases involving ParamSpecs.

Bug Fix: Fixed bug that can result in incorrect type evaluations when a keyword argument name is evaluated first when hovering over it.

Behavior Change: Added special-case handling to accommodate assignment of a method that differs only in the Self parameter.

Enhancement: Added logic to preserve function doc strings for a ParamSpec when it captures the signature of a function with a doc string. This is useful for decorators.

pyright - Published 1.1.199

Published by erictraut almost 3 years ago

Bug Fix: Fixed bug that resulted in false positive error when class constructor is invoked with more than one argument and the class's metaclass has a custom __call__ method.

Enhancement: Updated typeshed stubs to the latest version.

Bug Fix: Fixed recent regression that resulted in false positive when assigning a Type[Proto] to Type[Proto].

Enhancement: Added type checking for class constructor calls when the class has a metaclass with a custom __call__ method.

Bug Fix: Fixed a bug that resulted in an incorrect type inference when assigning to a list that includes an unpacked target variable.

Enhancement: Improved handling of call expressions that have a NoReturn type. In particular, the logic now handles constructors, __call__ methods, inferred symbol types, and symbol import chains.

Bug Fix: Fixed bug that resulted in infinite recursion in certain cases when an aliased conditional expression was used.

Bug Fix: Fixed bug in type evaluator that masked certain type errors when assigning a concrete type to a class TypeVar type.

Bug Fix: Fixed bug that caused false positive when passing a generic function callback as an argument to another generic function.

pyright - Published 1.1.198

Published by erictraut almost 3 years ago

Enhancement: Added support for exception group syntax introduced in PEP 654.

Bug Fix: Fixed bug that resulted in false positive errors when using a TypeVar within the new callable syntax within a function declaration.

Enhancement: Added missing check mandated by PEP 544, which disallows an assignment of a class type to a Type[Proto] if the class type is a protocol itself.

Enhancement: Added support for class types that satisfy protocols. This is specifically allowed in PEP 544 in the section titled "Type[] and class objects vs protocols".

Enhancement: Added support for assigning a param spec to a ... signature, since the latter is the Any equivalent for ParamSpecs.

Behavior Change: Changed type logic to allow type to be assigned to Type[T]. In this case, type is treated the same as Type[Any], so T receives a value of Any.

Enhancement: Added support for __getattr__ and __getattribute__ overloads that are typed with a literal str representing the attribute name.

Bug Fix: Fixed bug in handling of callable syntax when a TypeVar, ParamSpec or TypeVarTuple was used outside of an appropriate scope. No error was emitted in this case.

Bug Fix: Fixed a bug in the handling of the new callable syntax when it's used with an "async" keyword. The resulting return type should be Awaitable rather than Coroutine.

Behavior Change: Changed the behavior of the new callable syntax to not accept ... with other parameters. After further discussion on the typing-sig, the consensus is that supporting this will cause confusion.

Bug Fix: Fixed a false negative (missing) error when a method within a generic class was annotated to return a generic type of itself.

Enhancement: Added logic to handle the case where a declared return type of a function includes a constrained TypeVar and a return statement is guarded by a conditional check that guarantees that the constraint is met on that code path.

Enhancement: Improved error message (and reduced cascading errors) for the case where a variable is incorrectly used as the LHS of a subscript expression within a type annotation.

pyright - Published 1.1.197

Published by erictraut almost 3 years ago

Bug Fix: Fixed bug in type narrowing code for literal enums. It wasn't correctly handling the edge case where the enum class has no enumerated members.

Bug Fix: Fixed bug in type narrowing logic for comparisons to literals that involve enums declared in a type stub. It was incorrectly narrowing the type to Never in the negative (else) case.

Bug Fix: Fixed bug in type evaluator that resulted in incomplete (Unknown) types when variable types depend on each other within a loop and one of the expressions involves an unpack operator.

Bug Fix: Fixed bug in protocol TypeVar variance validation. Thanks to @Azureblade3808 for this contribution.

Enhancement: Added support for ellipsis type argument for a generic alias that uses a ParamSpec.

Bug Fix: Fixed bug that caused false positives when assigning a function to a generic class or callback protocol that is parameterized with a ParamSpec that is specialized using an ellipsis.

Bug Fix: Fixed several bugs where Type[None] was incorrectly treated as compatible with None and vice versa.

Bug Fix: Fixed bug that resulted in a false positive error when Required or NotRequired special forms were used with no type arguments in contexts where they are used as runtime class names rather than type annotations.

Behavior Change: Changed text representation of callables to more closely match the syntax introduced in PEP 677 including the use of "..." to represent "any parameters" and "**P" to represent a ParamSpec.

Bug Fix: Fixed error in pyrightconfig JSON schema, which duplicated a couple of IDs.

Bug Fix: Fixed bug that caused crash in type analyzer when a TypeVar of the same name was declared twice in the same scope with constraints in one case and without in the other.

Enhancement: Added support for draft PEP 677: callable type syntax.

pyright - Published 1.1.196

Published by erictraut almost 3 years ago

Enhancement: Added support for Python 3.11 StrEnum.

Behavior Change: Modified behavior for assignment-based type narrowing when the target of the assignment references an "asymmetric" descriptor or property, one where the setter accepts a different value type than the getter returns. When this is detected, assignment-based type narrowing is no longer applied.

Behavior Change: Changed class pattern matching behavior to support narrowing of Any or Unknown, exempting this case from the general "never narrow Any" rule.

Behavior Change: Modified behavior of overload matching when unpacked argument is present and the unpacked iterator is a type that doesn't provide any length information. In this case, overload matching will prefer an overload that includes a *args parameter rather than individual positional parameters.

Enhancement: Added check for a module used as a type annotation, which is not permitted.

Enhancement: Improved isinstance type narrowing logic to retain type arguments in cases where the corresponding type parameter is bound or constrained.

Bug Fix: Fixed bug that resulted in a false positive error indicating that an overload isn't compatible with its implementation when the overload includes a callable parameter with a type variable as a parameter.

Bug Fix: Fixed a bug in type evaluation of a Final class variable that has no explicit type but is assigned a literal value.

Bug Fix: Fixed a bug that resulted in incorrect type evaluations when a generic class using a ParamSpec was explicitly specialized using a Concatenate in the type argument, as in A[Concatenate[int, P]].

Bug Fix: Fixed a bug that resulted in incorrect type resolution when evaluating mutually-dependent variables within a loop where one of the expressions involved a call to a constructor with an unpacked argument.

Bug Fix: Fixed false positive error with reportUnnecessaryIsInstance diagnostic check with the provided class is dynamic.

pyright - Published 1.1.195

Published by erictraut almost 3 years ago

Bug Fix: Fixed bug in handling of __slots__. Entries listed in __slots__ apply only to instance variables, not to class variables.

Bug Fix: Fixed false positive error with reportUnnecessaryComparison diagnostic rule when one of the two operands is type or Type[Any] and the other is a class.

Bug Fix: Fixed false positive when using a generic type alias that refers to a class with a __getitem__ method.

Enhancement: Implemented support for type guards that based on "aliased conditional expressions". For details and examples, refer to https://github.com/microsoft/pyright/blob/main/docs/type-concepts.md#aliased-conditional-expression.

Bug Fix: Fixed a bug that caused a false positive error under certain circumstances where a function return type annotation referred to a forward-declared symbol and from __future__ import annotations was in effect.

Enhancement: Added error for an attempt to call a module, which generates an exception at runtime.

Bug Fix: Fixed bug related to ParamSpec specialization when the signature has zero parameters.

Behavior Change: Changed type completeness report (the "--verifytypes" feature) to exempt symbols that derive from "slots" entries.

Enhancement: Improved isinstance type narrowing when the original type is a generic class with a TypeVar as a type argument and the second argument to isinstance is a generic subclass of the original type. The type argument is now properly retained.

pyright - Published 1.1.194

Published by erictraut almost 3 years ago

Bug Fix: Fixed inconsistency in definition provider where it would sometimes fail to go to a declaration if the symbol was not re-exported from a type stub or "py.typed" module.

Enhancement: Added support for explicit specialization of generic type aliases that include a ParamSpec.

Bug Fix: Fixed bug that resulted in the import resolution paths retrieved from the currently-selected Python interpreter to omit the working directory if it happens to be in the "sys.path" list.

Bug Fix: Fixed bug in specialization of callable type where the return type includes the expansion (unpacking) of a variadic type variable.

Enhancement: Improved handling of x in y type guard to handle the case where y is a tuple.

Bug Fix: Fixed a bug that caused type narrowing to fail in certain cases when the "X in Y" type guard pattern was used.

Bug Fix: Fixed bug that resulted in false positive when a variable was modified in a loop that employed conditional type narrowing and was also used as a member access expression.

Bug Fix: Fixed a bug whereby an explicit TypeAlias definition that includes a generic type with no explicit type arguments was not assuming Unknown for those type arguments. For example, A: TypeAlias = list should assume that A is equivalent to list[Unknown].

Enhancement: Added a missing diagnostic for an attempt to specialize a class that has already been specialized. This can occur in the case of a type alias, such as A = list[int], A[int].

Enhancement: Added code to support __qualname__ in class definitions.

Bug Fix: PEP 484 indicates that Type[Any] should be interpreted as equivalent to type, but the previous code was treating it as Any.

Enhancement: Added error check for the use of a generic class as a metaclass.

Bug Fix: Fixed a bug that resulted in a false positive error when a dictionary literal was passed to a constructor of a generic subclass of dict.

pyright - Published 1.1.193

Published by erictraut almost 3 years ago

Bug Fix: Fixed incorrect type evaluation for symbols that are modified within a context manager block that is nested within a try/except statement.

Enhancement: Updated to the latest typeshed stubs. Note that type stubs for several third-party packages were recently removed from typeshed: click, flask, jinja2, markupsafe, werkzeug.

Bug Fix: Fixed bug that resulted in "unknown" type evaluation for variables assigned in a loop using a tuple assignment pattern.

Bug Fix: Fixed bug in TypeVar solver where Self type was being incorrectly replaced with its concrete form in some cases.

Bug Fix: Fixed bug that resulted in TypeVar not being solved in some circumstances involving recursive types.

Bug Fix: Fixed a bug in the handling of generic classes whose implementation includes another instantiation of itself using the original type parameters as type arguments for the nested instantiation.

Bug Fix: Fixed a bug in the handling of generic classes whose implementation includes another instantiation of itself using the original type parameters as type arguments for the nested instantiation.

Enhancement: Enhanced reportIncompatibleMethodOverride diagnostic check to also detect incompatible methods defined by two classes that are used as base classes in a multiple-inheritance derived class.

pyright - Published 1.1.192

Published by erictraut almost 3 years ago

Enhancement: Sped up "find reference" by performing a quick text search for the reference symbol and avoiding additional work for that file if there is no chance of finding a reference within it.

Bug Fix: Fixed misleading error message involving a type mismatch within the TypeVar constraint solver. The source and destination types were reversed.

Bug Fix: Fixed a bug in ternary expression type evaluation that resulted in a false positive error. It was not properly handling the case where the condition was statically determined to be false or true.

Enhancement: Improved error message for unknown or partially-unknown type arguments in package type verifier.

Bug Fix: Added missing check in package type verifier for generic type aliases with missing type arguments.

Bug Fix: Fixed bug that resulted in false positive error when a __new__ method has its own type variables that are not scoped to its corresponding class.

Bug Fix: Changed behavior of symbol resolution involving a quoted (forward-declared) type annotation that references a symbol in the global (module) or builtins namespaces. The previous implementation didn't match the runtime behavior of typing.get_type_hints.

Bug Fix: Improved heuristics that are intended to choose the simplest type when more than one solution is possible for a set of type variables.

Enhancement: Added support for class-based definition of "NewType", which will appear in a new version of typeshed stubs soon.

Bug Fix: Added missing check in function type compatibility checks for the case where the source type contains position-only parameters but the destination type does not.

Bug Fix: Added support for synthesized __hash__ method for dataclass and dataclass_transform.

Bug Fix: Fixed bug that resulted in false positive parse error when using "/" parameter in type stub when pythonVersion was prior to Python 3.8.

pyright - Published 1.1.191

Published by erictraut almost 3 years ago

Bug Fix: Fixed bug in synthesized __match_args__ type for dataclass, which shouldn't include any keyword-only fields. Thanks to @HKGx for this contribution.

Bug Fix: Added special-casing to suppress "partially unknown type" diagnostic within member access expressions when they are used to access non-specialized generic classes within an argument expression. There are legitimate uses of partially unknown types in this case (e.g. in "isinstance" calls).

Behavior Change: Exempted class symbol __weakref__ from type completeness check since its type is well defined by the Python spec.

Behavior Change: Changed reportPropertyTypeMismatch to be disabled by default in all diagnostic modes.

Bug Fix: Fixed a hole in the check for partially-unknown types. Generic type aliases that are not specialized or are partially specialized (i.e. only some type arguments are specified) should trigger this check.

Bug Fix: Fixed bug that resulted in a false positive error when using class pattern matching with type variables.

Bug Fix: Fixed bug in "--ignoreexternal" mode of "--verifytypes" feature. It was not properly flagging errors when the type was external (and known) but the type arguments were partially unknown.

Enhancement: Enhanced truthy/falsy type narrowing pattern to handle classes that contain a __bool__ method that always returns True or False.

Enhancement: Changed parse error messages related to unclosed parentheses, braces and brackets so they are reported at the location of the starting token to better match the new Python 3.10 parse error reporting behavior.

pyright - Published 1.1.190

Published by erictraut almost 3 years ago

Bug Fix: Fixed bug that caused false positive when evaluating type compatibility between two TypedDict types that are structurally the same but have different declarations. PEP 589 indicates that these should be treated as compatible types.

Bug Fix: In the case where a type annotation is an illegal form (e.g. a variable or a function), the annotation should evaluate to an Unknown type.

Enhancement: Added support for async functions that return NoReturn type.

Bug Fix: Fixed bug that prevented error when a generator function returned an inappropriate type if that type was a subclass of Iterable.

Bug Fix: Fixed bug that resulted in unreported Unknown type in strict mode when the type was evaluated as part of a call to an overloaded function in some circumstances.

Enhancement: Updated typeshed stubs to the latest.

Bug Fix: Improved check for inconsistent use of tabs and spaces to catch a previously-unreported case that generates runtime errors.

Bug Fix: Added a type consistency check for TypedDicts which are otherwise compatible except that one is marked @final and the other is not.

Behavior Change: Changed reportUnusedVariable diagnostic check to exempt variables whose names begin with an underscore.

Behavior Change: Changed logic that determines whether a function should be exempt from return type consistency checks. If a function or method contains only a docstring but no ..., it is no longer exempt (unless it is an @overload).

pyright - Published 1.1.189

Published by erictraut almost 3 years ago

Bug Fix: Fixed regression relating to type inference for non-generic classes that have unannotated constructors (so-called "pseudo-generic classes").

Bug Fix: Fixed crash that occurred when specializing a class with a TypeVarTuple and failing to provide a type argument for the TypeVarTuple type parameter.

Bug Fix: Fixed recent regression in import resolver that caused a local import to no longer be preferred over an installed module by the same name.

Bug Fix: Fixed bug that caused incorrect type evaluation of parameter with implied Optional type based on None default argument value when strictParameterNoneValue setting is false.

Enhancement: Added checks for illegal forms of Literal type arguments.

Bug Fix: Fixed false positive error when using a union type expression in an isinstance or issubclass call on Python 3.10.

Bug Fix: Fixed bug in code flow engine that caused incorrect determination of node reachability in cases where an unannotated function recursively called itself.

Bug Fix: Fixed a hole in the type checking logic for TypedDict classes. It was not properly handling the invariant case.

Behavior Change: Made illegal assignment target checks unconditional so they are not gated by reportGeneralTypeIssues. These should be treated more like parse errors than type checking errors.

pyright - Published 1.1.188

Published by erictraut almost 3 years ago

Bug Fix: Fixed issue that caused import resolution failures for certain submodules of google.cloud.

Bug Fix: Fixed crash in completion provider.

Bug Fix: Fixed bug in ParamSpec type evaluation that caused a false positive error when assigning a callable with a Concatenate to another ParamSpec.

Bug Fix: Fixed bug in ParamSpec logic that resulted in false positive when a TypeVar was used as within a Concatenate expression.

Bug Fix: Fixed bug in type evaluator that resulted in false positive error in strict mode. Type of call argument expression was incorrectly reported as partially unknown in some cases.

Bug Fix: Fixed bug that resulted in a false positive when a tuple with known element types is used as an unpacked argument in a call to a function that uses position-only parameters.

Bug Fix: Fixed type checking hole (false negative) in certain circumstances involving loop constructs and variables whose types are modified within these loops. This bug fix also has a positive performance impact when analyzing functions with complex code flow graphs.

Bug Fix: Fixed issue that caused CLI version of pyright to use incorrect Python interpreter to discover the Python version when no "pythonVersion" configuration setting was supplied.

Enhancement: Implemented diagnostic check for a ClassVar declaration that uses a type variable. PEP 526 explicitly states that this is not allowed.

pyright - Published 1.1.187

Published by erictraut almost 3 years ago

Bug Fix: Fixed false positive error when assigning type T | Any to type T.

Behavior Change: Changed Callable special form to include a position-only marker at the end of the parameter list. Changed type printer to omit the / if it is unnecessary.

Behavior Change: Modified the check for function declaration redefinitions to allow for same-signature overrides in cases where the declarations are not within the same statement suite (e.g. one in the "if" and the other in the "else" block).

Bug Fix: Fixed missing diagnostic when a Self parameter was assigned to a Concatenate[X, P] where X is a type that is incompatible with Self.

Bug Fix: Fixed bug that resulted in a false positive error when a specialized generic class with a __call__ method uses a ParamSpec and is assigned to a Callable that is also parameterized with a ParamSpec.

Enhancement: Updated typeshed stubs to the latest.

Bug Fix: Fixed bug that resulted in hover text for symbols used within a default argument expression to sometimes be displayed as "Unknown".

Bug Fix: Fixed regression in handling of callback protocols that define a __name__ attribute, which is common to all functions.

Behavior Change: Added support for upcoming change in typing.pyi in the way that the NoReturn symbol is declared.

pyright - Published 1.1.186

Published by erictraut almost 3 years ago

Enhancement: Added checks for incorrect runtime usage of a UnionType object.

Enhancement: Added more complete type checks involving the use of a default argument for a generic parameter in a constructor.

Bug Fix: Fixed a bug that resulted in a false positive error when accessing members from a type instance or a Type[T].

Bug Fix: Fixed false positive error related to heuristics employed in bidirectional type inference for calls when the expected type comprises a union and the return type of the call is a union that includes Any and a type variable.

Enhancement: Added support for slots parameter to dataclass, a new feature added in Python 3.10.

Bug Fix: Fixed regression that caused a false positive error related to incorrect usage of a type variable within a type alias definition.

Bug Fix: Fixed incorrect handling of client-initiated progress reporting for "onReferences" and "onExecuteCommand" handlers in language server.

pyright - Published 1.1.185

Published by erictraut almost 3 years ago

Bug Fix: Fixed bug in completion provider where it was not properly handling binding to classes, which left parameter types unspecialized in some cases. It was already properly handling binding to objects (class instances), so this was a straightforward extension.

Enhancement: Added support in completion provide for enum members. They are now properly identified as such and prioritized higher in the completion list than other non-member symbols.

Enhancement: Improved readability of diagnostic message for type mismatch when assigning to a tuple expression.

Bug Fix: Fixed a bug in the handling of reveal_type that caused hover text within the argument to be displayed as Unknown in some circumstances.

Enhancement: Added special-case support for the __self__ attribute of a bound method.

Bug Fix: Fixed bug that resulted in stack overflow.

Bug Fix: Fixed bug in stub generation code that resulted in an error if a stub was requested for a submodule in a package that includes an __init__.py file in the same directory as the submodule source file.

Enhancement: Improved signature help for the constructor of classes that define a __new__ method but no __init__ method, such as the zip class. The previous logic was always preferring the __init__, which is supplied by the object class, which all classes derive from.

Bug Fix: Fixed a bug that resulted in a false positive error when assigning one ParamSpec to another ParamSpec.

Bug Fix: Fixed bug that resulted in false positive "reportUnknownMemberType" error when using a generic class within a class pattern.

Bug Fix: Added missing diagnostic check for illegal type argument lists that include a ParamSpec when the type parameter list includes a ParamSpec.

Enhancement: Added missing keyword "with" from completion provider.

Bug Fix: Fixed bug in type promotion logic that resulted in false positive. It wasn't properly handling subclasses of promotable types (like 'int', which can be promoted to 'float').

Enhancement: Improved bidirectional type inference for call expressions. The logic now handles the case where the return type of the callable is a generic type that is not an exact match for the expected type but is assignable to the expected type.

Enhancement: Added support for explicit type aliases (PEP 613) within class scopes. A proposed amendment to PEP 613 will make this legal.

Enhancement: Added check for a class-scoped generic type alias that uses a class-scoped TypeVar. This is now flagged as an error.

pyright - Published 1.1.184

Published by erictraut almost 3 years ago

Bug Fix: Fixed false positive error when a class used within as a TypeVar bound argument is a "pseudo generic" class, one whose constructor is unannotated.

Bug Fix: Changed type evaluator to elide NoReturn from union generated from or or and operator.

Enhancement: Improved error handling for the Generic special form. Eliminated false positive error when Generic is used in certain legitimate ways within a function.

Enhancement: Improved error messages for call expressions that involve overloaded functions.

Enhancement: Implemented optimization that reduces analysis time and memory usage by generating a diagnostic message (which often involve converting types to a textual representation) only if the caller is interested in the diagnostic message.

Enhancement: Added support for "Self" type documented in draft PEP: https://docs.google.com/document/d/1ujuSMXDmSIOJpiZyV7mvBEC8P-y55AgSzXcvhrZciuI/edit.

Enhancement: Added support for trace logging of type evaluation from the command line when both --stats and --verbose are specified.

Bug Fix: Fixed bug that resulted in the incorrect type evaluation when a property was defined on a metaclass and accessed through a class with that metaclass.

pyright - Published 1.1.183

Published by erictraut almost 3 years ago

Bug Fix: Fixed bug in handling of the recently-added "--skipunannotated" command-line flag.

Bug Fix: Fixed a recent regression that resulted in a false positive error when Union was used with no type arguments outside of a type annotation.

Enhancement: Extended support for bidirectional type inference for functions that have a generic return type and the "expected type" is a generic class with type arguments that include literal types.

Enhancement: Expanded support for bidirectional type checking for function call expressions where the return type of the function includes a TypeVar that also appears within a function parameter and that parameter is a callable.

Bug Fix: Fixed bug that resulted in incorrect type evaluation for a generic function that returns a specialized class that uses a Concatenate in one of the type arguments.

Bug Fix: Fixed bug that caused the type of super().__new__(cls) to be evaluated incorrectly.

Bug Fix: Changed type evaluator to elide NoReturn from union generated from ternary operator.

Bug Fix: Fixed a bug that allowed a function to be assigned to a (non-protocol) class if that class defined a __call__ method. This should be allowed only for protocol classes.

Bug Fix: Fixed a bug that allowed a function to be assigned to a protocol class if it defined a __call__ method but also defined additional methods or attributes.

Behavior Change: Changed text representation of inferred type of self and cls parameters to Self@ClassName. This is more consistent with the emerging standard for an explicit Self type.

pyright - Published 1.1.182

Published by erictraut almost 3 years ago

Enhancement: Implemented missing check for a write to a Final instance or class variable outside of the class implementation.

Enhancement: Added missing check for an attempt to write to a named tuple attribute, which generates a runtime exception.

Bug Fix: Fixed bug that resulted in a false positive when a function returned a callable type that included a parameter with a union type that included an unsolved type variable.

Bug Fix: Improved handling of intersection types produced as part of isinstance or issubclass type narrowing when the source variable is a type variable. The creation of the intersection type was incorrectly eliminating the association with the type variable, so the narrowed type was no longer seen as compatible with the TypeVar.

Enhancement: Added check for Union when only one type argument is provided and it is not an unpacked variadic type variable.

Bug Fix: Fixed bug in "--ignoreexternal" option used with package type verification. It was not correctly ignoring all externally-imported symbols that had unknown or partially-unknown types.

Enhancement: Updated typeshed stubs to latest.

Bug Fix: Fixed false positive error when a constrained TypeVar T and Type[T] were both used in the same function signature.

pyright - Published 1.1.181

Published by erictraut almost 3 years ago

Enhancement (from pylance): Improved completion suggestions when typing within a list expression.

Enhancement: Updated typeshed stubs to the latest.

Bug Fix: Fixed bug in type printing logic where it incorrectly displayed captured ParamSpec signature with "/" or "*" parameters.

Bug Fix: Fixed bug that caused false positive error when assigning one callback protocol to another when both protocols are generic and parameterized with a ParamSpec.

Bug Fix (from pylance): Fixed regression with "--watch" option in command-line version of pyright.

Behavior Change (from pylance): Increase max file size to 50 MB, matching VS Code.

Enhancement: Improved logic for isinstance and issubclass type narrowing when the filter class's type arguments can be determined from the type arguments of the subject type.

Enhancement: Improved type narrowing logic for class pattern matching when the matched class's type arguments can be determined from the type arguments of the subject type.

Bug Fix: Fixed bug that resulted in an incorrect type evaluation for a binary operator that acts upon a bound TypeVar.

Performance: Reduced the max number of nested call-site return type inference evaluations from 3 to 2. This can be extremely expensive in some code bases, such as with scipy, and it was leading to a poor user experience.

Performance: Improved analyzer performance for code that contains thousands of statements with tens of thousands of call statements within a single function or module. This is found in some test modules within the sympy library.

Enhancement: Added "--skipunannotated" option for command-line version of pyright. If specified, pyright skips type analysis of functions and methods that have no parameter or return type annotations. Return types of functions are also never inferred from the function implementation. This matches the default behavior of mypy and allows for more efficient analysis of complex code bases that are only partially annotated.