class instance scope

Jeethu Rao jeethu at tachyontech.net
Mon Jul 24 08:12:30 EDT 2006


You could possibly make the log class a singleton or a borg.

Jeethu Rao

Ritesh Raj Sarraf wrote:
>>> log = foo.log(x, y, z)
>>>
>>>       
>
> Resulting line is:
> log = foo.log(x, y, z)
> global log
>
> Making the instance "log" global makes it accessible to all the
> functions.
>
> Now I have only one question, Is this a correct way to do it ? Or are
> there better way ?
>
> Ritesh
>
>   




More information about the Python-list mailing list