I know that there are certain “special” methods of various objects that represent operations that are usually performed with operators (that is, int.__add__for +, object.__eq__for ==, etc.) and that one of them list.__setitemthat can assign a value to an element list. However, I need a function that can assign a list to a piece of another list.
Basically, I am looking for an equivalent expression some_list[2:4] = [2, 3].
source
share