Skip to content
Snippets Groups Projects
Commit 97f33446 authored by Armin Rigo's avatar Armin Rigo
Browse files

Clarify.

parent 76fea61e
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,9 @@
they just enable and disable the execution of finalizers. Also,
<tt class="docutils literal">gc.garbage</tt> always returns an empty list.</p>
</li>
<li><p class="first">You can't attach a <tt class="docutils literal">__del__</tt> method to a class after its creation.</p>
<li><p class="first">You can't add a <tt class="docutils literal">__del__</tt> method to an existing class; it
must be present in the class since the beginning, or else it
will not be automatically called when instances are freed.</p>
</li>
<li><p class="first">You can't store non-string keys in type objects. Example</p>
<div class="syntax python"><pre><span class="k">class</span> <span class="nc">A</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span><br/> <span class="nb">locals</span><span class="p">()[</span><span class="mi">42</span><span class="p">]</span> <span class="o">=</span> <span class="mi">3</span><br/></pre></div>
......
......@@ -71,7 +71,9 @@
they just enable and disable the execution of finalizers. Also,
``gc.garbage`` always returns an empty list.
* You can't attach a ``__del__`` method to a class after its creation.
* You can't add a ``__del__`` method to an existing class; it
must be present in the class since the beginning, or else it
will not be automatically called when instances are freed.
* You can't store non-string keys in type objects. Example
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment