I want to pass a list into function by value. By default, lists and other complex objects passed to function by reference. Here is some desision:
def add_at_
In case of ad is list you can simple call your function as add_at_rank(ad + [], rank).
add_at_rank(ad + [], rank)
This will create NEW instance of list every time you call function, that value equivalented of ad.
>>>ad == ad + [] True >>>ad is ad +[] False
Pure pythonic :)