On Sun, Dec 5, 2021 at 6:44 PM Steven D'Aprano <st...@pearwood.info> wrote:

> How do you get nine in the first place? Putting aside *args and
> **kwargs, the existing parameter matrix is either 3x2 or 3x2x∞ depending
> on whether you include types as part of the matrix.
> which makes 3x2 = 6, not 9. Adding a distinction between early and late
> defaults would make it 3x3=9, not 18.
>

I probably counted wrong.  I wrote it late last night in my timezone.  I
think trying again, we actually have this currently:

position-only, no default
position-only, early default
position-or-keyword, no default
position-or-keyword, early default
keyword-only, no default  (weird one that I've definitely never used before
just now)
keyword-only, early default

Under the proposal we'd add:

position-only, late default
position-or-keyword, late default
keyword-only, late default

It's not nearly as much as I was thinking.  Of course, it *is* a 50%
increase in the number of parameter types.  Still, that's not the main
reason I oppose the PEP.  I don't really think any of these are fully
orthogonal.  But the number isn't absurdly large.

Hmm... I suppose `*args` and `**kws` are also different types as well.  Of
course, defaults don't make sense for those. So maybe eleven rather than
nine (and lower percentage increase).

--
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/24SQ7VNEFFWA5JHFVCVNMJ6KH32I3R6Z/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to