Changeset 391 for python/trunk/Doc/library/gc.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/library/gc.rst
r2 r391 133 133 Return a list of objects directly referred to by any of the arguments. The 134 134 referents returned are those objects visited by the arguments' C-level 135 : attr:`tp_traverse` methods (if any), and may not be all objects actually136 directly reachable. : attr:`tp_traverse` methods are supported only by objects135 :c:member:`~PyTypeObject.tp_traverse` methods (if any), and may not be all objects actually 136 directly reachable. :c:member:`~PyTypeObject.tp_traverse` methods are supported only by objects 137 137 that support garbage collection, and are only required to visit objects that may 138 138 be involved in a cycle. So, for example, if an integer is directly reachable … … 140 140 141 141 .. versionadded:: 2.3 142 143 .. function:: is_tracked(obj) 144 145 Returns True if the object is currently tracked by the garbage collector, 146 False otherwise. As a general rule, instances of atomic types aren't 147 tracked and instances of non-atomic types (containers, user-defined 148 objects...) are. However, some type-specific optimizations can be present 149 in order to suppress the garbage collector footprint of simple instances 150 (e.g. dicts containing only atomic keys and values):: 151 152 >>> gc.is_tracked(0) 153 False 154 >>> gc.is_tracked("a") 155 False 156 >>> gc.is_tracked([]) 157 True 158 >>> gc.is_tracked({}) 159 False 160 >>> gc.is_tracked({"a": 1}) 161 False 162 >>> gc.is_tracked({"a": []}) 163 True 164 165 .. versionadded:: 2.7 166 142 167 143 168 The following variable is provided for read-only access (you can mutate its
Note:
See TracChangeset
for help on using the changeset viewer.