pyndustric
pyndustric copied to clipboard
Support imports of additional modules
Split off https://github.com/Lonami/pyndustric/pull/12/files#diff-852dce7acd90bf3bfbde1cec63522f7204b9c209cc52b3e40d23bb6f3202ef7fR54-R55.
It would be necessary to inspect import
statements and figure out what's used from them.
This issue won't be easy to tackle, because even if the user does from foo import bar
, bar
might be relying on the baz
or even be compiled conditionally depending on qux
. From an implementation-perspective:
- Assume the imported function is self-contained.
- Actually validate that the function is self-contained an error at compile time, to prevent running broken mlog.
- Smarter imports which will be able to handle some of the cases where 2. errors out (probably not possible to handle them all without extreme clutter).