diff options
Diffstat (limited to 'Lib/statistics.py')
-rw-r--r-- | Lib/statistics.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/statistics.py b/Lib/statistics.py index 25a26d4..3972ed2 100644 --- a/Lib/statistics.py +++ b/Lib/statistics.py @@ -150,7 +150,7 @@ def _sum(data, start=0): # We fail as soon as we reach a value that is not an int or the type of # the first value which is not an int. E.g. _sum([int, int, float, int]) # is okay, but sum([int, int, float, Fraction]) is not. - allowed_types = set([int, type(start)]) + allowed_types = {int, type(start)} n, d = _exact_ratio(start) partials = {d: n} # map {denominator: sum of numerators} # Micro-optimizations. @@ -168,7 +168,7 @@ def _sum(data, start=0): assert allowed_types.pop() is int T = int else: - T = (allowed_types - set([int])).pop() + T = (allowed_types - {int}).pop() if None in partials: assert issubclass(T, (float, Decimal)) assert not math.isfinite(partials[None]) |