Skip to content

Docs: correct output from interactive mode in tutorial pages #91478

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alex-krav
Copy link

No description provided.

@ghost
Copy link

ghost commented Apr 12, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@AlexWaygood
Copy link
Member

Hi, thanks for the PR! Could you possibly change the title to something a bit more descriptive of the changes you've made? "updated tutorial example code output" isn't particularly helpful for core developers looking to review your PR.

Also, please sign the CLA, as the bot suggests, or we probably won't be able to accept this PR for legal reasons 🙂

@alex-krav alex-krav changed the title updated tutorial example code output updated code listings error messages Apr 13, 2022
@alex-krav
Copy link
Author

Hi @AlexWaygood. I made updates. Thanks!

@slateny slateny changed the title updated code listings error messages Correct output from interactive mode in tutorial pages Jan 11, 2023
@@ -807,7 +807,6 @@ using the :func:`next` built-in function; this example shows how it all works::
>>> next(it)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
next(it)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true for 3.12 and 3.11, but on current main I get:

>>> next(it)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    next(it)
    ~~~~^^^^
StopIteration

@@ -339,7 +339,7 @@ Without arguments, :func:`dir` lists the names you have defined currently::
>>> import fibo
>>> fib = fibo.fib
>>> dir()
['__builtins__', '__name__', 'a', 'fib', 'fibo', 'sys']
['__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'a', 'fib', 'fibo', 'sys']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the example suggesting this is a fresh REPL session? If so, sys is not imported.

Suggested change
['__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'a', 'fib', 'fibo', 'sys']
['__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'a', 'fib', 'fibo']

@@ -280,6 +280,7 @@ applications include caching objects that are expensive to create::
d['primary'] # entry was automatically removed
File "C:/python311/lib/weakref.py", line 46, in __getitem__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
File "C:/python311/lib/weakref.py", line 46, in __getitem__
File "C:/python313/lib/weakref.py", line 136, in __getitem__

@erlend-aasland erlend-aasland changed the title Correct output from interactive mode in tutorial pages Docs: correct output from interactive mode in tutorial pages Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

5 participants