On Dec 09, 2011, at 03:50 AM, Lennart Regebro wrote:
One reason is that you need to be able to say "This should be str in Python 2, and binary in Python 3, that should be Unicode in Python 2 and str in Python 3, and that over there should be str in both versions", and the future import doesn't support that.
Sorry, I don't understand this. What does it mean to be "str in both
versions"? And why would you want that?
As for "str in Python 2 and binary in Python 3", b'' prefixes do that in
Python >= 2.6 without the future import (if I take "binary" to mean bytes
type).
As for "Unicode in Python 2 and str in Python 3", unadorned strings with the
future import in Python >= 2.6 does that just fine.
One of the nice things too is that with #include