[pypy-svn] r72064 - in pypy/extradoc/pypy.org: . source
fijal at codespeak.net
fijal at codespeak.net
Wed Mar 10 16:25:13 CET 2010
Author: fijal
Date: Wed Mar 10 16:25:12 2010
New Revision: 72064
Modified:
pypy/extradoc/pypy.org/compat.html
pypy/extradoc/pypy.org/source/compat.txt
Log:
use syntax highlightning
Modified: pypy/extradoc/pypy.org/compat.html
==============================================================================
--- pypy/extradoc/pypy.org/compat.html (original)
+++ pypy/extradoc/pypy.org/compat.html Wed Mar 10 16:25:12 2010
@@ -75,21 +75,12 @@
<ul>
<li><p class="first">PyPy does not support refcounting semantics. The code below
won't fill the file immediately, but only after a certain period
-of time, when the GC will collect:</p>
-<pre class="literal-block">
-open("filename", "w").write("stuff")
-</pre>
-<p>The proper fix is:</p>
-<pre class="literal-block">
-f = open("filename", "w")
-f.write("stuff")
-f.close()
-</pre>
-<p>or using the <tt class="docutils literal"><span class="pre">with</span></tt> keyword:</p>
-<pre class="literal-block">
-with open("filename", "w") as f:
- f.write("stuff")
-</pre>
+of time, when the GC will collect</p>
+<div class="syntax python"><pre><span class="nb">open</span><span class="p">(</span><span class="s">"filename"</span><span class="p">,</span> <span class="s">"w"</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"stuff"</span><span class="p">)</span><br/></pre></div>
+<p>The proper fix is</p>
+<div class="syntax python"><pre><span class="n">f</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="s">"filename"</span><span class="p">,</span> <span class="s">"w"</span><span class="p">)</span><br/><span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"stuff"</span><span class="p">)</span><br/><span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span><br/></pre></div>
+<p>or using the <tt class="docutils literal"><span class="pre">with</span></tt> keyword</p>
+<div class="syntax python"><pre><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s">"filename"</span><span class="p">,</span> <span class="s">"w"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span><br/> <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">"stuff"</span><span class="p">)</span><br/></pre></div>
</li>
<li><p class="first">We don't support certain attributes that were decided to be
implementation-dependent. For example, <tt class="docutils literal"><span class="pre">gc.get_referrers</span></tt> does not exist.
@@ -99,11 +90,8 @@
</li>
<li><p class="first">You can't attach a <tt class="docutils literal"><span class="pre">__del__</span></tt> method to a class after its creation.</p>
</li>
-<li><p class="first">You can't store non-string keys in type objects. Example:</p>
-<pre class="literal-block">
-class A(object):
- locals()[42] = 3
-</pre>
+<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>
<p>won't work.</p>
</li>
</ul>
Modified: pypy/extradoc/pypy.org/source/compat.txt
==============================================================================
--- pypy/extradoc/pypy.org/source/compat.txt (original)
+++ pypy/extradoc/pypy.org/source/compat.txt Wed Mar 10 16:25:12 2010
@@ -39,17 +39,23 @@
* PyPy does not support refcounting semantics. The code below
won't fill the file immediately, but only after a certain period
- of time, when the GC will collect::
+ of time, when the GC will collect
+
+ .. syntax:: python
open("filename", "w").write("stuff")
- The proper fix is::
+ The proper fix is
+
+ .. syntax:: python
f = open("filename", "w")
f.write("stuff")
f.close()
- or using the ``with`` keyword::
+ or using the ``with`` keyword
+
+ .. syntax:: python
with open("filename", "w") as f:
f.write("stuff")
@@ -62,7 +68,9 @@
* You can't attach a ``__del__`` method to a class after its creation.
-* You can't store non-string keys in type objects. Example::
+* You can't store non-string keys in type objects. Example
+
+ .. syntax:: python
class A(object):
locals()[42] = 3
More information about the Pypy-commit
mailing list