Possible constant assignment operators ":=" and "::=" for Python

Steve Holden steve at holdenweb.com
Thu May 18 07:27:30 CEST 2006


Piet van Oostrum wrote:
>>>>>>Edward Elliott <nobody at 127.0.0.1> (EE) wrote:
> 
> 
>>EE> Piet van Oostrum wrote:
>>
>>>>>>>>>tsaar2003 at yahoo.com (T) wrote:
>>>>
>>T> As you can see, the "constant" A can be modified this easily. But if
>>T> there were an intuitive mechanism to declare a symbol to be immutable,
>>T> then there won't be this problem.
>>
>>>>Mutability is not a property of symbols but of values. So it doesn't make
>>>>sense to declare an identifier to be immutable. And mutability is tied to
>>>>the object's type, not to individual instances.
> 
> 
>>EE> I think he meant immutable binding, not immutable symbol. So
>>EE> rebinding/overshadowing a "constant" A would raise an error, but
>>EE> mutating the underlying object A refers to would not (unless it too
>>EE> were immutable).
> 
> 
> The way I understood it was that he meant both.

The way I understood it was that he didn't understand it. But then he 
was gracious enough to admit that under questioning.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Love me, love my blog  http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the Python-list mailing list