function parameter passing mechanism, what does the value and the reference mean?
The problem of function parameter passing mechanism is essentially the method that calls the function (procedure) and the called function (procedure) to communicate when the call occurs. There are two basic parameter passing mechanisms: value passing and reference passing.
In the process of value passing (passl-by-value), the formal parameters of the called function are treated as local variables of the called function, that is, the memory space is opened up in the stack to hold the values of the arguments put in by the main key function, so as to become a copy of the arguments. The characteristic of value passing is that any operation of the tuned function on the situation parameter is performed as a local variable and does not affect the value of the argument variable of the main key function.
In the reference Pass (pass-by-reference) process, the formal parameters of the called function, while also opening up the memory space in the stack as a local variable, are stored in the address of the argument variable that is put in by the main key function. Any operation of the modulated function on the formal parameter is handled as an indirection, that is, the argument variable in the keynote function is accessed through the address stored in the stack. Because of this, any manipulation of the modulated function on the parameter affects the argument variables in the keynote function.
In Python, you can have multiple references pointing to one memory at a time.
Python does not allow programmers to choose whether to use a value or to pass a reference. Python parameter passing is definitely a way to "pass an object reference". This approach is equivalent to a synthesis of the value of the pass and the reference. If a function receives a reference to a Mutable object (a dictionary, a list), it can modify the original value of the object-the equivalent of a ' pass-reference ' to pass the object. If a function receives a reference to an immutable object (a number, a character, or a tuple), it cannot directly modify the original object-equivalent to passing the object through ' value passing '.
is the parameter pass of Python a value pass or a reference pass??