Means of avoiding accidental import of/from an Implicit Namespace Package

More than once, I've had bugs that were hard to track down because I was accidentally using an implicit namespace without realizing it. The last time this happened, it was a typo, and my init file was named `_init__.py` instead of `__init__.py`. The init file imported from sub-modules, including 1 with a class that was supposed be be registered via an `__init_subclass__` callback that was not happening. I'm sure that implicit namespace packages are here to stay, and I imagine I will actually want to use them on purpose at some point, but it would be nice if we could come up with a straightforward way to avoid the accidental usages. One idea that comes to mind is to add a new built-in context manager within which the importing of a purely implicit namespace raises an exception.
participants (1)
-
Steve Jorgensen