Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Bug Tracking

    import_checker 1.1

    Download button

    Downloads: 421  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Walter de Jong | More programs
    GPL / FREE
    October 24th, 2006, 18:35 GMT
    ROOT / Programming / Bug Tracking

     Read user reviews (0)  Refer to a friend  Subscribe

    import_checker description

    import_checker checks Python programs for circular (or recursive) imports.

    import_checker checks Python programs for circular (or recursive) imports.

    Python is a fine programming language. There is one horrendous thing with it though, that bites even the most experienced python programmers every now and then: the scope of variables.

    We've been taught to use the keyword 'global', and heartily do so. Still, problems occur when running into a "recursive import" problem.

    Example:

    ### program A ###

    import B

    var = 0

    if __name__ == '__main__':
    var = 10
    B.doit()

    ### module B ###

    import A

    def doit():
    print A.var

    ### end of example ###

    Module B will see A.var having value 0, even though in program A we assigned it a value of 10. Python is right and it is not a python bug, but it is $#@! confusing and it is being caused by the recursive import; A imports B, and B imports A.

    The import_checker.py is a tool that detects recursive imports.

    This problem only occurs for global variables in modules.

    The best way of solving the problem is to put 'var' into a new module C,
    and import C from both A and B.

    Requirements:

    · Python

    What's New in This Release:

    · The Python source files are now read using the shlex lexical scanner.



    Product's homepage

      


    TAGS:

    checks Python programs | circular imports | Python checker | import_checker | checks | Python

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM