On Mon, Dec 27, 2010 at 11:14 AM, Justin C. Walker <jus...@mac.com> wrote:
> Thanks for the reply.
>
> On Dec 26, 2010, at 03:17 , Volker Braun wrote:
>
>> Python has no "const". You can always manually change the innards of your
>> class. The set_immutable() is just implemented by hand.
>
> Tuples are "really" immutable, correct?  Is this possible because the tuple 
> is an internal data type?

Well, you can change them from Cython :). It's because they're
implemented in C, and (by design) no Python-level "hooks" are created
to mutate them from Python.

>> One could override __setattr__() to catch assignments to existing
>> attributes, but I think that is not done anywhere in Sage.
>
> Are 'attributes' the same as (or do they include) instance variables?

Yes, attributes include variables, methodes, etc. When you do

x.a = var

Then x.__gsetattr(x, a, var)

gets called, which by default just updates the dictionary of attributes of x.

- Robert

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to