Next step after pychecker

System Administrator skip at pobox.com
Wed Feb 2 11:13:18 EST 2005


    Francis> But Skip, I am sure that you can easily find an example by
    Francis> yourself. For example, replace "+" by a function that does
    Francis> different things depending on its argument type.

Sure.  I was thinking of the optimization use of type inferencing,
forgetting the subject of the note.

Coming back to this:

    1- if a is None:
    2-   b = 1
    3- else:
    4-   b = "Phew"
    5- b = b + 1

pychecker should be able to warn you today (but it doesn't) that you are
using b to refer to objects of two different types.  It's not type
inferencing, but it would probably be a reasonable addition to its suite of
things it checks.

Skip



More information about the Python-list mailing list