[New-bugs-announce] [issue41242] When concating strings, I think it is better to use += than join the list

Wansoo Kim report at bugs.python.org
Wed Jul 8 10:49:19 EDT 2020


New submission from Wansoo Kim <rladhkstn8 at gmail.com>:

Hello

I think it's better to use += than list.join() when concating strings.

This is more intuitive than other methods.

Also, I personally think it is not good for one variable to change to another type during runtime.

https://github.com/python/cpython/blob/b26a0db8ea2de3a8a8e4b40e69fc8642c7d7cb68/Lib/asyncio/base_events.py#L826

If you look at the link above, `msg` was a list type at first, in the end 
 become a str type.

----------
components: asyncio
messages: 373310
nosy: asvetlov, ys19991, yselivanov
priority: normal
severity: normal
status: open
title: When concating strings, I think it is better to use += than join the list
type: enhancement

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


More information about the New-bugs-announce mailing list