Is it possible to keep everything still working when I place a python class to somewhere else, without editing the caller and callee? -


i'm starting use python real things , realized related importing folder mess. know whether can "project dependencies" in other ides link own projects together, or can library me, can many application frameworks.

let's have project looks this:

{root} -- foo ---- foo.py ------class foo() -- bar ---- bar.py ------class bar() 

you use tricky import commands modifying sys.path , pythonpath or use relative lookups doesn't work anymore when class bar moved somewhere else, plus problem using different script entry point cause interpreter lost.

simply speaking, what's best way avoid kind of import errors in clean manner? i'm not talking can pypi. there seems full-stack solutions out there can't find details on them.

i see solution similar many oop languages moving class folder doesn't affect anything, object binding.


Comments