
On Sat, Apr 18, 2020 at 11:19 PM Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
Chris Angelico writes:
Look at the real-world examples that I posted and tell me what I should be doing differently, if it's an anti-pattern to be discouraged.
IIRC, you didn't post real-world examples relevant to Paul's comment because you posted only the call sites.
So, for example, if a function call you posted were refactored to a local function (perhaps using a nonlocal declaration, though cases where that's necessary should be rare), you wouldn't need to pass those arguments at all.
Except that render_template isn't one of my own functions. It's part of the templating engine (this is a Flask web app). There is no refactoring to do - that IS the correct way to call it. The only way to avoid that would be to do something silly like **locals() and we already know from the f-string discussion that that's a bad idea. ChrisA