22.2.0
Bugfixes:
- fix bugs in several error codes so that e.g.
_T = typing.TypeVar("_T")is
recognised as aTypeVardefinition (previously only_T = TypeVar("_T")was
recognised). - fix bug where
foo = Falseat the module level did not trigger a Y015 error. - fix bug where
TypeVars were erroneously flagged as unused if they were only used in
atyping.Unionsubscript. - improve unclear error messages for Y022, Y023 and Y027 error codes.
Features:
- introduce Y032 (prefer
objecttoAnyfor 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 useTypeVars instead). - introduce Y035 (
__all__in a stub has the same semantics as at runtime).