[issue9196] Improve docs for string interpolation "%s" re Unicode strings

2020-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python 2.7 is no longer supported. -- nosy: +serhiy.storchaka resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue9196] Improve docs for string interpolation %s re Unicode strings

2014-06-02 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9196 ___ ___ Python-bugs-list

[issue9196] Improve docs for string interpolation %s re Unicode strings

2011-11-29 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: More info on this thread: http://mail.python.org/pipermail/python-dev/2006-December/070237.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9196

[issue9196] Improve docs for string interpolation %s re Unicode strings

2011-04-21 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9196 ___

[issue9196] Improve docs for string interpolation %s re Unicode strings

2011-01-20 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Python 3 checks the return types of __bytes__ and __str__, raising an error if it's not bytes and str respectively: str(C()) TypeError: __str__ returned non-string (type bytes) bytes(C()) TypeError: __bytes__ returned non-bytes (type str)

[issue9196] Improve docs for string interpolation %s re Unicode strings

2011-01-09 Thread Craig McQueen
Craig McQueen pyt...@craig.mcqueen.id.au added the comment: I'm attaching a file that I used (in Python 2.x). It's a little rough--I manually commented and uncommented various lines to see what would change under various circumstances. But at least you should be able to see what I was doing.

[issue9196] Improve docs for string interpolation %s re Unicode strings

2010-12-26 Thread Craig McQueen
Craig McQueen pyt...@craig.mcqueen.id.au added the comment: I should be able to attach my test code. But it is at my work, and I'm on holidays for 2 more weeks. Sorry 'bout that! I do assume that Python 3 greatly simplifies this. -- ___ Python

[issue9196] Improve docs for string interpolation %s re Unicode strings

2010-12-25 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I’m not sure how much effort should be put into a patch here, considering that the horrible bytes/text confusion and implicit conversion should stop in Python 3, and %-formatting is mildly deprecated. Ezio, what do you think? Craig, could you

[issue9196] Improve docs for string interpolation %s re Unicode strings

2010-07-08 Thread Craig McQueen
New submission from Craig McQueen pyt...@craig.mcqueen.id.au: I have just been trying to figure out how string interpolation works for %s, when Unicode strings are involved. It seems it's a bit complicated, but the Python documentation doesn't really describe it. It just says %s converts any

[issue9196] Improve docs for string interpolation %s re Unicode strings

2010-07-08 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9196 ___

[issue9196] Improve docs for string interpolation %s re Unicode strings

2010-07-08 Thread Craig McQueen
Craig McQueen pyt...@craig.mcqueen.id.au added the comment: Another thing I discovered, for Example 1: 4. If test_object.__str__() returns a Unicode object (for some reason), and test_object.__unicode__() does not exist, then the Unicode value from the __str__() call is used as-is (no