Re:Python 3 Q&A by a prolific core developer
by gardentheory on Friday June 29, 2012 @04:27AM
(#4175766)
Well the lighter solution and more Pythonic solution is strong typing. If a Unicode string and a byte string could not be combined then the problem would not exist AFAIK. For example "a" + 1 is an error, why is u"a" + "s" not an error?
[ Parent
| on HN ]
Re:Python 3 Q&A by a prolific core developer
by masklinn on Friday June 29, 2012 @05:20AM
(#4175872)
> For example "a" + 1 is an error, why is u"a" + "s" not an error?
"a" + b"s" is an error in Python 3.
Re:Python 3 Q&A by a prolific core developer
by gardentheory on Friday June 29, 2012 @01:33PM
(#4177846)
Sorry, that was my point. Strengthening the types in python3 solves the problem without static typing being needed at all.
Re:Python 3 Q&A by a prolific core developer
by masklinn on Friday June 29, 2012 @03:05PM
(#4178449)
ok.
Static types solve it earlier though, especially for little-exercised code paths which could be forgotten or missed in testing.
But b"s" + "a" is an error in Py3.