import_checker 1.1
import_checker checks Python programs for circular (or recursive) imports. Python is a fine programming language
|
|||||||||||||||||||
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:
What's New in This Release:
tags
Download import_checker 1.1
Authors software
|
|
|
|
Similar software
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Other software in this category
|
|
|
|
|
|
|
|
|
|
Featured Software
jEdit 4.3 pre8
jEdit is an Open Source text editor written in Java
Opera 9.02
Surf the Internet in a safer, faster, and easier way with Opera browser
GNU Aspell 0.60.4
GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell
- Communications
- Database
- Desktop Environment
- Games
- Internet
- Multimedia
- Office
- Programming
- Science and Engineering
- System
- Text Editing&Processing
