bpo-45225: use map function instead of genexpr in capwords (GH-28342)

This commit is contained in:
speedrun-program 2021-09-16 12:49:38 -07:00 committed by GitHub
parent f4b94b1f57
commit a59ede2447
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -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)))
####################################################################

View File

@ -0,0 +1 @@
use map function instead of genexpr in capwords.