[IronPython] Is this a bug in IP 2.0?

Tim Roberts timr at probo.com
Wed Dec 24 19:05:20 CET 2008

On Tue, 23 Dec 2008 21:01:21 +0000, Michael Foord
<fuzzyman at voidspace.org.uk> wrote:
> Mark Russo wrote:
>> In IronPython 2.0, when I replace a Point object in a list using 
>> assignment, a copy of the Point object is used to replace the original 
>> list element rather than the original Point itself. This does not 
>> happen with user-defined objects. It also does not happen with Point 
>> objects in IronPython 1.1.
> Point objects are value types, so some operations cause them to be 
> copied. Probably the way they are used under the hood has changed with 
> IronPython 2.

But, this has to be considered a rather serious bug, doesn't it?  If I
create an object p2, then insert it into a list at l[0], the Python
contract guarantees that l[0] and p2 are references to the same object,
so that modifying one must modify the other.

Am I missing the point here?  Is there another level of indirection in
the implementation that means these really are references to the same
object, despite having different IDs?

Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20081224/b9fe18bf/attachment.html>

More information about the Ironpython-users mailing list