artyprog at wanadoo.fr
Thu Jun 12 23:06:19 CEST 2003
W Isaac Carroll wrote:
> Salvatore wrote:
>> Is it possible to avoid twice instanciation
>> of the same variable ?
>> class Global:
>> def __init__(self,init=0):
>> self.value = init
>> g = Global() #instanciating one time ok
>> g = Global() #instanciating two times would raise an exception
> What do you mean by "instanciation" and "variable"?
> If you are asking whether it's possible to prevent binding the same name
> a second time, then no, it's not possible.
That's it - excuse my poor English ;-)
As I said to Manual, i'll propose another solution.
More information about the Python-list