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: dir() docs show incorrect output
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mwh Nosy List: mwh, quiver, stillflame
Priority: normal Keywords:

Created on 2005-04-26 22:20 by stillflame, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg25144 - (view) Author: Martin Chase (stillflame) Date: 2005-04-26 22:20
on the web at http://docs.python.org/tut/node8.html

under "6.3 The dir() Function",
the following text reports incorrectly what the dir()
call would return:

  >>> a = [1, 2, 3, 4, 5]
  >>> import fibo, sys
  >>> fib = fibo.fib
  >>> dir()
  ['__builtins__', '__doc__', '__file__', '__name__',
'fib', 'fib2']

it should have 'a' and 'fibo',
but not 'fib2'.
msg25145 - (view) Author: George Yoshida (quiver) (Python committer) Date: 2005-04-27 03:36
Logged In: YES 
user_id=671362

A minor nit.
> it should have 'a' and 'fibo',
'sys' is also missing from the list.

>>> dir()
['__builtins__', '__doc__', '__file__', '__name__', 'a', 'fib', 'fibo', '
sys']
msg25146 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2005-04-27 10:00
Logged In: YES 
user_id=6656

Fixed in rev 1.270 of Doc/tut.tex.

Thanks for the report!
msg25147 - (view) Author: George Yoshida (quiver) (Python committer) Date: 2005-05-01 15:00
Logged In: YES 
user_id=671362

> -['__builtins__', '__doc__', '__file__', '__name__', 'fib', 'fib2']
> +['__builtins__', '__doc__', '__file__', '__name__', 'a', 'fib']

So, where is 'fibo'?
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 41909
2005-04-26 22:20:22stillflamecreate