Skip to content

Commit ed59791

Browse files
committed
Website build
1 parent 4a6f5a3 commit ed59791

14 files changed

+325
-92
lines changed

0_preface.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ <h2>Changes in the second and third editions<a class="headerlink" href="#changes
236236
workspaces in <a class="reference internal" href="2_programs_in_files.html#workspaces"><span class="std std-numref">Section 2.2.1</span></a>, and the Flake8 extension in
237237
<a class="reference internal" href="4_style.html#flake8-extension"><span class="std std-numref">Section 4.2.2</span></a>. Together, these provide correctly integrated code
238238
linting. It also consistently uses <code class="xref py py-obj docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span></code> to invoke tools such as <code class="xref py py-obj docutils literal notranslate"><span class="pre">pip</span></code>,
239-
<a class="reference external" href="https://docs.pytest.org/en/latest/index.html#module-pytest" title="(in pytest v8.5.0.dev210)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">pytest</span></code></a> and <code class="xref py py-obj docutils literal notranslate"><span class="pre">flake8</span></code>. This is less error-prone for students. The description
239+
<a class="reference external" href="https://docs.pytest.org/en/latest/index.html#module-pytest" title="(in pytest v9.1.0.dev134)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">pytest</span></code></a> and <code class="xref py py-obj docutils literal notranslate"><span class="pre">flake8</span></code>. This is less error-prone for students. The description
240240
of <a class="reference external" href="https://docs.python.org/3/reference/compound_stmts.html#finally" title="(in Python v3.14)"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">finally</span></code></a> in <a class="reference internal" href="6_exceptions.html#else-finally"><span class="std std-numref">Section 6.5.2</span></a> has been also improved.</p>
241241
</section>
242242
</section>

1_introduction.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ <h3><span class="section-number">1.2.2. </span>Creating the venv<a class="header
318318
<h2><span class="section-number">1.3. </span>Installing Python packages<a class="headerlink" href="#installing-python-packages" title="Link to this heading"></a></h2>
319319
<p>Suppose we’ve created and activated a venv, and now there’s a Python package
320320
we’d like to have access to. Installation of Python packages is handled by the
321-
Python package <a class="reference external" href="https://pip.pypa.io/en/stable/" title="(in pip v25.2)"><span class="xref std std-doc">Pip</span></a>, which you will usually find
321+
Python package <a class="reference external" href="https://pip.pypa.io/en/stable/" title="(in pip v25.3)"><span class="xref std std-doc">Pip</span></a>, which you will usually find
322322
pre-installed in your Python installation. Pip has many usage options, which
323323
enable a large number of different installation configurations. However, for
324324
most users most of the time, a few simple pip commands suffice. As with

2_programs_in_files.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ <h2><span class="section-number">2.5. </span>Testing frameworks<a class="headerl
716716
including tests in your code here.</p>
717717
<p>There are a number of Python packages which support code testing. The concepts
718718
are largely similar so rather than get bogged down in the details of multiple
719-
frameworks, we will introduce <a class="reference external" href="https://docs.pytest.org/en/latest/index.html" title="(in pytest v8.5.0.dev210)"><span class="xref std std-doc">Pytest</span></a>, which is one of the
719+
frameworks, we will introduce <a class="reference external" href="https://docs.pytest.org/en/latest/index.html" title="(in pytest v9.1.0.dev134)"><span class="xref std std-doc">Pytest</span></a>, which is one of the
720720
most widely used. Pytest is simply a Python package, so you can install it into
721721
your current environment using:</p>
722722
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp gp-VirtualEnv">(PoP_venv)</span> <span class="gp">$ </span>python<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>pytest

7_inheritance.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,8 @@ <h2><span class="section-number">7.6. </span>Exercises<a class="headerlink" href
763763
<code class="xref py py-class docutils literal notranslate"><span class="pre">VerifiedSet</span></code> will need to have its own version which calls
764764
<code class="xref py py-meth docutils literal notranslate"><span class="pre">_verify()</span></code> on each item, before calling the appropriate superclass
765765
method in order to actually insert the value(s). The methods which add
766-
items to a set are <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#frozenset.add" title="(in Python v3.14)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">add()</span></code></a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#frozenset.update" title="(in Python v3.14)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update()</span></code></a>, and
767-
<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#frozenset.symmetric_difference_update" title="(in Python v3.14)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">symmetric_difference_update()</span></code></a>.</p></li>
766+
items to a set are <code class="xref py py-meth docutils literal notranslate"><span class="pre">add()</span></code>, <code class="xref py py-meth docutils literal notranslate"><span class="pre">update()</span></code>, and
767+
<code class="xref py py-meth docutils literal notranslate"><span class="pre">symmetric_difference_update()</span></code>.</p></li>
768768
<li><p>For those methods which create a new set, <code class="xref py py-class docutils literal notranslate"><span class="pre">VerifiedSet</span></code> will also
769769
need to <a class="reference internal" href="3_objects.html#term-instantiate"><span class="xref std std-term">instantiate</span></a> a new object, so that the method returns a subclass of
770770
<code class="xref py py-class docutils literal notranslate"><span class="pre">VerifiedSet</span></code> instead of a plain <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#set" title="(in Python v3.14)"><code class="xref py py-class docutils literal notranslate"><span class="pre">set</span></code></a>. The methods to which

9_trees_and_directed_acyclic_graphs.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -694,10 +694,10 @@ <h3><span class="section-number">9.4.2. </span>Operations on expression trees<a
694694
code to execute, depending on the type of the first argument <a class="footnote-reference brackets" href="#single" id="id3" role="doc-noteref"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a>.</p>
695695
<p><a class="reference internal" href="#tree-evaluate"><span class="std std-numref">Listing 9.7</span></a> shows a single dispatch function for a visitor function
696696
which evaluates a <code class="xref py py-class docutils literal notranslate"><span class="pre">Expression</span></code>. Start with lines 6-24. These define a
697-
function <code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code> which will be used in
697+
function <a class="reference internal" href="example_code.html#example_code.expression_tools.evaluate" title="example_code.expression_tools.evaluate"><code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code></a> which will be used in
698698
the default case, that is, in the case where the <a class="reference external" href="https://docs.python.org/3/library/functions.html#type" title="(in Python v3.14)"><code class="xref py py-class docutils literal notranslate"><span class="pre">type</span></code></a> of the first
699699
argument doesn’t match any of the other implementations of
700-
<code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code>. In this case, the first
700+
<a class="reference internal" href="example_code.html#example_code.expression_tools.evaluate" title="example_code.expression_tools.evaluate"><code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code></a>. In this case, the first
701701
argument is the expression that we’re evaluating, so if the type doesn’t match
702702
then this means that we don’t know how to evaluate this object, and the only
703703
course of action available is to throw an <a class="reference internal" href="6_exceptions.html#term-exception"><span class="xref std std-term">exception</span></a>.</p>
@@ -783,13 +783,13 @@ <h3><span class="section-number">9.4.2. </span>Operations on expression trees<a
783783
Notice that the function name is given as <code class="xref py py-obj docutils literal notranslate"><span class="pre">_</span></code>. This is the Python convention for
784784
a name which will never be used. This function will never be called by its
785785
declared name. Instead, look at the decorator on line 28. The single dispatch
786-
function <code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code> has a <a class="reference internal" href="3_objects.html#term-method"><span class="xref std std-term">method</span></a>
786+
function <a class="reference internal" href="example_code.html#example_code.expression_tools.evaluate" title="example_code.expression_tools.evaluate"><code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code></a> has a <a class="reference internal" href="3_objects.html#term-method"><span class="xref std std-term">method</span></a>
787787
<code class="xref py py-meth docutils literal notranslate"><span class="pre">register()</span></code>. When used as a decorator, the <code class="xref py py-meth docutils literal notranslate"><span class="pre">register()</span></code> method of a
788788
single dispatch function registers the function that follows as implementation
789789
for the <a class="reference external" href="https://docs.python.org/3/reference/compound_stmts.html#class" title="(in Python v3.14)"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">class</span></code></a> given as an argument to <code class="xref py py-meth docutils literal notranslate"><span class="pre">register()</span></code>. On this
790790
occasion, this is <code class="xref py py-class docutils literal notranslate"><span class="pre">expressions.Number</span></code>.</p>
791791
<p>Now look at lines 33-35. These contain the implementation of
792-
<code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code> for <code class="xref py py-class docutils literal notranslate"><span class="pre">expressions.Symbol</span></code>.
792+
<a class="reference internal" href="example_code.html#example_code.expression_tools.evaluate" title="example_code.expression_tools.evaluate"><code class="xref py py-func docutils literal notranslate"><span class="pre">evaluate()</span></code></a> for <code class="xref py py-class docutils literal notranslate"><span class="pre">expressions.Symbol</span></code>.
793793
In order to evaluate a symbol, we depend on the mapping from symbol names to
794794
numerical values that has been passed in.</p>
795795
<p>Finally, look at lines 38-40. These define the evaluation visitor for addition.
@@ -1125,7 +1125,7 @@ <h2><span class="section-number">9.9. </span>Exercises<a class="headerlink" href
11251125
<p>Write a <a class="reference internal" href="#term-single-dispatch-function"><span class="xref std std-term">single dispatch function</span></a> importable as
11261126
<code class="xref py py-func docutils literal notranslate"><span class="pre">expressions.differentiate()</span></code> which has the correct interface to be
11271127
passed to <code class="xref py py-func docutils literal notranslate"><span class="pre">expressions.postvisitor()</span></code> or
1128-
<code class="xref py py-func docutils literal notranslate"><span class="pre">example_code.expression_tools.postvisitor()</span></code> and which differentiates the
1128+
<a class="reference internal" href="example_code.html#example_code.expression_tools.postvisitor" title="example_code.expression_tools.postvisitor"><code class="xref py py-func docutils literal notranslate"><span class="pre">example_code.expression_tools.postvisitor()</span></code></a> and which differentiates the
11291129
expression provided with respect to a symbol whose name is passed as the
11301130
string <a class="reference external" href="https://docs.python.org/3/glossary.html#term-argument" title="(in Python v3.14)"><span class="xref std std-term">keyword argument</span></a> <code class="xref py py-obj docutils literal notranslate"><span class="pre">var</span></code>.</p>
11311131
<p>As a simplification, the tests will assume that <code class="xref py py-obj docutils literal notranslate"><span class="pre">var</span></code> does not appear in an

_modules/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
<h1>All modules for which code is available</h1>
6060
<ul><li><a href="example_code/addable.html">example_code.addable</a></li>
6161
<li><a href="example_code/euclid.html">example_code.euclid</a></li>
62+
<li><a href="example_code/expression_tools.html">example_code.expression_tools</a></li>
6263
<li><a href="example_code/graphs.html">example_code.graphs</a></li>
6364
<li><a href="example_code/groups.html">example_code.groups</a></li>
6465
<li><a href="example_code/groups_abc.html">example_code.groups_abc</a></li>

_sources/8_debugging.rst.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ function:
384384
385385
import pdb; pdb.set_trace()
386386
387+
387388
Command-line debugger commands
388389
------------------------------
389390

0 commit comments

Comments
 (0)