On 19/07/2020 16:38, Serhiy Storchaka wrote:
I have problem with the location of hexadecimal memory address in custom reprs.

I agree they are "noise" mostly and difficult to distinguish when you need to.
What if use serial numbers to differentiate instances?

    <threading.BoundedSemaphore #5: 2/3>

where the serial number starts with 1 and increased for every new instance of that type.

What would happen at a __class__ assignment?

IIUC class assignability is an equivalence relation amongst types: serial numbers would have to be unique within the equivalence class, not within the type. Otherwise, they would have to change (unlike id()), may not round-trip if __class__ were assigned there and back.

Jeff Allen

_______________________________________________
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/THVJFA3INNGWW2CXDKGFTMASH3UURAYG/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to