How does Python handle functions that allocate a new object and return a reference?
def fun_function():
obj = {}
for x in range(100):
obj[x] = True
return obj
Something like this would not work in C if I recall because of the stack pointer, but in Python it seems to work. Could there be memory consequences of this kind of return value for long running programs?
Is it more preferred to pass a handle to the object into the function?