File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 5959 from future .builtins .newnext import newnext as next
6060 from future .builtins .newround import newround as round
6161 from future .builtins .newsuper import newsuper as super
62+ from future .types .newint import newint
6263
6364 _SENTINEL = object ()
6465
6566 def pow (x , y , z = _SENTINEL ):
6667 """
6768 pow(x, y[, z]) -> number
68-
69+
6970 With two arguments, equivalent to x**y. With three arguments,
7071 equivalent to (x**y) % z, but may be more efficient (e.g. for ints).
7172 """
73+ # Handle newints
74+ if isinstance (x , newint ):
75+ x = long (x )
76+ if isinstance (y , newint ):
77+ y = long (y )
78+ if isinstance (z , newint ):
79+ z = long (z )
80+
7281 try :
7382 if z == _SENTINEL :
7483 return _builtin_pow (x , y )
Original file line number Diff line number Diff line change @@ -639,7 +639,7 @@ def __dir__(self):
639639 # raise IndexError
640640 # except:
641641 # self.assertEqual(len(dir(sys.exc_info()[2])), 4)
642- #
642+ #
643643 # # test that object has a __dir__()
644644 # self.assertEqual(sorted([].__dir__()), dir([]))
645645
@@ -1271,9 +1271,9 @@ def test_pow(self):
12711271 self .assertAlmostEqual (pow (- 2. ,2 ), 4. )
12721272 self .assertAlmostEqual (pow (- 2. ,3 ), - 8. )
12731273
1274- for x in 2 , 2.0 :
1275- for y in 10 , 10.0 :
1276- for z in 1000 , 1000.0 :
1274+ for x in 2 , int ( 2 ), 2.0 :
1275+ for y in 10 , int ( 10 ), 10.0 :
1276+ for z in 1000 , int ( 1000 ), 1000.0 :
12771277 if isinstance (x , float ) or \
12781278 isinstance (y , float ) or \
12791279 isinstance (z , float ):
You can’t perform that action at this time.
0 commit comments