Skip to content

Commit 913a0f5

Browse files
committed
Supporting Python 2.6
1 parent 0ae75e7 commit 913a0f5

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

source_py2/test_python_toolbox/test_cheat_hashing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_cheat_hash():
1818
[1, 2, 3.4],
1919
(1, 2, 3.4),
2020
{1: 2, 3: 4.5},
21-
{1, 2, 3.4},
21+
set((1, 2, 3.4)),
2222
[1, [1, 2], 3],
2323
[1, {frozenset((1, 2)): 'meow'}, 3],
2424
sum,

source_py2/test_python_toolbox/test_combi/test_comb_space.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def test():
1818
'du', 'db', 'br', ('d', 'u'), Comb('du', comb_space)
1919
)
2020
things_not_in_comb_space = (
21-
'dx', 'dub', ('d', 'x'), {'d', 'u', 'b'}, Comb('dux', comb_space),
22-
Comb('du', CombSpace('other', 2)), {'d', 'u'}, 'ud', 'rb',
21+
'dx', 'dub', ('d', 'x'), set(('d', 'u', 'b')), Comb('dux', comb_space),
22+
Comb('du', CombSpace('other', 2)), set(('d', 'u')), 'ud', 'rb',
2323
Comb('bu', comb_space)
2424
)
2525

source_py2/test_python_toolbox/test_combi/test_extensive.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def __init__(self, iterable_or_length, domain=None, n_elements=None,
5959
len(self.sequence)
6060
self.domain = (domain or
6161
sequence_tools.CuteRange(self.sequence_length))[:self.n_elements]
62-
self.fixed_map = {key: value for key, value in fixed_map.items() if key
63-
in self.domain}
62+
self.fixed_map = dict((key, value) for key, value in fixed_map.items()
63+
if key in self.domain)
6464
self.degrees = \
6565
degrees or sequence_tools.CuteRange(self.sequence_length)
6666
self.is_combination = is_combination
@@ -174,10 +174,10 @@ def _check_variation_selection(variation_selection, perm_space_type,
174174
kwargs['is_combination'] = is_combination
175175

176176
if purified_fixed_map != NO_ARGUMENT:
177-
kwargs['fixed_map'] = actual_fixed_map = {
178-
actual_domain[key]: sequence[value] for key, value
177+
kwargs['fixed_map'] = actual_fixed_map = dict(
178+
(actual_domain[key], sequence[value]) for key, value
179179
in purified_fixed_map.items() if key < len(sequence)
180-
}
180+
)
181181
else:
182182
actual_fixed_map = {}
183183

@@ -320,10 +320,10 @@ def _check_variation_selection(variation_selection, perm_space_type,
320320
else:
321321
assert type(perm) == Perm
322322

323-
if variation_selection.variations <= {
323+
if variation_selection.variations <= set((
324324
perming.variations.Variation.DAPPLIED,
325325
perming.variations.Variation.RAPPLIED,
326-
perming.variations.Variation.COMBINATION,}:
326+
perming.variations.Variation.COMBINATION)):
327327
assert perm.nominal_perm_space == perm_space
328328
assert perm.nominal_perm_space == \
329329
perm_space._nominal_perm_space_of_perms == \

0 commit comments

Comments
 (0)