[IronPython] __objclass__

Michael Foord fuzzyman at voidspace.org.uk
Thu Jun 11 21:34:39 CEST 2009


Seo Sanghyeon wrote:
> 2009/6/10 Michael Foord <fuzzyman at voidspace.org.uk>:
>   
>> All .NET classes used from IronPython have an __objclass__ attribute on
>> their methods / members. This is *really* useful for introspection - can I
>> rely on it staying or is it an implementation detail that may change?
>>     
>
> Since this is also a CPython behavior (although undocumented, or poorly
> documented one), it's unlikely to change. __objclass__ of a descriptor
> points to its class.
>
> C:\>python
> Python 2.6.1
>   
>>>> object.__repr__.__objclass__
>>>>         
> <type 'object'>
>
>   
 
Ah - didn't know that, and if google knew she hid it from me.

Thanks

Michael

-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog





More information about the Ironpython-users mailing list