[issue39304] Don't accept a negative number for the count argument in str.replace(old, new[, count])

Karthikeyan Singaravelan report at bugs.python.org
Sat Jan 11 10:04:41 EST 2020


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

negative value is an implementation detail where count < 0 is similar to replace all [0]. See also issue5416

[0] https://github.com/python/cpython/blob/43682f1e39a3c61f0e8a638b887bcdcbfef766c5/Objects/unicodeobject.c#L10578

----------
nosy: +rhettinger, xtreak

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39304>
_______________________________________


More information about the Python-bugs-list mailing list