mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-11 09:08:27 +08:00
Use Generator instead of Iterator for 3rd-party context managers (#12481)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import contextlib
|
||||
import enum
|
||||
import sys
|
||||
from collections.abc import Callable, Iterable, Iterator
|
||||
from collections.abc import Callable, Generator, Iterable, Iterator
|
||||
from typing import Any, ClassVar
|
||||
from typing_extensions import Self
|
||||
|
||||
@@ -108,7 +108,7 @@ class Controller:
|
||||
def tap(self, key: str | Key | KeyCode) -> None: ...
|
||||
def touch(self, key: str | Key | KeyCode, is_press: bool) -> None: ...
|
||||
@contextlib.contextmanager
|
||||
def pressed(self, *args: str | Key | KeyCode) -> Iterator[None]: ...
|
||||
def pressed(self, *args: str | Key | KeyCode) -> Generator[None]: ...
|
||||
def type(self, string: str) -> None: ...
|
||||
@property
|
||||
def modifiers(self) -> contextlib.AbstractContextManager[Iterator[set[Key]]]: ...
|
||||
|
||||
Reference in New Issue
Block a user