Implemented warning about inconsistent usage of return statements

Skip Montanaro skip@mojam.com
Sat, 25 Sep 99 01:58:40 GMT


As a result of the recent thread in c.l.py I was motivated to create a patch
for Python/compile.c that modifies the byte code compiler to warn about
inconsistent use of the return statement within a function.  It's not at all
clear yet where this belongs.  I implemented it in compile.c because I'm
familiar with the code and I knew most people would have it available.  I
think that's probably not the best place for it in the long run.  Still, I'm
making it available now so that people can play around with it.

The patch is available from my Python Bits page:

    http://www.musi-cal.com/~skip/python/

If you have any questions or discover any bugs, let me know.

Skip Montanaro | http://www.mojam.com/
skip@mojam.com | http://www.musi-cal.com/~skip/
847-971-7098   | Python: Programming the way Guido indented...

<P><A HREF="http://www.musi-cal.com/~skip/python/">Inconsistent return
warning patch</A> -  a patch that makes Python warn about inconsistent use
of the <CODE>return</CODE> statement within a function.  (10-Sep-99)

-- 
----------- comp.lang.python.announce (moderated) ----------
Article Submission Address:  python-announce@python.org
Python Language Home Page:   http://www.python.org/
Python Quick Help Index:     http://www.python.org/Help.html
------------------------------------------------------------