Closed mixilchenko closed 1 year ago
Importing Path
in b.py
is a workaround
I guess here we should also iterate through class mro and add globals from base class modules
@lebrice I can fix it if this solution is fine for you Also for now I can't imagine how to write test for this use case.
Hey @mixilchenko, thanks for posting this.
Yeah that solution makes sense to me.
There are some small complications that might arise, but that we can probably ignore for now. For example, if in the module of the base class, some annotation e.g. Foo refers to some class Foo, while in the scope of the other module, the same name refers to another class Foo, then the first Foo class should be used.
Feel free to make a PR for this, if you have a fix in mind, I'd be very grateful :)
As for tests, I suggest creating a folder under test
with these exact modules.
Running
python b.py -h
gives an error