Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

links for Python standard errors using class role in src/doc #35955

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/doc/de/tutorial/interactive_shell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ Fehlerbehandlung
Wenn irgendetwas schief geht, werden Sie normalerweise eine
Python-Fehlermeldung sehen. Python macht sogar einen Vorschlag, was den
Fehler ausgelöst hat. Oft sehen Sie den Namen der Fehlermeldung,
z.B. ``NameError`` oder ``ValueError`` (vgl. Python Library Reference
z.B. :class:`NameError` oder :class:`ValueError` (vgl. Python Library Reference
[PyLR]_ für eine komplette Liste der Fehlermeldungen). Zum Beispiel:

.. skip
Expand Down
4 changes: 2 additions & 2 deletions src/doc/en/faq/faq-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ issue these commands:
import _tkinter
import Tkinter

If they do not raise an ``ImportError`` then it worked.
If they do not raise an :class:`ImportError` then it worked.


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


Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/installation/source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ If
sage: import _tkinter
sage: import Tkinter

does not raise an ``ImportError``, then it worked.
does not raise an :class:`ImportError`, then it worked.

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

Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/reference/coercion/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ Methods to implement
this case ``r * s`` gets handled as ``r._act_on_(s, True)`` or
``s._acted_upon_(r, False)`` and ``s * r`` as ``r._act_on_(s, False)`` or
``s._acted_upon_(r, True)``. There is no constraint on the type or parents
of objects passed to these methods; raise a ``TypeError`` or ``ValueError``
of objects passed to these methods; raise a :class:`TypeError` or :class:`ValueError`
if the wrong kind of object is passed in to indicate the action is not
appropriate here.

Expand Down
4 changes: 2 additions & 2 deletions src/doc/en/thematic_tutorials/tutorial-programming-python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ indentation. Most of the time a new block is introduced by

.. CODE-BLOCK:: python

raise <ErrorType> [, error message]
raise <ErrorType>[("error message")]

Usual errors include ``ValueError`` and ``TypeError``.
Usual errors include :class:`ValueError` and :class:`TypeError`.

Functions
=========
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/tutorial/interactive_shell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ Errors and Exceptions
When something goes wrong, you will usually see a Python
"exception". Python even tries to suggest what raised the
exception. Often you see the name of the exception, e.g.,
``NameError`` or ``ValueError`` (see the Python Library Reference [PyLR]_
:class:`NameError` or :class:`ValueError` (see the Python Library Reference [PyLR]_
for a complete list of exceptions). For example,

.. skip
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/tutorial/tour_algebra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ functions are defined to be ``var(...)``. As an example:
sage: diff(sin(u), u)
cos(u)

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


Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/tutorial/tour_functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ These functions can be plotted, but not differentiated or integrated.
Graphics object consisting of 1 graphics primitive

In the last line, note the syntax. Using ``plot(f(z), 0, 2)`` instead
will give a ``NameError``, because ``z`` is a dummy variable in the
will give a :class:`NameError`, because ``z`` is a dummy variable in the
definition of ``f`` and is not defined outside of that definition.
In order to be able to use ``f(z)`` in the plot command, ``z``
(or whatever is desired) needs to be defined as a variable. We
Expand Down
5 changes: 3 additions & 2 deletions src/doc/fr/tutorial/interactive_shell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,9 @@ Erreurs et exceptions
Quand quelque chose ne marche pas, cela se manifeste habituellement par
une « exception » Python. Python essaie de plus de donner une idée de ce
qui a pu déclencher l'exception. Bien souvent, il affiche le nom de
l'exception (par exemple ``NameError`` ou ``ValueError``, voir le manuel
de référence de la bibliothèque de Python [PyLR]_ pour une liste complète). Par exemple :
l'exception (par exemple :class:`NameError` ou :class:`ValueError`, voir
le manuel de référence de la bibliothèque de Python [PyLR]_ pour une liste
complète). Par exemple :

.. skip

Expand Down
4 changes: 2 additions & 2 deletions src/doc/it/faq/faq-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ lancia i seguenti comandi dall'interfaccia a riga di comando di Sage::
import _tkinter
import Tkinter

Se non ti viene segnalato alcun errore di ``ImportError``
Se non ti viene segnalato alcun errore di :class:`ImportError`
allora il problema è risolto.


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

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

Expand Down
2 changes: 1 addition & 1 deletion src/doc/ja/tutorial/interactive_shell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ IPythonのクイック レファレンスガイドを見たければ, ``%quick
=====================

処理中に何かまずいことが起きると,Pythonはふつう『例外』(exception)を発生し,その例外を引き起こした原因を教えてくれることもある.
よくお目にかかることになるのは, ``NameError````ValueError`` といった名称の例外だ(Pythonライブラリーリファレンス [PyLR]_ に例外名の包括的なリストがある).
よくお目にかかることになるのは, :class:`NameError` や :class:`ValueError` といった名称の例外だ(Pythonライブラリーリファレンス [PyLR]_ に例外名の包括的なリストがある).
実例を見てみよう:

::
Expand Down
2 changes: 1 addition & 1 deletion src/doc/pt/tutorial/interactive_shell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ Erros e Exceções

Quando algo errado ocorre, você usualmente verá uma "exceção" do
Python. O Python até mesmo tenta sugerir o que ocasionou a exceção,
por exemplo, ``NameError`` ou ``ValueError`` (veja o Referência da
por exemplo, :class:`NameError` ou :class:`ValueError` (veja o Referência da
Biblioteca Python [PyLR]_ para uma lista completa de exceções). Por
exemplo,

Expand Down
5 changes: 3 additions & 2 deletions src/doc/ru/tutorial/interactive_shell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,9 @@ Wall time. Однако, если существует существенная

Когда что-то идет не так, обычно можно увидеть исключение Python (Python
"exception"). Python даже попытается предположить, что вызвало ошибку. Часто
вы можете видеть имя исключения, например, ``NameError`` или ``ValueError``
(см. Python Library Reference [PyLR]_ для полного списка исключений). Например,
вы можете видеть имя исключения, например, :class:`NameError` или
:class:`ValueError` (см. Python Library Reference [PyLR]_ для полного списка
исключений). Например,

.. skip

Expand Down