Behavior Change: Changed type inference logic that infers the type of the value
attribute in an enum. If the enum class has a custom metaclass (one that is not part of the stdlib), pyright now assumes that the custom metaclass may perform some runtime magic that modifies the value
. This occurs, for example, in django's TextChoices
class.
Bug Fix: Fixed a bug that led to incorrect import resolution in cases where multiple import resolution paths have partial overlapping paths and some include namespace packages and others do not.
Bug Fix: Reworked the logic for bidirectional type inference to address several systemic issues with the previous mechanism when nested calls were used. This is a significant change, and it has the potential for regressions.
Bug Fix: Fixed a bug that led to the incorrect type evaluation of a generic function call if the return result included a type variable that evaluated to Unknown
.
Bug Fix: Fixed bug that resulted in a bogus "fully-qualified name" of a symbol if used within a file that is located outside of the project and is not imported by a file in the project.
Bug Fix: Fixed a bug that resulted in incorrect fully-qualified names of type aliases that are nested within classes.
Enhancement: Added code to the "type printer" module that detects overlapping class and type alias names used within the same type. When these are detected, they are printed in their fully-qualified forms to help the user disambiguate.
Behavior Change: Added code to exempt the synthesized __hash__
symbol in dataclass classes from override checks (such as reportIncompatibleVariableOverride
).
Bug Fix: Fixed a bug in protocol matching that resulted in a false positive if Self
was used in a method within a protocol base class used for another protocol.