Example code:
def primary_function(object_id):
some_object = SomeObject.query.get(object_id)
# Do stuff here
secondary_function(unknown_parameter)
def secondary_function(unknown_parameter):
# Do more stuff here
Both functions need access to some_object. Is it more efficient to have unknown_parameter be the object itself, or would it be better to have it as object_id, and then call SomeObject.query.get(object_id) a second time?
I didn't see anything about this in the documentation (though I suppose I could have missed something), and all the other questions here that I could find were for other languages and had mixed answers.