diveintopython icon indicating copy to clipboard operation
diveintopython copied to clipboard

Python 3 compatibility

Open joshgachnang opened this issue 13 years ago • 3 comments

Various things, such as print being a function in 3, should be mentioned and used when possible in the book. Python 2.7 supports many of Python 3's features, and the book should be written to make the transition easier. Update all the print statements, ensure sorted() vs .sort, etc.

joshgachnang avatar May 20 '12 20:05 joshgachnang

As mentioned in another issue, the book should also exclusively use the new string formatting.

joshgachnang avatar May 20 '12 20:05 joshgachnang

List of updates: print() .format() urllib.urlopen is now urllib2.urlopen() integer division from __ future __ import ?UPDATE?

CrazyPython avatar Jan 27 '13 15:01 CrazyPython

Add more to the list then delete your comment once I added it.

CrazyPython avatar Jan 27 '13 15:01 CrazyPython