type method-wrapper?

T

Thomas Guettler

Hi,
l=[]
print type(l.__delattr__)
# --> <type 'method-wrapper'>

I didn't find a corresponding type in the modules "types".
Is it missing or am I blind?

(Python 2.3.3)
 
A

Alan Kennedy

Thomas said:
Hi,
l=[]
print type(l.__delattr__)
# --> <type 'method-wrapper'>

I didn't find a corresponding type in the modules "types".
Is it missing or am I blind?

(Python 2.3.3)

I don't have the answer to the question, but perhaps this sheds a little
more light on it?

Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> l = []
>>> type(l.__delattr__)
>>> import types
>>> for t in dir(types):
.... if t[-4:] == 'Type' and isinstance(l.__delattr__, getattr(types, t)):
.... print "It's a '%s'" % str(t)
....
It's a 'ObjectType'
I also am interested in what <type method-wrapper> is.

regards,
 
T

Terry Reedy

Hi,
l=[]
print type(l.__delattr__)
# --> <type 'method-wrapper'>

I didn't find a corresponding type in the modules "types".
Is it missing or am I blind?

(Python 2.3.3)

method_wrapper is an implementation type, not a language type in the same
way that int, list, function, etc are. I suspect that there are others
'missing' from the types module that you have not discovered yet.

Terry J. Reedy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top