How to get the special method names by reflection?

Aahz aahz at pythoncraft.com
Mon May 12 20:45:25 EDT 2003


In article <FWUva.35380$n2.18475 at clmboh1-nws5.columbus.rr.com>,
Jim Jinkins  <jjinkins at comports.com> wrote:
>
>But the only way I have figured out to get the special method names is 
>to cut and paste from the online Python Reference, then extract the 
>names with the program.  __add__, __hash__, and __getitem__ are examples 
>of special names.
>
>Is a way to get the special method names by reflection?  Is there 
>another group of words that should be highlighted?

What I'd do for a first pass is to iterate over all the builtin types.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"In many ways, it's a dull language, borrowing solid old concepts from
many other languages & styles:  boring syntax, unsurprising semantics,
few automatic coercions, etc etc.  But that's one of the things I like
about it."  --Tim Peters on Python, 16 Sep 93




More information about the Python-list mailing list