[issue45225] use map function instead of genexpr in capwords

2021-09-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the PR. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue45225] use map function instead of genexpr in capwords

2021-09-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset a59ede244714455aa9ee8637608e019a20fa2ca6 by speedrun-program in branch 'main': bpo-45225: use map function instead of genexpr in capwords (GH-28342) https://github.com/python/cpython/commit/a59ede244714455aa9ee8637608e019a20fa2ca6

[issue45225] use map function instead of genexpr in capwords

2021-09-16 Thread speedrun-program
New submission from speedrun-program : In string.py, the capwords function passes str.join a generator expression, but the map function could be used instead. This is how capwords is currently written: ```py def capwords(s, sep=None): """capwords(s [,sep]) -> string