[Python-Dev] Not documented special methods

Serhiy Storchaka storchaka at gmail.com
Wed Mar 11 12:25:39 CET 2015

There are many special names used in Python core and the stdlib, but 
absent in the documentation index [1]. If you see names that are defined 
or used in the module or area maintained by you, please add references 
to these names to the index and document them if it is needed.

Repeat the lists here.

Module level names used in pydoc:

Module level name used in doctest:

Other module level names:
     __about__               (heapq only)
     __copyright__           (many modules)
     __cvsid__               (tarfile only)
     __docformat__           (doctest only)
     __email__               (test_with and test_keywordonlyarg only)
     __libmpdec_version__    (decimal only)
     __status__              (logging only)

type attributes (mostly used in tests):
     __abstractmethods__     (used in abc, functools)
     __flags__               (used in inspect, copyreg)

super() attributes:

Used in sqlite:

Used in ctypes:

Used in unittest:

float methods, for testing:

Used in IDLE RPC:

     __alloc__               (bytearray method)
     __args__                (used in bdb)
     __build_class__         (builtins function, used in eval loop)
     __builtins__            (module attribute)
     __decimal_context__     (used in decimal)
     __exception__           (used in pdb)
     __getinitargs__         (used in pickle, datetime)
     __initializing__        (used in importlib)
     __isabstractmethod__    (function/method/descriptor attribute,
                              used in abc, functools, types)
     __ltrace__              (used in eval loop, never set)
     __members__             (Enum attribute, used in many modules)
     __mp_main__             (used in multiprocessing)
     __new_member__          (Enum attribute, used in enum internally)
     __newobj__              (copyreg function,
                              used in pickle, object.__reduce_ex__)
     __newobj_ex__           (copyreg function,
                              used in pickle, object.__reduce_ex__)
     __objclass__            (descriptor/enum attribute, used in
                              inspect, pydoc, doctest, multiprocessing)
     __prepare__             (metaclass method,
                              used in builtins.__build_class__, types)
     __pycache__             (cache directory name)
     __return__              (used in pdb)
     __signature__           (used in inspect, never set)
     __sizeof__              (standard method, used in sys.getsizeof)
     __slotnames__           (used in object.__getstate__ for caching)
     __text_signature__      (function/method/descriptor attribute,
                              used in inspect)
     __trunc__               (used in math.trunc, int, etc)
     __warningregistry__     (used in warnings)
     __weakref__             (used in weakref)
     __wrapped__             (used in inspect, functools, contextlib,

[1] http://bugs.python.org/issue23639

More information about the Python-Dev mailing list