global variables ?

Ulrich Petri ulope at gmx.de
Sun Nov 2 21:34:49 EST 2003


"ruari mactaggart" <ruari at charliefortune.com> schrieb im Newsbeitrag
news:bo0cuk$sj0$1 at news6.svr.pol.co.uk...
> John Roth <newsgroups at jhrothjr.com> wrote in message
> news:vq78f2gc8bgv59 at news.supernews.com...
> > Using a dictionary, it looks like this:
> >
> > foodict = {foobar: "huh?"}
> >
> > def snafu():
> >     foodict["foobar"] = "what?"
> >
> > That lets you consolidate all of those messy global variables
> > in one place as well as giving you a name you can use for
> > better internal documentation.
> >
> > John Roth
>
> thank you ! It works now. This is very satisfying.
>

Well - no. It's not.
Globals are bad, ugly, ...






More information about the Python-list mailing list