On Wed, Jun 24, 2020 at 10:11 AM Guido van Rossum
On Tue, Jun 23, 2020 at 4:41 PM MRAB
wrote: On 2020-06-23 22:50, Barry Warsaw wrote:
On Jun 23, 2020, at 14:31, Chris Angelico
wrote: I can't find it among the rejected alternatives, but was it considered to use "..." as the wildcard, rather than "_"? It carries similar meaning but its special case of "this will never be bound" is simply preventing an error, rather than making one otherwise-valid name special.
I thought of that too as I was reading the PEP, but forgot to add it to my notes. I do like ellipsis more than underscore here.
+1
The problem is that ellipsis already has a number of other meanings, *and* is easily confused in examples and documentation with leaving things out that should be obvious or uninteresting. Also, if I saw [a, ..., z] in a pattern I would probably guess that it meant "any sequence of length > 2, and capture the first and last element" rather than "a sequence of length three, and capture the first and third elements". (The first meaning is currently spelled as [a, *_, z].)
Ah, yes, very good point. Agreed. ChrisA