##// END OF EJS Templates
Use module and method descriptor types declared in the types module
Carlos Cordoba -
Show More
@@ -18,6 +18,7 b' import operator'
18 18 import sys
19 19 from functools import cached_property
20 20 from dataclasses import dataclass, field
21 from types import MethodDescriptorType, ModuleType
21 22
22 23 from IPython.utils.docs import GENERATING_DOCUMENTATION
23 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 633 dict_keys: Type[collections.abc.KeysView] = type({}.keys())
633 method_descriptor: Any = type(list.copy)
634 module = type(builtins)
635 634
636 635 NUMERICS = {int, float, complex}
637 636
@@ -680,8 +679,8 b' BUILTIN_GETATTR: Set[MayHaveGetattr] = {'
680 679 type, # `type` handles a lot of generic cases, e.g. numbers as in `int.real`.
681 680 *NUMERICS,
682 681 dict_keys,
683 method_descriptor,
684 module,
682 MethodDescriptorType,
683 ModuleType,
685 684 }
686 685
687 686
General Comments 0
You need to be logged in to leave comments. Login now