Skip to content

Commit fae75b7

Browse files
committed
Doc: Add Ellipsis reference into the pass statement section at tutorial
1 parent 011ceb9 commit fae75b7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Doc/tutorial/controlflow.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ statements: a ``try`` statement's ``else`` clause runs when no exception
251251
occurs, and a loop's ``else`` clause runs when no ``break`` occurs. For more on
252252
the ``try`` statement and exceptions, see :ref:`tut-handling`.
253253

254+
.. index:: single: ...; placeholder
254255
.. _tut-pass:
255256

256257
:keyword:`!pass` Statements
@@ -277,6 +278,12 @@ at a more abstract level. The :keyword:`!pass` is silently ignored::
277278
... pass # Remember to implement this!
278279
...
279280

281+
For this last case, many people use the ellipsis literal :code:`...` instead of
282+
:code:`pass`. This use has no special meaning to Python, and it is not part of
283+
the language definition (you could use any constant expression here), but
284+
:code:`...` is used conventionally as a placeholder body as well.
285+
See :ref:`bltin-ellipsis-object`.
286+
280287

281288
.. _tut-match:
282289

0 commit comments

Comments
 (0)