Armin Rigo wrote:
> Hi,
> 
> Ok, here is the reason for the leak...
> 
> There is in scipy a type called 'int32_arrtype' which inherits from both
> another scipy type called 'signedinteger_arrtype', and from 'int'.
> Obscure!  This is not 100% officially allowed: you are inheriting from
> two C types.  You're living dangerously!
> 
> Now in this case it mostly works as expected, because the parent scipy
> type has no field at all, so it's mostly like inheriting from both
> 'object' and 'int' -- which is allowed, or would be if the bases were
> written in the opposite order.  But still, something confuses the
> fragile logic of typeobject.c.  (I'll leave this bit to scipy people to
> debug :-)

Well, I'm stumped on this.  Note the method resolution order for the new 
scalar array type (exactly as I would expect).   Why doesn't the int32 
type inherit its tp_free from the early types first?

a = zeros(10)
type(a[0]).mro()

[<type 'int32_arrtype'>, <type 'signedinteger_arrtype'>, <type 
'integer_arrtype'>,
<type 'numeric_arrtype'>, <type 'generic_arrtype'>, <type 'int'>, <type 
'object'>]




_______________________________________________
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

Reply via email to