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.
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) * (Python committer) | 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) * (Python committer) | Date: 2012年07月26日 10:36 | |
See also issue12399. |
|||
| msg166512 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | 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) (Python triager) | 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) * (Python committer) | Date: 2012年07月26日 20:24 | |
Thanks for the patch! |
|||
| msg166637 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | 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 | |