[Python-ideas] namespace for backported stdlib modules?
Robert Collins
robertc at robertcollins.net
Tue Oct 21 03:18:54 CEST 2014
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
--
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud
More information about the Python-ideas
mailing list