bytes vs. characters
bytes vs. characters
Posted Apr 17, 2015 14:35 UTC (Fri) by intgr (subscriber, #39733)In reply to: bytes vs. characters by Cyberax
Parent article: Report from the Python Language Summit
How is it a problem in Python that it insists on data to conform to a specification?
How do you think it should behave? Always return bytes? No, JSON specifies Unicode. Try Unicode first but fall back to bytes? No, that seems like it would be very surprising behavior and cause more bugs than it solves. AFAICT the alternatives are far worse.
The situation you're in is *caused* by implementations being too lenient and accepting junk as input, which is why the vendor has not noticed this issue before.
