Opinions are fine. And I agree that this situation is bad and should be fixed. I have said as much both here and on the relevant GitHub issue. One constructive way to give an opinion is to simply post here or on the issue something along the lines of “I got bitten by this and would love to see this fixed.” That kind of feedback is always welcomed and does help to prioritize things when many people indicate that they’ve encountered some problem. What doesn’t help is:
- asserting that doing something is obviously very easy
- expressing outrage that some issue has not been addressed yet
- implying that developers have been sitting around twiddling their thumbs just putting off fixing this one issue
If you had just said “I encountered this and it would be great to have a warning at least” then the reaction would have been “sorry about that, thanks for letting us know”. It’s the other parts of your posts that provoke pushback. In particular, if you express certainty that something must be easy to fix, then it seems fair to assume you know what you’re talking about, in which case it’s also reasonable to suppose that you might be a person who could help fix the issue. If that’s not the case, that’s ok of course, but then how can you be so sure that it’s easy to fix?
For this specific problem, the hard part is not emitting a warning but figuring out under what circumstances to emit it. Here’s a contribution you could make that requires zero programming: under what precise circumstances should code defining inner functions emit a warning? Please keep in mind all the kinds of control flow constructs that may occur, including conditionals, loops, comprehensions, closures, try/catch blocks, and goto. Also keep in mind that we generally cannot break code that currently works (including adding warnings) unless there’s strong evidence based on reasoning through the problem and inspecting code in the wild that the pattern we’re breaking is almost never used in a correct way, in which case a warning can be added, but that analysis has to be done first.