No Thoughts about Everything
bblochl
bblochl at fh-lausitz.de
Thu Feb 26 07:05:59 EST 2004
Richie Hindle schrieb:
>[Bernhard]
>
>
>>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])
>>
>>
>
>*Please* don't start teaching that to Python beginners! <0.5 wink>
>
>Apart from the horrible confusion it would cause, it doesn't even work:
>
>
>
>>>>Mytest.LOGE_10=(2.0,) # Near enough for engineers
>>>>
>>>>
>
>Next you'll be asking for a preprocessor so that you can say:
>
>#define LOGE_10 Mytest.LOGE_10[0]
>
>8-)
>
>
>
Thanks, I will bear in mind your warning! I will try not to push off
persons from the programming wagon.
But:
Better to light a candle than to curse the darkness.
# Ancient Chinese Proverb
Mytest.LOGE_10=(2.0,) mmmh - is working as it is not working, :-)
Cheers,
Bernhard
More information about the Python-list
mailing list