Upgrade flake8-pyi to 22.4.0, enable Y026 in .flake8 config (#7650)

This commit is contained in:
Alex Waygood
2022-04-17 01:23:35 +01:00
committed by GitHub
parent 145a85307a
commit 7ce4607dee
4 changed files with 12 additions and 9 deletions

View File

@@ -1289,7 +1289,7 @@ def next(__i: SupportsNext[_T]) -> _T: ...
def next(__i: SupportsNext[_T], __default: _VT) -> _T | _VT: ...
def oct(__number: int | SupportsIndex) -> str: ...
_OpenFile = StrOrBytesPath | int
_OpenFile = StrOrBytesPath | int # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed
_Opener: TypeAlias = Callable[[str, int], int]
# Text mode: always returns a TextIOWrapper
@@ -1408,7 +1408,9 @@ class _SupportsPow3NoneOnly(Protocol[_E, _T_co]):
class _SupportsPow3(Protocol[_E, _M, _T_co]):
def __pow__(self, __other: _E, __modulo: _M) -> _T_co: ...
_SupportsSomeKindOfPow = _SupportsPow2[Any, Any] | _SupportsPow3NoneOnly[Any, Any] | _SupportsPow3[Any, Any, Any]
_SupportsSomeKindOfPow = ( # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed
_SupportsPow2[Any, Any] | _SupportsPow3NoneOnly[Any, Any] | _SupportsPow3[Any, Any, Any]
)
if sys.version_info >= (3, 8):
@overload

View File

@@ -1146,7 +1146,7 @@ class Pattern(Generic[AnyStr]):
# Functions
if sys.version_info >= (3, 7):
_get_type_hints_obj_allowed_types = (
_get_type_hints_obj_allowed_types = ( # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed
object
| Callable[..., Any]
| FunctionType
@@ -1158,7 +1158,9 @@ if sys.version_info >= (3, 7):
| MethodDescriptorType
)
else:
_get_type_hints_obj_allowed_types = object | Callable[..., Any] | FunctionType | BuiltinFunctionType | MethodType | ModuleType
_get_type_hints_obj_allowed_types = ( # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed
object | Callable[..., Any] | FunctionType | BuiltinFunctionType | MethodType | ModuleType
)
if sys.version_info >= (3, 9):
def get_type_hints(