Operator Overloading
Nick Coghlan
ncoghlan at email.com
Fri Nov 26 10:47:21 EST 2004
Sebastien Boisgerault wrote:
>>>from Numeric import *
>>>a = array([3.14])
>>>Array = type(a)
>>>a.__getitem__(0)
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> AttributeError: __getitem__
>
>>>Array.__getitem__(a,0)
>
> 3.14
That's just. . . odd. It's possible that array has a custom __getattr__ or
__getattribute__ implementation that is not falling back to the class dictionary
correctly. The direct class access doesn't use the custom handlers, and gets the
correct answer. However, you'd need someone more familiar with Numeric than I am
to say exactly what is going on.
If Numeric has its own mailing list, I'd try asking there.
Cheers,
Nick.
More information about the Python-list
mailing list