[issue34002] minor efficiency and clarity improvements in email package
Michael Selik
report at bugs.python.org
Fri Jun 29 15:02:30 EDT 2018
New submission from Michael Selik <mike at selik.org>:
The primary motivation for these improvements was avoiding a while/pop pattern for looping. A for-loop is a big improvement over copying a list, then repeatedly popping the 0th element.
A lesser improvement is the use of ``a.intersection(b)`` instead of ``c = set(b); len(c) > len(c - a)``. The check for intersection is more clear, and it avoids an unnecessary set construction.
https://github.com/python/cpython/pull/7999/
----------
messages: 320730
nosy: selik
priority: normal
severity: normal
status: open
title: minor efficiency and clarity improvements in email package
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34002>
_______________________________________
More information about the Python-bugs-list
mailing list