
On Wed, 14 Jun 2023 at 09:05, BoppreH via Python-ideas <python-ideas@python.org> wrote:
@ChrisA: There are already flags for enabling warnings on dangerous bytearray comparisons[1] or relying on locale-dependent encodings[2], not to mention a whole Development Mode flag[3] that adds extra checks. Some of those checks affect fewer people than my proposal. A "warn on reused generators" flag would fit right in, maintain backwards compatibility, and help some people (admittedly less than an opt-out one).
Citation needed, how do you calculate that they affect fewer people than your proposal? The byte/str comparison warning relates to Py2/Py3 changes, which affected huge numbers of people; locale-dependent encodings affect everyone whose systems default to those encodings; and I don't know what the debug build does exactly, but it's specifically meant to cover things that are too expensive to check for normally. Also, question: Would your proposal even be useful to people if they had to run Python with a special parameter to get it? Wouldn't it be just as easy to shadow iter(), like I have already suggested multiple times as a much better way to do this?
And then Chris' messages started rolling in.
Backward compatibility is WAY more important than a lot of proposals seem to acknowledge. You're welcome to hate me for saying it, but frankly, you're also welcome to ignore my posts. I don't have to prove anything to you; the onus is on you to demonstrate the value of your proposal, and at the moment, you've shown a benefit in a very small number of cases, contrasted with a potentially huge number of situations where this would create a spurious warning. Blaming me for the pushback is a tad unfair. But that's your prerogative. ChrisA