[issue37911] Minor error in PEP567 code example
New submission from Semyon <simeon+bpo@maryasin.name>: 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()))`. ---------- assignee: docs@python components: Documentation messages: 350129 nosy: MarSoft, docs@python priority: normal severity: normal status: open title: Minor error in PEP567 code example versions: Python 3.7 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue37911> _______________________________________
Karthikeyan Singaravelan <tir.karthi@gmail.com> added the comment: 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. ---------- nosy: +xtreak _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue37911> _______________________________________
Change by Karthikeyan Singaravelan <tir.karthi@gmail.com>: ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue37911> _______________________________________
participants (2)
-
Karthikeyan Singaravelan
-
Semyon