No Thoughts about Everything

Paul Rubin http
Thu Feb 26 03:34:07 EST 2004


bblochl <bblochl at fh-lausitz.de> writes:
> I found a solution for the simulation of access modifier "static final
> " in python:
> 
> 
> class Mytest:
>     LOGE_10=(2.302585092994046,)
>     #Klassenkonstante (static final) use a tuple :-)
>     #def __init__(self):
>           def log10(self,x):
>         return(log(x)/LOGE_10[0])
> 
> testmath=Mytest()

But you can still change the value by saying

   testmath.LOGE_10 = (3.14159,)

outside the class definition.



More information about the Python-list mailing list