Autoloader (was Re: CSV Error)

Skip Montanaro skip.montanaro at gmail.com
Sun Dec 28 09:15:31 EST 2014


> We were discussing something along these lines a while ago, and I
> never saw anything truly satisfactory - there's no easy way to handle
> a missing name by returning a value (comparably to __getattr__), you
> have to catch it and then try to re-execute the failing code, which
> isn't perfect. How does yours work? Or was it one of the ones that was
> mentioned last time?

Just like that. I've attached a copy. As you said, I'm sure it's not
perfect, but it's handy in precisely those interactive interpreter
cases when *dope slap* you forgot to import a standard module before
launching into a block of code.

Skip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: autoload.py
Type: text/x-python-script
Size: 1730 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20141228/7a66265d/attachment.bin>


More information about the Python-list mailing list