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

Skip to content

Commit d23b504

Browse files
author
Guido van Rossum
committed
Remove all mention of 'module' from typeshed.
This depends on python/mypy#3107.
1 parent aaa83a7 commit d23b504

File tree

7 files changed

+11
-25
lines changed

7 files changed

+11
-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: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Automatically generated by pytype, manually fixed up. May still contain errors.
22

33
from typing import Any, Callable, Dict, Generator, Iterator, List, Tuple, Union, Iterable
4+
import types
45

56
__all__ = ... # type: List[str]
67
__author__ = ... # type: str
@@ -102,15 +103,15 @@ chain = ... # type: type
102103
double3prog = ... # type: type
103104
endprogs = ... # type: Dict[str, Any]
104105
pseudoprog = ... # type: type
105-
re = ... # type: module
106+
re = ... # type: types.ModuleType
106107
single3prog = ... # type: type
107108
single_quoted = ... # type: Dict[str, str]
108-
string = ... # type: module
109-
sys = ... # type: module
109+
string = ... # type: types.ModuleType
110+
sys = ... # type: types.ModuleType
110111
t = ... # type: str
111112
tabsize = ... # type: int
112113
tok_name = ... # type: Dict[int, str]
113-
token = ... # type: module
114+
token = ... # type: types.ModuleType
114115
tokenprog = ... # type: type
115116
triple_quoted = ... # type: Dict[str, str]
116117
x = ... # type: str

stdlib/2/types.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ class ModuleType:
103103
__name__ = ... # type: str
104104
__package__ = ... # type: Optional[str]
105105
__path__ = ... # type: Optional[Iterable[str]]
106+
__dict__ = ... # type: Dict[str, Any]
106107
def __init__(self, name: str, doc: Optional[str] = ...) -> None: ...
107108
FileType = file
108109
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)