Bug Fixes:
- Fixed bug that results in incorrect truthy/falsy type narrowing for an enum that overrides
__bool__
. - Fixed bug that results in a false positive when accessing a generic attribute in a base class from a subclass that explicitly specializes the generic type.
- Fixed bug that results in duplicate and (contradictory) diagnostic outputs in certain cases where
reveal_type
is used in a loop. - Fixed a bug that results in incorrect (local) type evaluation of an instance variable with a declared type when assigned within a loop that uses an augmented assignment.
- Fixed bug that causes
Final
annotation not to be honored when wrapped in anAnnotated
annotation. - Fixed bug that results in a false positive error under certain circumstances involving tuple type narrowing in a loop.
- Fixed bug that led to divergent behaviors between pyrightconfig.json and pyproject.toml configurations. Specifically, default exclude patterns were not added in the case of pyproject.toml. Thanks to @augustelalande for contributing to this fix.
- Fixed bug that results in parameter types being converted to
Any
when converting aNewType
or dataclass constructor to a callable.
Enhancements:
- Updated typeshed stubs to the latest version.
- Implemented provisional support for PEP 746, which provides consistency checks for metadata used in an
Annotated
annotation. - Added check for
except*
to enforce that exception class does not derive fromBaseExceptionGroup
. - Added the ability to override type checking configuration settings for each execution environment. This allows, for example, a test directory to use different settings than the directories that contain production code.
Behavior Changes:
- Added extra blank line to JSON output to assist with parsing when used in watch mode.
- Changed the import resolution order to better reflect runtime behavior and match a proposed change to the typing spec. In particular, stdlib typeshed stubs are now resolved prior to
site_packages
.