Changes between Version 4 and Version 5 of python2and3CompatiblityEN
- Timestamp:
- Jun 13, 2013, 1:11:53 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
python2and3CompatiblityEN
v4 v5 40 40 If 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. 41 41 42 == Text vs binary data == 43 Python 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 42 45 == Unicode handling == 46 The ''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. 43 47 44 48 == Library renaming ==