Python equivalent to PHP's SPL __autoload() ??

Max Erickson maxerickson at
Mon Apr 28 00:54:15 CEST 2008

Ixiaus <parnell.s at> wrote:

> I was curious (and have spent an enormous amount of time on Google
> trying to answer it for myself) if Python has anything remotely
> similar to PHP's SPL __autoload() for loading classes on the fly??
> After digging through docs I feel doubtful there is such a language
> feature, but, it is possible I missed something or maybe someone has
> written an extension?!?
> Thanks in advance!
> --

If I'm understanding __autoload() correctly, not in the box, but most 
of what you need is built in, you just have to do a little work to use 
it. See the "Loading and reloading modules" section on this page:


More information about the Python-list mailing list