Obtain memory address where function is stores

Hello,
I would like to print out the memory address where a function is stored. For example:

Q = FunctionSpace(mesh, 'P', 1)
f = Function(Q)

#here I would like to print out the information about f and the memory address where f is stored

f = interpolate(f_Expression(element=Q.ufl_element()), Q)

#interpolate has allocated a new f -> here I would like to print out the information about f and the new memory address where it is stored

How can I do this ?
Thanks

What do you need the memory address for?
This also seems like a rather general Python question: How to get the memory address of an object in Python - GeeksforGeeks

To see when a Function() has been allocated as a new object by some calls to Fenics methods.

Whenever you do operations such as new_variable = interpolate(something, some space) you will assign new memory.

However, if you instead go down the route:

new_variable = Function(some_space)
new_variable.interpolate(something)
# Use variable
# ....

new_variable.interpolate(something_else)

you will not assign new memory for either of the interpolate functions.
I have already mentioned this in: Write Function to file at multiple time steps - #7 by dokken