Implemented warning about inconsistent usage of return statements 
Author Message
 Implemented warning about inconsistent usage of return statements

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.*-*-*.com/ ~skip/python/

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

Skip Montanaro | http://www.*-*-*.com/

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

<P><A HREF=" http://www.*-*-*.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) ----------

Python Language Home Page:   http://www.*-*-*.com/
Python Quick Help Index:     http://www.*-*-*.com/
------------------------------------------------------------



Wed, 13 Mar 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. inconsistent [return] at level #0

2. (why) inconsistent yield/return syntax?

3. Compiler warning in Macro usage

4. Tcl_ResetResult usage and WARNING

5. Synopsys warning (Statement never reached)

6. How to implement a continue statement in Ada?

7. How to implement a continue statement in Ada?

8. Usage of if statements - Need help!!

9. Structure and Data Statement Usage

10. Implementing Expect if-statements

11. WARNING: Returned non-Integer object from callback

12. Implementing virtual functions that return reference to self

 

 
Powered by phpBB® Forum Software