On Sat, Dec 04, 2021 at 11:39:00PM -0500, David Mertz, Ph.D. wrote:

> Wow! That's an even bigger teaching nightmare than I envisioned in  my
> prior post.  Nine (3x3) different kinds of parameters is already too big of
> a cognitive burden.  Doubling that to 18 kinds makes me shudder. I admit I
> sort of blocked out the positional-only defaults thing.

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.

There are three calling conventions for parameters:

- positional only
- positional or keyword
- keyword only

and currently two states:

- no default
- default

which makes 3x2 = 6, not 9. Adding a distinction between early and late 
defaults would make it 3x3=9, not 18.

But surely you don't teach those six (or nine) permutations as 
*independent* features to be learned by rote as separate concepts? Of 
course when you enumerate through all the possibilities, you get six 
seperate choices (positional only with no default, etc), but I would 
hope you aren't teaching them as six independent concepts!

The calling convention and the presence of a default are concepts which 
are orthogonal to each other, so we need only teach them as two choices:

- choose a calling convention (and by all means leave out positional 
  only in an introductory course for beginners);

- choose whether or not to supply a default.

If the PEP is accepted, it doesn't double the number of choices. It just 
adds one more:

- choose between no default, early default or late default.

-- 
Steve
_______________________________________________
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/K4GMDFOUJXN6XJI2LSGVFCOWG4VMWMNA/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to