22.7.0
New error codes:
- Introduce Y041: Ban redundant numeric unions (
int | float,int | complex,
float | complex). - Introduce Y042: Type alias names should use CamelCase rather than snake_case
- Introduce Y043: Ban type aliases from having names ending with an uppercase "T".
- Introduce Y044: Discourage unnecessary
from __future__ import annotationsimport.
Contributed by Torsten Wörtwein. - Introduce Y045: Ban returning
(Async)Iterablefrom__(a)iter__methods.
Other enhancements and behaviour changes:
- Improve error message for Y026 check.
- Expand Y026 check. Since version 22.4.0, this has only emitted an error for
assignments totyping.Literal,typing.Union, and PEP 604 unions. It now also
emits an error for any subscription on the right-hand side of a simple assignment, as
well as for assignments totyping.AnyandNone. - Support
typing_extensions.overloadandtyping_extensions.NamedTuple. - Slightly expand Y034 to cover the case where a class inheriting from
(Async)Iterator
returns(Async)Iterablefrom__(a)iter__. These classes should nearly always return
Selffrom these methods. - Support Python 3.11.