On Sun, Jul 19, 2020 at 1:34 PM Thomas Moreau <thomas.moreau.2...@gmail.com> wrote:
> While it would be nice to have simpler identifiers for objects, it would > be hard to make it work for multiprocessing, as objects in different > interpreter would end up having the same repr. Shared objects (locks) might > also have different serial numbers depending on how many objects have been > created before it is communicated to the child process. > Adding to what was said here, there are serious implications outside of the multiprocessing case, too... 1) In a multi-threaded Python, threads will need to contend over a per-type counter, serializing the allocation of those counted types. 2) In a Python with tagged immediates (like fixnums, etc.) the added space cost would disqualify counted types from being implemented as an immediate value. This would force counted types to be heap-allocated and suffer from the aforementioned serialization.
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/HZQ2XIH3FAX44Q3ZXJIUQ7XOPYNKT7MN/ Code of Conduct: http://python.org/psf/codeofconduct/