[Python-ideas] namespace for backported stdlib modules?
Ian Cordasco
graffatcolmingov at gmail.com
Tue Oct 21 03:41:27 CEST 2014
On Oct 20, 2014 8:25 PM, "Robert Collins" <robertc at robertcollins.net> wrote:
>
> I want to make the improvements in unittest (which transitively
> includes mock and traceback and perhaps inspect ...) available for
> folk that can't use 3.5 yet.
>
> We've currently got the unittest2 and mock as modules on pypi, and
> clearly we can add another e.g. traceback2 as a way to get the
> traceback changes out there.
>
> I'm wondering though if perhaps putting up a namespace package on pypi
> for things in the stdlib - e.g. 'stdlib' (or stdlib2 or something)
> would make sense. In particular that might permit relative imports to
> automatically pick up the other also backported modules without source
> changes.
>
> So we'd have e.g.
> stdlib.unittest
> stdlib.traceback
> stdlib.mock
>
> And then using that would be done through the normal
>
> try:
> from stdlib import unitest
> except ImportError:
> import unittest
>
> dance.
>
> -Rob
There are several packages already named backports.{{module}}. I think they
all use the same namespace too. They're also all maintained by people not
working on the stdlib. For example, backports.ssl is an attempt to backport
python 3's ssl features to python 2 using pyOpenSSL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20141020/a072a8fb/attachment-0001.html>
More information about the Python-ideas
mailing list