Skip to content

22.2.0

Choose a tag to compare

@AlexWaygood AlexWaygood released this 21 Feb 01:35
411e1aa

Bugfixes:

  • fix bugs in several error codes so that e.g. _T = typing.TypeVar("_T") is
    recognised as a TypeVar definition (previously only _T = TypeVar("_T") was
    recognised).
  • fix bug where foo = False at the module level did not trigger a Y015 error.
  • fix bug where TypeVars were erroneously flagged as unused if they were only used in
    a typing.Union subscript.
  • improve unclear error messages for Y022, Y023 and Y027 error codes.

Features:

  • introduce Y032 (prefer object to Any for the second argument in __eq__ and
    __ne__ methods).
  • introduce Y033 (always use annotations in stubs, rather than type comments).
  • introduce Y034 (detect common errors where return types are hardcoded, but they
    should use TypeVars instead).
  • introduce Y035 (__all__ in a stub has the same semantics as at runtime).