A RetroSearch Logo

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

Search Query:

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

[Python-Dev] Re: test_string, test_unicode fail

[Python-Dev] Re: test_string, test_unicode failM.-A. Lemburg mal@lemburg.com
Thu, 20 Sep 2001 19:40:18 +0200
Guido van Rossum wrote:
> > > ...
> > > Is this really an good idea?  Was it an intended side effect?
> >
> > The intention is to make str() and unicode() behave in the same
> > way. It is not a side-effect. unicode() now behaves in the same
> > way as str() always did.
> 
> Not true.  "".join(["a", 3]) raises a TypeError, and this is how it
> should be.  So I expect that u"".join(["a", 3]) also raises TypeError,
> not return u"a3" as it does now.

This is fixed now. It was a bug in the .join() method (it would
have excepted instances with __str__ too, for example).
 
> I urge you to reconsider how this change is implemented.  The implied
> unicode() call for list items in the join() method is probably just
> scratching the surface -- there are likely other places where now
> suddenly everything is auto-converted to a unicode string.

Hmm, perhaps you are right and we should use a slightly extended
version of PyObject_Unicode() for unicode() and leave 
PyUnicode_FromObject() as it was (it only converted strings,
buffers and instances implementing __str__ to Unicode).

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/



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