I came across what, in my opinion, is a mistake, and I am looking for confirmation or that I do not understand how this method works.
Here is my main conclusion:
(Pdb) x = 'KEY_K' (Pdb) x.lstrip('K') 'EY_K' (Pdb) x.lstrip('KE') 'Y_K' (Pdb) x.lstrip('KEY') '_K' (Pdb) x.lstrip('KEY_') '' (Pdb) import sys (Pdb) sys.version '2.7.11 (default, Dec 5 2015, 14:44:47) \n[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)]'
I understand that the final "lstrip" in this example should have returned "K", but that is not the case. Does anyone know why?
source share