Checking for usual descriptors in Python 2.3

François Pinard pinard at iro.umontreal.ca
Wed Feb 11 19:30:37 EST 2004


This question is a bit technical, but hopefully, this list will offer me
good hints or nice solutions.  Happily enough for me, it often does! :-)

I would need to recognise and play with descriptor types, like:

    member descriptors
    method descriptors
    getset descriptors
    wrapper descriptors

but do not find how to easily refer to them, either from existing
constructor types (like we could do with `property', say), nor from
members of the `types' module.  I also wonder how much I can "get into"
these various descriptors or tear them apart...


P.S. - If you are curious, my real goal is creating some metaclass able
to build kind-of-shadow classes for various pygtk widgets, lazily, on
the fly.  If experimentation shows that this is not speedy enough, than
I may rather have a pre-processor that would produce Python source
instead.  In any case, I need to learn how to explore descriptors at run
time, rather than working hard at scanning/parsing real pygtk sources.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list