Skip to content

Commit 46ebf7f

Browse files
committed
Reverting all Python 2.6 changes (and some others)
1 parent ae890c4 commit 46ebf7f

File tree

60 files changed

+156
-1114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+156
-1114
lines changed

LICENSE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,4 @@ Python Toolbox includes third-party Python packages as subpackages that are used
2525
* `linecache2` by "Testing-cabal" and others, PSF license.
2626
* `traceback2` by "Testing-cabal" and others, PSF license.
2727
* `six` by Benjamin Peterson and others, MIT license.
28-
* `functools` and `collections` by Python-dev and others, PSF license.
2928

README.markdown

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ Python Toolbox includes third-party Python packages as subpackages that are used
8484
* `linecache2` by "Testing-cabal" and others, PSF license.
8585
* `traceback2` by "Testing-cabal" and others, PSF license.
8686
* `six` by Benjamin Peterson and others, MIT license.
87-
* `functools` and `collections` by Python-dev and others, PSF license.
8887

8988

9089
------------------------------------------------------------------

setup.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
# #
1414
if sys.version_info[:2] <= (2, 6):
1515
raise Exception(
16-
"You're using Python <= 2.5, but this package requires either Python "
17-
"2.6/2.7, or 3.3 or above, so you can't use it unless you upgrade "
18-
"your Python version."
16+
"You're using Python <= 2.6, but this package requires either Python "
17+
"2.7, or 3.3 or above, so you can't use it unless you upgrade your "
18+
"Python version."
1919
)
2020
if sys.version_info[0] == 3 and sys.version_info[1] <= 2:
2121
raise Exception(
2222
"You're using Python <= 3.2, but this package requires either Python "
23-
"3.3 or above, or Python 2.6/2.7, so you can't use it unless you "
24-
"upgrade your Python version."
23+
"3.3 or above, or Python 2.7, so you can't use it unless you upgrade "
24+
"your Python version."
2525
)
2626
# #
2727
### Finished confirming correct Python version. ###############################
@@ -149,7 +149,6 @@ def get_packages():
149149
'License :: OSI Approved :: MIT License',
150150
'Operating System :: OS Independent',
151151
'Programming Language :: Python',
152-
'Programming Language :: Python :: 2.6',
153152
'Programming Language :: Python :: 2.7',
154153
'Programming Language :: Python :: 3.3',
155154
'Programming Language :: Python :: 3.4',

source_py2/python_toolbox/MIT_license.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ Python Toolbox includes third-party Python packages as subpackages that are used
2525
* `linecache2` by "Testing-cabal" and others, PSF license.
2626
* `traceback2` by "Testing-cabal" and others, PSF license.
2727
* `six` by Benjamin Peterson and others, MIT license.
28-
* `functools` and `collections` by Python-dev and others, PSF license.
28+

source_py2/python_toolbox/_bootstrap/bootstrap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
raise Exception("This is a Python 2.x distribution of `python_toolbox`, "
1010
"and you're using Python 3.x. Please get the Python 3.x "
1111
"distribution.")
12-
if sys.version_info[1] <= 5:
12+
if sys.version_info[1] <= 6:
1313
raise Exception(
14-
"You're using Python <= 2.5, but this package requires Python 2.6, "
14+
"You're using Python <= 2.6, but this package requires Python 2.7, "
1515
"(or Python 3.3+ on a different distribution,) so you can't use it "
1616
"unless you upgrade your Python version."
1717
)

source_py2/python_toolbox/combi/perming/_fixed_map_managing_mixin.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ def free_values(self):
4444
# case of recurrent sequences, we don't want to remove all the sequence
4545
# items that are in `self.fixed_map.values()` but only as many as there
4646
# are in `self.fixed_map.values()`.
47-
from python_toolbox.nifty_collections import Bag
4847
free_values = []
49-
fixed_counter = Bag(self.fixed_map.values())
48+
fixed_counter = collections.Counter(self.fixed_map.values())
5049
for item in self.sequence:
5150
if fixed_counter[item]:
5251
fixed_counter[item] -= 1
@@ -79,16 +78,16 @@ def _n_cycles_in_fixed_items_of_just_fixed(self):
7978
@caching.CachedProperty
8079
def _undapplied_fixed_map(self):
8180
if self.is_dapplied:
82-
return dict((self.domain.index(key), value) for key, value
83-
in self.fixed_map.items())
81+
return {self.domain.index(key): value for key, value
82+
in self.fixed_map.items()}
8483
else:
8584
return self.fixed_map
8685

8786
@caching.CachedProperty
8887
def _undapplied_unrapplied_fixed_map(self):
8988
if self.is_dapplied or self.is_rapplied:
90-
return dict((self.domain.index(key), self.sequence.index(value))
91-
for key, value in self.fixed_map.items())
89+
return {self.domain.index(key): self.sequence.index(value)
90+
for key, value in self.fixed_map.items()}
9291
else:
9392
return self.fixed_map
9493

source_py2/python_toolbox/combi/perming/_variation_adding_mixin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def get_rapplied(self, sequence):
2121
raise Exception
2222
return PermSpace(
2323
sequence, n_elements=self.n_elements, domain=self.domain,
24-
fixed_map=dict((key, sequence[value]) for key, value in
25-
self.fixed_map.items()),
24+
fixed_map={key: sequence[value] for key, value in
25+
self.fixed_map.items()},
2626
degrees=self.degrees, slice_=self.canonical_slice,
2727
is_combination=self.is_combination,
2828
perm_type=self.perm_type
@@ -87,8 +87,8 @@ def get_dapplied(self, domain):
8787
raise Exception
8888
return PermSpace(
8989
self.sequence, n_elements=self.n_elements, domain=domain,
90-
fixed_map=dict((domain[key], value) for key, value in
91-
self._undapplied_fixed_map),
90+
fixed_map={domain[key]: value for key, value in
91+
self._undapplied_fixed_map},
9292
degrees=self.degrees, slice_=self.canonical_slice,
9393
is_combination=self.is_combination,
9494
perm_type=self.perm_type

source_py2/python_toolbox/combi/perming/_variation_removing_mixin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def unrapplied(self):
3232
return PermSpace(
3333
self.sequence_length, n_elements=self.n_elements,
3434
domain=self.domain,
35-
fixed_map=dict((key, self.sequence.index(value)) for
36-
key, value in self.fixed_map.items()),
35+
fixed_map={key: self.sequence.index(value) for
36+
key, value in self.fixed_map.items()},
3737
degrees=self.degrees, slice_=self.canonical_slice,
3838
is_combination=self.is_combination, perm_type=self.perm_type
3939
)

source_py2/python_toolbox/combi/perming/calculating_length.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ def calculate_length_of_recurrent_perm_space(k, fbb):
5959
### Doing phase one, getting all sub-FBBs: ################################
6060
# #
6161
levels = []
62-
current_fbbs = set((fbb,))
62+
current_fbbs = {fbb}
6363
while len(levels) < k and current_fbbs:
6464
k_ = k - len(levels)
6565
levels.append(
66-
dict((fbb_, fbb_.get_sub_fbbs_for_one_key_removed())
67-
for fbb_ in current_fbbs if (k_, fbb_) not in cache)
66+
{fbb_: fbb_.get_sub_fbbs_for_one_key_removed()
67+
for fbb_ in current_fbbs if (k_, fbb_) not in cache}
6868
)
6969
current_fbbs = set(itertools.chain(*levels[-1].values()))
7070
# #
@@ -144,12 +144,12 @@ def calculate_length_of_recurrent_comb_space(k, fbb):
144144
### Doing phase one, getting all sub-FBBs: ################################
145145
# #
146146
levels = []
147-
current_fbbs = set((fbb,))
147+
current_fbbs = {fbb}
148148
while len(levels) < k and current_fbbs:
149149
k_ = k - len(levels)
150150
levels.append(
151-
dict((fbb_, fbb_.get_sub_fbbs_for_one_key_and_previous_piles_removed())
152-
for fbb_ in current_fbbs if (k_, fbb_) not in cache)
151+
{fbb_: fbb_.get_sub_fbbs_for_one_key_and_previous_piles_removed()
152+
for fbb_ in current_fbbs if (k_, fbb_) not in cache}
153153
)
154154
current_fbbs = set(itertools.chain(*levels[-1].values()))
155155
# #

source_py2/python_toolbox/combi/perming/perm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# Copyright 2009-2015 Ram Rachum.
22
# This program is distributed under the MIT license.
33

4+
import functools
45
import abc
56
import collections
67
import numbers
78

8-
from python_toolbox.third_party import functools
9-
109
from python_toolbox import misc_tools
1110
from python_toolbox import nifty_collections
1211
from python_toolbox import caching

0 commit comments

Comments
 (0)