[Python-ideas] namespace for backported stdlib modules?

Robert Collins robertc at robertcollins.net
Wed Oct 22 00:43:56 CEST 2014


Sorry for not seeing this one - it went to my spam folder - I've
hopefully sorted that out for future messages.

-Rob

On 21 October 2014 14:41, Ian Cordasco <graffatcolmingov at gmail.com> wrote:
>
> 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



-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud


More information about the Python-ideas mailing list