Skip to content

Published 1.1.390

Latest
Compare
Choose a tag to compare
@bschnurr bschnurr released this 04 Dec 03:20

Bug Fixes:

  • Fixed recent regression that results in incorrect narrowed type when using the x in y pattern where y is a container type whose element type is Unknown or Any.
  • Fixed bug that causes a false positive overlapping overload error when the overload accepts a Callable[..., T] form.
  • Fixed a bug that results in a hang under certain circumstances when using a recursive type alias.
  • Fixed a bug that leads to a false positive when a function is decorated and has no explicit return type annotation and the body references the decorated function in a loop.
  • Fixed a bug that leads to incorrect type evaluation when __getitem__ is set to a callable object.
  • Fixed bug that results in confusing error message when there is a partially-unknown metaclass type detected by the --verifytypes command.

Enhancements:

  • Updated typeshed stubs to the latest version.
  • Added check for \u and \N escapes within bytes literals, which are illegal.
  • Added support for a "bare" Final annotation in a dataclass entry that has a default value assigned to it.
  • Improved dataclass converters to support generic types.
  • Added check for importing a Final variable from another module and then attempting to overwrite it.
  • Added check for an attempt to assign to a module-local variable if it is shadowing a Final variable declared by the builtins module or some other chained file.
  • Added support for evaluating the slice class type arguments for slice expressions.
  • Added check for invalid use of ClassVar qualifier within a NamedTuple or TypedDict attribute annotation.

Behavior Changes:

  • Changed inference logic for exception groups to more closely match the runtime. If a non-base exception is targeted, the inferred type is now ExceptionGroup rather than BaseExceptionGroup.