Releases: PyCQA/flake8-pyi
Releases · PyCQA/flake8-pyi
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).
22.1.0
- extend Y001 to cover ParamSpec and TypeVarTuple in addition to TypeVar
- detect usage of non-integer indices in
sys.version_infochecks - extend Y010 to check async functions in addition to normal functions
- extend Y010 to cover what was previously included in Y090 (disallow
assignments in__init__methods) and Y091 (disallowraise
statements). The previous checks were disabled by default. - introduce Y016 (duplicate union member)
- introduce Y017 (disallows assignments with multiple targets or non-name targets)
- introduce Y018 (detect unused TypeVars)
- introduce Y019 (detect TypeVars that should be _typeshed.Self, but aren't)
- introduce Y020 (never use quoted annotations in stubs)
- introduce Y021 (docstrings should not be included in stubs)
- introduce Y022 (prefer stdlib classes over
typingaliases) - introduce Y023 (prefer
typingovertyping_extensions) - introduce Y024 (prefer
typing.NamedTupletocollections.namedtuple) - introduce Y026 (require using TypeAlias for type aliases)
- introduce Y025 (always alias
collections.abc.Set) - introduce Y027 (Python 2-incompatible extension of Y022)
- introduce Y028 (Use class-based syntax for NamedTuples)
- introduce Y029 (never define
__repr__or__str__) - introduce Y030 (use
Literal['foo', 'bar']instead ofLiteral['foo'] | Literal['bar']) - introduce Y031 (use class-based syntax for TypedDicts where possible)
- all errors are now enabled by default
- remove Y092 (top-level attribute must not have a default value)
attrsis no longer a dependencyast_decompilerhas been added as a dependency on Python 3.8 and 3.7- support Python 3.10
- discontinue support for Python 3.6
22.1.0rc1
Pre-release. If all goes well 22.1.0 will follow soon with the exact same code.
- extend Y001 to cover ParamSpec and TypeVarTuple in addition to TypeVar
- detect usage of non-integer indices in
sys.version_infochecks - extend Y010 to check async functions in addition to normal functions
- extend Y010 to cover what was previously included in Y090 (disallow
assignments in__init__methods) and Y091 (disallowraise
statements). The previous checks were disabled by default. - introduce Y016 (duplicate union member)
- introduce Y017 (disallows assignments with multiple targets or non-name targets)
- introduce Y018 (detect unused TypeVars)
- introduce Y019 (detect TypeVars that should be _typeshed.Self, but aren't)
- introduce Y020 (never use quoted annotations in stubs)
- introduce Y021 (docstrings should not be included in stubs)
- introduce Y022 (prefer stdlib classes over
typingaliases) - introduce Y023 (prefer
typingovertyping_extensions) - introduce Y024 (prefer
typing.NamedTupletocollections.namedtuple) - introduce Y026 (require using TypeAlias for type aliases)
- introduce Y025 (always alias
collections.abc.Set) - introduce Y027 (Python 2-incompatible extension of Y022)
- introduce Y028 (Use class-based syntax for NamedTuples)
- introduce Y029 (never define
__repr__or__str__) - introduce Y030 (use
Literal['foo', 'bar']instead ofLiteral['foo'] | Literal['bar']) - introduce Y031 (use class-based syntax for TypedDicts where possible)
- all errors are now enabled by default
- remove Y092 (top-level attribute must not have a default value)
attrsis no longer a dependencyast_decompilerhas been added as a dependency on Python 3.8 and 3.7- support Python 3.10
- discontinue support for Python 3.6