github microsoft/pyright 1.1.83
Published 1.1.83

latest releases: 1.1.387, 1.1.386, 1.1.385...
3 years ago

Bug Fix: Fixed bug in perf optimization for set, list, and dictionary type inference. The old code was failing to evaluate expressions associated with entries beyond 64, which meant that tokens were not classified correctly and type errors in these expressions were not reported.

Bug Fix: Do not report errors for union alternative syntax (PEP 604) if evaluation of type annotation is postponed (either in a quote or via PEP 563).

Bug Fix: Fixed bug that caused spurious errors when evaluating type annotations within certain circumstances.

Bug Fix: Fixed bug that sporadically caused incorrect and confusing type errors such as "list is incompatible with List".

Bug Fix: PEP 585 says that it should be possible to use type in place of Type within type annotations. Previously, this generated an error.

Behavior Change: Changed re-export logic for type stub and py.typed modules to honor the clarification that was recently added to PEP 484. Previously, any import that used an "as" clause was considered to be re-exported. Now, symbols are re-exported only if the "as" clause is redundant (i.e. it is of the form import A as A or from A import X as X).

Bug Fix: Fixed inconsistency in handling of imported symbols that have multiple untyped declarations within the target module. The inconsistency was between the two cases import x, x.y and from x import y. In the latter case the type resolution logic considered only the last symbol declaration in the target module, but in the former case it was considering all declarations and returning the union of all types.

Bug Fix: Fixed bug in f-string parsing. It was generating an error for comma-separate list of expressions, which is legal.

Bug Fix: Fixed inconsistency in type narrowing for isinstance and issubclass calls. Previously, the narrowing logic used the target class(es) if the source expression was of type Any but did not do the same when the source expression was a union type that included Any but all other subtypes were eliminated.

Bug Fix: Added logic for or and and operators to handle the case where the left-hand operand is always falsy (in the case of or) or always truthy (in the case of and).

Don't miss a new pyright release

NewReleases is sending notifications on new releases.