[C++-sig] C++ const -> Python immutable?

David Abrahams dave at boost-consulting.com
Wed Sep 25 15:31:47 CEST 2002

Yep. Implementing a notion of immutability is on the list for "someday".

However, I don't yet have plans to make a wrapper around a const reference
to T different from a wrapper around a reference to T. Python doesn't have
the notion of a const reference to a mutable object (though of course
proxies are possible). In python, objects are either mutable or immutable;

However #2, I don't think it's impossible to implement that distinction.
Let's talk about it again after Boost.Python is released.

           David Abrahams * Boost Consulting
dave at boost-consulting.com * http://www.boost-consulting.com

----- Original Message -----
From: "Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com>
To: <c++-sig at python.org>
Sent: Wednesday, September 25, 2002 9:47 AM
Subject: Re: [C++-sig] C++ const -> Python immutable?

> --- "Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com> wrote:
> > Wait, I take that back, I was using a type that goes through a custom
> > converter... I will try again.
> Now it seems to me that both by_reference and by_const_reference work,
but that
> the "const" is lost. Is this correct?
> Ralf
> __________________________________________________
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
> http://sbc.yahoo.com
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig

More information about the Cplusplus-sig mailing list