4 ms·
Hardly any changes at all, and the things that did change didn't actually make a clear difference in productivity or the clarity of your code. The ability to ma
by stdbrouw 11y ago
Hardly any changes at all, and the things that did change didn't actually make a clear difference in productivity or the clarity of your code. The ability to make breaking changes wasn't really used to improve the language, maybe except for unicode handling – no new syntax (would've loved functions-as-blocks myself), no getting rid of old crufty syntax, nada.
- toyg 11y ago> things that did change didn't actually make a clear difference in [...] the clarity of your code print "%s remember to %s in %s if %s but never %s" % (some_random_tuple) vs print("{when} remember {what} in {room} if {condition} but never {dont}".format(* * dict_with_explicit_keys)) A bit verbose but much clearer and future-proof.
- icebraining 11y agoBut you can already do that in Python 2.7.
- mmarx 11y agoThat's an unfair comparison, however, print "%(when)s remember to %(what)s in %(room)s but never %(dont)s" % dict_with_explicit_keys was supported back in at least 2.4.
- Ded7xSEoPKYNsDd 11y agoPython 2.7 supports string.format and Python 3 supports % formatting. The only actual difference in that example is that print became a function in Python 3, requiring some additional parentheses. (Something that can be mechanically translated without much hassle.)
- GFK_of_xmaspast 11y agoWasn't the % formatting missing from early versions of python3?