[Import-SIG] importlib2

Brett Cannon bcannon at gmail.com
Wed May 28 15:44:06 CEST 2014

On Wed May 28 2014 at 12:55:00 AM, Eric Snow <ericsnowcurrently at gmail.com>

> Hi all,
> Motivated at PyCon by the "pymigrate" discussions, I started
> backporting importlib to 2.7.  I've finally freed up some time in the
> last week or so and have come close to having the project ready to
> release on the cheeseshop (as importlib2).  I'm hosting the repo and
> bug tracker on bitbucket:
> https://bitbucket.org/ericsnowcurrently/importlib2
> Feel free to take it for a spin.  Keep in mind that any functionality
> that depends on the no-longer-implicit import state (finders/path
> hooks) will not work without first calling importlib2.hook.inject().
> That includes importlib2.import_module().  If you notice any other
> rough corners just let me know.
> There are a few minor things I want to wrap up before officially
> releasing the project, but that shouldn't take much work.  In parallel
> I'm going to start working on the pymigrate* project, which will
> leverage importlib2 and importers to facilitate per-module enforcement
> of the 2.7/3.x intersection language.

You'll have to refresh my memory because there were a lot of ideas tossed
out at PyCon: why an importer and not some custom rules for pylint? E.g. I
can see requiring that either ``from __future__ import unicode_literals``
or every string literal being marked with u or b being a rule, but I don't
see the exact benefit of that over an importer (I realize that a per-file
thing is desired, but tooling for that should be possible as well).

Anyway, this discussion should probably happen on the python-porting list
since that's the audience more interested in this topic. =)

> Lastly, I can never offer enough thanks to Brett Cannon for importlib
> and its thorough test suite.  It's made the backporting job possible
> (and almost easy).  Thanks Brett!

Glad it helped someone else out! If I ever needed a personal example of why
testing is important, importlib is it (there has been hardly any bugs about
importlib which still continues to astound me).


> -eric
> * Go go gadget bikeshed!
> _______________________________________________
> Import-SIG mailing list
> Import-SIG at python.org
> https://mail.python.org/mailman/listinfo/import-sig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/import-sig/attachments/20140528/9438d076/attachment.html>

More information about the Import-SIG mailing list