On Wed, Nov 18, 2020 at 11:39 AM Brett Cannon <br...@python.org> wrote:

> My question about adding pattern matching later was more to comment on the
> fact that the languages that use "_" for a wildcard pattern did it from
> early on, not later on; it had nothing to do with the proposal proposing
> pattern matching late in Python's history.
>

I suspect that historically there is a connection here; we used "_" in
Python for a number of special purposes because it's defined to be an
identifier by the lexer but not likely to be used as a "regular"
identifier, being kind of an edge case. Like Python, many other languages
inherited this from C, with its definition of identifiers as "letter
(letter|digit)*" where "_" is considered a letter.

Also, in Scala its usage in patterns is similarly different from the rest
of the language; there, too, it is a normal variable name except in
patterns.

PS. Why do you think that this is "late in Python's history?" In 100 years
people will chuckle about that. :-)

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/5VBDCGYHWFZM3C4AB5364M7XY4H3ZSUE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to