Skip to content

Commit 9852094

Browse files
author
Release Manager
committed
gh-35955: links for Python standard errors using class role in src/doc
<!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> In `src/doc`, Let us use `:class:...Error` to make links to python's own documentation <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #35955 Reported by: Frédéric Chapoton Reviewer(s): Matthias Köppe
2 parents 25eb671 + 9d12aa5 commit 9852094

File tree

15 files changed

+24
-22
lines changed

15 files changed

+24
-22
lines changed

build/pkgs/configure/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=354d134d4bcdedba55ed2bcb1eac6ea33146ca15
3-
md5=2143a40fdce9ed5cb8b29a6232be4789
4-
cksum=304076036
2+
sha1=556e5e5a03146223da4c540532f2744b5f020aae
3+
md5=43e504a3833767059afc054b8be73a1e
4+
cksum=3293099866
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
37fa2da8e75716793e91c384237a5e9f67ed83e8
1+
68e7d744a31fa469d9b2746353041faa409877d2

src/doc/de/tutorial/interactive_shell.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ Fehlerbehandlung
373373
Wenn irgendetwas schief geht, werden Sie normalerweise eine
374374
Python-Fehlermeldung sehen. Python macht sogar einen Vorschlag, was den
375375
Fehler ausgelöst hat. Oft sehen Sie den Namen der Fehlermeldung,
376-
z.B. ``NameError`` oder ``ValueError`` (vgl. Python Library Reference
376+
z.B. :class:`NameError` oder :class:`ValueError` (vgl. Python Library Reference
377377
[PyLR]_ für eine komplette Liste der Fehlermeldungen). Zum Beispiel:
378378

379379
.. skip

src/doc/en/faq/faq-usage.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ issue these commands:
115115
import _tkinter
116116
import Tkinter
117117
118-
If they do not raise an ``ImportError`` then it worked.
118+
If they do not raise an :class:`ImportError` then it worked.
119119

120120

121121
How do I import Sage into a Python script?
@@ -663,7 +663,7 @@ With objects a and b and a function f, I accidentally typed f(a) = b instead of
663663
It is because of how functions are defined in Sage with the
664664
``f(x) = expr`` notation using the preparser. Also notice that if you
665665
make this mistake inside of an ``if`` statement, you will get a
666-
``SyntaxError`` before anything else goes wrong. So in this case,
666+
:class:`SyntaxError` before anything else goes wrong. So in this case,
667667
there is no problem.
668668

669669

src/doc/en/installation/source.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ If
546546
sage: import _tkinter
547547
sage: import Tkinter
548548
549-
does not raise an ``ImportError``, then it worked.
549+
does not raise an :class:`ImportError`, then it worked.
550550

551551
.. _build-from-source-step-by-step:
552552

src/doc/en/reference/coercion/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ Methods to implement
345345
this case ``r * s`` gets handled as ``r._act_on_(s, True)`` or
346346
``s._acted_upon_(r, False)`` and ``s * r`` as ``r._act_on_(s, False)`` or
347347
``s._acted_upon_(r, True)``. There is no constraint on the type or parents
348-
of objects passed to these methods; raise a ``TypeError`` or ``ValueError``
348+
of objects passed to these methods; raise a :class:`TypeError` or :class:`ValueError`
349349
if the wrong kind of object is passed in to indicate the action is not
350350
appropriate here.
351351

src/doc/en/thematic_tutorials/tutorial-programming-python.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ indentation. Most of the time a new block is introduced by
176176

177177
.. CODE-BLOCK:: python
178178
179-
raise <ErrorType> [, error message]
179+
raise <ErrorType>[("error message")]
180180
181-
Usual errors include ``ValueError`` and ``TypeError``.
181+
Usual errors include :class:`ValueError` and :class:`TypeError`.
182182

183183
Functions
184184
=========

src/doc/en/tutorial/interactive_shell.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ Errors and Exceptions
426426
When something goes wrong, you will usually see a Python
427427
"exception". Python even tries to suggest what raised the
428428
exception. Often you see the name of the exception, e.g.,
429-
``NameError`` or ``ValueError`` (see the Python Library Reference [PyLR]_
429+
:class:`NameError` or :class:`ValueError` (see the Python Library Reference [PyLR]_
430430
for a complete list of exceptions). For example,
431431

432432
.. skip

src/doc/en/tutorial/tour_algebra.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ functions are defined to be ``var(...)``. As an example:
1616
sage: diff(sin(u), u)
1717
cos(u)
1818

19-
If you get a ``NameError``, check to see if you misspelled something,
19+
If you get a :class:`NameError`, check to see if you misspelled something,
2020
or forgot to define a variable with ``var(...)``.
2121

2222

src/doc/en/tutorial/tour_functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ These functions can be plotted, but not differentiated or integrated.
2424
Graphics object consisting of 1 graphics primitive
2525

2626
In the last line, note the syntax. Using ``plot(f(z), 0, 2)`` instead
27-
will give a ``NameError``, because ``z`` is a dummy variable in the
27+
will give a :class:`NameError`, because ``z`` is a dummy variable in the
2828
definition of ``f`` and is not defined outside of that definition.
2929
In order to be able to use ``f(z)`` in the plot command, ``z``
3030
(or whatever is desired) needs to be defined as a variable. We

0 commit comments

Comments
 (0)