Replaced `type(...)` and `type(ellipsis)` with `types.EllipsisType` · python/cpython@0a97a88 · GitHub
Skip to content

Commit 0a97a88

Browse files
author
Bas van Beek
committed
Replaced type(...) and type(ellipsis) with types.EllipsisType
1 parent 00639fc commit 0a97a88

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

Lib/ast.py

Lines changed: 3 additions & 2 deletions

Lib/copy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ def _copy_immutable(x):
108108
return x
109109
for t in (type(None), int, float, bool, complex, str, tuple,
110110
bytes, frozenset, type, range, slice, property,
111-
types.BuiltinFunctionType, type(Ellipsis), type(NotImplemented),
112-
types.FunctionType, weakref.ref):
111+
types.BuiltinFunctionType, types.EllipsisType,
112+
type(NotImplemented), types.FunctionType, weakref.ref):
113113
d[t] = _copy_immutable
114114
t = getattr(types, "CodeType", None)
115115
if t is not None:
@@ -182,7 +182,7 @@ def deepcopy(x, memo=None, _nil=[]):
182182
def _deepcopy_atomic(x, memo):
183183
return x
184184
d[type(None)] = _deepcopy_atomic
185-
d[type(Ellipsis)] = _deepcopy_atomic
185+
d[types.EllipsisType] = _deepcopy_atomic
186186
d[type(NotImplemented)] = _deepcopy_atomic
187187
d[int] = _deepcopy_atomic
188188
d[float] = _deepcopy_atomic

Lib/lib2to3/fixes/fix_types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
'ComplexType' : 'complex',
3131
'DictType': 'dict',
3232
'DictionaryType' : 'dict',
33-
'EllipsisType' : 'type(Ellipsis)',
3433
#'FileType' : 'io.IOBase',
3534
'FloatType': 'float',
3635
'IntType': 'int',

Lib/pickle.py

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)