Changes between Version 4 and Version 5 of python2and3CompatiblityEN


Ignore:
Timestamp:
Jun 13, 2013, 1:11:53 AM (11 years ago)
Author:
Martin Kolman
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • python2and3CompatiblityEN

    v4 v5  
    4040If Python 2.5 doesn't have to be supported, just using the ''as'' syntax is enough for the exception handling code to be Python 2.6-3.3+ compatible.
    4141
     42== Text vs binary data ==
     43Python 3 tries to enforce quite strong type checking for text vs binary data. There for all ''open'' calls need to properly use the ''b'' flag with working with binary data. Python 2 also understands this flag, so keeping file opening compatible is easy.
     44
    4245== Unicode handling ==
     46The ''u'' prefix used for marking up Unicode data in Python 2 is gone in Python 3.0-3.2, but was reintroduced in Python 3.3. The ''six'' compatibility library has the ''u()'' function, that can be used the replace the ''u'' prefix and abstract it's behavior in Python 2 & 3.
    4347
    4448== Library renaming ==