Use PEP 570 syntax in comments (#11552)

This commit is contained in:
Shantanu
2024-03-09 15:06:25 -08:00
committed by GitHub
parent 470a13ab09
commit 2d146e7da2
3 changed files with 3 additions and 3 deletions

View File

@@ -182,7 +182,7 @@ class Context:
# even settable attributes like `prec` and `rounding`,
# but that's inexpressable in the stub.
# Type checkers either ignore it or misinterpret it
# if you add a `def __delattr__(self, __name: str) -> NoReturn` method to the stub
# if you add a `def __delattr__(self, name: str, /) -> NoReturn` method to the stub
prec: int
rounding: str
Emin: int

View File

@@ -23,7 +23,7 @@ class DBAPICursor(Protocol):
@property
def rowcount(self) -> int: ...
# optional:
# def callproc(self, __procname: str, __parameters: Sequence[Any] = ...) -> Sequence[Any]: ...
# def callproc(self, procname: str, parameters: Sequence[Any] = ..., /) -> Sequence[Any]: ...
def close(self) -> object: ...
def execute(self, operation: str, parameters: Sequence[Any] | Mapping[str, Any] = ..., /) -> object: ...
def executemany(self, operation: str, seq_of_parameters: Sequence[Sequence[Any]], /) -> object: ...

View File

@@ -44,7 +44,7 @@ class _ZipStream(Protocol):
# The following methods are optional:
# def seekable(self) -> bool: ...
# def tell(self) -> int: ...
# def seek(self, __n: int) -> object: ...
# def seek(self, n: int, /) -> object: ...
# Stream shape as required by _EndRecData() and _EndRecData64().
class _SupportsReadSeekTell(Protocol):