Author vstinner
Recipients SilentGhost, St├ęphane Henriot, ericvw, georg.brandl, martin.panter, r.david.murray, serhiy.storchaka, vstinner
Date 2019-10-28.15:58:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572278339.52.0.223235128078.issue28029@roundup.psfhosted.org>
In-reply-to
Content
The current behavior is really surprising.

>>> "".replace("", "|")
'|'
>>> "".replace("", "|", -1)
'|'

vs

>>> "".replace("", "|", 0)
''
>>> "".replace("", "|", 1)
''
>>> "".replace("", "|", 1000)
''

I always expect "|".

---

This behavior makes sense to me:

>>> "abc".replace("", "|")
'|a|b|c|'
>>> "abc".replace("", "|", -1)
'|a|b|c|'
>>> "abc".replace("", "|", 0)
'abc'
>>> "abc".replace("", "|", 1)
'|abc'
>>> "abc".replace("", "|", 100)
'|a|b|c|'
History
Date User Action Args
2019-10-28 15:58:59vstinnersetrecipients: + vstinner, georg.brandl, ericvw, r.david.murray, SilentGhost, martin.panter, serhiy.storchaka, St├ęphane Henriot
2019-10-28 15:58:59vstinnersetmessageid: <1572278339.52.0.223235128078.issue28029@roundup.psfhosted.org>
2019-10-28 15:58:59vstinnerlinkissue28029 messages
2019-10-28 15:58:59vstinnercreate