Issue 15695: Correct sizeof support for StgDict (original) (raw)

Created on 2012-08-16 19:13 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
stgdict_sizeof-3.3.patch serhiy.storchaka,2012-08-16 19:13 Patch for 3.3 review
stgdict_sizeof-3.2.patch serhiy.storchaka,2012-08-16 19:14 Patch for 3.2 review
stgdict_sizeof-2.7.patch serhiy.storchaka,2012-08-16 19:15 Patch for 2.7 review
Pull Requests
URL Status Linked Edit
PR 509 merged serhiy.storchaka,2017-03-06 10:44
PR 639 merged serhiy.storchaka,2017-03-12 11:36
Messages (6)
msg168399 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-08-16 19:13
Here is a patch that implements correct __sizeof__ for StgDict (a dictionary subclass used in ctypes). There are no tests because I don't know how to create and use StgDict. So I'm not sure that the code works correctly. Please help me with tests.
msg170155 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2012-09-10 02:56
What is the point of providing a __sizeof__ method to a purely internal type? I don't think it is possible to expose StgDict at the python level. It is always hidden behind a mapping proxy. Furthemore, StgDict is only used inside type objects and the size of type objects is not relevant for __sizeof__ calculations.
msg170563 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-09-16 18:32
I don't know where StgDict used. Probably need to provide the correct __sizeof__ method for a mapping proxy behind which StgDict hidden.
msg289091 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-06 10:46
Now changes are simpler since _PyDict_SizeOf() already was implemented.
msg290198 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-24 22:22
New changeset bc44f045e6a801903bd7530a4fc5474e657832da by Serhiy Storchaka in branch 'master': bpo-15695: Add PyAPI_FUNC() to _PyDict_SizeOf() declaration. (#639) https://github.com/python/cpython/commit/bc44f045e6a801903bd7530a4fc5474e657832da
msg290212 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-24 22:24
New changeset 8999caeb003ed292011e98b8a30746cce787a125 by Serhiy Storchaka in branch 'master': bpo-15695: Implemented StgDict.__sizeof__(). (#509) https://github.com/python/cpython/commit/8999caeb003ed292011e98b8a30746cce787a125
History
Date User Action Args
2022-04-11 14:57:34 admin set github: 59900
2017-03-24 22:24:41 serhiy.storchaka set messages: +
2017-03-24 22:22:25 serhiy.storchaka set messages: +
2017-03-12 12🔞22 serhiy.storchaka set status: open -> closedresolution: fixedstage: test needed -> resolved
2017-03-12 11:36:59 serhiy.storchaka set pull_requests: + <pull%5Frequest528>
2017-03-06 10:46:27 serhiy.storchaka set priority: normal -> lowmessages: +
2017-03-06 10:44:19 serhiy.storchaka set pull_requests: + <pull%5Frequest418>
2017-03-06 10:25:09 serhiy.storchaka set versions: + Python 3.7, - Python 2.7, Python 3.2, Python 3.3
2013-01-07 16:28:10 serhiy.storchaka set assignee: serhiy.storchaka
2012-09-16 18:32:31 serhiy.storchaka set messages: +
2012-09-10 02:56:43 belopolsky set messages: +
2012-09-10 02:33:13 jcea set nosy: + jcea
2012-08-29 12:02:45 aliles set nosy: + aliles
2012-08-16 19:15:07 serhiy.storchaka set files: + stgdict_sizeof-2.7.patchstage: patch review -> test needed
2012-08-16 19:14:08 serhiy.storchaka set files: + stgdict_sizeof-3.2.patch
2012-08-16 19:13:36 serhiy.storchaka create