Re: [VOTE] Named arguments
| From: | Chuck Adams | Date: | Fri, 10 Jul 2020 22:34:23 +0000 |
| Subject: | Re: [VOTE] Named arguments | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110930@lists.php.net to get a copy of this message | ||
> Then the question becomes, do we rename parameters a lot? I doubt it's a
> large problem, and even then the variadics support makes it very easy to
> handle in a backwards compatible way. In addition libraries are always open
> to declare they don't consider named parameters as part of their API.
Python supports the notion of "keyword-only arguments". If that was
supported, and the renamed argument had a default, an API could rename
parameters in a backward-compatible manner by introducing a kw-only
arg with the same name. One could also consider an aliasing syntax
such that more than one keyword could correspond to a named argument.
Perhaps using an annotation?
--c