type method-wrapper?

Gerrit gerrit at nl.linux.org
Mon Dec 20 17:44:16 CET 2004


Alan Kennedy wrote:
> 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__)
> <type 'method-wrapper'>
> >>> 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'
> >>>

Everything is:
>>> for d in dir(types):
...  print getattr(types, d), isinstance(getattr(types, d),
types.ObjectType)
...
<type 'bool'> True
<type 'buffer'> True
<type 'builtin_function_or_method'> True
<type 'builtin_function_or_method'> True
<type 'classobj'> True
<type 'code'> True
<type 'complex'> True
<type 'dictproxy'> True
...

you get the general idea.

yours,
Gerrit.

-- 
Weather in Lulea / Kallax, Sweden 20/12 16:50:
	-3.0°C Scattered clouds partly cloudy wind 8.0 m/s NW (34 m above NAP)
-- 
In the councils of government, we must guard against the acquisition of
unwarranted influence, whether sought or unsought, by the
military-industrial complex. The potential for the disastrous rise of
misplaced power exists and will persist.
    -Dwight David Eisenhower, January 17, 1961



More information about the Python-list mailing list