But none of those limitations are there under our proposal. You can write
this if you want:
match = 1
match match:
case case: print(case, match)
And you can use _(“...”) anywhere in the case block and even in the guard.
Just not as a pattern, but you can’t use f(1) there either...
On Fri, Nov 20, 2020 at 09:44 Jim J. Jewett <[email protected]> wrote:
> Not being able to use a particular variable name (such as match or case)
> in the limited context of matching is only a minor wart. Unfortunately, _
> for internationalization is already a well-established convention for
> something that you might well want to do within each separate case. It
> isn't just that you can't call your variable match; it is that you can't do
> output without renaming what seems like a standard library function.
>
> Not insurmountable, but also not trivial.
> _______________________________________________
> Python-Dev mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/[email protected]/message/PVETCKEWNZI5LCI7BSXKRIHYD77734MJ/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido (mobile)
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/CWB2TFRY6OKANNG6FOX5AY7VG2DVHYS2/
Code of Conduct: http://python.org/psf/codeofconduct/