Experience of Python's “PEP-302 New Import Hooks”
Posted
by
Koichi Sasada
on Programmers
See other posts from Programmers
or by Koichi Sasada
Published on 2012-06-26T05:35:04Z
Indexed on
2012/06/26
9:22 UTC
Read the original article
Hit count: 348
I'm one of the developers of Ruby (CRuby). We are working on Ruby 2.0 release (planned to release 2012/Feb).
Python has "PEP302: New Import Hooks" (2003):
This PEP proposes to add a new set of import hooks that offer better customization of the Python import mechanism. Contrary to the current import hook, a new-style hook can be injected into the existing scheme, allowing for a finer grained control of how modules are found and how they are loaded.
We are considering introducing a feature similar to PEP302 into Ruby 2.0 (CRuby 2.0). I want to make a proposal which can persuade Matz. Currently, CRuby can load scripts from only file systems in a standard way.
If you have any experience or consideration about PEP 302, please share.
Example:
- It's a great spec. No need to change it.
- It is almost good, but it has this problem...
- If I could go back to 2003, then I would change the spec to...
I'm sorry if such a question is not suitable for here. I posted here because I'm not sure that I can ask this question at python-dev (of course, the list is not for cruby development).
This post is moved from http://stackoverflow.com/questions/11188229/experience-of-pythons-pep-302-new-import-hooks.
© Programmers or respective owner