A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-September/017622.html below:

[Python-Dev] str() vs. unicode()

[Python-Dev] str() vs. unicode() [Python-Dev] str() vs. unicode()Walter Dörwald walter@livinglogic.de
Wed, 26 Sep 2001 19:11:00 +0200
Guido van Rossum wrote:

>[...]
> 
>>BTW, what about __repr__? Should this be allowed to return unicode 
>>objects? (currently it is, and uses PyUnicode_AsUnicodeEscapeString)
>>
> 
> But this is rarely what the caller expects, and it violates the
> guideline that repr() should return something that can be fed back to
> the parser.


I'd say this is a bug in the parser! >;)

> I'd rather change the rules to require that __repr__ and
> tp_repr return an 8-bit string at all times.


Sounds reasonable and again makes the implementation simpler
(as long as we're not in an all unicode world).

Bye,
    Walter Dörwald




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