Anthony Sottile <asott...@umich.edu> added the comment:

at least for static analysis of other python constructs it's very convenient to 
know from a `Name` node alone whether it's being used in a read or write 
context -- without this information an ast traversal needs to maintain more 
information about whether it's a read or write context

for pyflakes this is especially important as it needs to know what names are 
defined in scope (and referenced in scope) to produce diagnostic messages

for other tools like `dead` / `vulture` it's useful to identify introduced and 
referenced names similarly

the `as` in `with` does and the target for assignment expressions so I would 
expect the similar constructs in `match` to do so as well

`Name` nodes are also useful for better diagnostic messages as they contain 
positioning information, which isn't easily extracted from `MatchAs`, etc. -- 
if I recall correctly, the `asname` for imports was recently extended to add 
this information for the same purpose

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43994>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to