Skip to content

Commit 6d6e858

Browse files
authored
Enable Ruff PLC (Pylint Convention) (#13306)
1 parent 738cc50 commit 6d6e858

File tree

17 files changed

+173
-153
lines changed

17 files changed

+173
-153
lines changed

pyproject.toml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ select = [
4545
"I", # isort
4646
"N", # pep8-naming
4747
"PGH", # pygrep-hooks
48+
"PLC", # Pylint Convention
4849
"RUF", # Ruff-specific and unused-noqa
4950
"TRY", # tryceratops
5051
"UP", # pyupgrade
@@ -159,19 +160,26 @@ ignore = [
159160
# A lot of stubs are incomplete on purpose, and that's configured through pyright
160161
# Some ANN204 (special method) are autofixable in stubs, but not all.
161162
"ANN2", # Missing return type annotation for ...
162-
# Most pep8-naming rules don't apply for third-party stubs like typeshed.
163-
# N811 to N814 could apply, but we often use them to disambiguate a name whilst making it look like a more common one
164-
"N8",
163+
# Ruff 0.8.0 added sorting of __all__ and __slots_.
164+
# There is no consensus on whether we want to apply this to stubs, so keeping the status quo.
165+
# See https://github.com/python/typeshed/pull/13108
166+
"RUF022", # `__all__` is not sorted
167+
"RUF023", # `{}.__slots__` is not sorted
168+
###
165169
# Rules that are out of the control of stub authors:
170+
###
166171
"F403", # `from . import *` used; unable to detect undefined names
167172
# Stubs can sometimes re-export entire modules.
168173
# Issues with using a star-imported name will be caught by type-checkers.
169174
"F405", # may be undefined, or defined from star imports
170-
# Ruff 0.8.0 added sorting of __all__ and __slots_.
171-
# There is no consensus on whether we want to apply this to stubs, so keeping the status quo.
172-
# See https://github.com/python/typeshed/pull/13108
173-
"RUF022",
174-
"RUF023",
175+
# Most pep8-naming rules don't apply for third-party stubs like typeshed.
176+
# N811 to N814 could apply, but we often use them to disambiguate a name whilst making it look like a more common one
177+
"N8", # pep8-naming
178+
"PLC2701", # Private name import from external module
179+
]
180+
"lib/ts_utils/**" = [
181+
# Doesn't affect stubs. The only re-exports we have should be in our local lib ts_utils
182+
"PLC0414", # Import alias does not rename original package
175183
]
176184
"*_pb2.pyi" = [
177185
# Leave the docstrings as-is, matching source

stdlib/builtins.pyi

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ _T2 = TypeVar("_T2")
8989
_T3 = TypeVar("_T3")
9090
_T4 = TypeVar("_T4")
9191
_T5 = TypeVar("_T5")
92-
_SupportsNextT = TypeVar("_SupportsNextT", bound=SupportsNext[Any], covariant=True)
93-
_SupportsAnextT = TypeVar("_SupportsAnextT", bound=SupportsAnext[Any], covariant=True)
92+
_SupportsNextT_co = TypeVar("_SupportsNextT_co", bound=SupportsNext[Any], covariant=True)
93+
_SupportsAnextT_co = TypeVar("_SupportsAnextT_co", bound=SupportsAnext[Any], covariant=True)
9494
_AwaitableT = TypeVar("_AwaitableT", bound=Awaitable[Any])
9595
_AwaitableT_co = TypeVar("_AwaitableT_co", bound=Awaitable[Any], covariant=True)
9696
_P = ParamSpec("_P")
@@ -1319,7 +1319,7 @@ class _PathLike(Protocol[AnyStr_co]):
13191319
def __fspath__(self) -> AnyStr_co: ...
13201320

13211321
if sys.version_info >= (3, 10):
1322-
def aiter(async_iterable: SupportsAiter[_SupportsAnextT], /) -> _SupportsAnextT: ...
1322+
def aiter(async_iterable: SupportsAiter[_SupportsAnextT_co], /) -> _SupportsAnextT_co: ...
13231323

13241324
class _SupportsSynchronousAnext(Protocol[_AwaitableT_co]):
13251325
def __anext__(self) -> _AwaitableT_co: ...
@@ -1481,7 +1481,7 @@ class _GetItemIterable(Protocol[_T_co]):
14811481
def __getitem__(self, i: int, /) -> _T_co: ...
14821482

14831483
@overload
1484-
def iter(object: SupportsIter[_SupportsNextT], /) -> _SupportsNextT: ...
1484+
def iter(object: SupportsIter[_SupportsNextT_co], /) -> _SupportsNextT_co: ...
14851485
@overload
14861486
def iter(object: _GetItemIterable[_T], /) -> Iterator[_T]: ...
14871487
@overload
@@ -1688,17 +1688,17 @@ def print(
16881688
*values: object, sep: str | None = " ", end: str | None = "\n", file: _SupportsWriteAndFlush[str] | None = None, flush: bool
16891689
) -> None: ...
16901690

1691-
_E = TypeVar("_E", contravariant=True)
1692-
_M = TypeVar("_M", contravariant=True)
1691+
_E_contra = TypeVar("_E_contra", contravariant=True)
1692+
_M_contra = TypeVar("_M_contra", contravariant=True)
16931693

1694-
class _SupportsPow2(Protocol[_E, _T_co]):
1695-
def __pow__(self, other: _E, /) -> _T_co: ...
1694+
class _SupportsPow2(Protocol[_E_contra, _T_co]):
1695+
def __pow__(self, other: _E_contra, /) -> _T_co: ...
16961696

1697-
class _SupportsPow3NoneOnly(Protocol[_E, _T_co]):
1698-
def __pow__(self, other: _E, modulo: None = None, /) -> _T_co: ...
1697+
class _SupportsPow3NoneOnly(Protocol[_E_contra, _T_co]):
1698+
def __pow__(self, other: _E_contra, modulo: None = None, /) -> _T_co: ...
16991699

1700-
class _SupportsPow3(Protocol[_E, _M, _T_co]):
1701-
def __pow__(self, other: _E, modulo: _M, /) -> _T_co: ...
1700+
class _SupportsPow3(Protocol[_E_contra, _M_contra, _T_co]):
1701+
def __pow__(self, other: _E_contra, modulo: _M_contra, /) -> _T_co: ...
17021702

17031703
_SupportsSomeKindOfPow = ( # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed
17041704
_SupportsPow2[Any, Any] | _SupportsPow3NoneOnly[Any, Any] | _SupportsPow3[Any, Any, Any]
@@ -1734,11 +1734,11 @@ def pow(base: float, exp: complex | _SupportsSomeKindOfPow, mod: None = None) ->
17341734
@overload
17351735
def pow(base: complex, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> complex: ...
17361736
@overload
1737-
def pow(base: _SupportsPow2[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... # type: ignore[overload-overlap]
1737+
def pow(base: _SupportsPow2[_E_contra, _T_co], exp: _E_contra, mod: None = None) -> _T_co: ... # type: ignore[overload-overlap]
17381738
@overload
1739-
def pow(base: _SupportsPow3NoneOnly[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... # type: ignore[overload-overlap]
1739+
def pow(base: _SupportsPow3NoneOnly[_E_contra, _T_co], exp: _E_contra, mod: None = None) -> _T_co: ... # type: ignore[overload-overlap]
17401740
@overload
1741-
def pow(base: _SupportsPow3[_E, _M, _T_co], exp: _E, mod: _M) -> _T_co: ...
1741+
def pow(base: _SupportsPow3[_E_contra, _M_contra, _T_co], exp: _E_contra, mod: _M_contra) -> _T_co: ...
17421742
@overload
17431743
def pow(base: _SupportsSomeKindOfPow, exp: float, mod: None = None) -> Any: ...
17441744
@overload

stdlib/contextlib.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ _T_co = TypeVar("_T_co", covariant=True)
3333
_T_io = TypeVar("_T_io", bound=IO[str] | None)
3434
_ExitT_co = TypeVar("_ExitT_co", covariant=True, bound=bool | None, default=bool | None)
3535
_F = TypeVar("_F", bound=Callable[..., Any])
36-
_G = TypeVar("_G", bound=Generator[Any, Any, Any] | AsyncGenerator[Any, Any], covariant=True)
36+
_G_co = TypeVar("_G_co", bound=Generator[Any, Any, Any] | AsyncGenerator[Any, Any], covariant=True)
3737
_P = ParamSpec("_P")
3838

3939
_SendT_contra = TypeVar("_SendT_contra", contravariant=True, default=None)
@@ -68,11 +68,11 @@ class ContextDecorator:
6868
def _recreate_cm(self) -> Self: ...
6969
def __call__(self, func: _F) -> _F: ...
7070

71-
class _GeneratorContextManagerBase(Generic[_G]):
71+
class _GeneratorContextManagerBase(Generic[_G_co]):
7272
# Ideally this would use ParamSpec, but that requires (*args, **kwargs), which this isn't. see #6676
73-
def __init__(self, func: Callable[..., _G], args: tuple[Any, ...], kwds: dict[str, Any]) -> None: ...
74-
gen: _G
75-
func: Callable[..., _G]
73+
def __init__(self, func: Callable[..., _G_co], args: tuple[Any, ...], kwds: dict[str, Any]) -> None: ...
74+
gen: _G_co
75+
func: Callable[..., _G_co]
7676
args: tuple[Any, ...]
7777
kwds: dict[str, Any]
7878

stdlib/inspect.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ if sys.version_info >= (3, 11):
143143
_P = ParamSpec("_P")
144144
_T = TypeVar("_T")
145145
_F = TypeVar("_F", bound=Callable[..., Any])
146-
_T_cont = TypeVar("_T_cont", contravariant=True)
147-
_V_cont = TypeVar("_V_cont", contravariant=True)
146+
_T_contra = TypeVar("_T_contra", contravariant=True)
147+
_V_contra = TypeVar("_V_contra", contravariant=True)
148148

149149
#
150150
# Types and members
@@ -228,11 +228,11 @@ def isasyncgenfunction(obj: Callable[_P, Any]) -> TypeGuard[Callable[_P, AsyncGe
228228
@overload
229229
def isasyncgenfunction(obj: object) -> TypeGuard[Callable[..., AsyncGeneratorType[Any, Any]]]: ...
230230

231-
class _SupportsSet(Protocol[_T_cont, _V_cont]):
232-
def __set__(self, instance: _T_cont, value: _V_cont, /) -> None: ...
231+
class _SupportsSet(Protocol[_T_contra, _V_contra]):
232+
def __set__(self, instance: _T_contra, value: _V_contra, /) -> None: ...
233233

234-
class _SupportsDelete(Protocol[_T_cont]):
235-
def __delete__(self, instance: _T_cont, /) -> None: ...
234+
class _SupportsDelete(Protocol[_T_contra]):
235+
def __delete__(self, instance: _T_contra, /) -> None: ...
236236

237237
def isasyncgen(object: object) -> TypeIs[AsyncGeneratorType[Any, Any]]: ...
238238
def istraceback(object: object) -> TypeIs[TracebackType]: ...

stdlib/multiprocessing/connection.pyi

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ __all__ = ["Client", "Listener", "Pipe", "wait"]
1212
_Address: TypeAlias = str | tuple[str, int]
1313

1414
# Defaulting to Any to avoid forcing generics on a lot of pre-existing code
15-
_SendT = TypeVar("_SendT", contravariant=True, default=Any)
16-
_RecvT = TypeVar("_RecvT", covariant=True, default=Any)
15+
_SendT_contra = TypeVar("_SendT_contra", contravariant=True, default=Any)
16+
_RecvT_co = TypeVar("_RecvT_co", covariant=True, default=Any)
1717

18-
class _ConnectionBase(Generic[_SendT, _RecvT]):
18+
class _ConnectionBase(Generic[_SendT_contra, _RecvT_co]):
1919
def __init__(self, handle: SupportsIndex, readable: bool = True, writable: bool = True) -> None: ...
2020
@property
2121
def closed(self) -> bool: ... # undocumented
@@ -26,21 +26,21 @@ class _ConnectionBase(Generic[_SendT, _RecvT]):
2626
def fileno(self) -> int: ...
2727
def close(self) -> None: ...
2828
def send_bytes(self, buf: ReadableBuffer, offset: int = 0, size: int | None = None) -> None: ...
29-
def send(self, obj: _SendT) -> None: ...
29+
def send(self, obj: _SendT_contra) -> None: ...
3030
def recv_bytes(self, maxlength: int | None = None) -> bytes: ...
3131
def recv_bytes_into(self, buf: Any, offset: int = 0) -> int: ...
32-
def recv(self) -> _RecvT: ...
32+
def recv(self) -> _RecvT_co: ...
3333
def poll(self, timeout: float | None = 0.0) -> bool: ...
3434
def __enter__(self) -> Self: ...
3535
def __exit__(
3636
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, exc_tb: TracebackType | None
3737
) -> None: ...
3838
def __del__(self) -> None: ...
3939

40-
class Connection(_ConnectionBase[_SendT, _RecvT]): ...
40+
class Connection(_ConnectionBase[_SendT_contra, _RecvT_co]): ...
4141

4242
if sys.platform == "win32":
43-
class PipeConnection(_ConnectionBase[_SendT, _RecvT]): ...
43+
class PipeConnection(_ConnectionBase[_SendT_contra, _RecvT_co]): ...
4444

4545
class Listener:
4646
def __init__(
@@ -66,8 +66,8 @@ else:
6666

6767
def answer_challenge(connection: Connection[Any, Any], authkey: bytes) -> None: ...
6868
def wait(
69-
object_list: Iterable[Connection[_SendT, _RecvT] | socket.socket | int], timeout: float | None = None
70-
) -> list[Connection[_SendT, _RecvT] | socket.socket | int]: ...
69+
object_list: Iterable[Connection[_SendT_contra, _RecvT_co] | socket.socket | int], timeout: float | None = None
70+
) -> list[Connection[_SendT_contra, _RecvT_co] | socket.socket | int]: ...
7171
def Client(address: _Address, family: str | None = None, authkey: bytes | None = None) -> Connection[Any, Any]: ...
7272

7373
# N.B. Keep this in sync with multiprocessing.context.BaseContext.Pipe.

stdlib/typing.pyi

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -510,15 +510,15 @@ class Awaitable(Protocol[_T_co]):
510510
def __await__(self) -> Generator[Any, Any, _T_co]: ...
511511

512512
# Non-default variations to accommodate couroutines, and `AwaitableGenerator` having a 4th type parameter.
513-
_SendT_contra_nd = TypeVar("_SendT_contra_nd", contravariant=True)
514-
_ReturnT_co_nd = TypeVar("_ReturnT_co_nd", covariant=True)
513+
_SendT_nd_contra = TypeVar("_SendT_nd_contra", contravariant=True)
514+
_ReturnT_nd_co = TypeVar("_ReturnT_nd_co", covariant=True)
515515

516-
class Coroutine(Awaitable[_ReturnT_co_nd], Generic[_YieldT_co, _SendT_contra_nd, _ReturnT_co_nd]):
516+
class Coroutine(Awaitable[_ReturnT_nd_co], Generic[_YieldT_co, _SendT_nd_contra, _ReturnT_nd_co]):
517517
__name__: str
518518
__qualname__: str
519519

520520
@abstractmethod
521-
def send(self, value: _SendT_contra_nd, /) -> _YieldT_co: ...
521+
def send(self, value: _SendT_nd_contra, /) -> _YieldT_co: ...
522522
@overload
523523
@abstractmethod
524524
def throw(
@@ -534,9 +534,9 @@ class Coroutine(Awaitable[_ReturnT_co_nd], Generic[_YieldT_co, _SendT_contra_nd,
534534
# The parameters correspond to Generator, but the 4th is the original type.
535535
@type_check_only
536536
class AwaitableGenerator(
537-
Awaitable[_ReturnT_co_nd],
538-
Generator[_YieldT_co, _SendT_contra_nd, _ReturnT_co_nd],
539-
Generic[_YieldT_co, _SendT_contra_nd, _ReturnT_co_nd, _S],
537+
Awaitable[_ReturnT_nd_co],
538+
Generator[_YieldT_co, _SendT_nd_contra, _ReturnT_nd_co],
539+
Generic[_YieldT_co, _SendT_nd_contra, _ReturnT_nd_co, _S],
540540
metaclass=ABCMeta,
541541
): ...
542542

stubs/WTForms/wtforms/validators.pyi

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ __all__ = (
4242
"Disabled",
4343
)
4444

45-
_ValuesT = TypeVar("_ValuesT", bound=Collection[Any], contravariant=True)
45+
_ValuesT_contra = TypeVar("_ValuesT_contra", bound=Collection[Any], contravariant=True)
4646

4747
class ValidationError(ValueError):
4848
def __init__(self, message: str = "", *args: object) -> None: ...
@@ -150,9 +150,13 @@ class AnyOf:
150150
@overload
151151
def __init__(self, values: Collection[Any], message: str | None = None, values_formatter: None = None) -> None: ...
152152
@overload
153-
def __init__(self, values: _ValuesT, message: str | None, values_formatter: Callable[[_ValuesT], str]) -> None: ...
153+
def __init__(
154+
self, values: _ValuesT_contra, message: str | None, values_formatter: Callable[[_ValuesT_contra], str]
155+
) -> None: ...
154156
@overload
155-
def __init__(self, values: _ValuesT, message: str | None = None, *, values_formatter: Callable[[_ValuesT], str]) -> None: ...
157+
def __init__(
158+
self, values: _ValuesT_contra, message: str | None = None, *, values_formatter: Callable[[_ValuesT_contra], str]
159+
) -> None: ...
156160
def __call__(self, form: BaseForm, field: Field) -> None: ...
157161
@staticmethod
158162
def default_values_formatter(values: Iterable[object]) -> str: ...
@@ -164,9 +168,13 @@ class NoneOf:
164168
@overload
165169
def __init__(self, values: Collection[Any], message: str | None = None, values_formatter: None = None) -> None: ...
166170
@overload
167-
def __init__(self, values: _ValuesT, message: str | None, values_formatter: Callable[[_ValuesT], str]) -> None: ...
171+
def __init__(
172+
self, values: _ValuesT_contra, message: str | None, values_formatter: Callable[[_ValuesT_contra], str]
173+
) -> None: ...
168174
@overload
169-
def __init__(self, values: _ValuesT, message: str | None = None, *, values_formatter: Callable[[_ValuesT], str]) -> None: ...
175+
def __init__(
176+
self, values: _ValuesT_contra, message: str | None = None, *, values_formatter: Callable[[_ValuesT_contra], str]
177+
) -> None: ...
170178
def __call__(self, form: BaseForm, field: Field) -> None: ...
171179
@staticmethod
172180
def default_values_formatter(v: Iterable[object]) -> str: ...

stubs/boltons/boltons/tbutils.pyi

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,31 @@ class Callpoint:
2222
def from_tb(cls, tb: TracebackType) -> Self: ...
2323
def tb_frame_str(self) -> str: ...
2424

25-
_CallpointT = TypeVar("_CallpointT", bound=Callpoint, covariant=True, default=Callpoint)
25+
_CallpointT_co = TypeVar("_CallpointT_co", bound=Callpoint, covariant=True, default=Callpoint)
2626

27-
class TracebackInfo(Generic[_CallpointT]):
28-
callpoint_type: type[_CallpointT]
29-
frames: list[_CallpointT]
30-
def __init__(self, frames: list[_CallpointT]) -> None: ...
27+
class TracebackInfo(Generic[_CallpointT_co]):
28+
callpoint_type: type[_CallpointT_co]
29+
frames: list[_CallpointT_co]
30+
def __init__(self, frames: list[_CallpointT_co]) -> None: ...
3131
@classmethod
3232
def from_frame(cls, frame: FrameType | None = None, level: int = 1, limit: int | None = None) -> Self: ...
3333
@classmethod
3434
def from_traceback(cls, tb: TracebackType | None = None, limit: int | None = None) -> Self: ...
3535
@classmethod
36-
def from_dict(cls, d: Mapping[Literal["frames"], list[_CallpointT]]) -> Self: ...
37-
def to_dict(self) -> dict[str, list[dict[str, _CallpointT]]]: ...
36+
def from_dict(cls, d: Mapping[Literal["frames"], list[_CallpointT_co]]) -> Self: ...
37+
def to_dict(self) -> dict[str, list[dict[str, _CallpointT_co]]]: ...
3838
def __len__(self) -> int: ...
39-
def __iter__(self) -> Iterator[_CallpointT]: ...
39+
def __iter__(self) -> Iterator[_CallpointT_co]: ...
4040
def get_formatted(self) -> str: ...
4141

42-
_TracebackInfoT = TypeVar("_TracebackInfoT", bound=TracebackInfo, covariant=True, default=TracebackInfo)
42+
_TracebackInfoT_co = TypeVar("_TracebackInfoT_co", bound=TracebackInfo, covariant=True, default=TracebackInfo)
4343

44-
class ExceptionInfo(Generic[_TracebackInfoT]):
45-
tb_info_type: type[_TracebackInfoT]
44+
class ExceptionInfo(Generic[_TracebackInfoT_co]):
45+
tb_info_type: type[_TracebackInfoT_co]
4646
exc_type: str
4747
exc_msg: str
48-
tb_info: _TracebackInfoT
49-
def __init__(self, exc_type: str, exc_msg: str, tb_info: _TracebackInfoT) -> None: ...
48+
tb_info: _TracebackInfoT_co
49+
def __init__(self, exc_type: str, exc_msg: str, tb_info: _TracebackInfoT_co) -> None: ...
5050
@classmethod
5151
def from_exc_info(cls, exc_type: type[BaseException], exc_value: BaseException, traceback: TracebackType) -> Self: ...
5252
@classmethod

stubs/networkx/networkx/algorithms/operators/binary.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ def difference(G: Graph[_Node], H: Graph[_Node]): ...
1515
@_dispatchable
1616
def symmetric_difference(G: Graph[_Node], H: Graph[_Node]): ...
1717

18-
_X = TypeVar("_X", bound=Hashable, covariant=True)
19-
_Y = TypeVar("_Y", bound=Hashable, covariant=True)
18+
_X_co = TypeVar("_X_co", bound=Hashable, covariant=True)
19+
_Y_co = TypeVar("_Y_co", bound=Hashable, covariant=True)
2020

2121
@_dispatchable
22-
def compose(G: Graph[_X], H: Graph[_Y]) -> DiGraph[_X | _Y]: ...
22+
def compose(G: Graph[_X_co], H: Graph[_Y_co]) -> DiGraph[_X_co | _Y_co]: ...
2323
@_dispatchable
24-
def union(G: Graph[_X], H: Graph[_Y], rename: Iterable[Incomplete] | None = ()) -> DiGraph[_X | _Y]: ...
24+
def union(G: Graph[_X_co], H: Graph[_Y_co], rename: Iterable[Incomplete] | None = ()) -> DiGraph[_X_co | _Y_co]: ...

stubs/pynput/pynput/_util.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ from typing import Any, ClassVar, Generic, TypedDict, TypeVar
77
from typing_extensions import ParamSpec, Self
88

99
_T = TypeVar("_T")
10-
_AbstractListener_T = TypeVar("_AbstractListener_T", bound=AbstractListener)
10+
_AbstractListenerT = TypeVar("_AbstractListenerT", bound=AbstractListener)
1111
_P = ParamSpec("_P")
1212

1313
class _RESOLUTIONS(TypedDict):
@@ -49,15 +49,15 @@ class AbstractListener(threading.Thread):
4949
def _stop_platform(self) -> None: ... # undocumented
5050
def join(self, timeout: float | None = None, *args: Any) -> None: ...
5151

52-
class Events(Generic[_T, _AbstractListener_T]):
53-
_Listener: type[_AbstractListener_T] | None # undocumented
52+
class Events(Generic[_T, _AbstractListenerT]):
53+
_Listener: type[_AbstractListenerT] | None # undocumented
5454

5555
class Event:
5656
def __eq__(self, other: object) -> bool: ...
5757

5858
_event_queue: Queue[_T] # undocumented
5959
_sentinel: object # undocumented
60-
_listener: _AbstractListener_T # undocumented
60+
_listener: _AbstractListenerT # undocumented
6161
start: Callable[[], None]
6262
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
6363
def __enter__(self) -> Self: ...

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy