My wishlist for Python3K

Jeremy Hylton jeremy at beopen.com
Fri Jun 9 11:52:57 EDT 2000


hzhu at rocket.knowledgetrack.com (Huaiyu Zhu) writes:

> My wishlist for Python3K (This is not to start a flame war):
> 
> 3. The := operator for deepcopy as oposed to reference assignment.  Therefore
>    - the assignment (a = b) guarantees (a is b)
>    - the assignment (a := b) guarantees (a == b and a is not b).
>    

There are many kinds of objects where copying is not defined.  It's
unlikely we'll define copies for all of them.  It is also quite
difficult to guarantee that equality is defined for every kind of
object other than object identity.  In the case of an object that
contains references to other objects, a deepcopy that creates a
complete clone of every object referenced from the root is expensive
and probably unnecessary. Thus, I don't think we'll add a := operator.

I'd also observe that I seldom write programs where I need to make
copies (and almost never a full deepcopy).  If this programming idiom
is unusual, I don't see any advantage to having language syntax to
support it.

-- Jeremy Hylton <http://www.python.org/~jeremy/>





More information about the Python-list mailing list