Omar Sandoval
0a30d22f0d
Fix Python 3 round() signature ( #2107 )
...
In Python 3, the ndigits argument of round() defaults to None. If
ndigits is excluded or explicitly None, the result is always an int. If
ndigits is not None, the result should be the same type as the number.
$ cat test.py
from fractions import Fraction
print(type(round(0.1)))
print(type(round(0.1, None)))
print(type(round(0.1, 0)))
print(type(round(Fraction(1, 10))))
print(type(round(Fraction(1, 10), None)))
print(type(round(Fraction(1, 10), 0)))
$ python3 ./test.py
<class 'int'>
<class 'int'>
<class 'float'>
<class 'int'>
<class 'int'>
<class 'fractions.Fraction'>
Update the signatures to allow for an ndigits of None.
2018-05-11 14:02:09 -04:00
..
2018-04-27 14:38:00 -07:00
2018-03-22 07:59:13 -07:00
2018-01-26 14:39:55 -08:00
2018-05-09 16:28:14 -07:00
2017-07-19 20:28:43 +03:00
2017-05-22 15:14:15 -07:00
2018-04-12 12:29:22 -07:00
2018-03-28 18:44:40 -07:00
2017-11-09 10:32:17 -08:00
2018-04-18 19:20:01 -07:00
2018-04-06 11:22:15 -07:00
2018-04-25 19:44:42 -07:00
2018-04-12 12:29:22 -07:00
2018-03-06 21:36:33 -08:00
2018-04-06 11:09:45 -07:00
2017-05-22 15:14:15 -07:00
2018-01-23 14:31:59 -08:00
2018-03-05 12:42:29 -08:00
2017-04-24 15:31:29 -07:00
2017-11-13 06:56:24 -08:00
2016-12-19 23:53:19 -08:00
2017-03-18 14:57:57 -07:00
2017-04-24 15:04:42 -07:00
2017-03-14 11:43:42 -07:00
2015-09-30 09:59:44 -07:00
2016-12-13 14:56:06 -08:00
2017-07-10 21:20:02 -07:00
2017-04-14 09:21:34 -07:00
2018-03-15 15:59:14 -07:00
2018-05-07 11:21:19 -07:00
2016-09-23 13:35:55 -07:00
2018-05-11 14:02:09 -04:00
2017-05-17 16:05:50 -07:00
2018-02-18 09:03:09 -08:00
2017-01-26 12:05:53 -08:00
2017-08-28 21:29:57 -07:00
2015-09-30 09:59:44 -07:00
2018-03-05 18:52:46 -08:00
2016-12-21 01:15:26 -08:00
2016-05-25 07:14:42 -07:00
2017-11-09 06:28:40 -08:00
2016-12-20 01:02:59 -08:00
2017-06-02 12:53:38 -07:00
2017-11-09 05:56:55 -08:00
2017-11-08 19:39:55 -08:00
2017-09-12 08:27:41 -07:00
2017-04-24 15:31:29 -07:00
2018-03-28 20:24:39 -07:00
2018-04-12 12:29:22 -07:00
2018-04-10 20:55:06 -07:00
2017-04-21 16:25:10 -07:00
2015-09-30 09:59:44 -07:00
2017-04-27 08:48:22 -07:00
2017-04-21 16:25:10 -07:00
2017-04-30 14:16:30 -07:00
2017-10-09 21:02:10 -07:00
2016-12-20 00:47:51 -08:00
2018-01-09 13:50:56 -08:00
2018-04-06 11:11:29 -07:00
2017-08-10 20:15:43 -07:00
2017-05-24 14:09:52 -07:00
2018-02-19 09:23:57 -08:00
2017-04-24 14:57:26 -07:00
2017-08-21 10:08:51 -07:00
2017-05-22 15:14:15 -07:00
2017-11-13 06:56:24 -08:00
2017-09-11 12:30:48 -07:00
2017-05-26 09:30:20 -07:00
2016-12-19 22:09:35 -08:00
2018-03-15 16:01:23 -07:00
2018-04-12 12:29:22 -07:00
2017-05-31 12:07:21 -07:00
2017-11-03 22:48:10 -07:00
2017-08-01 14:38:49 -07:00
2018-04-09 12:58:15 -07:00
2018-01-23 14:27:01 -08:00
2017-04-27 08:47:59 -07:00
2018-04-12 12:29:42 -07:00
2017-03-23 08:26:45 -07:00
2018-05-06 08:40:56 -07:00
2018-03-28 16:41:24 -07:00
2017-10-08 21:12:19 -07:00
2018-02-26 11:01:48 -08:00
2018-04-29 23:02:13 -07:00
2018-05-09 16:24:23 -07:00