mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Use floor division operator.
This commit is contained in:
parent
4837a223ee
commit
ffdb8bb99c
7 changed files with 8 additions and 8 deletions
|
@ -1361,7 +1361,7 @@ def Time2Internaldate(date_time):
|
||||||
zone = -time.altzone
|
zone = -time.altzone
|
||||||
else:
|
else:
|
||||||
zone = -time.timezone
|
zone = -time.timezone
|
||||||
return '"' + dt + " %+03d%02d" % divmod(zone/60, 60) + '"'
|
return '"' + dt + " %+03d%02d" % divmod(zone//60, 60) + '"'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -197,9 +197,9 @@ class Random(_random.Random):
|
||||||
if istep != step:
|
if istep != step:
|
||||||
raise ValueError, "non-integer step for randrange()"
|
raise ValueError, "non-integer step for randrange()"
|
||||||
if istep > 0:
|
if istep > 0:
|
||||||
n = (width + istep - 1) / istep
|
n = (width + istep - 1) // istep
|
||||||
elif istep < 0:
|
elif istep < 0:
|
||||||
n = (width + istep + 1) / istep
|
n = (width + istep + 1) // istep
|
||||||
else:
|
else:
|
||||||
raise ValueError, "zero step for randrange()"
|
raise ValueError, "zero step for randrange()"
|
||||||
|
|
||||||
|
|
|
@ -385,7 +385,7 @@ class E:
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return self
|
return self
|
||||||
def next(self):
|
def next(self):
|
||||||
3/0
|
3 // 0
|
||||||
|
|
||||||
class S:
|
class S:
|
||||||
'Test immediate stop'
|
'Test immediate stop'
|
||||||
|
|
|
@ -50,7 +50,7 @@ class E:
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return self
|
return self
|
||||||
def next(self):
|
def next(self):
|
||||||
3/0
|
3 // 0
|
||||||
|
|
||||||
class N:
|
class N:
|
||||||
'Iterator missing next()'
|
'Iterator missing next()'
|
||||||
|
|
|
@ -476,7 +476,7 @@ class E:
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return self
|
return self
|
||||||
def next(self):
|
def next(self):
|
||||||
3/0
|
3 // 0
|
||||||
|
|
||||||
class S:
|
class S:
|
||||||
'Test immediate stop'
|
'Test immediate stop'
|
||||||
|
|
|
@ -79,7 +79,7 @@ class TestBasicOps(unittest.TestCase):
|
||||||
def factorial(n):
|
def factorial(n):
|
||||||
return reduce(int.__mul__, xrange(1, n), 1)
|
return reduce(int.__mul__, xrange(1, n), 1)
|
||||||
for k in xrange(n):
|
for k in xrange(n):
|
||||||
expected = factorial(n) / factorial(n-k)
|
expected = factorial(n) // factorial(n-k)
|
||||||
perms = {}
|
perms = {}
|
||||||
for i in xrange(trials):
|
for i in xrange(trials):
|
||||||
perms[tuple(self.gen.sample(pop, k))] = None
|
perms[tuple(self.gen.sample(pop, k))] = None
|
||||||
|
|
|
@ -1241,7 +1241,7 @@ class E:
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return self
|
return self
|
||||||
def next(self):
|
def next(self):
|
||||||
3/0
|
3 // 0
|
||||||
|
|
||||||
class S:
|
class S:
|
||||||
'Test immediate stop'
|
'Test immediate stop'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue