Magic words

Duncan Booth duncan at NOSPAMrcp.co.uk
Mon Apr 15 07:35:13 EDT 2002


Scott David Daniels <Scott.Daniels at Acm.Org> wrote in
news:1104_1018820620 at news.dsl-only.net: 

>> Seo Sanghyeon || Sat 13 Apr 2002 05:49:17a:
>> > Thank you very much for pointers, but I can think of something not
>> > listed there. For example, __all__ for "from module import *",
>> > pickle protocols, __new__ for subclassing from a type and so on. Is
>> > there a complete (or near-complete) list?
>> ...
> 
> You could also take this lack of a list as a charter for your
> collecting _all_ (not __all__) such names, and creating a document for
> others who, like you want to know the list of such names.  This could
> include package references if you so desire (others will complain if
> you leave something out, providing you with more fodder for your
> document). 
> 

To get you started, here is a list built by grepping over the Python 
sources. Some of the names are probably red herrings, and there are 
probably some used by libraries not in this list, but it should give you a 
start:

__GNUC__
_____________undefined______________
__abs__
__across__
__add__
__all__
__and__
__assert__
__base__
__bases__
__basicsize__
__builtin__
__builtins__
__call__
__check__
__class__
__cmp__
__coerce__
__complex__
__console__
__contains__
__copy__
__copyright__
__debug__
__declare__
__deepcopy__
__del__
__delattr__
__delete__
__delitem__
__delslice__
__dict__
__dictoffset__
__displayhook__
__div__
__divmod__
__doc__
__domain__
__eq__
__excepthook__
__file__
__flags__
__float__
__floordiv__
__future__
__ge__
__get__
__getattr__
__getattribute__
__getinitargs__
__getitem__
__getslice__
__getstate__
__gt__
__hash__
__hello__
__hex__
__iacross__
__iadd__
__iand__
__idiv__
__ifloordiv__
__ilshift__
__imod__
__import__
__imul__
__init__
__int__
__interfaces__
__invert__
__ior__
__ipow__
__irshift__
__isub__
__itemsize__
__iter__
__itruediv__
__ixor__
__le__
__len__
__lltrace__
__long__
__lshift__
__lt__
__main__
__members__
__metaclass__
__methods__
__mod__
__module__
__mro__
__mul__
__name__
__ne__
__neg__
__new__
__nonzero__
__objclass__
__oct__
__or__
__path__
__paul_prescod_hack_constant__
__phello__
__pos__
__pow__
__racross__
__radd__
__rand__
__rccheck__
__rdiv__
__rdivmod__
__reduce__
__repr__
__return__
__rfloordiv__
__rlshift__
__rmod__
__rmul__
__ror__
__rpow__
__rrshift__
__rshift__
__rsub__
__rtruediv__
__rxor__
__safe_for_unpickling__
__self__
__set__
__setattr__
__setitem__
__setslice__
__slots__
__stderr__
__stdin__
__stdout__
__str__
__sub__
__subclasses__
__test__
__thisclass__
__truediv__
__types__
__unicode__
__version__
__warningregistry__
__weakref__
__weakrefoffset__
__xor__


-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list