[issue30296] Remove unnecessary tuples, lists, sets, and dicts from Lib

Jon Dufresne report at bugs.python.org
Sun May 7 09:08:04 EDT 2017


New submission from Jon Dufresne:

Lib has some patterns that could be easily discovered and cleaned up. Doing so will reduce the number of unnecessary temporary lists in memory and unnecessary function calls. It will also take advantage of Python's own rich features in a way that better dog foods the language. For example:

* Replace list(<generator expression>) with list comprehension
* Replace dict(<generator expression>) with dict comprehension
* Replace set(<generator expression>) with set comprehension
* Replace builtin func(<list comprehension>) with func(<generator expression>) when supported (e.g. any(), all(), tuple(), min(), & max())

----------
components: Library (Lib)
messages: 293190
nosy: jdufresne
priority: normal
pull_requests: 1591
severity: normal
status: open
title: Remove unnecessary tuples, lists, sets, and dicts from Lib
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30296>
_______________________________________


More information about the Python-bugs-list mailing list