Skip to content

Commit 9d12aa5

Browse files
committed
links for Python standard errors using class role in src/doc
1 parent 1ca4a47 commit 9d12aa5

File tree

13 files changed

+20
-18
lines changed

13 files changed

+20
-18
lines changed

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

src/doc/fr/tutorial/interactive_shell.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,9 @@ Erreurs et exceptions
432432
Quand quelque chose ne marche pas, cela se manifeste habituellement par
433433
une « exception » Python. Python essaie de plus de donner une idée de ce
434434
qui a pu déclencher l'exception. Bien souvent, il affiche le nom de
435-
l'exception (par exemple ``NameError`` ou ``ValueError``, voir le manuel
436-
de référence de la bibliothèque de Python [PyLR]_ pour une liste complète). Par exemple :
435+
l'exception (par exemple :class:`NameError` ou :class:`ValueError`, voir
436+
le manuel de référence de la bibliothèque de Python [PyLR]_ pour une liste
437+
complète). Par exemple :
437438

438439
.. skip
439440

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ lancia i seguenti comandi dall'interfaccia a riga di comando di Sage::
9898
import _tkinter
9999
import Tkinter
100100

101-
Se non ti viene segnalato alcun errore di ``ImportError``
101+
Se non ti viene segnalato alcun errore di :class:`ImportError`
102102
allora il problema è risolto.
103103

104104

@@ -662,7 +662,7 @@ Con degli oggetti "a" e "b" ed una funzione "f" ho digitato accidentalmente "f(a
662662

663663
Questo è dovuto a come sono definite le funzioni in Sage con la
664664
notazione ``f(x)=expr`` usando il preparser. Nota anche che se fai
665-
quest'errore in un costrutto ``if``, avrai un errore ``SyntaxError``
665+
quest'errore in un costrutto ``if``, avrai un errore :class:`SyntaxError`
666666
prima di qualunque altro comportamento errato, quindi, in questo caso,
667667
non hai il problema.
668668

0 commit comments

Comments
 (0)