Python is interpreted programming language. He doesn't convert the code into machine code (unlike C or C++). Instead, Python interpreter transfers the programming code into bytecode, which is executed on the PVM (Python Virtual Machine). Let's see how it works using an example of the most popular interpreter implementation - CPython.
weakref module allows to create "weak" references to objects. It's not enough to have a weak reference to keep an objects alive - if weak references are the only references the object has, then garbage collector will remove the object and reuse the memory for other objects. However, while the object isn't deleted, a weak reference can return it even if there are no regular references to the objects.
Python is a dynamic programming language. Here you're allowed to do whatever you wish with objects and their instances - you can add attributes, remove them etc.