Is there a way to "inject" something into a module right before it's loaded?<div><br></div><div>For instance, a.py defines "foo". b.py print()s "foo". </div><div><br></div><div>I want to load b.py into a.py, but I need to let b.py know about "foo" before it can execute.</div>
<div><br></div><div>Is this any way to achieve this?</div><div><br></div><div>-- Jonas</div>