tuple, list, set, dict, ... are builtin types. Their name can be overwritten.
The name is only a reference to an object. A object can have more than one reference.
The assignment to a name, in this case with a dict or a list, let point the name to the new created object.
The old reference to dict and list is no longer there.
To demonstrate this with code:
If you look here, you see that dict and list have another color.
The name is only a reference to an object. A object can have more than one reference.
The assignment to a name, in this case with a dict or a list, let point the name to the new created object.
The old reference to dict and list is no longer there.
To demonstrate this with code:
print(dict) print(list) dict = { 'Geeks': 10, 'for': 12, 'Geek': 31 } list = [] print(dict) print(list) # deleting the names del dict del list # now magically the old types come back print(dict) print(list) # demonstrating syntax highlighting value = 42 print(value) # value is black # dict and tuple not, because they are built-insPS: If you use an IDE or Editor with syntax highlighting, you'll be warned by colors, that you're using a built-in name.
If you look here, you see that dict and list have another color.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!