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/2004-September/048747.html below:

[Python-Dev] unicode inconsistency?

[Python-Dev] unicode inconsistency? [Python-Dev] unicode inconsistency?Neil Schemenauer nas at arctrix.com
Thu Sep 9 20:50:35 CEST 2004
On Thu, Sep 09, 2004 at 02:09:56PM -0400, Aahz wrote:
> Check the recent python-dev archives for a long and nauseating
> thread about interactions between __str__ and unicode.

Using __unicode__ doesn't help.  The core problem is that you cannot
create a class that behaves like 'unicode' in this operation without
subclassing from 'unicode'.  That violates the "duck typing" design
principle of Python.  We violate it other places, usually in the
name of efficiency, but I see no good reason in this case.

I suspect the fix will be pretty straight forward (call tp_str and
if the result is 'unicode' the produce a 'unicode' string).  Again,
is there some reason why we don't want this behavior?

  Neil
More information about the Python-Dev mailing list

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