Hdl21
Hdl21 copied to clipboard
Drop special paths (like `__main__` especially) from exported Module paths
The paths we export, which eventually (can) become _importpath
s, could get smarter.
Example:
import hdl21 as h
m = h.Module(name="MyName")
print(m._importpath)
pkg = h.to_proto(m)
ns = h.from_proto(pkg)
print(ns.__main__.MyName._importpath)
Yields
None
['__main__']
The __main__
in that namespace-path is, well, pretty lame.
I recall thinking we should special-case that out (and maybe __init__.py
as well).
I do not recall whether I ever tried, or hit any roadblocks.
Originally https://github.com/dan-fritchman/Hdl21/issues/176#issuecomment-1700280538