On Apr 4, 4:55 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Ziga Seilnacht" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | This looks like a bug in Python. It works for all the other > | operators: [SNIP] > | >>> i ** 3 > | 74088 > | > | You should submit a bug report to the bug tracker: > | > |http://sourceforge.net/bugs/?group_id=5470 > > Nice test. I thought maybe __pow__ might be different in not having a > reverse form, but indeed, int has an __rpow__ method. > > Before submitting, make sure that this does not work in 2.5, and then say > so in the bug report. In fact, copy the version/system info that the > interactive interpreter puts up when it starts.
FWIW: Python 2.5 (r25:51908, Jan 21 2007, 03:10:25) [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on HOSTNAME_REDACTED Type "help", "copyright", "credits" or "license" for more information. >>> class MyInt(int): ... __pow__ = int.__add__ ... >>> i=MyInt(42) >>> i**3 74088 -- http://mail.python.org/mailman/listinfo/python-list