@StevenDAprano we are discussing alternative syntaxes to enhance readability and in place of blank assignments `k=` we could possibly use a sole `*` character as indicative that the following parameters are all to be passed as keywords.
In this syntax, the keyword to which the parameter will be assigned can be explicit as in `f(keyword=something)`, i.e. `something` is assigned to the `keyword` argument; or implicitly as in `f(*, something)`, i.e. `something` is assigned to the argument with same name of the parameter.
This thread is actually addressed to this reply: oliveira.rodrigo.m＠gmail.com wrote:
@StevenDAprano and this goes for @RhodriJames , thank you for sharing your point of view. Indeed the proposed syntax is obscure and would not be that readable for beginners. Couldn't we work around this so? The concept is still good for me just the syntax that is obscure, maybe something like this would work: # '*' character delimits that subsequent passed parameters will be passed # as keyword arguments with the same name of the variables used self.do_something(positional, *, keyword) # this would be equivalent to: self.do_something(positional, keyword=keyword)
I believe this is readable even if you don't know Python: positional and keyword are being passed as parameters, the * character is mysterious at first but so it is in def foo(a, *, b) and it doesn't get into the way of basic readability. Rodrigo Martins de Oliveira
I believe some of us just clicked "Reply" on Mailman 3 and started nesting threads. Sorry.