We call them references. They work like this

i = 5     # create int(5) instance, bind it to i
j = i     # bind j to the same int as i
j = 3     # create int(3) instance, bind it to j
print i   # i still bound to the int(5), j bound to the int(3)

(Sidenote: Small ints are interned, but that isn't important to this explanation)

i = [1,2,3]   # create the list instance, and bind it to i
j = i         # bind j to the same list as i
i[0] = 5      # change the first item of i
print j       # j is still bound to the same list as i
Answer from John La Rooy on Stack Overflow
🌐
Python Morsels
pythonmorsels.com › variables-are-pointers
Variables are pointers in Python - Python Morsels
July 18, 2026 - Variables in Python are not buckets that contain things, but pointers: variables point to objects.
🌐
Real Python
realpython.com › pointers-in-python
Pointers in Python: What's the Point? – Real Python
March 18, 2026 - Python throws an error, explaining that add_one() wants a pointer instead of just an integer. Luckily, ctypes has a way to pass pointers to these functions. First, declare a C-style integer: ... The above code creates a C-style integer x with a value of 0. ctypes provides the handy byref() to allow passing a variable by reference.
🌐
Launch School
launchschool.com › books › python › read › variables_pointers
How Python objects and variables really work
Thus, when you access a variable, Python first determines where the variable is on the stack. It then takes the object's heap address from the stack item and uses it to find the object. The variable is a pointer to a stack location, and the stack location is a pointer to the object.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › python tutorial › pointers in python
Pointers in Python | Type of Pointers | Arithmetic Operations
August 23, 2025 - Home Software Development Software ... Pedamkar · Variables which serve the special purpose of storing the address of other variables, pointing to the address of the variable of which the address is provided, with obtaining ...
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Nickmccullum
nickmccullum.com › python-pointers
How to Use Python Pointers | Nick McCullum
June 13, 2020 - Pointers store the address of other variables. Surprisingly, pointers don't really exist in Python.
Find elsewhere
🌐
Anvil
anvil.works › articles › pointers-in-my-python-1
Memory Management in Python - Part 1: What Are Pointers?
When you create a new variable, then that variable’s name is added to the namespace of whichever scope it’s in. So, for example, writing the following will add the name my_string to the global namespace: ... For the purposes of this series of articles, we don’t need to worry about scopes; we can assume all our examples take place in the global namespace. Pointers can be thought of as names - that is, entries in Python’s namespace - that correspond to objects in Python’s memory.
Top answer
1 of 11
90

There's no way you can do that changing only that line. You can do:

a = [1]
b = a
a[0] = 2
b[0]

That creates a list, assigns the reference to a, then b also, uses the a reference to set the first element to 2, then accesses using the b reference variable.

2 of 11
55

I want form.data['field'] and form.field.value to always have the same value

This is feasible, because it involves decorated names and indexing -- i.e., completely different constructs from the barenames a and b that you're asking about, and for with your request is utterly impossible. Why ask for something impossible and totally different from the (possible) thing you actually want?!

Maybe you don't realize how drastically different barenames and decorated names are. When you refer to a barename a, you're getting exactly the object a was last bound to in this scope (or an exception if it wasn't bound in this scope) -- this is such a deep and fundamental aspect of Python that it can't possibly be subverted. When you refer to a decorated name x.y, you're asking an object (the object x refers to) to please supply "the y attribute" -- and in response to that request, the object can perform totally arbitrary computations (and indexing is quite similar: it also allows arbitrary computations to be performed in response).

Now, your "actual desiderata" example is mysterious because in each case two levels of indexing or attribute-getting are involved, so the subtlety you crave could be introduced in many ways. What other attributes is form.field suppose to have, for example, besides value? Without that further .value computations, possibilities would include:

class Form(object):
   ...
   def __getattr__(self, name):
       return self.data[name]

and

class Form(object):
   ...
   @property
   def data(self):
       return self.__dict__

The presence of .value suggests picking the first form, plus a kind-of-useless wrapper:

class KouWrap(object):
   def __init__(self, value):
       self.value = value

class Form(object):
   ...
   def __getattr__(self, name):
       return KouWrap(self.data[name])

If assignments such form.field.value = 23 is also supposed to set the entry in form.data, then the wrapper must become more complex indeed, and not all that useless:

class MciWrap(object):
   def __init__(self, data, k):
       self._data = data
       self._k = k
   @property
   def value(self):
       return self._data[self._k]
   @value.setter
   def value(self, v)
       self._data[self._k] = v

class Form(object):
   ...
   def __getattr__(self, name):
       return MciWrap(self.data, name)

The latter example is roughly as close as it gets, in Python, to the sense of "a pointer" as you seem to want -- but it's crucial to understand that such subtleties can ever only work with indexing and/or decorated names, never with barenames as you originally asked!

🌐
Ned Batchelder
nedbatchelder.com › blog › 202403 › does_python_have_pointers
Does Python have pointers? | Ned Batchelder
March 11, 2024 - So Python doesn’t have the classic pair of operations to be able to work with pointers explicitly. But on the other hand, every variable in Python is a pointer, because variables in Python are names that refer to objects.
🌐
Reddit
reddit.com › r/learnpython › why doesn't python have pointers?
r/learnpython on Reddit: Why doesn't Python have pointers?
April 21, 2023 -

No, really. I've just started practicing problems on Leetcode and today I tried to do a bunch of things with Linked lists in python. I always second guess myself when I'm writing assignment statements like node = next_node because I'm worried that using shallow copies might screw things up for me.

Wouldn't it have been way easier to directly reference objects by their memory location?

I'm not going to use C for coding interviews so I'd also appreciate any ways I can idiot proof my code when I'm dealing with moving and assigning objects in Python.

One idea I had was to include a deepcopy method in the List node class definition but I can't make any changes to the leetcode question setup.

Top answer
1 of 28
219
Because it’s high level by design
2 of 28
137
Pointers are a concept that really doesn't make sense in Python, both because of practical reasons and philisophical reasons. In Python, "variables" are really "lebels" attached to objects, not a specific memory location in your address space. The internals of the Python interpreter do make use of pointers, but that's because it's written in C. Philisophically, the designers of Python view pointers as an intrinsically bad thing - they have all sorts of downsides that would have made Python a bad language. What Python has instead, is bindings - the labels I mentioned above - and they actually do behave in some ways like pointers, but without the downsides. Bindings do not have a type, but the objects they are bound to do have a type, and unlike in C, an object (i.e. a value or more complex type) can have multiple labels. Furthermore, container types like tuples, lists, and dictionaries contain references to objects, which are very like pointers: they don't have a name (binding) but they do give you a way to refer to an object - of any type. If you make a linked list element class in Python like this: class Element: def __init__(self,pred,value): self.pred = pred self.value = value That gives you a linked list with a reference to the previous Element in each object, and you can traverse the links like this: >>> a = Element(None,1) >>> b = Element(a,2) >>> c = Element(b,3) >>> c.pred.pred.value 1 >>> c.pred.value 2 Semantically, that's pretty much like pointers. Generally it's less useful to use such structures in Python, though it's still valid in some situations, but you can take advantage of references to build complex dynamic data structures you can traverse in the same way as most linked-list or tree structures in other languages.
🌐
TutorialsPoint
tutorialspoint.com › article › what-is-the-pointer-in-python-does-a-pointer-exist-in-python
What is the Pointer in Python? Does a Pointer Exist in Python?
April 4, 2023 - Everything is an object in Python, and objects are stored in memory. When you define a variable in Python, you are creating a reference to an object. This reference essentially serves as a pointer to the location in memory where the object is stored.
🌐
GeeksforGeeks
geeksforgeeks.org › python › using-pointers-in-python-using-ctypes
Using Pointers in Python using ctypes - GeeksforGeeks
July 23, 2025 - A pointer is a special type of variable which stores the memory address of another variable. They can't store normal values like integers or float or Strings, they can only store Addresses and we can use that address location to print the value ...
🌐
Scaler
scaler.com › home › topics › do we have pointers in python?
Do We Have Pointers in Python? - Scaler Topics
May 4, 2023 - It manages the code very well. It may be difficult for beginners, but it is an important concept in the program. However, it can result in a variety of memory management bugs. Python does not have explicit pointers like other languages, although they are implemented beneath the hood.
🌐
Practicaldatascience
practicaldatascience.org › notebooks › class_2 › week_3 › 13_objects_and_variables.html
Variables are pointers to objects — Practical Data Science with Python
This is true of lists, numpy arrays, integers, or strings. The name we give it is the variable, and it is a pointer to the place in memory that contains the actual data. So when you create a new array, Python puts that list somewhere in memory, kind of like how you might put something big on ...
🌐
YouTube
youtube.com › watch
Variables are pointers in Python - YouTube
Python's variables are not buckets that contain objects; they're pointers. Assignment statements don't copy: they point a variable to a value (and multiple v...
Published: May 2, 2024
🌐
Quora
quora.com › What-is-the-pointer-in-Python-Does-a-pointer-exist-in-Python
What is the pointer in Python? Does a pointer exist in Python? - Quora
Answer (1 of 7): Answer to: “What is the pointer in Python” Background: I come from assembly language and games coding in C++, so I know what pointers are all about. It’s important to understand variables in Python are effectively pointers in practical use. The equal “=” assignment ...
🌐
Javatpoint
javatpoint.com › pointer-in-python
Pointer in Python | Why Python doesn't support pointer - Javatpoint
Pointer in Python | Why Python doesn't support pointer with python, tutorial, tkinter, button, overview, entry, checkbutton, canvas, frame, environment set-up, first python program, operators, etc.