<div dir="ltr">Python's 'in' keyword has already several use cases, whether it's for testing inclusion in a set, or to iterate over that set, nevertheless, I think we could add one more function to that keyword.<div><br></div><div>It's not uncommon to see star imports in some sources. The reason that people use star imports are mainly the following :</div><div><br></div><div>- ease of use of the module's function</div><div>- overwriting parts of a module with another module's similarly named functions.</div><div><br></div><div>Obviously, there are plenty of cases where you don't want your module's functions to be overwritten, but sometimes, you do. I'm suggesting that the in keyword would be used to import a module in another module's namespace, with the following syntax :</div><div><br></div><div>import numpy as np</div><div>import math in np</div><div><br></div><div>This has two advantages over star imports :</div><div><br></div><div>1/ You keep a namespace. For maintainability reasons, it's best to use namespaces</div><div>2/ You can overwrite parts of a module with another one</div><div>3/ IDEs would know which modules have been imported and which functions are defined there, which they can't have with star imports.</div><div><br></div><div>Additionnally, The following syntax would also be valid :</div><div><br></div><div>import math</div><div>import numpy in math</div></div>