mirror of https://github.com/python/cpython
bpo-45225: use map function instead of genexpr in capwords (GH-28342)
This commit is contained in:
parent
f4b94b1f57
commit
a59ede2447
|
@ -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…
Reference in New Issue