pyndustric icon indicating copy to clipboard operation
pyndustric copied to clipboard

Support imports of additional modules

Open Lonami opened this issue 4 years ago • 0 comments

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:

  1. Assume the imported function is self-contained.
  2. Actually validate that the function is self-contained an error at compile time, to prevent running broken mlog.
  3. 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).

Lonami avatar Jan 10 '21 10:01 Lonami