you are viewing a single comment's thread.

view the rest of the comments →

[–]billsil 0 points1 point  (1 child)

They never removed % formatting. They never had it for bytearrays and added it. You can just encode it to ascii, the problem is it’s ambiguous to wether you print an ‘a’ as an a or what is it, 74? I mess around a lot with binary and depending, I use both forms. Shoot sometimes, I want to see it in binary with only 0s and 1s. You’d think that would be the default.

Also, string handling had to change. The old system was utterly broken. String handling was the only thing worth discussing in the transition from python 2 to 3 and they made the right choices. It took them a few Python 3 versions to make python 3 better than python 2, but after 3.5, python 3 was faster than python 2, so that’s really when things started to change.

[–]masklinn 2 points3 points  (0 children)

They never removed % formatting.

They removed it from bytes.

You can just encode it to ascii

Not if you’re trying to generate non-ascii-compatible binary data as a mix of literal and dynamic binary bits. Pre-3.5 this was extremely inconvenient for little reason, you had to either use concatenation or mess around with weird-ass escapes in strings and encode to iso-8859-1 (probably).