[Python-Dev] Catching "return" and "return expr" at compile time

Guido van Rossum guido@CNRI.Reston.VA.US
Tue, 07 Sep 1999 11:20:47 -0400

This is a valuable service!  Even though I'm sure that it will cause
some pain for people who were used to this programming style...

I'm not sure I like the fact that you can't turn it off --
traditionally, Python has had a "no warnings" policy.  That has been
diluted a bit (python -t prints warnings) but so far it has been the

I'm wondering if we should introduce a general '-w' flag to turn on
warnings like this (which would subsume -t)?  Or perhaps there should
be a -W flag ("no warnings") and warnings should be the default?

There are also platform problems, e.g. on the Mac, stderr doesn't
always exist, and on Windows, it doesn't exist if pythonw.exe is

--Guido van Rossum (home page: http://www.python.org/~guido/)