On Fri, Jun 15, 2012 at 11:24 PM, Larry Hastings <la...@hastings.org> wrote: > There are four more candidates I found with the grep but couldn't figure out > how to instantiate and test. They have to do with the descriptor protocol, > aka properties, but the types aren't directly exposed by Python. They're > all defined in Object/descrobject.c. The internal class names are: > > method_descriptor > classmethod_descriptor > wrapper_descriptor > method-wrapper (you get one of these out of a "wrapper_descriptor")
'method_descriptor' is apparently used for the methods of built-in (implemented in C) objects: >>> set.__dict__['union'].__class__ <class 'method_descriptor'> 'classmethod_descriptor' is similarly for the classmethods of built-in classes: >>> import itertools >>> itertools.chain.__dict__['from_iterable'].__class__ <class 'classmethod_descriptor'> 'wrapper_descriptor' is used for example the operators of built-in types: >>> int.__dict__['__add__'].__class__ <class 'wrapper_descriptor'> And 'method-wrapper': >>> (5).__add__.__class__ <class 'method-wrapper'> Daniel _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com