On Tue, Apr 21, 2020 at 9:27 AM M.-A. Lemburg <[email protected]> wrote:
> But arguing that f(a=, b=, c=, d=) is any better than
> f(a=a, b=b, c=c, d=d) does not really solve anything.
>
> The problem is with the code design, not with the syntax.
>
> You'd be better off putting your variables combined into a context
> object or container and pass that around:
>
> f(context)
>
> In many cases, you can avoid passing around any of these
> variables, by simply using an object rather than a function oriented
> approach. The variables would then become object attributes,
> so calling f() becomes:
>
> task.f()
>
> and the method f would get it's context straight from the
> object attributes of task -- without any arguments to pass in.

Please explain how this will help the case of render_template and
similar, where the function accepts ANY keyword arguments, and then
passes them along to the template. Do I need to package everything up
into a dictionary? And how would that actually improve things, given
that I'd still need to do the exact same thing to construct that
dictionary? Every template has its own unique variables, and most of
them come straight from the calling function, with the same names.

This is NOT going to be a consistent object with the same attributes.
That simply is not the use-case here. We already have that.

ChrisA
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/6E44C623KSMTXHNH5PZXNLG2LC2U2CIP/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to