Issue warning if no "return" in function?

P

Poster28

What would you suggest to check python programs for non-syntax error.
One example I could think of that one might forget to "return" a value from
a function.

How could I check for these and maybe other mistakes?
 
P

Paul McGuire

What would you suggest to check python programs for non-syntax error.
One example I could think of that one might forget to "return" a value from
a function.

How could I check for these and maybe other mistakes?

Check out PyLint (http://www.logilab.org/857) or PyChecker (http://
pychecker.sourceforge.net/).
 
A

alex23

What would you suggest to check python programs for non-syntax error.
One example I could think of that one might forget to "return" a value from
a function.

How could I check for these and maybe other mistakes?

I really recommend getting into the habit of writing tests for all of
your programs. I like the test-driven approach; write a test that
reflects the behaviour you want and -then- write your code. If it
doesn't succeed, there's most likely something wrong with your code.

Test-Driven Development in Python:
http://www.onlamp.com/pub/a/python/2004/12/02/tdd_pyunit.html

nose (a very nice test runner):
http://code.google.com/p/python-nose/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top