Josh Rosenberg <shadowranger+pyt...@gmail.com> added the comment:

Raymond said: "FWIW, the non-operator versions of these operations already 
support passing in multiple arguments and is the preferred way to do it."

True for sets with union/intersection/difference (and their inplace 
equivalents), but not for lists and bytearrays, which don't have an 
out-of-place version, and the in-place version, extend, only takes a single 
iterable argument.

Perhaps extend could be take multiple iterables as positional varargs, not just 
a single iterable, to make the multi-extend case work efficiently?

Not sure how often this actually comes up though; maybe I've just internalized 
good practices, but I only rarely find myself combining containers where the 
left-most operand is an unreferenced temporary, or combining many containers at 
once in a single line (I use itertools.chain wrapped in a constructor, or 
literals with the unpacking generalization for most of those cases).

----------
nosy: +josh.r

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

Reply via email to