I tried with this code:
```
from dataclasses import dataclass
@dataclass
class Point:
x: int
y: int
z = 41
def whereis(point):
w = 23
match point:
case Point(0, 0):
print("Origin")
case Point(0, y):
print(f"Y={y}")
case Point(x, 0):
print(f"X={x}")
case Point():
print("Somewhere else")
case 23:
print("Not the answer")
case w:
print("Not the answer, local w")
case z:
print("The answer")
case _:
print("other")
whereis(42)
```
It retuend:
```
Not the answer, local w
<>:23: SyntaxWarning: unguarded name capture pattern makes remaining cases
unreachable
<>:23: SyntaxWarning: unguarded name capture pattern makes remaining cases
unreachable
<ipython-input-12-a56535d2d86c>:23: SyntaxWarning: unguarded name capture
pattern makes remaining cases unreachable
case w:
```
It seems not the return I except.
_______________________________________________
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/SFY23W4UTT7VJZAW6WLPJ3UQEHUCXMQB/
Code of Conduct: http://python.org/psf/codeofconduct/