This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients
Date 2004-08-11.07:00:32
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=1038590

Don't know about anyone else, but the shortcut in str.join
that returns a reference to the *original* string in the
case of a single item sequence strikes me as very bad ju-ju:

>>> class mystr(str): pass
...
>>> s1 = mystr('fred')
>>> s1
'fred'
>>> s1.mutable = 42
>>> s1.mutable
42
>>> s2 = ''.join([s1])
>>> s2.mutable
42

When I call join, I expect to get a *new* object back, not a
reference to an old one (this is safe for standard strings,
but not for subclasses which may have mutable state).
History
Date User Action Args
2007-08-23 14:24:40adminlinkissue1001011 messages
2007-08-23 14:24:40admincreate