Hi Simon
You've suggested allowing
import numpy as np
import math in np
as an improvement on
from somewhere import *
But you can get a similar result already, by writing in your package
import .aaa as np
and within mypackage/aaa.py writing
from numpy import *
from math import *
When you write
import numpy as np
the value of the identifier becomes the numpy module. Your proposal
aims to add to that module additional key-value pairs. (A module is a
bit like a dict.) And perhaps clobber some existing resources.
It's generally best to treat a module as a read-only object. That way,
you don't get side-effects. This is why Chris was talking about
monkey-patching.
--
Jonathan
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/