Duplicate importing of functions
examples/modules/duplicate_add_from_module.py
from mycalc import add print(add(2, 3)) # 5 from mymath import add print(add(2, 3)) # 6 from mycalc import add print(add(2, 3)) # 5
The second declaration silently overrides the first declaration.
pylint can find such problems, along with a bunch of others.
pylint --disable=C duplicate_add_from_module.py
************* Module duplicate_add_from_module duplicate_add_from_module.py:4:0: W0404: Reimport 'add' (imported line 1) (reimported) duplicate_add_from_module.py:7:0: W0404: Reimport 'add' (imported line 1) (reimported) ------------------------------------------------------------------ Your code has been rated at 6.67/10 (previous run: 5.00/10, +1.67)