Argument count mismatch

Daniel Kluev dan.kluev at gmail.com
Fri Apr 22 06:19:19 EDT 2011


On Fri, Apr 22, 2011 at 12:43 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> It looks to me like this function relies on no fewer than three global
> variables, two that you read from and one which you write to:
>
> c
> Session
> MSPResponse
>
> This is almost certainly poor design. Using global state is almost always
> harmful and should be avoided.

Looks like its something similar to Pylons web framework. While
generally globals vars are indeed bad, in this case they are
specifically provided by framework to be used this way.
They are 'thread-local' rather than global, and usually cause no harm,
since framework guarantees that these instances are bound to context
of this particular http request.

-- 
With best regards,
Daniel Kluev



More information about the Python-list mailing list