[Python-checkins] r53690 - in python/branches/release25-maint: Misc/NEWS Objects/typeobject.c

martin.v.loewis python-checkins at python.org
Fri Feb 9 13:19:47 CET 2007


Author: martin.v.loewis
Date: Fri Feb  9 13:19:46 2007
New Revision: 53690

Modified:
   python/branches/release25-maint/Misc/NEWS
   python/branches/release25-maint/Objects/typeobject.c
Log:
Bug #1653736: Properly discard third argument to slot_nb_inplace_power.


Modified: python/branches/release25-maint/Misc/NEWS
==============================================================================
--- python/branches/release25-maint/Misc/NEWS	(original)
+++ python/branches/release25-maint/Misc/NEWS	Fri Feb  9 13:19:46 2007
@@ -12,6 +12,8 @@
 Core and builtins
 -----------------
 
+- Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
+
 - SF #151204:  enumerate() now raises an Overflow error at sys.maxint items.
 
 - Bug #1377858: Fix the segfaulting of the interpreter when an object created

Modified: python/branches/release25-maint/Objects/typeobject.c
==============================================================================
--- python/branches/release25-maint/Objects/typeobject.c	(original)
+++ python/branches/release25-maint/Objects/typeobject.c	Fri Feb  9 13:19:46 2007
@@ -4427,7 +4427,13 @@
 SLOT1(slot_nb_inplace_multiply, "__imul__", PyObject *, "O")
 SLOT1(slot_nb_inplace_divide, "__idiv__", PyObject *, "O")
 SLOT1(slot_nb_inplace_remainder, "__imod__", PyObject *, "O")
-SLOT1(slot_nb_inplace_power, "__ipow__", PyObject *, "O")
+/* Can't use SLOT1 here, because nb_inplace_power is ternary */
+static PyObject * 
+slot_nb_inplace_power(PyObject *self, PyObject * arg1, PyObject *arg2) 
+{ 
+  static PyObject *cache_str; 
+  return call_method(self, "__ipow__", &cache_str, "(" "O" ")", arg1); 
+}
 SLOT1(slot_nb_inplace_lshift, "__ilshift__", PyObject *, "O")
 SLOT1(slot_nb_inplace_rshift, "__irshift__", PyObject *, "O")
 SLOT1(slot_nb_inplace_and, "__iand__", PyObject *, "O")


More information about the Python-checkins mailing list