On 19 May 2000, Guido van Rossum said: > The email below suggests a simple solution to a problem that > e.g. Fran\347ois Pinard brought up long ago; repr() of a string turns > all non-ASCII chars into \oct escapes. Jyrki's solution: use > isprint(), which makes it locale-dependent. I can live with this. For "ASCII" strings in this day and age -- which are often not necessarily plain ol' 7-bit ASCII -- I'd say that "32 <= c <= 127" is not the right way to determine printability. 'isprint()' seems much more appropriate to me. Are there other areas of Python that should be locale-sensitive but aren't? A minor objection to this patch is that it's a creeping change that brings in a little bit of locale-sensitivity without addressing a (possibly) wider problem. However, I will immediately shoot down my own objection on the grounds that if we try to fix everything all at once, then nothing will ever get fixed. Locale sensitivity strikes me as the sort of thing that *can* be a "creeping" change -- just fix the bits that bug people most, and eventually all the important bits will be fixed. I have no expertise and therefore no opinion on such a change for Unicode strings. Greg
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4