constant in python?
Frederic Giacometti
fred at arakane.com
Sun Aug 19 17:39:16 EDT 2001
"Michael Ströder" <michael at stroeder.com> wrote in message
news:3B7E5390.C6966CAD at stroeder.com...
> Brian Quinlan wrote:
> >
> > > i found a similar example on the net i was just making sure.
> > > seems kinda alot of work just to get a constant. even perl
> > > has "use constant" and thats about the ugliest language around :)
> >
> > The questions is why do you need explicit language support for
> > constants? Just don't change the value and it should behave constant
> > enough for you.
>
> To avoid that another developer in the team changes the constant
> accidently?
And what about other definitions in the module global scope (classes,
functions...) ? Be consistent :))
Phython's name scoping rules and the import mechanisms make it that changing
the a reference in another module can't happen accidentaly.
Since I bet you won't agree, you'll quickly give a counter exemple proving
I'm wrong...
FG
More information about the Python-list
mailing list