print doesn't work as a function in 2.x without the from future import. If you try to put it in a dictionary or assign it to a different name like you could a normal function you will see.
range has always (to my knowledge) worked in 2.x it just returns a list rather than a generator. xrange returns the generator in 2.x. Come 3.x range was removed and xrange was renamed to range (similar to how input was removed in 3.x and raw_input was renamed input). This means that most code that uses range would still run in 2.x it just wouldn't perform as well.
Big things that always get me are the difference between default integer division (2.x) and default true division (3.x). To combat this, I always try to use "//" when I want integer division, and I make damn sure one of the values is a float if I want true.
Super is annoyingly incompatible. If you do it the nice way that 3.x allows then it won't work in 2.x; and if you do it the way 2.x allows... well... you aren't really saving any time. I just avoid its use.
You can no longer put parenthetic arguments in function definitions in 3.x either (not that there should ever be a need to but I have hit it in others' code).
- Code: Select all
The above would work in 2.x but not 3.x.