Skip to content

Commit a59ede2

Browse files
bpo-45225: use map function instead of genexpr in capwords (pythonGH-28342)
1 parent f4b94b1 commit a59ede2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/string.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def capwords(s, sep=None):
4545
sep is used to split and join the words.
4646
4747
"""
48-
return (sep or ' ').join(x.capitalize() for x in s.split(sep))
48+
return (sep or ' ').join(map(str.capitalize, s.split(sep)))
4949

5050

5151
####################################################################
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use map function instead of genexpr in capwords.

0 commit comments

Comments
 (0)