mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
stdlib: More pos-only parameters to Protocols (#10987)
This commit is contained in:
@@ -69,7 +69,7 @@ if sys.version_info >= (3, 12):
|
||||
def invalidate_caches(self) -> None: ...
|
||||
# Not defined on the actual class, but expected to exist.
|
||||
def find_spec(
|
||||
self, fullname: str, path: Sequence[str] | None, target: types.ModuleType | None = ...
|
||||
self, __fullname: str, __path: Sequence[str] | None, __target: types.ModuleType | None = ...
|
||||
) -> ModuleSpec | None: ...
|
||||
|
||||
class PathEntryFinder(metaclass=ABCMeta):
|
||||
@@ -84,7 +84,7 @@ else:
|
||||
def invalidate_caches(self) -> None: ...
|
||||
# Not defined on the actual class, but expected to exist.
|
||||
def find_spec(
|
||||
self, fullname: str, path: Sequence[str] | None, target: types.ModuleType | None = ...
|
||||
self, __fullname: str, __path: Sequence[str] | None, __target: types.ModuleType | None = ...
|
||||
) -> ModuleSpec | None: ...
|
||||
|
||||
class PathEntryFinder(Finder):
|
||||
|
||||
@@ -73,7 +73,7 @@ def synchronized(obj: ctypes.Array[_CT], lock: _LockLike | None = None, ctx: Any
|
||||
def synchronized(obj: _CT, lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedBase[_CT]: ...
|
||||
|
||||
class _AcquireFunc(Protocol):
|
||||
def __call__(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
|
||||
def __call__(self, __block: bool = ..., __timeout: float | None = ...) -> bool: ...
|
||||
|
||||
class SynchronizedBase(Generic[_CT]):
|
||||
acquire: _AcquireFunc
|
||||
|
||||
@@ -68,9 +68,9 @@ def quotedata(data: str) -> str: ...
|
||||
|
||||
class _AuthObject(Protocol):
|
||||
@overload
|
||||
def __call__(self, challenge: None = None) -> str | None: ...
|
||||
def __call__(self, __challenge: None = None) -> str | None: ...
|
||||
@overload
|
||||
def __call__(self, challenge: bytes) -> str: ...
|
||||
def __call__(self, __challenge: bytes) -> str: ...
|
||||
|
||||
class SMTP:
|
||||
debuglevel: int
|
||||
|
||||
@@ -17,7 +17,9 @@ _OptExcInfo: TypeAlias = OptExcInfo # noqa: Y047 # TODO: obsolete, remove fall
|
||||
|
||||
# Intentionally omits one deprecated and one optional method of `importlib.abc.MetaPathFinder`
|
||||
class _MetaPathFinder(Protocol):
|
||||
def find_spec(self, fullname: str, path: Sequence[str] | None, target: ModuleType | None = ...) -> ModuleSpec | None: ...
|
||||
def find_spec(
|
||||
self, __fullname: str, __path: Sequence[str] | None, __target: ModuleType | None = ...
|
||||
) -> ModuleSpec | None: ...
|
||||
|
||||
# ----- sys variables -----
|
||||
if sys.platform != "win32":
|
||||
|
||||
@@ -6,7 +6,7 @@ if sys.version_info >= (3, 9):
|
||||
__all__ = ["dnd_start", "DndHandler"]
|
||||
|
||||
class _DndSource(Protocol):
|
||||
def dnd_end(self, target: Widget | None, event: Event[Misc] | None) -> None: ...
|
||||
def dnd_end(self, __target: Widget | None, __event: Event[Misc] | None) -> None: ...
|
||||
|
||||
class DndHandler:
|
||||
root: ClassVar[Tk | None]
|
||||
|
||||
@@ -11,7 +11,7 @@ MAIN_EXAMPLES: str
|
||||
MODULE_EXAMPLES: str
|
||||
|
||||
class _TestRunner(Protocol):
|
||||
def run(self, test: unittest.suite.TestSuite | unittest.case.TestCase) -> unittest.result.TestResult: ...
|
||||
def run(self, __test: unittest.suite.TestSuite | unittest.case.TestCase) -> unittest.result.TestResult: ...
|
||||
|
||||
# not really documented
|
||||
class TestProgram:
|
||||
|
||||
@@ -227,7 +227,8 @@ class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):
|
||||
class _HTTPConnectionProtocol(Protocol):
|
||||
def __call__(
|
||||
self,
|
||||
host: str,
|
||||
__host: str,
|
||||
*,
|
||||
port: int | None = ...,
|
||||
timeout: float = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
|
||||
Reference in New Issue
Block a user