[Python-ideas] str.rreplace
spir
denis.spir at gmail.com
Tue Jan 28 09:40:49 CET 2014
On 01/28/2014 07:27 AM, Ron Adam wrote:
>> And of course str.find takes negative indices and that's actually used in some
>> quick&dirty scripts:
>>
>> >>> has_ext = path.find('.', -4)
>>
>> Of course you could make an argument that any such scripts deserve to be broken…
>
> I'd say they are already broken in that particular case. ;-)
Not if the file(name)s are ones you create & control yourself. (Well, I don't
mean I would program that way, except for a throwaway script. ;-)
d
More information about the Python-ideas
mailing list