Implemented warning about inconsistent usage of return statements

Skip Montanaro
Sat, 25 Sep 99 01:58:40 GMT

As a result of the recent thread in 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:

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

Skip Montanaro | |
847-971-7098   | Python: Programming the way Guido indented...

<P><A HREF="">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 Language Home Page:
Python Quick Help Index: