Re: const objects (was Re: Death to tuples!)

2005-12-14 Thread Steven D'Aprano
On Wed, 14 Dec 2005 18:35:51 +, Tom Anderson wrote: > On Wed, 14 Dec 2005, Steven D'Aprano wrote: > >> On Wed, 14 Dec 2005 10:57:05 +0100, Gabriel Zachmann wrote: >> >>> I was wondering why python doesn't contain a way to make things "const"? >>> >>> If it were possible to "declare" variables

Re: const objects (was Re: Death to tuples!)

2005-12-14 Thread Tom Anderson
On Wed, 14 Dec 2005, Steven D'Aprano wrote: > On Wed, 14 Dec 2005 10:57:05 +0100, Gabriel Zachmann wrote: > >> I was wondering why python doesn't contain a way to make things "const"? >> >> If it were possible to "declare" variables at the time they are bound >> to objects that they should not al

Re: const objects (was Re: Death to tuples!)

2005-12-14 Thread Magnus Lycka
Gabriel Zachmann wrote: > > I was wondering why python doesn't contain a way to make things "const"? > > If it were possible to "declare" variables at the time they are bound to > objects that they should not allow modification of the object, then we > would have a concept _orthogonal_ to data

Re: const objects (was Re: Death to tuples!)

2005-12-14 Thread Christopher Subich
Gabriel Zachmann wrote: > > I was wondering why python doesn't contain a way to make things "const"? > > If it were possible to "declare" variables at the time they are bound to > objects that they should not allow modification of the object, then we > would have a concept _orthogonal_ to data

Re: const objects (was Re: Death to tuples!)

2005-12-14 Thread Steve Holden
Gabriel Zachmann wrote: [...] > > It seems to me that implementing that feature would be fairly easy. > All that would be needed is a flag with each variable. > It seems to me like it should be quite easy to add a sixth forward gear to my car, but I'm quite sure an auto engineer would quickly be

Re: const objects (was Re: Death to tuples!)

2005-12-14 Thread Steven D'Aprano
On Wed, 14 Dec 2005 10:57:05 +0100, Gabriel Zachmann wrote: > I was wondering why python doesn't contain a way to make things "const"? > > If it were possible to "declare" variables at the time they are bound to > objects that they should not allow modification of the object, then we would > ha