A global or module-level variable?

Bret bret.wortman at gmail.com
Thu Jan 24 10:49:40 EST 2008


On Jan 23, 2:27 pm, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
wrote:
> En Wed, 23 Jan 2008 11:58:05 -0200, Bret <bret.wort... at gmail.com> escribió:
>
> > On Jan 22, 1:00 pm, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
>
> >> If you have to do it that way, use:
>
> > Is there a better way?  A more Pythonic way?
>
> It's simple, clear and works fine, why make it more complicated?
> Unless you have additional requirements, like a multithreaded program.
>
> --
> Gabriel Genellina

Ultimately, it will be multithreaded -- and I had intended to wrap the
access to the global member in a lock to ensure only one thread could
get a value at any point.  It might also become multiprocess (ugh!)
and so might need to live in its own SocketServer some day.  But for
now, I agree.  Simple is good.  I just wanted to be sure I wasn't
oversimplifying, you know?

Thanks!



More information about the Python-list mailing list