mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-45225: use map function instead of genexpr in capwords (GH-28342)
This commit is contained in:
parent
f4b94b1f57
commit
a59ede2447
2 changed files with 2 additions and 1 deletions
|
@ -45,7 +45,7 @@ def capwords(s, sep=None):
|
|||
sep is used to split and join the words.
|
||||
|
||||
"""
|
||||
return (sep or ' ').join(x.capitalize() for x in s.split(sep))
|
||||
return (sep or ' ').join(map(str.capitalize, s.split(sep)))
|
||||
|
||||
|
||||
####################################################################
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
use map function instead of genexpr in capwords.
|
Loading…
Add table
Add a link
Reference in a new issue