Skip to content

Commit 002adf8

Browse files
committed
-
1 parent 41230b4 commit 002adf8

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

source_py2/python_toolbox/cute_iter_tools.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -403,15 +403,13 @@ def are_equal(*sequences):
403403
from python_toolbox import logic_tools
404404
sequence_types = set(map(type, sequences))
405405

406-
if not sys_tools.is_pypy: # Hack around Pypy bug 1799
407-
# Trying cheap comparison:
408-
if len(sequence_types) == 1 and issubclass(
409-
get_single_if_any(sequence_types), collections.Sequence) and \
410-
not get_single_if_any(sequence_types) == xrange:
411-
# (Excluding `xrange` from this fast check because it has no
412-
# `__eq__`.)
413-
414-
return logic_tools.all_equal(sequences)
406+
# Trying cheap comparison:
407+
if len(sequence_types) == 1 and issubclass(
408+
get_single_if_any(sequence_types), collections.Sequence) and \
409+
not get_single_if_any(sequence_types) == xrange:
410+
# (Excluding `xrange` from this fast check because it has no
411+
# `__eq__`.)
412+
return logic_tools.all_equal(sequences)
415413

416414
# If cheap comparison didn't work, trying item-by-item comparison:
417415
zipped = itertools.izip_longest(*sequences,

source_py3/python_toolbox/cute_iter_tools.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -400,15 +400,11 @@ def are_equal(*sequences):
400400
from python_toolbox import logic_tools
401401
sequence_types = set(map(type, sequences))
402402

403-
if not sys_tools.is_pypy: # Hack around Pypy bug 1799
404-
# Trying cheap comparison:
405-
if len(sequence_types) == 1 and issubclass(
406-
get_single_if_any(sequence_types), collections.Sequence):
407-
408-
return logic_tools.all_equal(sequences)
409-
# blocktodo: test on pypy and hopefully remove these two lines if not needed
410-
# if sequence_types == {CuteCount}: # Hack around Pypy bug 1799, remove
411-
# return logic_tools.all_equal(sequences.start for sequence in sequences)
403+
# Trying cheap comparison:
404+
if len(sequence_types) == 1 and issubclass(
405+
get_single_if_any(sequence_types), collections.Sequence):
406+
407+
return logic_tools.all_equal(sequences)
412408

413409
# If cheap comparison didn't work, trying item-by-item comparison:
414410
zipped = itertools.zip_longest(*sequences,

source_py3/python_toolbox/math_tools/types.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@
99

1010

1111
class _PossiblyInfiniteIntegralType(abc.ABCMeta):
12-
# blocktodo: use everywhere in python_toolbox
1312
def __instancecheck__(self, thing):
1413
return isinstance(thing, numbers.Integral) or (thing in infinities)
1514
class PossiblyInfiniteIntegral(numbers.Number,
1615
metaclass=_PossiblyInfiniteIntegralType):
1716
pass
1817

1918
class _PossiblyInfiniteRealType(abc.ABCMeta):
20-
# blocktodo: use everywhere in python_toolbox
2119
def __instancecheck__(self, thing):
2220
return isinstance(thing, numbers.Real) or (thing in infinities)
2321
class PossiblyInfiniteReal(numbers.Number,

0 commit comments

Comments
 (0)