Why do new objects in multiprocessing have the same id?

id in CPython returns the pointer of the given object. As threads have shared address space, two different instances of an object will be allocated in two different locations returning two different ids (aka virtual address pointers).

This is not the case for separate processes which own their own address space. By chance, they happen to get the same address pointer.

Keep in mind that address pointers are virtual, therefore they represent an offset within the process address space itself. That's why they are the same.

It is usually better not to rely on id() for distinguishing objects, as new ones might get ids of old ones making hard to track them over time. It usually leads to tricky bugs.