Good solutions for passing around large numbers of arguments in a layered architecture?

Stephen Hansen me+list/python at ixokai.io
Fri Jun 11 18:16:26 EDT 2010


On 6/11/10 10:00 AM, Nathan Rice wrote:
> I've tried using args/kwargs, however I found it difficult to avoid
> having arguments in my signature re-ordered, and it is also a source
> of bugs.
> 
> Has anyone come up with a good solution for dealing with arguments in
> situations like this where you'd like to encapsulate lower level stuff
> for neophyte users but make it easily available to advanced users?

I'd just use a dictionary, with some namespacey sort of names for the
arguments. Sort of like how layered WSGI apps have their 'environ' object.

Its like, environ["beaker.session.blah"] = "fubar". Though that's
something of a mix of configuration and state.

-- 

   Stephen Hansen
   ... me+list/python (AT) ixokai (DOT) io

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20100611/73e208a5/attachment.sig>


More information about the Python-list mailing list