PEP 263 comments

Huaiyu Zhu huaiyu at gauss.almadan.ibm.com
Tue Mar 5 14:41:26 EST 2002


On 05 Mar 2002 12:42:30 +0900, Stephen J. Turnbull <stephen at xemacs.org> wrote:
>
>Verbatim low-level I/O would be permitted.  I would want them to be
>restricted from being displayed literally by character-oriented
>high-level functions like print, though.  If you want to use print on
>them, convert them to something with an appropriate (trivial) __repr__
>operation defined.
...
>Thus by the principle of "least surprise" I advocate that raw string
>users use a new notation, while the (much larger and much more naive)
>group of people who expect
>
>    print 'And now for something completely different'
>
>to do something useful would notice nothing new.
>
>    print o'she turned me into a newt ... it got bettah'
>
>would either error (my preference) or print something like a tuple of
>integers.
>
>    print Code86(o'spam, spam, eggs, and spam').disassemble()
>
>would do what you think, if class Code86 were defined appropriately.

Now I see what you are advocating.  I agree completely.

Huaiyu




More information about the Python-list mailing list