Bugfixes:
- fix bugs in several error codes so that e.g.
_T = typing.TypeVar("_T")
is
recognised as aTypeVar
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
TypeVar
s were erroneously flagged as unused if they were only used in
atyping.Union
subscript. - improve unclear error messages for Y022, Y023 and Y027 error codes.
Features:
- introduce Y032 (prefer
object
toAny
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 useTypeVar
s instead). - introduce Y035 (
__all__
in a stub has the same semantics as at runtime).