[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 : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

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

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

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

2011-04-21 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

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

2011-01-20 Thread Ezio Melotti
Ezio Melotti 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) The Python 2 do

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

2011-01-09 Thread Craig McQueen
Craig McQueen 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. -- Added file: htt

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

2010-12-26 Thread Craig McQueen
Craig McQueen 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 tracker

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

2010-12-25 Thread Éric Araujo
Éric Araujo 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 attach your test_o

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

2010-07-08 Thread Craig McQueen
Craig McQueen 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 conversion to string, no encoding e

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

2010-07-08 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

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

2010-07-08 Thread Craig McQueen
New submission from Craig McQueen : 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 Python object using str(