90% of Python in 90 Minutes (2013)
slideshare.net
90% of Python in 90 Minutes (2013)
1–10 of 61 posts
Re: 90% of Python in 90 Minutes (2013)
#2Re: 90% of Python in 90 Minutes (2013)
#3Although this ignores most of the differences between Python 2 vs 3, note that there will be differences in iterables, classes, and print functions. Feel free to comment if you aware of any more.
I think [1] and [2] are good places, not sure if there's an absolutely easy-to-navigate summary from 2-3.
[1]: https://docs.python.org/3/howto/pyporting.html [2]: http://python-future.org/compatible_idioms.html
Re: 90% of Python in 90 Minutes (2013)
#4Although this ignores most of the differences between Python 2 vs 3, note that there will be differences in iterables, classes, and print functions. Feel free to comment if you aware of any more.
Re: 90% of Python in 90 Minutes (2013)
#5Although this ignores most of the differences between Python 2 vs 3, note that there will be differences in iterables, classes, and print functions. Feel free to comment if you aware of any more.
Also relative/absolute imports can cause some confusing bugs.
Re: 90% of Python in 90 Minutes (2013)
#6Although this ignores most of the differences between Python 2 vs 3, note that there will be differences in iterables, classes, and print functions. Feel free to comment if you aware of any more.
Generally projects that suffer from the str/bytes/unicode mess is the hardest to port in my experience as 2to3 can't really help. Also relative/absolute imports can cause some confusing bugs.
Re: 90% of Python in 90 Minutes (2013)
#7Instead focus on what is special about Python like indentation and colons, slicing, __iter__, arbitrary precision integers, ... This are the important things, otherwise you can not really say you know much about Python because it is generic stuff that applies to most languages under the sun.
Re: 90% of Python in 90 Minutes (2013)
#8Earlier quoted context omitted.
Generally projects that suffer from the str/bytes/unicode mess is the hardest to port in my experience as 2to3 can't really help. Also relative/absolute imports can cause some confusing bugs.
That's because the programmer needs to make the choice of whether the data is text or just bytes. I suppose you could write a tool to infer that choice, but it wouldn't be perfectly accurate.
Re: 90% of Python in 90 Minutes (2013)
#9Re: 90% of Python in 90 Minutes (2013)
#10> (In Python 3 // is integer division)
I find it clearer to describe this behavior as "floor" division. You might think "integer division" would have the same results as python 3's `int(a / b)` when `a` and `b` are ints, but, no, this is not the case. I never could quite understand why all the hub-bub about "integer division" and why it should change from python 2 to python 3 because the behavior seemed natural and similar to the native integer division on most processors. Indeed its behavior is astonishingly different with negative numbers.
$ python2 -c 'print 2/3, -2/3, int(-2./3.)'
0 -1 0
$ python3 -c 'print(2//3, -2//3, int(-2.//3.))'
0 -1 -1
$ python3 -c 'print(2/3, -2/3, int(-2./3.))'
0.6666666666666666 -0.6666666666666666 0