
On 3/1/2017 2:53 PM, Guido van Rossum wrote:
On Wed, Mar 1, 2017 at 11:25 AM, Serhiy Storchaka <storchaka@gmail.com <mailto:storchaka@gmail.com>> wrote:
On 28.02.17 23:17, Victor Stinner wrote:
My question is: would it make sense to implement this feature in Python directly? If yes, what should be the syntax? Use "/" marker? Use the @positional() decorator?
I'm strongly +1 for supporting positional-only parameters. The main benefit to me is that this allows to declare functions that takes arbitrary keyword arguments like Formatter.format() or MutableMapping.update(). Now we can't use even the "self" parameter and need to use a trick with parsing *args manually. This harms clearness and performance.
Agreed.
+ 1 also. When people write a Python equivalent of a built-in function for documentation or teaching purposes, they should be able to exactly mimic the API.
The problem with the "/" marker is that it looks ugly. There was an excuse for the "*" marker -- it came from omitting the name in "*args". The "*" prefix itself means an iterable unpacking, but "/" is not used neither as prefix nor suffix.
It's in a sense a pun -- * and / are "opposites" in mathematics, and so are the usages here.
Besides which, '/' has traditionally be used in non-numeric contexts as a separator, and in unix paths. -- Terry Jan Reedy