Closed kmike closed 9 years ago
I love you - I had planned to do exactly this thing!
I were about to add that feature as well. However, I wouldn't even bother to subclass the module type. Note that you can put any kind of objects in sys.modules
. So following code would already be sufficient:
ish._module = sys.modules[__name__]
sys.modules[__name__] = ish
Hi,
Me and @eliasdorneles realized that ish API could be better. We're using it heavily in production, and
from ish import ish
is too verbose and tiresome to type. We wanted to be able to do justimport ish
, which provides a cleaner and DRYer API. The implementation is in this PR.What do you think about it? There are tests and changes are fully backwards compatible.