Assuming z is passed as a list (in the corresponding python code). z += 3 can be translated to del z[:3] , which moves element 3 to 0. However, in python you need to copy the array before doing this, because with the del-statement the array is changed.
In C, you can access elements before the specified index using negative indices. This can be done using an "invisible" offset nested in the class. This offset is always added to the index when accessing the list. The following class demonstrates behavior.
class pointer_like: def __init__(self, lst): self.lst = lst; self.offset = 0
Note that pyhon also has a += operator for lists, but this allows you to add another list to the end.
source share