I encountered with some wierd behavior, when trying to pass object like query which has the following structure:
query = session.query(...).filter(...)
To foo(query)
, while:
def foo_add_filter(query):
# adding some condition
query = query.filter(....)
When I exit function query wasn't updated, this lead me to understand the query is not passed by reference and therefore can't be altered inside function without return value.
If this is the state, how can I pass this query object by ref, without modifying my foo
function to return value: query