8000 Fix pow() with negative newint (issue #568) · PythonCharmers/python-future@a7dd2cb · GitHub
[go: up one dir, main page]

Skip to content

Commit a7dd2cb

Browse files
committed
Fix pow() with negative newint (issue #568)
1 parent 87f7ed4 commit a7dd2cb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/future/types/newint.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,11 @@ def __pow__(self, other):
223223

224224
def __rpow__(self, other):
225225
value = super(newint, self).__rpow__(other)
226-
if value is NotImplemented:
226+
if isint(value):
227+
return newint(value)
228+
elif value is NotImplemented:
227229
return other ** long(self)
228-
return newint(value)
230+
return value
229231

230232
def __lshift__(self, other):
231233
if not isint(other):

0 commit comments

Comments
 (0)
0