Magic words
Philip Swartzleonard
starx at pacbell.net
Sat Apr 13 22:24:24 EDT 2002
Seo Sanghyeon || Sat 13 Apr 2002 05:49:17a:
> Philip Swartzleonard <starx at pacbell.net> wrote
>
>> The first section of the index[1] for the language reference manual
>> lists all of these things (the underscore section), with links.
>
> 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?
>
Well, pickle protocols are defined by the pickle module, right? Thus are
not part of the language, but just __foo__ names that the module calls on
your object. For this kind of special name, I'd think you would _have_ to
look in the documentation for the module that provides the functionality,
and it would not be included on a language __x__ scorecard anyway.
For the __new__, I think the problem there is that the newer type/class
unification structures and keywords haven't all trickled down into the
reference documentation: if you want to learn about list comprehensions
and object-based types, you currently have to go to the 'what's new in py
2.2' documentation. These should be added to that index list in due time.
(Never heard of __all__ though, so... :\ )
--
Philip Sw "Starweaver" [rasx] :: www.rubydragon.com
More information about the Python-list
mailing list