On Wed, Jun 24, 2020 at 2:04 AM Guido van Rossum <gu...@python.org> wrote:
> def http_error(status):
>     match status:
>         case 404:
>             return "Not found"
>         case 418:
>             return "I'm a teapot"
>         case _:
>             return "Something else"
>
> Note the last block: the "variable name" `_` acts as a *wildcard* and
> never fails to match.

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.

> Raw strings and byte strings are supported. F-strings are not allowed (since 
> in general they are not really literals).

It won't come up often, but are triple-quoted strings allowed?

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

Reply via email to