Skip to content

Commit dbb4303

Browse files
committed
-
1 parent 45188a7 commit dbb4303

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

source_py2/python_toolbox/combi/perm_space.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __call__(cls, *args, **kwargs):
5252
_degrees_for_checking=arguments_profile['degrees'],
5353
)
5454
else:
55-
return super(PermSpaceType, self).__call__(*args, **kwargs)
55+
return super(PermSpaceType, cls).__call__(*args, **kwargs)
5656

5757

5858
@functools.total_ordering
@@ -283,7 +283,7 @@ def __init__(self, iterable_or_length, domain=None, n_elements=None,
283283
if degrees is None:
284284
degrees = ()
285285
if not isinstance(degrees, collections.Iterable):
286-
assert isinstance(degrees, int)
286+
assert isinstance(degrees, numbers.Integral)
287287
degrees = (degrees,)
288288
degrees = \
289289
sequence_tools.ensure_iterable_is_immutable_sequence(degrees)
@@ -408,7 +408,7 @@ def __getitem__(self, i):
408408
slice_=canonical_slice)
409409

410410
else:
411-
assert isinstance(i, int)
411+
assert isinstance(i, numbers.Integral)
412412
if i <= -1:
413413
i += self.length
414414
if not (0 <= i < self.length):

source_py2/python_toolbox/cute_iter_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ def are_equal(*sequences):
414414
# return logic_tools.all_equal(sequences.start for sequence in sequences)
415415

416416
# If cheap comparison didn't work, trying item-by-item comparison:
417-
zipped = itertools.zip_longest(*sequences,
418-
fillvalue=_EMPTY_SENTINEL)
417+
zipped = itertools.izip_longest(*sequences,
418+
fillvalue=_EMPTY_SENTINEL)
419419
for values in zipped:
420420
# No need to explicitly check for `_EMPTY_SENTINEL`, it would just make
421421
# the following condition `False`, because it's impossible for all

source_py2/test_python_toolbox/test_combi/test_selection_space.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test():
1919
assert 7 not in selection_space
2020
assert (1, 3, 4) in selection_space
2121
assert selection_space
22-
assert repr(selection_space) == '<SelectionSpace: range(0, 5)>'
22+
assert repr(selection_space) == '<SelectionSpace: (0, 1, 2, 3, 4)>'
2323
assert {SelectionSpace(range(4)), SelectionSpace(range(4)),
2424
SelectionSpace(range(5)), SelectionSpace(range(4))} == \
2525
{SelectionSpace(range(4)), SelectionSpace(range(5))}

source_py3/python_toolbox/combi/perm_space.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def __init__(self, iterable_or_length, domain=None, n_elements=None,
283283
if degrees is None:
284284
degrees = ()
285285
if not isinstance(degrees, collections.Iterable):
286-
assert isinstance(degrees, int)
286+
assert isinstance(degrees, numbers.Integral)
287287
degrees = (degrees,)
288288
degrees = \
289289
sequence_tools.ensure_iterable_is_immutable_sequence(degrees)
@@ -408,7 +408,7 @@ def __getitem__(self, i):
408408
slice_=canonical_slice)
409409

410410
else:
411-
assert isinstance(i, int)
411+
assert isinstance(i, numbers.Integral)
412412
if i <= -1:
413413
i += self.length
414414
if not (0 <= i < self.length):

0 commit comments

Comments
 (0)