##// END OF EJS Templates
Use module and method descriptor types declared in the `types` module (#14055)...
Matthias Bussonnier -
r28311:3a567f0e merge
parent child Browse files
Show More
@@ -18,6 +18,7 b' import operator'
18 import sys
18 import sys
19 from functools import cached_property
19 from functools import cached_property
20 from dataclasses import dataclass, field
20 from dataclasses import dataclass, field
21 from types import MethodDescriptorType, ModuleType
21
22
22 from IPython.utils.docs import GENERATING_DOCUMENTATION
23 from IPython.utils.docs import GENERATING_DOCUMENTATION
23 from IPython.utils.decorators import undoc
24 from IPython.utils.decorators import undoc
@@ -630,8 +631,6 b' set_non_mutating_methods = set(dir(set)) & set(dir(frozenset))'
630
631
631
632
632 dict_keys: Type[collections.abc.KeysView] = type({}.keys())
633 dict_keys: Type[collections.abc.KeysView] = type({}.keys())
633 method_descriptor: Any = type(list.copy)
634 module = type(builtins)
635
634
636 NUMERICS = {int, float, complex}
635 NUMERICS = {int, float, complex}
637
636
@@ -680,8 +679,8 b' BUILTIN_GETATTR: Set[MayHaveGetattr] = {'
680 type, # `type` handles a lot of generic cases, e.g. numbers as in `int.real`.
679 type, # `type` handles a lot of generic cases, e.g. numbers as in `int.real`.
681 *NUMERICS,
680 *NUMERICS,
682 dict_keys,
681 dict_keys,
683 method_descriptor,
682 MethodDescriptorType,
684 module,
683 ModuleType,
685 }
684 }
686
685
687
686
General Comments 0
You need to be logged in to leave comments. Login now