Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
cbd2ab13
Commit
cbd2ab13
authored
Dec 04, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1513299: cleanup some map() uses where a comprehension works better.
parent
8334fd92
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
7 deletions
+7
-7
Lib/http/cookies.py
Lib/http/cookies.py
+1
-1
Lib/http/server.py
Lib/http/server.py
+1
-1
Lib/pydoc.py
Lib/pydoc.py
+2
-2
Lib/tabnanny.py
Lib/tabnanny.py
+1
-1
Lib/test/pystone.py
Lib/test/pystone.py
+1
-1
Lib/test/test_long.py
Lib/test/test_long.py
+1
-1
No files found.
Lib/http/cookies.py
View file @
cbd2ab13
...
...
@@ -230,7 +230,7 @@ def _quote(str, LegalChars=_LegalChars):
if
all
(
c
in
LegalChars
for
c
in
str
):
return
str
else
:
return
'"'
+
_nulljoin
(
map
(
_Translator
.
get
,
str
,
str
)
)
+
'"'
return
'"'
+
_nulljoin
(
_Translator
.
get
(
s
,
s
)
for
s
in
str
)
+
'"'
_OctalPatt
=
re
.
compile
(
r"\\[0-3][0-7][0-7]"
)
...
...
Lib/http/server.py
View file @
cbd2ab13
...
...
@@ -868,7 +868,7 @@ def nobody_uid():
try
:
nobody
=
pwd
.
getpwnam
(
'nobody'
)[
2
]
except
KeyError
:
nobody
=
1
+
max
(
map
(
lambda
x
:
x
[
2
],
pwd
.
getpwall
()
))
nobody
=
1
+
max
(
x
[
2
]
for
x
in
pwd
.
getpwall
(
))
return
nobody
...
...
Lib/pydoc.py
View file @
cbd2ab13
...
...
@@ -1000,7 +1000,7 @@ class TextDoc(Doc):
def
bold
(
self
,
text
):
"""Format a string in bold by overstriking."""
return
''
.
join
(
map
(
lambda
ch
:
ch
+
'
\
b
'
+
ch
,
text
)
)
return
''
.
join
(
ch
+
'
\
b
'
+
ch
for
ch
in
text
)
def
indent
(
self
,
text
,
prefix
=
' '
):
"""Indent text by prepending a given prefix to each line."""
...
...
@@ -1024,7 +1024,7 @@ class TextDoc(Doc):
c
,
bases
=
entry
result
=
result
+
prefix
+
classname
(
c
,
modname
)
if
bases
and
bases
!=
(
parent
,):
parents
=
map
(
lambda
c
,
m
=
modname
:
classname
(
c
,
m
),
bases
)
parents
=
(
classname
(
c
,
modname
)
for
c
in
bases
)
result
=
result
+
'(%s)'
%
', '
.
join
(
parents
)
result
=
result
+
'
\
n
'
elif
type
(
entry
)
is
type
([]):
...
...
Lib/tabnanny.py
View file @
cbd2ab13
...
...
@@ -264,7 +264,7 @@ class Whitespace:
return
a
def
format_witnesses
(
w
):
firsts
=
map
(
lambda
tup
:
str
(
tup
[
0
]),
w
)
firsts
=
(
str
(
tup
[
0
])
for
tup
in
w
)
prefix
=
"at tab size"
if
len
(
w
)
>
1
:
prefix
=
prefix
+
"s"
...
...
Lib/test/pystone.py
View file @
cbd2ab13
...
...
@@ -72,7 +72,7 @@ BoolGlob = FALSE
Char1Glob
=
'
\
0
'
Char2Glob
=
'
\
0
'
Array1Glob
=
[
0
]
*
51
Array2Glob
=
list
(
map
(
lambda
x
:
x
[:],
[
Array1Glob
]
*
51
))
Array2Glob
=
[
x
[:]
for
x
in
[
Array1Glob
]
*
51
]
PtrGlb
=
None
PtrGlbNext
=
None
...
...
Lib/test/test_long.py
View file @
cbd2ab13
...
...
@@ -276,7 +276,7 @@ class LongTest(unittest.TestCase):
digits
=
digits
or
[
0
]
return
'-'
[:
sign
]
+
\
{
2
:
'0b'
,
8
:
'0o'
,
10
:
''
,
16
:
'0x'
}[
base
]
+
\
""
.
join
(
map
(
lambda
i
:
"0123456789abcdef"
[
i
],
digits
)
)
""
.
join
(
"0123456789abcdef"
[
i
]
for
i
in
digits
)
def
check_format_1
(
self
,
x
):
for
base
,
mapper
in
(
8
,
oct
),
(
10
,
repr
),
(
16
,
hex
):
...
...
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