[issue43535] Make str.join auto-convert inputs to strings.

Raymond Hettinger report at bugs.python.org
Thu Mar 18 19:22:39 EDT 2021


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

>  What changed?

It comes up almost every week that I teach a Python course.  Eventually, I've come to see the light :-)

Also, I worked though the steps and found an efficiency gain for new code with no detriment to existing code.

Lastly, I used to worry a lot about join() also being defined for bytes() and bytearray().  But after working through the use cases, I can see that we get an even bigger win.  People seem to have a hard time figuring out how to convert a single integer to a byte.  The expression "bytes([x])" isn't at all intuitive; it doesn't look nice in a list comprehension, and is incomprehensible when used with map() and lambda.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43535>
_______________________________________


More information about the Python-bugs-list mailing list