npm pyright 1.1.114
Published 1.1.114

latest releases: 1.1.363, 1.1.362, 1.1.361...
3 years ago

Enhancement: Improve source mapper (the code that maps symbols found in stub files to the corresponding code in ".py" files) to handle more cases.

Enhancement: Added diagnostic error for try statement that has no except or finally statement.

New Feature: Added "reportOverlappingOverload" diagnostic rule, splitting out a few checks that were previously in the "reportGeneralTypeIssue" rule. This allows for finer-grained control over these overload checks.

Behavior Change: Added a few additional names that can be used for "cls" parameter without triggering diagnostic. These variants are reasonable and are used within some typeshed stubs.

Enhancement: Added TypeVarTuple definition to typings.pyi stub.

Enhancement: Updated TypeVarTuple logic to detect and report an error when a tuple of unknown length is bound to an unpacked TypeVarTuple. This is illegal according to the latest version of PEP 646.

Enhancement: Special-cased the __init_subclass__ method in the completion provider so it is offered as a suggestion even though there is no @classmethod decorator present. This symbol is unfortunately inconsistent from all other class methods in that it doesn't require a @classmethod decorator for some reason.

Behavior Change: Changed logic for attributes marked ClassVar to allow writes from an instance of the class as long as the type of the attribute is a descriptor object.

Bug Fix: Fixed a hole in type comparison logic for TypeVars that could have theoretically resulted in incorrect aliasing of types.

Bug Fix: Fixed bug that caused false positive when import statement targeted a symbol that had a nonlocal or global name binding.

Behavior Change: Enhanced method override compatibility logic to allow instance and class methods to pass generic bound types for self and cls.

New Feature: Added support for ".pth" files (often used for editable installs) when using the "venv" configuration option in pythonconfig.json.

Bug Fix: Fixed bug whereby import symbol “A” in the statement “from . import A” was not considered a public symbol in a py.typed source file, but it should be.

Enhancement: Improved handling of enum classes. If such a class is defined in a ".py" file, variables defined in the class with type annotations but no assignment are now considered instance variables within each enum instance, whereas variables assigned within the enum class are assumed to be members of the enumeration. This is consistent with the way the EnumMeta metaclass works. In stub files, type annotations without assignments are still assumed to be members of the enumeration, since that's the convention used in typeshed and other stubs.

Enhancement: Added check for parameter names when comparing functions. Parameter names that do not begin with an underscore must match in name. This also affects method override checks and protocol matching checks.

Bug Fix: Fix potential infinite recursion in source mapping, crash in doc strings

Don't miss a new pyright release

NewReleases is sending notifications on new releases.