[Python-Dev] PEP 414 - Unicode Literals for Python 3

Vinay Sajip vinay_sajip at yahoo.co.uk
Tue Feb 28 17:29:44 CET 2012


Steven D'Aprano <steve <at> pearwood.info> writes:

> I don't think it's fair to say it makes it *more* painful. Fair to say it 
> doesn't make it less painful, but adding u'' to 3.3+ doesn't make it harder to 
> port from 2.x to 3.1+. You're merely no better off with it than without it.

No, it actually does make it *more* painful in some scenarios. Let's say Django
decides to move to 3.x using a single codebase starting with 3.3, using PEP 414
to avoid changing u'xxx' in their source code. This is dandy for 3.3, and say I
have to work with Django on 2.6, 2.7 and 3.3. Great - I make some changes, I run
tests on 2.x, 3.3 - make changes as needed to fix failures, then commit. And on
to the next set of changes.

Now, suppose I also need to support 3.2, in addition to the other versions. I
don't get the same easy workflow I had before: for 3.2, I have to run Armin's
hook to remove the u'' prefixes between making changes and running tests, *every
time*, but the output will be written to a separate directory, and I may have to
maintain a separate test environment there in terms of test data files etc. It's
exactly the complaint the PEP makes about having to have 2to3 in the workflow,
and how that hurts your productivity! Though the experience may differ in degree
because Armin's tool is faster, it's not going to make for a seamless workflow.
Especially not if it has to run over all the files in the Django codebase. And
if it's going to know only which files have changed and run only on those, how
does it propose to do that, independently of my editing tools?

Regards,

Vinay Sajip



More information about the Python-Dev mailing list