For example, to use the | operator for type annotations in <3.10, one can do from __future__ import annotations.
Is something similar possible for structural pattern matching, i.e. writing things like
match x:
case 1:
print("x is 1")
case 2:
print("x is 2")
Sorry, there is no backport. This was a deep change to the language grammar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With