[Python-ideas] Fwd: Keyword only argument on function call

Anders Hovmöller boxed at killingar.net
Tue Sep 25 08:32:30 EDT 2018


> I'm still not sure why all this focus on new syntax or convoluted IDE enhancements. I presented a very simple utility function that accomplishes exactly the started goal of DRY in keyword arguments. 

And I’ve already stated my reasons for rejecting this specific solution, but I’ll repeat them for onlookers:

1. Huge performance penalty
2. Rather verbose, so somewhat fails on the stated goal of improving readability
3. Tooling* falls down very hard on this

My macropy implementation that I linked to solves 1, improves 2 somewhat (but not much), and handled half of 3 by resulting in code that tooling can validate that the passed variables exists but fails in that tooling won’t correctly validate that the arguments actually correspond to existing parameters. 

* by tooling I mean editors like PyCharm and static analysis tools like mypy

/ Anders


More information about the Python-ideas mailing list