This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Antony.Lee
Recipients Antony.Lee, pitrou, rhettinger
Date 2017-08-25.05:35:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1503639320.56.0.307957119411.issue31254@psf.upfronthosting.co.za>
In-reply-to
Content
For my use case, it was easy enough to wrap the `uid = d[obj]` in a try... catch... plus locking.

Using setdefault would cause the counter to be incremented every time.  In truth, here I did not care about having consecutive uids, so that would have worked just as well.

In real truth, it later turned out that I didn't really need numeric uids anyways; I could just use weakrefs to the object themselves instead.
History
Date User Action Args
2017-08-25 05:35:20Antony.Leesetrecipients: + Antony.Lee, rhettinger, pitrou
2017-08-25 05:35:20Antony.Leesetmessageid: <1503639320.56.0.307957119411.issue31254@psf.upfronthosting.co.za>
2017-08-25 05:35:20Antony.Leelinkissue31254 messages
2017-08-25 05:35:20Antony.Leecreate