Message263053
| Author |
Kevin Modzelewski |
| Recipients |
Kevin Modzelewski |
| Date |
2016年04月09日.01:02:02 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1460163723.35.0.208266777223.issue26718@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The super() __init__ function fills in the fields of a super object without checking if they were already set. If someone happens to call __init__ again, the previously-set references will end up getting forgotten and leak memory.
For example:
import sys
print(sys.gettotalrefcount())
sp = super(int, 1)
for i in range(100000):
super.__init__(sp, float, 1.0)
print(sys.gettotalrefcount()) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年04月09日 01:02:03 | Kevin Modzelewski | set | recipients:
+ Kevin Modzelewski |
| 2016年04月09日 01:02:03 | Kevin Modzelewski | set | messageid: <1460163723.35.0.208266777223.issue26718@psf.upfronthosting.co.za> |
| 2016年04月09日 01:02:03 | Kevin Modzelewski | link | issue26718 messages |
| 2016年04月09日 01:02:02 | Kevin Modzelewski | create |
|