Is this optparse object abuse?
Bruno Desthuilliers
bdesth.quelquechose at free.quelquepart.fr
Sun Nov 16 13:30:55 EST 2008
John O'Hagan a écrit :
> Hello,
>
> I've recently found it convenient to do something like this:
>
(snip)
> In other words, using the optparse object to hold as attributes everything
> needed by all the functions and methods in the module, and simply passing it
> holus bolus to all them and just pulling out what's actually needed inside
> the function, even adding new attributes or reassigning old ones along the
> way.
Congratulations, you just reinvented globals and spaghetti-code.
(snip)
> My question is: is this horribly inefficient or otherwise wrong?
>
The only thing I can say is that I hope I'll *never* have to maintain
your code.
More information about the Python-list
mailing list