Skip to content

Commit 359c8cc

Browse files
gvanrossumJelleZijlstra
authored andcommitted
Remove all mention of 'module' from typeshed. (#1156)
This depends on python/mypy#3107.
1 parent f543ddd commit 359c8cc

File tree

7 files changed

+6
-25
lines changed

7 files changed

+6
-25
lines changed

stdlib/2/__builtin__.pyi

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -675,11 +675,6 @@ class xrange(Sized, Iterable[int], Reversible[int]):
675675
def __getitem__(self, i: int) -> int: ...
676676
def __reversed__(self) -> Iterator[int]: ...
677677

678-
class module:
679-
__name__ = ... # type: str
680-
__file__ = ... # type: str
681-
__dict__ = ... # type: Dict[unicode, Any]
682-
683678
class property(object):
684679
def __init__(self, fget: Callable[[Any], Any] = None,
685680
fset: Callable[[Any, Any], None] = None,

stdlib/2/abc.pyi

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
from typing import Any, Dict, Set, Tuple, Type
22
import _weakrefset
33

4-
# mypy has special processing for ABCMeta and abstractmethod.
5-
6-
WeakSet = ... # type: _weakrefset.WeakSet
7-
_InstanceType = ... # type: type
8-
types = ... # type: module
4+
# NOTE: mypy has special processing for ABCMeta and abstractmethod.
95

106
def abstractmethod(funcobj: Any) -> Any: ...
117

@@ -23,9 +19,6 @@ class ABCMeta(type):
2319
def _dump_registry(cls: "ABCMeta", *args: Any, **kwargs: Any) -> None: ...
2420
def register(cls: "ABCMeta", subclass: Type[Any]) -> None: ...
2521

26-
class _C:
27-
pass
28-
2922
# TODO: The real abc.abstractproperty inherits from "property".
3023
class abstractproperty(object):
3124
def __new__(cls, func: Any) -> Any: ...

stdlib/2/tokenize.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,11 @@ chain = ... # type: type
102102
double3prog = ... # type: type
103103
endprogs = ... # type: Dict[str, Any]
104104
pseudoprog = ... # type: type
105-
re = ... # type: module
106105
single3prog = ... # type: type
107106
single_quoted = ... # type: Dict[str, str]
108-
string = ... # type: module
109-
sys = ... # type: module
110107
t = ... # type: str
111108
tabsize = ... # type: int
112109
tok_name = ... # type: Dict[int, str]
113-
token = ... # type: module
114110
tokenprog = ... # type: type
115111
triple_quoted = ... # type: Dict[str, str]
116112
x = ... # type: str

stdlib/2/types.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ class ModuleType:
104104
__name__ = ... # type: str
105105
__package__ = ... # type: Optional[str]
106106
__path__ = ... # type: Optional[Iterable[str]]
107+
__dict__ = ... # type: Dict[str, Any]
107108
def __init__(self, name: str, doc: Optional[str] = ...) -> None: ...
108109
FileType = file
109110
XRangeType = xrange

stdlib/2/unittest.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ from typing import (
99
overload, Set, FrozenSet, TypeVar, Union, Pattern, Type
1010
)
1111
from abc import abstractmethod, ABCMeta
12+
import types
1213

1314
_T = TypeVar('_T')
1415
_FT = TypeVar('_FT')
@@ -173,4 +174,4 @@ def main(module: str = ..., defaultTest: str = ...,
173174
testLoader: Any = ...) -> None: ... # TODO types
174175

175176
# private but occasionally used
176-
util = ... # type: module
177+
util = ... # type: types.ModuleType

stdlib/3/_importlib_modulespec.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from abc import ABCMeta
99
import sys
10-
from typing import Any, Optional
10+
from typing import Dict, Any, Optional
1111

1212
if sys.version_info >= (3, 4):
1313
class ModuleSpec:
@@ -26,6 +26,7 @@ if sys.version_info >= (3, 4):
2626
class ModuleType:
2727
__name__ = ... # type: str
2828
__file__ = ... # type: str
29+
__dict__ = ... # type: Dict[str, Any]
2930
if sys.version_info >= (3, 4):
3031
__loader__ = ... # type: Optional[Loader]
3132
__package__ = ... # type: Optional[str]

stdlib/3/builtins.pyi

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -731,12 +731,6 @@ class range(Sequence[int]):
731731
def __repr__(self) -> str: ...
732732
def __reversed__(self) -> Iterator[int]: ...
733733

734-
class module:
735-
# TODO not defined in builtins!
736-
__name__ = ... # type: str
737-
__file__ = ... # type: str
738-
__dict__ = ... # type: Dict[str, Any]
739-
740734
class property:
741735
def __init__(self, fget: Callable[[Any], Any] = None,
742736
fset: Callable[[Any, Any], None] = None,

0 commit comments

Comments
 (0)