[issue40427] importlib of module results in different id than when imported with import keyword

2020-04-29 Thread John Andersen
John Andersen added the comment: Thank you! :) I must have missed that somehow -- ___ Python tracker ___ ___ Python-bugs-list

[issue40427] importlib of module results in different id than when imported with import keyword

2020-04-28 Thread Brett Cannon
Brett Cannon added the comment: That's expected because you are constructing a completely new module object with importlib.util.module_from_spec(). You're also completely circumventing sys.modules with the code you wrote which is the only way you would get equivalent IDs compared to using

[issue40427] importlib of module results in different id than when imported with import keyword

2020-04-28 Thread John Andersen
New submission from John Andersen : When importing a file using importlib the id() of the object being imported is not the same as when imported using the `import` keyword. I feel like this is a bug. As if I have a package which is using relative imports, and then I import all of the files