How do you create constants?

Tom wright thomas.wright1 at ntlworld.REMOVETHIS.com
Sat Oct 28 13:16:31 EDT 2000


Hi Fred,

because python doesnt have the concept of a constant, so if a real way of
creating constants existed then they would be immutable ( as you can do in c
and c++ ).  The compromise in python, seems to be make a variable, assign a
value and  pretend its constant however this is not enforceable ( or so I
understand, please correct me if wrong ).  I was just thinking was there a
way to create a true constant variable.  Sorry if I was not clear, it was
more in the way of a joke than a real request.

Best regards

Tom

"Fredrik Lundh" <effbot at telia.com> wrote in message
news:2nDK5.2916$QH2.270412 at newsb.telia.net...
> Tom Wright wrote:
> > shame they cant be made immutable once they have been set,
> > feature for 2.1 ??? ;-)
>
> can you explain why you think you need immutable
> "constants"?
>
> </F>
>
>





More information about the Python-list mailing list