Issue warning if no "return" in function?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Poster28

    Issue warning if no "return" in function?

    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?

  • Paul McGuire

    #2
    Re: Issue warning if no "return&qu ot; in function?

    On Sep 4, 5:05 am, Poster28 <usen...@anton. e4ward.comwrote :
    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.sourc eforge.net/).

    Comment

    • Wojtek Walczak

      #3
      Re: Issue warning if no &quot;return&qu ot; in function?

      On Thu, 04 Sep 2008 12:05:45 +0200, Poster28 wrote:
      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 pychecker or figleaf:



      --
      Regards,
      Wojtek Walczak,
      Cena domeny: 4999 PLN (do negocjacji). Możliwość kupna na raty od 624.88 PLN miesięcznie. Oferta sprzedaży znajduje się w serwisie Aftermarket.pl, największej giełdzie domen internetowych w Polsce.

      Comment

      • alex23

        #4
        Re: Issue warning if no &quot;return&qu ot; in function?

        On Sep 4, 8:05 pm, Poster28 <usen...@anton. e4ward.comwrote :
        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:
        Now, next, and beyond: Tracking need-to-know trends at the intersection of business and technology


        nose (a very nice test runner):

        Comment

        Working...