New submission from Akshay Deogaonkar: lst = [0,1,2,3,4] print(lst[0:3]) #returns [0,1,2] print(lst[:3]) #returns [0,1,2]
#Above two syntax returns same lists. print(lst[0:3:-1]) #returns [] print(lst[:3:-1]) #returns [4] #Here is a bug; what expected was that the both syntax would have returned the similar lists; however, they didn't! ---------- messages: 292120 nosy: Akshay Deogaonkar priority: normal severity: normal status: open title: Equivalent syntax regarding List returns List objects with non-similar list elements. type: behavior versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30137> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com