[Python-ideas] Match statement brainstorm
k7hoven at gmail.com
Tue May 24 10:03:51 EDT 2016
On Tue, May 24, 2016 at 4:31 PM, Michael Selik <michael.selik at gmail.com> wrote:
> On Tue, May 24, 2016 at 2:08 AM Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>> * It could also be abused to get an assigment-in-
>> expression anywhere you wanted. Such things have
>> been rejected before; are we changing our mind
>> on that?
> No, using the assign-if-can operator would be syntax error outside of an
> if/elif, the reverse of how an assign operator is a syntax error inside an if/elif.
I might be stating the obvious, but the `given` expression syntax
could of course also be allowed only inside if/elif, even if I didn't
>> * THere would be no hope of checking for coverage
>> of all cases in a static checker.
> I believe you, though the logic isn't clear to me. Could you explain why?
It's not clear to me either. Maybe there is hope, with a sophisticated
enough checker at some point in the future?
More information about the Python-ideas