← 输入框|bugs.python.org|刷新

➜

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.

作者 pitrou
收信人 Rhamphoryncus, collinwinter, gregory.p.smith, loewis, pitrou
日期 2008-12-17.15:21:11
SpamBayes Score 4.2107683e-07
Marked as misclassified 否
Message-id <1229527273.8.0.177245447541.issue4074@psf.upfronthosting.co.za>
In-reply-to
内容
This new patch also adds a function named gc.is_tracked() which returns
True if the object is tracked by the GC:

>>> import gc
>>> gc.is_tracked(1)
False
>>> gc.is_tracked([])
True
>>> gc.is_tracked(())
True
>>> gc.is_tracked((0,1))
False
>>> gc.is_tracked((0,"a"))
False
>>> gc.is_tracked((0,[]))
True
>>> gc.is_tracked((0,(1,2)))
False
>>> gc.is_tracked((0,(1,0.55)))
False
>>> gc.is_tracked((0,(1,{})))
True
>>> gc.is_tracked((None, True, False, "a", (1,2,u"z",("another",
"nested", u"tuple")), int))
False
>>> gc.is_tracked(gc)
True


(as you see the empty tuple is considered tracked, this is not important
since it is a singleton anyway)
历史
日期 用户 动作 参数
2008-12-17 15:21:13pitrou修改recipients: + pitrou, loewis, collinwinter, gregory.p.smith, Rhamphoryncus
2008-12-17 15:21:13pitrou修改messageid: <1229527273.8.0.177245447541.issue4074@psf.upfronthosting.co.za>
2008-12-17 15:21:13pitrou链接issue4074 messages
2008-12-17 15:21:12pitrou创建