3 ms·
> Unicode is great, but standard library APIs should understand each other without the need to call decode. If one "standard library API" generates integers an
by masklinn 12y ago
> Unicode is great, but standard library APIs should understand each other without the need to call decode.
If one "standard library API" generates integers and an other consumes strings, would you expect the second one to take the output of the first one without conversion?
- allendoerfer 12y agoNo, I would not. To stay with your problematic analogy that differently encoded strings are to each other what integers are to strings: Would you write a function, that takes either a string or an integer and returns therefor either a string or an integer, so you can not feed the output of this first function into a second function, that is often called after the first, but can only take integers? Or would you rather say "Okay, we are working with numbers here, lets just take and return integers in this module."? You can read more about this here: http://lucumr.pocoo.org/2014/1/5/unicode-in-2-and-3/ http://lucumr.pocoo.org/2014/1/5/unicode-in-2-and-3/