On Wed, Mar 1, 2017 at 2:31 AM, Nicolas Cellier
<cont...@nicolas-cellier.net> wrote:
> For example:
>
>> lazy import pylab as pl  # do nothing for now
>>
>> # do stuff
>>
>> def plot(*args):
>>     pl.figure() # Will raise an ImportError at this point
>>     pl.plot(...)

This can already be achieved without introducing a new keyword by
using LazyLoader:
https://docs.python.org/3/library/importlib.html#importlib.util.LazyLoader

--Berker
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to