2009/11/15 Brett Cannon <br...@python.org>: > On Sat, Nov 14, 2009 at 20:01, Benjamin Peterson <benja...@python.org> wrote: >> 2009/11/14 Nick Coghlan <ncogh...@gmail.com>: >>> This does constrain where we can use itertools - if we want carte >>> blanche to use it anywhere in the standard library, even those parts >>> that are imported as part of the build chain, we'll need to bite the >>> bullet and make it a builtin module rather than a separately built >>> extension module. >> >> I have another unpleasant but slightly less hacky solution. We put >> detect_encoding in linecache where it is actually used. > > Well, it happens to be used by the standard library in linecache, but > not all external uses of it necessarily tie into linecache (e.g. > importlib uses detect_encoding() in some non-critical code). Might > just have to live with sub-optimal code.
Well, what I mean is that we'd do: def _detect_encoding(): in linecache and then "from linecache import _detect_encoding as detect_encoding" in tokenize.py. -- Regards, Benjamin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com