-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: refactor geometry matching clauses with Python 3.10's pattern matching #5051
RFC: refactor geometry matching clauses with Python 3.10's pattern matching #5051
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I like this a lot more. Thank you.
Quick question -- is there something about the way the |
is evaluated in the cases that means it has to be put in the case? Or, could we create top-level special cases like HAS_Z_AXIS
for CARTESIAN | POLAR | SPECTRAL_CUBE
?
If you're asking if
I think this would be achievable using |
Me neither! I think the first answer, that |
I want to push couple times to this branch before I can undraft this. |
cd4e4f1
to
ad90a6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i'm now convinced of match/case's usefulness :) I was kinda ambivalent about it before.
I'll merge now to save myself some conflict solving later. |
PR Summary
Now that we don't support 3.9 anymore we have access to
match
/case
statements (pattern matching). Arguably this improves readability in these instances, albeit at the cost of an additional indentation level.