[issue43076] str.split() indexing issue

2021-01-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: Slicing is described here: https://docs.python.org/3/tutorial/introduction.html -- ___ Python tracker ___ _

[issue43076] str.split() indexing issue

2021-01-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi Aleksandr, In future, when posting what you think might be a bug, please try to cut the code down to the bare minimum needed. In this case, it doesn't matter at all that the strings you are processing come from splitting a larger string. split() has don

[issue43076] str.split() indexing issue

2021-01-30 Thread Aleksandr Sigalov
New submission from Aleksandr Sigalov : The following code ran in Google Colab... = import sys print (sys.version) string = 'WORD=BIRD\nBIRD\nBIRD' print(string.split()) print('') print(string.split('=')[0][0:3]) print(string.split('=')[1][0:3])