Releases: microsoft/pyright
Releases Β· microsoft/pyright
Published 1.1.407
Changes:
- 276448f Fixed package-lock files
- 783ee67 Published 1.1.407
- f9fc2aa Updated typeshed stubs to the latest version (#11051)
- 5f599f9 Added error reporting for unknown or unsupported config settings. This addresses #11040. (#11045)
- cadded6 Fixed regression that results in
--createstubdoing nothing. This addresses #11043. (#11044) - 538053d Fixed bug that causes a false negative when a
TypedDictoverrides a parent withextra_itemsthat are notReadOnlywith aReadOnlyfield. This addresses #11037. (#11038) - ba3f0d4 Fixed bug that results in a false positive when a
namedtuplefunctional form is used with a field starting with an underscore andrename=True. This addresses #11033. (#11034) - 80eb0dc Fixed bug in type narrowing for literal patterns. The runtime uses equality checks, so matching against the pattern
3cannot necessarily narrow the type toLiteral[3]. This addresses #11026. (#11028) - b1c9ae2 Fixed bug that results in a false positive error when a
withstatement has a single parenthesized context manager. This addresses #11020. (#11024) - 346f74c Fixed a bug that causes a
@dataclass_transformto fail if the decorator returns a callback protocol rather than aCallable. This addresses #11015. (#11018)
See More
- 20aa20a Pull Pylance with Pyright 1.1.406 (#11010)
- 9ed33cf Fixed bug that results in a spurious error when running pyright on Python 3.14 but configured for Python 3.13 or earlier. This addresses #11003. (#11006)
- 6e877dd Changed default Python version from 3.13 to 3.14 to reflect new stable version (#11004)
- 69a5d84 Fixed bug that omit
**kwargsparameter with an unpacked TypedDict with extra items. (#10997) [ #10996 ] - ed83d58 Eagerly exit isEnumClassWithMembers (#10990)
- 17f24b3 Updated diagnostic message to include "standard" mode. This addresses #10988. (#10989)
- 30db40b Add users to notification list for manual validation (#10984)
This list of changes was auto generated.
Published 1.1.406
Changes:
- 308f5c0 Published 1.1.406
- 38317d6 Fixed bug that results in false positive for module attributes that are synthesized for namespace modules. This addresses #10692. (#10972)
- 676cd11 Fixed several bugs related to subscripts with unpack operators, notably when the unpack targets a tuple with a known length. This addresses #10723. (#10971)
- 8996f91 Removed remaining code that was left over from PEP 637, which was rejected.
- f7285d9 Added special casing in
reportUnnecessaryComparisoncheck for modules. This addresses #10706. (#10970) - 907028c Added check for the use of a
NewTypein a class pattern. This addresses #10784. (#10969) - 7b28a61 Updated typeshed stubs to the latest version (#10968)
- ad557b5 Fixed bug that results in incorrect behavior when
partialis applied to a function with a positional-only parameter separator. This addresses #10954. (#10967) - 6a92d60 Bump tar-fs from 2.1.3 to 2.1.4 in /packages/vscode-pyright (#10965)
- b0fb77d Fixed bug that causes workspace edits to include annotation IDs without changeAnnotations field. (#10902) [ #10671 ]
See More
- 79ff3e3 Fix literal overload completions in call arguments (#10762)
- 1a46b0f Clarified implicit import rules in docs.
- 97ae524 Fix regression in symlinked files (#10944)
- b122ef9 Fix mypy_primer to run again (#10945)
- 135fa85 Subtle issue with change tracking when not doing analysis (#10918)
- 7905b19 Removed "reportShadowedImports" check and associated "renameShadowedFile" action. This feature is off by default in pyright although enabled by default in pylance. (#10891)
- b182c80 Fixed bug that results in spurious errors when a wildcard import targets a traditional
TypeVarwith the same name as a PEP 695 TypeVar. This addresses #10900. (#10903) - eaa43e4 Reduced log level for "Skipping recursive symlink" when enumerating project files.
- b4a158f Clarify editable install behavior with setuptools and uv (#10888)
- d64f3fa pull-pylance-with-pyright-1.1.404-20250902-204731 (#10885)
- b7c1e79 pull-pylance-with-pyright-1.1.404-20250902-173744 (#10882)
This list of changes was auto generated.
Published 1.1.405
Changes:
- 7ee3058 Published 1.1.405.
- bb13689 Fixed bug that results in false positive "reportPossiblyUnboundVariable" error on keyword argument names. This addresses #10811. (#10876)
- 539aabd Updated error message for
NewTypeused inisinstancecheck. I don't think this makes things clearer, but it is technically more correct. Addresses #10601. - ce16aa1 Changed the evaluated type of
__class__fromtype[Self]totype[<Enclosing class]. This addresses #10685. (#10874) - 099954d Added optimization that reduces the number of Uri objects that need to be created during type evaluation. This is an attempt to address #10832. (#10872)
- 93c98d7 Fixed bug that causes a false negative when using unquoted types in a TypedDict functional class definition if the types are forward declared. This addresses #10612. (#10869)
- 29bb1b0 Fixed bug that resulted in false negative when backslash followed by line feed occurs at end of file. This addresses #10814. (#10867)
- f3ab90b Fixed false negative when a keyword parameter in a child class method overrides a method with a
**kwargsin the parent and the type is incompatible. This addresses #10815. (#10866) - c407ded Fixed regression introduced in 1.1.343 that results in nondeterministic (order-dependent) type evaluation under certain circumstances involving recursive type aliases. This addresses #10850. (#10865)
- d97565a Revert "Added support for tracking multiple constraint sets when performing protocol matching. This allows protocols with overloaded methods to contribute independent constraint sets. This addresses #9835. (#9864)" (#10863) [ #10849 ]
See More
- aff9b4f Fixed bug that contributes to out-of-memory crashes under certain circumstances where a module's transitive import graph is very large and may not fit within the available heap space. (#10862)
- 7395f59 Bump tmp from 0.2.3 to 0.2.5 in /packages/vscode-pyright (#10824)
- 769a124 Added support for
match_argsdataclass parameter. This addresses #10858. (#10861) - 464bc01 Fixed bug that results in false negative when a
closed=Falseis used inTypedDictthat subclasses from a non-openTypedDictbase class. This addresses #10859. (#10860) - eccd633 Revert "Reverted a recent change that appears to have affected performance on some projects. This attempts to address #10832. (#10841)"
- b85f7ff Improved performance of import resolution when there are large number⦠(#10855)
- b45deb0 Document editable installs with uv (#10854)
- cd980e2 Fixed a bug that results in spurious errors if a class decorator is a⦠(#10846) [ #10836 ]
- 30068aa Fixed a bug that results in false positive errors when using
objectmethods (like__eq__) on aSentinelinstance. This addresses #10773. (#10844) - 1ce3e78 Fixed bug that results in incorrect literal math results for bitwise negation. This addresses #10834. (#10842)
- fe7aaf2 Reverted a recent change that appears to have affected performance on some projects. This attempts to address #10832. (#10841)
- d639324 pull-pylance-with-pyright-1.1.403-20250820-201137 (#10831)
This list of changes was auto generated.
Published 1.1.404
Changes:
- f11dd22 Switch to Node 22 and make publish to npm wait (#10830)
- ba6a729 Update azure-pipelines-release.yml for Azure Pipelines
- 33f41a8 Published 1.1.404
- e32022c Improved performance and memory usage of import resolver by not recording import failure information unless caller asks for it. This is normally needed only when verboseOutput is enabled. (#10819)
- 572bc31 Implemented a number of performance and memory optimizations (#10816)
- 2d1aaf0 Fixed a recent regression that broke the "--threads" option in the CLI. (#10812)
- 7b90e9e Made PEP 728 (TypedDict with extra items) no longer experimental since it has been accepted by the SC. (#10804)
- de2d23d Improved startup performance for large projects by lazily computing the module name of each source file. (#10798)
- 78088b4 Bump tmp from 0.2.3 to 0.2.4 (#10771)
- f1c19c6 Bump axios from 1.10.0 to 1.11.0 (#10742)
See More
- c125807 Bump form-data from 4.0.3 to 4.0.4 in /packages/vscode-pyright (#10732)
- 42c478f Tweaked the new source enumerator implementation so it enumerates files in the same order as the old implementation. The order that files are type checked shouldn't theoretically matter, but in practice there can be minor differences (e.g. union order in error messages).
- b8688e7 Fixed regression that resulted in a false positive error when using
reportUninitializedInstanceVariablewith aNamedTupleclass. This addresses #10490. (#10791) - facb494 Fixed a bug that results in a false positive error when a
breakorcontinuestatement is used within awhileorforloop within an exception group block. This addresses #10766. (#10790) - 6dc4f77 Updated typeshed to the latest version.
- 390f1da Removed trailing whitespace in diagnostic line output. This addresses #10726.
- fd0a5e8 Improved startup responsiveness on large monorepos (#10786) [ #3075 ]
- 8b02aa8 Pull Pylance with Pyright 1.1.403 (#10687)
This list of changes was auto generated.
Published 1.1.403
Enhancements:
- Updated typeshed stubs to the latest version
Behavior Changes:
- Removed experimental support for PEP 736, which was rejected. (#10616)
Published 1.1.402
Changes:
- f584f78 Published 1.1.402
- 0246b06 Fixed bug that results in a false positive "fully overlapping overload" error when a second overload uses a Callable with a ParamSpec but the first does not. This addresses #10587. (#10588)
- ce1c735 Improved modeling of bound and unbound methods so they properly use
types.MethodTypeortypes.FunctionType. This addresses #10514. (#10586) - 859cc50 Added support for bidirectional type inference when assigning an expression to an unpacked tuple literal and all of the items in the tuple have a declared type. This addresses #10481. (#10585)
- 4887eb7 Fixed bug that results in confusion between two classes defined in the same file with the same name but in different functions when they are used in protocol matching. This addresses #10418. (#10584)
- 4cd01c6 Revert "Added check for mutable values of type list, dict, or set when used as default values for a dataclass field. These result in TypeErrors at runtime. This addresses #10553. (#10557)"
- f326cc6 Added
reportUnreachablediagnostic check. If enabled, it emits a diagnostic for code that is determined to be structurally unreachable or unreachable via type analysis. It does not report code that is within a code block that is gated by a conditional that is statically determined to be false, such asTYPE_CHECKINGand version checks. This diagnostic check is off by default even in strict mode because there are legitimate reasons for unreachable code to exist in Python code. (#10581) [ #10284 ] - c165c3f Reverted narrowing behavior for discriminating between TypedDicts. This narrowing behavior isn't technically correct from a type safety standpoint, but until PEP 728 is accepted, it's the only practical way to do this form of discrimination. This addresses #10517. (#10579)
- 8610325 Changed behavior when
@finalis applied to a method but subsequent decorators (like@functools.cacheor@property) subsequently transform the method into a different type. The typing spec is not clear how this should work. Pyright now honors the@finalin these cases, which is consistent with mypy. This addresses #10543. (#10578) - a52db80 Fixed bug that causes bidirectional type inference to be skipped when the target of an assignment is a member access expression (
base.member) and the base expression is a module. This addresses #10539. (#10577)
See More
- b23d4a2 Fixed bug that results in a false positive
reportUnusedVariableerror under specific conditions when an expression's local type has a circular dependency. This addresses #10512. (#10575) - 6ecb8f2 Added support for Sentinel type introduced in draft PEP 661. The
enableExperimentalFeaturessetting must be set to true to enable this feature. This addresses #10565. (#10574) - db0da4b Added support for Python 3.14 "template string" feature (PEP 750). This addresses #10320. (#10572)
- 6adcbc8 Fixed a bug that results in some additional (unnecessary) memory consumption under certain circumstances involving reachability analysis. This change shouldn't result in any observable behavioral changes other than (theoretically) slightly less memory pressure. (#10569)
- 7137377 Updated typeshed stubs to the latest version.
- 64b389c Fixed bug that results in crash when a class is parameterized by a TypeVarTuple that has a non-TypeVarTuple after it in the type parameter list. This addresses #10563. (#10564)
- 29ce473 Fixed bug that results in incorrect behavior when a type variable is used to define the
extra_itemstype for a generic TypedDict. This addresses #10545. (#10563) - 332c215 Added special-case logic to detect when a class-like symbol created by calling NewType is used as an actual class for assignability or member accesses. This addresses #10550. (#10562)
- 0f8ded0 Added support for PEP 758, which allows Python 3.14 and newer to support multiple exceptions in an
exceptclause without surrounding parentheses. This addresses #10546. (#10561) - 960fb52 Fixed bug that results in a false negative when attempting to assign an IntEnum or StrEnum literal to the Literal type corresponding to its value type. This addresses #10552. (#10558)
- 9148e3d Added check for mutable values of type list, dict, or set when used as default values for a dataclass field. These result in TypeErrors at runtime. This addresses #10553. (#10557)
- bd84a04 Revert "Fixed bug that results in a false positive when accessing a generic attribute from an object whose type is
type[X]. This addresses #10304. (#10305)" - 3f17258 Fixed bug in language service code that was mutating the contents of a parse node.
- 743b482 Bump tar-fs from 2.1.2 to 2.1.3 in /packages/vscode-pyright (#10533)
- ced3289 Removed dependency on unused package "leven". No functional change.
- d340ecc Minor code cleanup for consistency and maintainability.
- 9cccf0e Moved regular expressions used in hot paths to global constants so they don't need to be reconstructed each time. (#10506)
- cc812ef Fixed longstanding bug in tokenizer that can result in incorrect behavior under certain circumstances involving characters that require two uint16 unicode character codes (a surrogate followed by a second word). (#10504)
- d296a1a Updated typeshed stubs to the latest version.
- 50dda51 Alternative fix for recent regression related to
_type_checker_internals.pyi(#10496) - 321b6bf Removed some circular module dependencies. (#10485)
- b249d11 pull-pylance-with-pyright-1.1.401-20250521-185403 (#10486)
This list of changes was auto generated.
Published 1.1.401
Bug Fixes:
- Fixed a bug in the type narrowing logic for the
S in Dtype guard pattern (where S is a string literal and D is a TypedDict). If the TypedDict is not closed, the absence of the key within the TypedDict definition cannot eliminate the type during narrowing. - Fixed a bug that leads to a false negative when accessing a key on a TypedDict that is defined with
extra_items=Never. - Fixed bug that results in incorrect variance inference when a property access method uses a method-local type variable to annotate the
selfparameter. - Fixed bug that results in a false positive error under certain circumstances where the second argument for a
supercall is a union. - Fixed bug that results in a false negative when deriving from a stdlib protocol class and not implementing one or more abstract methods.
- Fixed bug that results in incorrect type narrowing behavior when the second argument to an
isinstancecall includes a union (specifically with the|operator) within a tuple expression. - Fixed a bug that results in a spurious error when
__class__()is assigned toSelf. - Added missing check for unquoted self references when calling
TypeAliasTypeconstructor manually (as opposed to using the PEP 695typesyntax). - Fixed a bug that results in incorrect expansion of the
bytespromotion type if the value is a bytes literal. - Fixed bug in type narrowing logic for class patterns in a
matchstatement. Negative type narrowing was incorrect when the subject is a literal type and the class is the corresponding non-literal class.
Enhancements:
- Improved handling of
__slots__members to correctly model the case where a descriptor object is stored in a__slots__variable. - Modified
--verifytypesoutput to expand type aliases in its error messages to help diagnose "partially unknown" conditions. - Enhanced
x is ...type narrowing logic to narrowAny | EllipsisTypetoEllipsisTypeto matchx is Nonenarrowing logic. - Updated typeshed stubs to the latest version.
Behavior Changes:
- Switched internal usage of
builtins.function,typing.AwaitableGenerator, andtyping._TypedDicttotypes.FunctionType,_typeshed._type_checker_internals.AwaitableGenerator, and_typeshed._type_checker_internals.TypedDictFallback, respectively.
Published 1.1.400
Bug Fixes:
- Fixed bug that results in a false positive when accessing a generic attribute from an object whose type is
type[X]. - Fixed bug that results in incorrect type narrowing of a variable that is shadowed in an inner-scoped comprehension.
- Fixed bug that results in a false positive error when referencing a class-scoped type alias defined as a callable.
- Fixed bug that causes bidirectional type inference not to be used in cases where a ternary expression is assigned to an annotated instance or class variable and the ternary condition narrows the type of
selforcls. - Fixed bug that results in a spurious "type already specialized" error when using a class-scoped type alias defined using a
typestatement orTypeAliasTypeconstructor. - Fixed a bug that leads to a hang when a generic type alias definition refers to itself.
- Fixed a bug that results in missing diagnostic details under certain circumstances where bidirectional type inference is attempted in the assignment of an attribute.
- Fixed a bug that results in a false positive error when calling a function with an unpacked TypedDict with
extra_itemswhen additional keyword args are passed. - [From pylance] Fixed regression introduced in 1.1.399 that caused pyright CLI to fail to run on Linux systems.
Enhancements:
- Extended "type(x) is C" type narrowing logic to support cases where
Cis a union of types or a type variable with a union upper bound. - Added support for PEP 765, which makes it a syntax error (or warning) in Python 3.14 if a
return,breakorcontinueis used to exit afinallyclause. - Added check for named tuple field names that begin with an underscore. These result in a runtime exception.
Behavior Change:
- Reverted a recent change that extended the
reportPrivateImportUsagecheck to enforce imports from submodules whose names begin with an underscore. This change was disruptive to users of the popularpandaslibrary because it exports a submodule named_typing. This was originally intended to be experimental or private, but it was never fully addressed. The pandas maintainers will work to fix this issue (pandas-dev/pandas#55231) over the next year. I'm going to back out this change to pyright in the meantime.
Published 1.1.399
Bug Fixes:
- Fixed bug that results in incorrect type narrowing when a value whose type is a non-callable (and non-final) class is passed as the second argument to an
isinstancecall and the first argument is a callable type. In this case, a subclass could provide a compatible__call__method, so the type shouldn't be narrowed toNever. - Fixed bug that results in a false positive "missing stub file" diagnostic when importing a "py.typed" submodule from a namespace package.
- Fixed bug that results in a false negative when a type variable with an upper bound is used to annotate a parameter in a method override.
- Fixed a bug that results in a false negative for a method override that uses
Selfin a contravariant position. - Fixed bug that results in a false positive error under certain circumstances involving a type variable with an upper bound of
type[T]that is assigned to another type variable. - Fixed a bug that results in a false negative when the specialization of a TypeVarTuple includes multiple unpacked tuples of unknown length.
- Fixed a bug that results in a false negative when a class that derives from
type[Any]is assigned to any other type. - Fixed bug that results in an incorrect error under certain circumstances when inferring the return type of a recursive function that has a decorator or is
async. - Fixed bug that results in a false negative when a return statement contains a call expression that invokes a
NoReturncall and the argument list contains errors. - Fixed bug that leads to a false positive in the
reportUnnecessaryComparisoncheck when one operand's type is a callable and the other is not. - [From pylance] Fixed a bug that results in an internal assertion (and therefore a crash) when
__builtins__.pyiimports from a project file.
Enhancements:
- Extended
deprecateTypingAliasesfeature to support symbols imported fromtyping_extensions. - Extended
reportUnknownVariableTypecheck to include cases where a value whose type is a generic class parameterized byUnknownis assigned to a variable with a declared type. - Extended the check for
isinstanceandissubclassargument validation to flag theLiteralspecial form, which leads to a runtime error when used in the second argument. - Updated typeshed stubs to the latest version. This version removes support for Python 3.8, which is now out of service.
Behavior Changes:
- Removed support for
ruandurstring prefixes. These were supported in Python 2.7 but are syntax errors in Python 3.x.
Published 1.1.398
Bug Fixes:
- Fixed bug that results in a spurious type error when a ParamSpec is used in conjunction with a dataclass and a contextmanager.
- Fixed recent regression that results in a false negative when calling a function with a positional-only parameter whose type is generic and has a concrete default argument value.
- Fixed regression that results in an
Unknowntype evaluation where previouslyAnywas generated during bidirectional type inference. - Fixed bug that results in incorrect overload resolution when an unpacked argument is of unknown length and potentially matches multiple overloads.
- Fixed bug that results in a variable being displayed as "not accessed" if it's used in an argument expression for a call expression whose base type is a module or
None. - Fixed bug that results in a hang under certain very specific circumstances involving a protocol method that has been decorated in such a way that it can no longer be bound to the owning protocol class.
- Fixed a bug that contributes to inconsistent type evaluation results when using the "--threads" feature.
- Fixed bug that results in incorrect "literal math" result when dividing
Literal[0]by a negative literal int value. - Fixed a bug in "literal math" for shift operators. If the RHS value is negative, the operation is invalid, so literal math shouldn't be applied.
- Fixed bug in "literal math" logic for modulo and floor divide operators that affect cases where operands have different signs.
Behavior Changes:
- Changed algorithm for applying type narrowing upon assignment when one or both of the declared type or assigned type contain "Any".
- Removed special-casing for async functions that skips check for implicit return when the return type is
NoReturn.
Enhancements:
- Updated typeshed stubs to the latest version.
- Extended
reportPrivateImportUsageto report the use of symbols imported from private submodules in a "py.typed" or stub library. - Extended the
reportUnnecessaryComparisioncheck to support the patternsx is Noneandx is not Nonein cases wherexis provably disjoint in type. - Added generalized support for assignment expressions (walrus operators) for type guards.
- Extended the type narrowing logic for the
x == Ltype guard pattern so it supports the case wherexisLiteralStringandLis a string literal.