New submission from Samuel Marks <samuelma...@gmail.com>:

This is an extremely minor improvement. Rather than create a `list`—using a 
comprehension—then have it consumed by `.join`, one can skip the list 
construction entirely.

(I remember this working from at least Python 2.7… probably earlier also)

----------
messages: 383474
nosy: samuelmarks
priority: normal
pull_requests: 22737
severity: normal
status: open
title: Use `.join(k for k in g)` instead of `.join([k for k in g])`
type: performance
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42699>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to