"Paul Dubois" <paul@pfdubois.com> writes: > My "masked array" class MA has a problem that I don't know how to solve. The > inplace multiply function > > def __imul__ (self, other) > > is not getting called while my other input operations do work. The scenario > is > > x = MA.array(...) > > x *= c > > If c is an int, this works correctly, calling MA.__imul__. Otherwise, I get > a message from the Python runtime saying it can't multiply a sequence by a > non-int. But change MA to Numeric, it works. > > Numeric is an extension type and MA is a (new style) class. MA defines > __len__ as well as all the math operators. What version of Python? This smells like a bug that has been (thought) fixed. Cheers, M. -- The ability to quote is a serviceable substitute for wit. -- W. Somerset Maugham
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4