Mitigating python deprecation message frustrations by improving the design of deprecation message handling

That’s a good summary, but note that
import __main__ is OK, since that does get a hit in sys.modules. It’s import pkg.__main__ (as well as any relative imports that resolve to that) that triggers the duplicate import.

1 Like