> match get_node() into c:

+1 to scoping name pattern related objects upfront. (mirrors my post, so no 
bias :P)

Using a namespace to group capture variables is a good idea, though new 
attributes are introduced throughout the match block. In my view, this is very 
similar to the use a special character like '$', the difference being that such 
a modifier can be 'named'.

I second your idea of an 'into' keyword to align the match statement with 
others in Python. It was a consideration of mine, but I was likewise wary of 
the first-line verbosity. I think it's worth it for the increased familiarity, 
especially since capture variables are in a sense auxiliary to the match 
statement (so just pop them at the end).

Flattening your capture object into individual variables does this while still 
being explicit from the beginning about what variables can be used for name 
matching:
match get_node() into a, b, c:

As far as the naming of the 'into' keyword, I think yours is a solid candidate. 
Others are sure to present a healthy range of alternatives I'm sure :). My only 
preference would be that the qualification of the match statement is appended, 
rather than done in place like match(a, b, c) get_node():
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/C6EP2L66LBJKT5RHDE6OIKG7KWM2NMLV/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to