Flake8-pyi

Latest version: v24.9.0

Safety actively analyzes 681866 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 7

22.5.1

Behaviour changes:
* Relax Y020 check slightly, enabling the idiom `__all__ += ["foo", "bar"]` to be used
in a stub file.

22.5.0

Features:
* Introduce Y039: Use `str` instead of `typing.Text` for Python 3 stubs.
* Teach the Y036 check that `builtins.object` (as well as the unqualified `object`) is
acceptable as an annotation for an `__(a)exit__` method argument.
* Teach the Y029 check to emit errors for `__repr__` and `__str__` methods that return
`builtins.str` (as opposed to the unqualified `str`).
* Introduce Y040: Never explicitly inherit from `object` in Python 3 stubs.

22.4.1

Features:
* Expand Y027 check to prohibit importing any objects from the `typing` module that are
aliases for objects living `collections.abc` (except for `typing.AbstractSet`, which
is special-cased).
* Introduce Y038: Use `from collections.abc import Set as AbstractSet` instead of
`from typing import AbstractSet`.

Bugfixes:
* Improve inaccurate error messages for Y036.

22.4.0

Features:
* Introduce Y036 (check for badly defined `__exit__` and `__aexit__` methods).
* Introduce Y037 (Use PEP 604 syntax instead of `typing.Union` and `typing.Optional`).
Contributed by Oleg Höfling.

Behaviour changes:
* Expand Y035 to cover `__match_args__` inside class definitions, as well as `__all__`
in the global scope.

Bugfixes:
* Improve Y026 check (regarding `typing.TypeAlias`) to reduce false-positive errors
emitted when the plugin encountered variable aliases in a stub file.

22.3.0

Bugfixes:
* fix bug where incorrect quoted annotations were not detected within `if` blocks

Behaviour changes:
* Add special-casing so that string literals are allowed in the context of
`__match_args__` assignments inside a class definition.
* Add special-casing so that arbitrary values can be assigned to a variable in
a stub file if the variable is annotated with `Final`.

22.2.0

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 `TypeVar`s 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 `TypeVar`s instead).
* introduce Y035 (`__all__` in a stub has the same semantics as at runtime).

Page 5 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.