classification
Title: Documentation error in inspect module
Type: Stage: patch review
Components: Documentation Versions: Python 3.7, Python 3.6, Python 3.3, Python 3.4, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, jalexvig, marco.buttu, serhiy.storchaka, utkarsh2102
Priority: normal Keywords: patch

Created on 2017-07-17 17:29 by jalexvig, last changed 2019-01-30 14:54 by utkarsh2102.

Pull Requests
URL Status Linked Edit
PR 2742 closed jalexvig, 2017-07-17 19:01
PR 2743 open jalexvig, 2017-07-17 19:38
PR 10668 closed utkarsh2102, 2018-11-22 22:12
Messages (4)
msg298545 - (view) Author: Alex (jalexvig) * Date: 2017-07-17 17:29
The documentation for co_names in the inspect module is:

"tuple of names of local variables"

Local variable names are however in co_varnames while co_names contains global variable names. This description should read:

"tuple of names of global variables"

Relevant StackOverflow post here:

https://stackoverflow.com/q/45147260/1953800
msg298644 - (view) Author: Marco Buttu (marco.buttu) * Date: 2017-07-19 08:49
Or maybe: "tuple of names of global variables used in the bytecode"
msg330300 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-11-23 08:58
co_names contains not only names of global variables. It contains also local names in the class scope, attribute names, names of imported modules, etc.
msg334563 - (view) Author: Utkarsh Gupta (utkarsh2102) * Date: 2019-01-30 14:54
Serhiy: What change d'you possibly suggest then?
History
Date User Action Args
2019-01-30 14:54:29utkarsh2102setmessages: + msg334563
2018-11-23 08:58:28serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg330300
2018-11-22 22:41:40utkarsh2102setnosy: + utkarsh2102
2018-11-22 22:12:56utkarsh2102setkeywords: + patch
stage: patch review
pull_requests: + pull_request9921
2017-07-19 08:49:57marco.buttusetnosy: + marco.buttu
messages: + msg298644
2017-07-17 19:38:27jalexvigsetpull_requests: + pull_request2803
2017-07-17 19:01:45jalexvigsetpull_requests: + pull_request2802
2017-07-17 17:29:35jalexvigcreate