[Patches] [ python-Patches-1007087 ] Return new string for single item joins (Bug #1001011)

SourceForge.net noreply at sourceforge.net
Wed Aug 11 10:03:32 CEST 2004


Patches item #1007087, was opened at 2004-08-11 18:03
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1007087&group_id=5470

Category: Core (C code)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Nick Coghlan (ncoghlan)
Assigned to: Nobody/Anonymous (nobody)
Summary: Return new string for single item joins (Bug #1001011)

Initial Comment:
At present, str.join contains a shortcut that returns a
reference to the existing string for a sequence that
contains a single item.

This can cause misbehaviour when subclasses of str are
involved (see the bug report for details).

The attached patch removes the shortcut, and adds a
test for the correct behaviour.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1007087&group_id=5470


More information about the Patches mailing list