Pyflakes' goal is to be useful. It does not try to fit into any particular formal mathematical framework.
Personally, I avoid the question of what pyflakes should do in this case by not using locals() to interpolate into strings. I don't find that this constrains my ability to write programs easily.
I would say that injecting `locals` into a scope and expecting Pyflakes to behave correctly in that case is more unreasonable than expecting locals() interpolated into a string literal to mark the keys in the string literal as used locals. So, go ahead and submit a branch implementing this feature.
Pyflakes' goal is to be useful. It does not try to fit into any particular formal mathematical framework.
Personally, I avoid the question of what pyflakes should do in this case by not using locals() to interpolate into strings. I don't find that this constrains my ability to write programs easily.
I would say that injecting `locals` into a scope and expecting Pyflakes to behave correctly in that case is more unreasonable than expecting locals() interpolated into a string literal to mark the keys in the string literal as used locals. So, go ahead and submit a branch implementing this feature.