Mercurial > p > roundup > code
comparison roundup/support.py @ 5400:2120f77554d5
Python 3 preparation: use // and __truediv__ as needed.
Tool-assisted patch. Those divisions that I thought must be integer
floor divisions and rely on Python 2 integer floor division semantics
are changed to use // (if any are actually meant to be floating-point
divisions, that would break things). One __div__ method is changed to
__truediv__ (with __div__ = __truediv__ for Python 2 compatibility).
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Tue, 24 Jul 2018 23:16:09 +0000 |
| parents | 831787cf6694 |
| children | afd9fd3a0edb |
comparison
equal
deleted
inserted
replaced
| 5399:dccae35caa59 | 5400:2120f77554d5 |
|---|---|
| 68 self.info = info | 68 self.info = info |
| 69 self.sequence = iter(sequence) | 69 self.sequence = iter(sequence) |
| 70 self.total = len(sequence) | 70 self.total = len(sequence) |
| 71 self.start = self.now = time.time() | 71 self.start = self.now = time.time() |
| 72 self.num = 0 | 72 self.num = 0 |
| 73 self.stepsize = self.total / 100 or 1 | 73 self.stepsize = self.total // 100 or 1 |
| 74 self.steptimes = [] | 74 self.steptimes = [] |
| 75 self.display() | 75 self.display() |
| 76 | 76 |
| 77 def __iter__(self): return self | 77 def __iter__(self): return self |
| 78 | 78 |
