Message183260
The functionality of dict.setdefault() is not currently available through the C-API. Specfically, there is no way to test for a key and insert a fallback value for it without evaluating the hash function twice.
The attached patch adds a new C-API function PyDict_GetItemSetDefault() that makes this feature available. Like all PyDict_Getitem*() functions, it returns a borrowed reference.
I hope I got the update in refcounts.dat right. I have no idea how to express that a function *may* increase the refcounts of its arguments. |
|
Date |
User |
Action |
Args |
2013-03-01 13:45:55 | scoder | set | recipients:
+ scoder |
2013-03-01 13:45:55 | scoder | set | messageid: <1362145555.76.0.784733003054.issue17327@psf.upfronthosting.co.za> |
2013-03-01 13:45:55 | scoder | link | issue17327 messages |
2013-03-01 13:45:55 | scoder | create | |
|