On Fri, Jun 15, 2012 at 11:24 PM, Larry Hastings <larry at 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4