On 09/15/2014 03:46 PM, Mark Lawrence wrote: > On 15/09/2014 23:29, Mark Shannon wrote: >> >> I think this is an OK forum for this question. It isn't. ;) >> If someone isn't sure if something is a bug or not, then why not ask >> here before reporting it on the bug tracker? The first stop should still be the main Python list, or Python Dev would be inundated with questions about why this or that doesn't work the same way as <insert other language here>. If the responses from Python list indicate that it is (or probably is) a bug, then possibly a post here to verify -- but a bug-tracker entry at that point is quite reasonable. >> This does seem strange behaviour, and the documentation for list.insert >> gives no clue as to why this behaviour was chosen. > > I assume it's based on the concepts of slicing. From the docs "s.insert(i, x) - inserts x into s at the index given by > i (same as s[i:i] = [x])". Although shouldn't that read s[i:i+1] = [x] ? No. If it was `s[i:i+1]` then the ith element would be replaced by the inserted object. -- ~Ethan~
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4