Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Doc/library/gc.rst

    r2 r391  
    133133   Return a list of objects directly referred to by any of the arguments. The
    134134   referents returned are those objects visited by the arguments' C-level
    135    :attr:`tp_traverse` methods (if any), and may not be all objects actually
    136    directly reachable.  :attr:`tp_traverse` methods are supported only by objects
     135   :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
    137137   that support garbage collection, and are only required to visit objects that may
    138138   be involved in a cycle.  So, for example, if an integer is directly reachable
     
    140140
    141141   .. 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
    142167
    143168The following variable is provided for read-only access (you can mutate its
Note: See TracChangeset for help on using the changeset viewer.