Yup, that's what the PEP seems to suggest.
This along with mutable default values is going to be one of the nastier Python warts.
This along with mutable default values is going to be one of the nastier Python warts.
This is already special-cased in the standard library for, say, set union (where admittedly the concept is more similar to bitwise or).
Thanks for proving my point though!
match event.get():
case Click(position=(x, y)):
handle_click_at(x, y)
case KeyPress(key_name="Q") | Quit():
game.quit()
where `Click(position=(x, y))` is not at all what one would expect.What I still don't understand is: does the new syntax magically do this to a user-defined class? i.e. if I say
foo = Click(position=(x, y))
vs ...
case Click(position=(x, y))
those identical expressions, for the same value of Click, have widely different semantics?edit: typo fix