Movatterモバイル変換
[0]ホーム
[Python-Dev] Round Bug in Python 1.6?
Guido van Rossumguido@python.org
Fri, 07 Apr 2000 15:18:40 -0400
> Just checking my newly bought "Guido Channeling" kit -- you mean str()> but special case the snot out of strings(TM), don't youExcept I'm not sure what kind of special-casing should be happening.Put quotes around it without worrying if that makes it a valid stringliteral is one thought that comes to mind.Another approach might be what Tk's text widget does -- pass throughcertain control characters (LF, TAB) and all (even non-ASCII) printingcharacters, but display other control characters as \x.. escapesrather than risk putting the terminal in a weird mode. No quotesthough. Hm, I kind of like this: when used as intended, it will justdisplay the text, with newlines and umlauts etc.; but when printingbinary gibberish, it will do something friendly.There's also the issue of what to do with lists (or tuples, or dicts)containing strings. If we agree on this:>>> "hello\nworld\n\347" # octal 347 is a cedillahelloworldç>>>Then what should ("hello\nworld", "\347") show? I've got enough seriouscomplaints that I don't want to propose that it use repr():>>> ("hello\nworld", "\347")('hello\nworld', '\347')>>>Other possibilities:>>> ("hello\nworld", "\347")('helloworld', 'ç')>>>or maybe>>> ("hello\nworld", "\347")('''helloworld''', 'ç')>>>Of course there's also the Unicode issue -- the above all assumesLatin-1 for stdout.Still no closure, I think...--Guido van Rossum (home page:http://www.python.org/~guido/)
[8]ページ先頭