[Zope3-dev] Overriding standard library modules
Barry Warsaw
barry@python.org
11 Apr 2003 11:04:29 -0400
On Thu, 2003-04-10 at 16:09, Barry A. Warsaw wrote:
> I've run into a situation where I need to -- in some cases -- override
> a Python standard library module.
> - Finally, we could create a pythonlib package but not put it on
> sys.path. Then you'd have to do "from pythonlib.gettext import
> blah" and pythonlib.gettext would do the right thing. It would use
> a version check to see if the Python you're using has the right
> gettext module and if not, import one from
> pythonlib.compatXY.gettext where X and Y are the major and minor
> revs of the Python executable. If that raises an ImportError, then
> we just import the global (i.e. standard) module and use it.
I haven't seen any comments on this and I want to move on, so I'm just
going to check all this in. It would be easy enough to change later if
people end up hating it.
-Barry