I have a method that contains no loops. I pass a list into that method. I assign the list a new value per this snippet:
def do_paging(pageable_list):
pageable_list = pageable_list[start:end]
In the calling code:
do_paging(source_list)
but it does not look like the source_list
gets changed. If I return pageable_list
from do_paging()
everything is great. Are array arguments immutable?
I started returning the value because it's better. But I am surprised and would like to know what's going on.
EDIT - how could I have been programming Python for a year and not known this!