Issue15456
Created on 2012-07-26 10:29 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| code_sizeof.patch | serhiy.storchaka, 2012-07-26 10:29 | review | ||
| Messages (6) | |||
|---|---|---|---|
| msg166469 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2012-07-26 10:29 | |
Here is a patch that implements __sizeof__ for code objects (PyCodeObject) counting co_cell2arg array. |
|||
| msg166470 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2012-07-26 10:36 | |
See also issue12399. |
|||
| msg166512 - (view) | Author: Martin v. Löwis (loewis) * | Date: 2012-07-26 20:18 | |
Interestingly, the original patch did change the sizeof test, but incorrectly (adding the extra pointer to the struct spec, but failing to recognize that there is additional memory allocated). This tells me a) we *absolutely* need to preserve the current testing style where the test cases count the individual fields (see issue15402 for the related discussion). Had the test used object.__sizeof__, it would not have needed any change to continue to pass, losing all hope that somebody might have detected it except by very careful review. b) the trigger that the test broke apparently was not sufficient to hint Benjamin that the sizeof implementation may be incorrect, he just assumed that the test was incorrect. |
|||
| msg166514 - (view) | Author: Roundup Robot (python-dev) | Date: 2012-07-26 20:23 | |
New changeset 5093cfdff2a9 by Martin v. Löwis in branch 'default': Issue #15456: Fix code __sizeof__ after #12399 change. http://hg.python.org/cpython/rev/5093cfdff2a9 |
|||
| msg166516 - (view) | Author: Martin v. Löwis (loewis) * | Date: 2012-07-26 20:24 | |
Thanks for the patch! |
|||
| msg166637 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2012-07-28 08:28 | |
Thank you for fast commiting. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:33 | admin | set | github: 59661 |
| 2012-08-03 01:05:24 | jcea | set | nosy:
+ jcea |
| 2012-07-28 08:28:22 | serhiy.storchaka | set | messages: + msg166637 |
| 2012-07-26 20:24:03 | loewis | set | status: open -> closed resolution: fixed messages: + msg166516 |
| 2012-07-26 20:23:38 | python-dev | set | nosy:
+ python-dev messages: + msg166514 |
| 2012-07-26 20:18:22 | loewis | set | nosy:
+ loewis messages: + msg166512 |
| 2012-07-26 10:36:10 | serhiy.storchaka | set | nosy:
+ ncoghlan, benjamin.peterson messages: + msg166470 |
| 2012-07-26 10:29:14 | serhiy.storchaka | create | |