Python 3

Ben Finney ben+bazaar at benfinney.id.au
Wed Jun 23 00:52:54 BST 2010


Robert Collins <robertc at robertcollins.net> writes:

> Adding a _u() decorator - like Benjamins patch in testtools - to make
> that explicit would be a fine step, and one that slipped my mind at
> the start of this thread.

Why not simply use Python 2's “u'foo'” syntax?

This doesn't entail maintaining two separate code bases: rather the
Python 2 code base is what gets maintained. A run of ‘2to3’ followed by
the full test suite run under Python 3 can be an indicator of how ready
the code base is for Python 3.

(This doesn't cover C modules, but they're a separate headache either
way.)

Eventually, the decision is made to switch to Python 3. This is only
done some time after the ‘2to3’-output passes the full test suite under
Python 3.

So why would this ‘_u()’ shim be necessary or desirable?

-- 
 \      “Software patents provide one more means of controlling access |
  `\      to information. They are the tool of choice for the internet |
_o__)                                     highwayman.” —Anthony Taylor |
Ben Finney




More information about the bazaar mailing list