[issue6326] Add a "swap" method to list

Kristján Valur Jónsson report at bugs.python.org
Wed Jul 1 02:03:24 CEST 2009


Kristján Valur Jónsson <kristjan at ccpgames.com> added the comment:

fyi, here is the thread from python-ideas:

http://mail.python.org/pipermail/python-ideas/2009-June/005042.html

The parallel to C++´s future "rvalue reference" is interesting 
(http://www.artima.com/cppsource/rvalue.html, see the "move" 
application) 

Especially, perhaps, in light of this quote from http://evanjones.ca/rvalue-references.html, criticising the concept:

"...Or add a swap member function. This is not "elegant" nor is it as 
general. However, this is what we've been using for decades. It also 
requires zero changes to C++ compilers, and requires users to learn 
nothing. It has been immortalized in books like Effective C++ (Item 25: 
Consider support for a non-throwing swap)."

This, incidentally, is where the name 'swap' comes from, me being an old 
C++ programmer.

----------

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


More information about the Python-bugs-list mailing list