Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 64f4811

Browse files
authored
drop ellipsis assignments from module vars, classvars and instance attrs (#5914)
Signed-off-by: oleg.hoefling <[email protected]>
1 parent 6c41e3c commit 64f4811

34 files changed

Lines changed: 325 additions & 325 deletions

stdlib/_winapi.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def WriteFile(handle: int, buffer: bytes, overlapped: Literal[False] = ...) -> T
128128
def WriteFile(handle: int, buffer: bytes, overlapped: int | bool) -> Tuple[Any, int]: ...
129129

130130
class Overlapped:
131-
event: int = ...
131+
event: int
132132
def GetOverlappedResult(self, __wait: bool) -> Tuple[int, int]: ...
133133
def cancel(self) -> None: ...
134134
def getbuffer(self) -> bytes | None: ...

stdlib/asyncio/constants.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ if sys.version_info >= (3, 7):
99
SENDFILE_FALLBACK_READBUFFER_SIZE: int
1010

1111
class _SendfileMode(enum.Enum):
12-
UNSUPPORTED: int = ...
13-
TRY_NATIVE: int = ...
14-
FALLBACK: int = ...
12+
UNSUPPORTED: int
13+
TRY_NATIVE: int
14+
FALLBACK: int

stdlib/asyncio/events.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class AbstractServer:
6666
async def wait_closed(self) -> None: ...
6767

6868
class AbstractEventLoop(metaclass=ABCMeta):
69-
slow_callback_duration: float = ...
69+
slow_callback_duration: float
7070
@abstractmethod
7171
def run_forever(self) -> None: ...
7272
# Can't use a union, see mypy issue # 1873.

stdlib/asyncio/proactor_events.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport, _ProactorBaseWrit
6565

6666
class _ProactorSocketTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport):
6767

68-
_sendfile_compatible: constants._SendfileMode = ...
68+
_sendfile_compatible: constants._SendfileMode
6969
def __init__(
7070
self,
7171
loop: events.AbstractEventLoop,

stdlib/asyncore.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ from typing import Any, Dict, Tuple, overload
77
_maptype = Dict[int, Any]
88
_socket = socket
99

10-
socket_map: _maptype = ... # undocumented
10+
socket_map: _maptype # undocumented
1111

1212
class ExitNow(Exception): ...
1313

stdlib/bdb.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ _T = TypeVar("_T")
55
_TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type
66
_ExcInfo = Tuple[Type[BaseException], BaseException, FrameType]
77

8-
GENERATOR_AND_COROUTINE_FLAGS: int = ...
8+
GENERATOR_AND_COROUTINE_FLAGS: int
99

1010
class BdbQuit(Exception): ...
1111

@@ -65,9 +65,9 @@ class Bdb:
6565

6666
class Breakpoint:
6767

68-
next: int = ...
69-
bplist: dict[Tuple[str, int], list[Breakpoint]] = ...
70-
bpbynumber: list[Breakpoint | None] = ...
68+
next: int
69+
bplist: dict[Tuple[str, int], list[Breakpoint]]
70+
bpbynumber: list[Breakpoint | None]
7171

7272
funcname: str | None
7373
func_first_executable_line: int | None

stdlib/configparser.pyi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ class LegacyInterpolation(Interpolation):
4848
def before_get(self, parser: _parser, section: str, option: str, value: str, vars: _section) -> str: ...
4949

5050
class RawConfigParser(_parser):
51-
_SECT_TMPL: ClassVar[str] = ... # undocumented
52-
_OPT_TMPL: ClassVar[str] = ... # undocumented
53-
_OPT_NV_TMPL: ClassVar[str] = ... # undocumented
51+
_SECT_TMPL: ClassVar[str] # undocumented
52+
_OPT_TMPL: ClassVar[str] # undocumented
53+
_OPT_NV_TMPL: ClassVar[str] # undocumented
5454

55-
SECTCRE: Pattern[str] = ...
56-
OPTCRE: ClassVar[Pattern[str]] = ...
57-
OPTCRE_NV: ClassVar[Pattern[str]] = ... # undocumented
58-
NONSPACECRE: ClassVar[Pattern[str]] = ... # undocumented
55+
SECTCRE: Pattern[str]
56+
OPTCRE: ClassVar[Pattern[str]]
57+
OPTCRE_NV: ClassVar[Pattern[str]] # undocumented
58+
NONSPACECRE: ClassVar[Pattern[str]] # undocumented
5959

60-
BOOLEAN_STATES: ClassVar[Mapping[str, bool]] = ... # undocumented
60+
BOOLEAN_STATES: ClassVar[Mapping[str, bool]] # undocumented
6161
default_section: str
6262
@overload
6363
def __init__(

stdlib/ctypes/__init__.pyi

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ _T = TypeVar("_T")
2424
_DLLT = TypeVar("_DLLT", bound=CDLL)
2525
_CT = TypeVar("_CT", bound=_CData)
2626

27-
RTLD_GLOBAL: int = ...
28-
RTLD_LOCAL: int = ...
29-
DEFAULT_MODE: int = ...
27+
RTLD_GLOBAL: int
28+
RTLD_LOCAL: int
29+
DEFAULT_MODE: int
3030

3131
class CDLL(object):
32-
_func_flags_: ClassVar[int] = ...
33-
_func_restype_: ClassVar[_CData] = ...
34-
_name: str = ...
35-
_handle: int = ...
36-
_FuncPtr: Type[_FuncPointer] = ...
32+
_func_flags_: ClassVar[int]
33+
_func_restype_: ClassVar[_CData]
34+
_name: str
35+
_handle: int
36+
_FuncPtr: Type[_FuncPointer]
3737
if sys.version_info >= (3, 8):
3838
def __init__(
3939
self,
@@ -65,12 +65,12 @@ class LibraryLoader(Generic[_DLLT]):
6565
if sys.version_info >= (3, 9):
6666
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
6767

68-
cdll: LibraryLoader[CDLL] = ...
68+
cdll: LibraryLoader[CDLL]
6969
if sys.platform == "win32":
70-
windll: LibraryLoader[WinDLL] = ...
71-
oledll: LibraryLoader[OleDLL] = ...
72-
pydll: LibraryLoader[PyDLL] = ...
73-
pythonapi: PyDLL = ...
70+
windll: LibraryLoader[WinDLL]
71+
oledll: LibraryLoader[OleDLL]
72+
pydll: LibraryLoader[PyDLL]
73+
pythonapi: PyDLL
7474

7575
# Anything that implements the read-write buffer interface.
7676
# The buffer interface is defined purely on the C level, so we cannot define a normal Protocol
@@ -87,9 +87,9 @@ class _CDataMeta(type):
8787
def __rmul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore
8888

8989
class _CData(metaclass=_CDataMeta):
90-
_b_base: int = ...
91-
_b_needsfree_: bool = ...
92-
_objects: Mapping[Any, int] | None = ...
90+
_b_base: int
91+
_b_needsfree_: bool
92+
_objects: Mapping[Any, int] | None
9393
@classmethod
9494
def from_buffer(cls: Type[_CT], source: _WritableBuffer, offset: int = ...) -> _CT: ...
9595
@classmethod
@@ -108,9 +108,9 @@ _ECT = Callable[[Optional[Type[_CData]], _FuncPointer, Tuple[_CData, ...]], _CDa
108108
_PF = _UnionT[Tuple[int], Tuple[int, str], Tuple[int, str, Any]]
109109

110110
class _FuncPointer(_PointerLike, _CData):
111-
restype: Type[_CData] | Callable[[int], Any] | None = ...
112-
argtypes: Sequence[Type[_CData]] = ...
113-
errcheck: _ECT = ...
111+
restype: Type[_CData] | Callable[[int], Any] | None
112+
argtypes: Sequence[Type[_CData]]
113+
errcheck: _ECT
114114
@overload
115115
def __init__(self, address: int) -> None: ...
116116
@overload
@@ -180,8 +180,8 @@ def POINTER(type: Type[_CT]) -> Type[pointer[_CT]]: ...
180180
# ctypes._Pointer in that it is the base class for all pointer types. Unlike the real _Pointer,
181181
# it can be instantiated directly (to mimic the behavior of the real pointer function).
182182
class pointer(Generic[_CT], _PointerLike, _CData):
183-
_type_: ClassVar[Type[_CT]] = ...
184-
contents: _CT = ...
183+
_type_: ClassVar[Type[_CT]]
184+
contents: _CT
185185
def __init__(self, arg: _CT = ...) -> None: ...
186186
@overload
187187
def __getitem__(self, i: int) -> _CT: ...
@@ -207,7 +207,7 @@ if sys.platform == "win32":
207207
def wstring_at(address: _CVoidConstPLike, size: int = ...) -> str: ...
208208

209209
class _SimpleCData(Generic[_T], _CData):
210-
value: _T = ...
210+
value: _T
211211
def __init__(self, value: _T = ...) -> None: ...
212212

213213
class c_byte(_SimpleCData[int]): ...
@@ -255,13 +255,13 @@ if sys.platform == "win32":
255255
class py_object(_CanCastTo, _SimpleCData[_T]): ...
256256

257257
class _CField:
258-
offset: int = ...
259-
size: int = ...
258+
offset: int
259+
size: int
260260

261261
class _StructUnionMeta(_CDataMeta):
262-
_fields_: Sequence[Tuple[str, Type[_CData]] | Tuple[str, Type[_CData], int]] = ...
263-
_pack_: int = ...
264-
_anonymous_: Sequence[str] = ...
262+
_fields_: Sequence[Tuple[str, Type[_CData]] | Tuple[str, Type[_CData], int]]
263+
_pack_: int
264+
_anonymous_: Sequence[str]
265265
def __getattr__(self, name: str) -> _CField: ...
266266

267267
class _StructUnionBase(_CData, metaclass=_StructUnionMeta):
@@ -275,10 +275,10 @@ class BigEndianStructure(Structure): ...
275275
class LittleEndianStructure(Structure): ...
276276

277277
class Array(Generic[_CT], _CData):
278-
_length_: ClassVar[int] = ...
279-
_type_: ClassVar[Type[_CT]] = ...
280-
raw: bytes = ... # Note: only available if _CT == c_char
281-
value: Any = ... # Note: bytes if _CT == c_char, str if _CT == c_wchar, unavailable otherwise
278+
_length_: ClassVar[int]
279+
_type_: ClassVar[Type[_CT]]
280+
raw: bytes # Note: only available if _CT == c_char
281+
value: Any # Note: bytes if _CT == c_char, str if _CT == c_wchar, unavailable otherwise
282282
# TODO These methods cannot be annotated correctly at the moment.
283283
# All of these "Any"s stand for the array's element type, but it's not possible to use _CT
284284
# here, because of a special feature of ctypes.

stdlib/dbm/ndbm.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ _ValueType = Union[str, bytes]
88

99
class error(OSError): ...
1010

11-
library: str = ...
11+
library: str
1212

1313
# Actual typename dbm, not exposed by the implementation
1414
class _dbm:

stdlib/decimal.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class Context(object):
186186
def clear_traps(self) -> None: ...
187187
def copy(self) -> Context: ...
188188
def __copy__(self) -> Context: ...
189-
__hash__: Any = ...
189+
__hash__: Any
190190
def Etiny(self) -> int: ...
191191
def Etop(self) -> int: ...
192192
def create_decimal(self, __num: _DecimalNew = ...) -> Decimal: ...

0 commit comments

Comments
 (0)