Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
5482db66
Commit
5482db66
authored
Dec 01, 2013
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cythonpp.py: drop support for python2.5
parent
54d409df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
35 deletions
+1
-35
util/cythonpp.py
util/cythonpp.py
+1
-35
No files found.
util/cythonpp.py
View file @
5482db66
...
@@ -8,6 +8,7 @@ import datetime
...
@@ -8,6 +8,7 @@ import datetime
import
pipes
import
pipes
import
difflib
import
difflib
from
hashlib
import
md5
from
hashlib
import
md5
from
itertools
import
combinations
,
product
do_exec
=
None
do_exec
=
None
if
sys
.
version_info
>=
(
3
,
0
):
if
sys
.
version_info
>=
(
3
,
0
):
...
@@ -725,41 +726,6 @@ def dbg(*args):
...
@@ -725,41 +726,6 @@ def dbg(*args):
return
log
(
*
args
)
return
log
(
*
args
)
# itertools is not available on python 2.5
# itertools.combinations has a problem on 2.6.1
def
combinations
(
iterable
,
r
):
# combinations('ABCD', 2) --> AB AC AD BC BD CD
# combinations(range(4), 3) --> 012 013 023 123
pool
=
tuple
(
iterable
)
n
=
len
(
pool
)
if
r
>
n
:
return
indices
=
list
(
range
(
r
))
yield
tuple
(
pool
[
i
]
for
i
in
indices
)
while
True
:
for
i
in
reversed
(
range
(
r
)):
if
indices
[
i
]
!=
i
+
n
-
r
:
break
else
:
return
indices
[
i
]
+=
1
for
j
in
range
(
i
+
1
,
r
):
indices
[
j
]
=
indices
[
j
-
1
]
+
1
yield
tuple
(
pool
[
i
]
for
i
in
indices
)
def
product
(
*
args
,
**
kwds
):
# product('ABCD', 'xy') --> Ax Ay Bx By Cx Cy Dx Dy
# product(range(2), repeat=3) --> 000 001 010 011 100 101 110 111
pools
=
tuple
(
map
(
tuple
,
args
))
*
kwds
.
get
(
'repeat'
,
1
)
result
=
[[]]
for
pool
in
pools
:
result
=
[
x
+
[
y
]
for
x
in
result
for
y
in
pool
]
for
prod
in
result
:
yield
tuple
(
prod
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
import
optparse
import
optparse
parser
=
optparse
.
OptionParser
()
parser
=
optparse
.
OptionParser
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment