Twice instanciation

vincent wehren v.wehren at home.nl
Thu Jun 12 15:47:47 EDT 2003


"Salvatore" <artyprog at wanadoo.fr> schrieb im Newsbeitrag
news:bcakmg$jv7$1 at news-reader14.wanadoo.fr...
> Hello,
>
> Is it possible to avoid twice instanciation
> of the same variable ?

Maybe this helps:
http://aspn.activestate.com/ASPN/Python/Cookbook/Recipe/52558

Regards,
Vincent Wehren


> 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
>
>
> Regards
>
> Salvatore
>






More information about the Python-list mailing list