This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Missing >>> in Python code example
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: Ramchandra Apte, chris.jerdonek, docs@python, ezio.melotti, python-dev
Priority: normal Keywords:

Created on 2012-09-24 14:27 by Ramchandra Apte, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg171143 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2012-09-24 14:27
In http://docs.python.org/py3k/tutorial/stdlib2.html#logging , some code in a code sample is missing ">>>".

The code is:

unsearched = deque([starting_node])
def breadth_first_search(unsearched):
    node = unsearched.popleft()
    for m in gen_moves(node):
        if is_goal(m):
            return m
        unsearched.append(m)


should be:
>>> unsearched = deque([starting_node])
>>> def breadth_first_search(unsearched):
>>>    node = unsearched.popleft()
>>>    for m in gen_moves(node):
>>>        if is_goal(m):
>>>            return m
>>>        unsearched.append(m)
msg171145 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-09-24 14:32
New changeset ce943bce76c9 by Ezio Melotti in branch '2.7':
#16019, #16020: fix syntax highlight.
http://hg.python.org/cpython/rev/ce943bce76c9

New changeset 101354f95a07 by Ezio Melotti in branch '3.2':
#16019, #16020: fix syntax highlight.
http://hg.python.org/cpython/rev/101354f95a07

New changeset 62ddf16eea24 by Ezio Melotti in branch 'default':
#16019, #16020: merge with 3.2.
http://hg.python.org/cpython/rev/62ddf16eea24
msg171146 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-09-24 14:32
Fixed, thanks for the report!
msg171149 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-09-24 14:34
Thanks for the report.  Minor clarification for future reference.  Subsequent lines should begin with "..." (when doctest-style is used):

>>> def breadth_first_search(unsearched):
...     node = unsearched.popleft()
etc.
msg171151 - (view) Author: Ramchandra Apte (Ramchandra Apte) * Date: 2012-09-24 14:52
This issue still does not appear to be fixed - looking at http://hg.python.org/cpython/file/101354f95a07/Doc/tutorial/stdlib2.rst .

And sorry, the URL should be http://docs.python.org/py3k/tutorial/stdlib2.html#tools-for-working-with-lists.
msg171152 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-09-24 14:54
The code didn't have any output, so I created a separate code block with regular Python highlight -- no need to add >>>/... there.
History
Date User Action Args
2022-04-11 14:57:36adminsetgithub: 60224
2012-09-24 14:54:34ezio.melottisetmessages: + msg171152
2012-09-24 14:52:49Ramchandra Aptesetmessages: + msg171151
2012-09-24 14:34:15chris.jerdoneksetnosy: + chris.jerdonek
messages: + msg171149
2012-09-24 14:32:42ezio.melottisetstatus: open -> closed

type: enhancement
assignee: docs@python -> ezio.melotti
versions: + Python 2.7, Python 3.2, Python 3.3
nosy: + ezio.melotti

messages: + msg171146
resolution: fixed
stage: resolved
2012-09-24 14:32:03python-devsetnosy: + python-dev
messages: + msg171145
2012-09-24 14:27:11Ramchandra Aptecreate