Message21867
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). |
|
Date |
User |
Action |
Args |
2007-08-23 14:24:40 | admin | link | issue1001011 messages |
2007-08-23 14:24:40 | admin | create | |
|