[Python-ideas] Class autoload
Jamesie Pic
jpic at yourlabs.org
Sat Mar 3 12:12:06 EST 2018
Hello everybody,
I thought perhaps we could allow the usage of a "new" keyword to
instanciate an object, ie:
obj = new yourmodule.YourClass()
In this case, it would behave the same as from yourmodule import YourClass;
obj = YourClass(), except that it wouldn't need to be imported. This would
also eliminate the need to manage an import list at the beginning of a
script in most case.
I'm really not proud of this idea but PHP has had autoload for years and
when i open scripts with hundred lines of imports it makes me think Python
could do something about this.
Thanks in advance for your feedback
Best regards
--
∞
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180303/8b9ef467/attachment.html>
More information about the Python-ideas
mailing list