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: Minor error in PEP567 code example
Type: Stage: resolved
Components: Documentation Versions: Python 3.7
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: docs@python Nosy List: MarSoft, docs@python, xtreak
Priority: normal Keywords:

Created on 2019-08-21 23:01 by MarSoft, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg350129 - (view) Author: Semyon (MarSoft) Date: 2019-08-21 23:01
In PEP-567 there is a code example in `contextvars.Context` section (https://www.python.org/dev/peps/pep-0567/#contextvars-context):

```
# Print all context variables and their values in 'ctx':
print(ctx.items())
```

But `ctx.items()` doesn't return a list of tuples as probably expected by this code; instead it returns a `items` object which, unlike `dict_items`, does not contain any sensible `repr` or `str`. So this print statement will output something like `<items at 0x7f7fbd91e468>`.

I think this code example should be chaned to something like `print(list(ctx.items()))`.
msg350151 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-08-22 01:34
PEPs have their own GitHub issue tracker though I am not sure of edits to this PEP.
 GitHub : https://github.com/python/peps/issues . This can be closed as third party.
History
Date User Action Args
2022-04-11 14:59:19adminsetgithub: 82092
2019-10-24 09:31:30xtreaksetstatus: open -> closed
resolution: third party
stage: resolved
2019-08-22 01:34:49xtreaksetnosy: + xtreak
messages: + msg350151
2019-08-21 23:01:15MarSoftcreate