On 26/11/20 12:41 pm, Steven D'Aprano wrote:
a = "abcdef" a[-2] # returns a result
Yes, but did you *intend* that result, or did the -2 result from a calculation that should have returned a positive index but went wrong? Python has no way to tell. -- Greg _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/B4QZX4WJR3PSXW6CSPYRSBL6636RVKKX/ Code of Conduct: http://python.org/psf/codeofconduct/