Maybe this is not only a Python related question but a more general question about object-based programming and thinking...
As I have been working with Python for a few months now, I find that I lack a general understanding. Can someone explain to me how to visualize the concept of "call by object reference" or "call by assignment"?
When passing arguments like numbers, strings or tuples to a function, the passing is like call-by-value. That means I can not change the value of the (immutable) objects being passed to the function. I know that, but I don't understand its basic meaning. Let me explain where I think my difficulties in understanding are:
An experience from everyday life: For example, if I need a piece of information that is stored in a file on my hard drive, I open the corresponding folder, which has a unique name, and I open the file I am looking for, which itself has a unique name. I can handle it like a very special book in a library. So I can identify and retrieve a particular piece of information I'm looking for by its unique file name.
If I don't remember exactly in which folder this file is located, I can have it found by its specific name using a search function. I can also display a list of the last file I used, provided that the logbook has been set up accordingly.
Here the name of the file seem to work not only as a pointer but also as a usable variable. I can work with this name not only with the file's content.
I observe that in Python I always have a hard time understanding why I can't use object names as variables.
There are a lot of similar questions on the net from Python beginners like "how do I get the name of an object"? And there are a lot of answers like : "you can't do that in Python" or "Python objects don't have names".
These are unsatisfactory answers because they do not get to the core: It is an imagination problem of a beginner who has associated the wrong everyday experiences with the Python object.
When I program something in Python, I seem to assign names to objects. Please correct me if I have misunderstood: However, it is not something like "a label on a spine of a book on a shelf" but only something like a street sign that points me in the direction of a memory location, right?
How exactly does this pointing work in Python? What core processes are behind it? Can someone explain this to me clearly?