[3.11] gh-101100: Fix Sphinx warnings in `tutorial/controlflow.rst` (GH-109424) (#110085)
https://github.com/python/cpython/commit/58ac0ed093754c34884b152e05cbf5a009b... commit: 58ac0ed093754c34884b152e05cbf5a009b49576 branch: 3.11 author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> committer: hugovk <hugovk@users.noreply.github.com> date: 2023-09-29T08:36:24Z summary: [3.11] gh-101100: Fix Sphinx warnings in `tutorial/controlflow.rst` (GH-109424) (#110085) Co-authored-by: Maciej Olko <maciej.olko@affirm.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> files: M Doc/tools/.nitignore M Doc/tutorial/controlflow.rst diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore index 36ea3a95314ff..dace135cb560f 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -150,7 +150,6 @@ Doc/reference/datamodel.rst Doc/reference/expressions.rst Doc/reference/import.rst Doc/reference/simple_stmts.rst -Doc/tutorial/controlflow.rst Doc/tutorial/datastructures.rst Doc/tutorial/introduction.rst Doc/using/cmdline.rst diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 4bcc3768111cc..aa9caa101da40 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -534,7 +534,7 @@ This example, as usual, demonstrates some new Python features: Different types define different methods. Methods of different types may have the same name without causing ambiguity. (It is possible to define your own object types and methods, using *classes*, see :ref:`tut-classes`) - The method :meth:`~list.append` shown in the example is defined for list objects; it + The method :meth:`!append` shown in the example is defined for list objects; it adds a new element at the end of the list. In this example it is equivalent to ``result = result + [a]``, but more efficient. @@ -1046,7 +1046,7 @@ Function Annotations information about the types used by user-defined functions (see :pep:`3107` and :pep:`484` for more information). -:term:`Annotations <function annotation>` are stored in the :attr:`__annotations__` +:term:`Annotations <function annotation>` are stored in the :attr:`!__annotations__` attribute of the function as a dictionary and have no effect on any other part of the function. Parameter annotations are defined by a colon after the parameter name, followed by an expression evaluating to the value of the annotation. Return annotations are
participants (1)
-
hugovk