(prepep) Preventing future issues with warnings as errors

The interpreter could be updated to stuff the warnings in a buffer during compilation. After completion of parsing the *py file, any unfiltered warnings from the buffer could be emitted then.

It would need to be at runtime because the filterwarnings function isn’t being processed by any part of the compiler in a meaningful degree. And then you get exactly the behavior already described via RuntimeSyntaxWarning above.

2 Likes

What’s stopping the compiler from processing them?

1 Like