PEP 302 Example: New Import Hooks
问题 Where can I find an example implementation of the "New Import Hooks" described in PEP 302? I would like to implement a custom finder and loader in the most forward compatible way possible. In other words, the implementation should work in python 2.x and 3.x. 回答1: You can find thousands of open-source examples e.g. with a google code search, here it is: http://www.google.com/codesearch?hl=en&lr=&q="imp.find_module"+"imp.load_module"&sbtn=Search Edit: as the questioner clarified he's looking