4 ms·
Python Gotcha: strip, lstrip, rstrip can remove more than expected
- stevemk14ebr 3y agoDeveloper uses the wrong api and goes :surprised_pikachu:
- LeoPanthera 3y agoThis isn't a "gotcha". This is using the wrong function. "rstrip" and "removesuffix" are simply not the same thing.
- duke_sam 3y agoAbsolutely, it’s possible the name could be misleading but surely this is one of those times where maybe you make the mistake once and then never again. There are far more painful gotchas in Python (see mutable args).
- korijn 3y agoRTFM
- thumbcore 3y agoRTFM
- passion__desire 3y agoHis mistakes aren't our mistakes.