[Python-3000] u'text' as an alias for 'text'?
"Martin v. Löwis"
martin at v.loewis.de
Thu Mar 20 15:01:36 CET 2008
> What about using sys.path_hooks to run 2to3 on the fly at import time?
> It would cache its results, of course.
It would have to do so selectively, and it would be fairly slow (atleast
with the current implementation), but yes, that could also work.
The question then is: what __file__ do you put into the code? The
original one, or the cached one? I'd vote for the cached copy, so
that you get sensible output in tracebacks. It probably should
also mark the cached copy read-only on disk, so that people won't
attempt to edit it. If off-by-one errors are acceptable, it could
also try to put a first-line comment "GENERATED" into it.
Regards,
Martin
More information about the Python-3000
mailing list