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: ContextVar does not have a "name" attribute
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: miss-islington, ned.deily, rvijayak, yselivanov
Priority: high Keywords: patch

Created on 2018-06-27 22:45 by rvijayak, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 7980 merged yselivanov, 2018-06-27 22:59
PR 7995 merged miss-islington, 2018-06-28 17:21
Messages (4)
msg320637 - (view) Author: Rajiv Vijayakumar (rvijayak) * Date: 2018-06-27 22:45
Per PEP 567 and the contextvars documentation, I expected that a ContextVar would have a "name" read-only attribute. However I get an AttributeError when accessing ContextVar.name with 3.7.0rc1:

> python
Python 3.7.0rc1 (v3.7.0rc1:dfad352267, Jun 12 2018, 01:00:10) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from contextvars import ContextVar
>>> var = ContextVar('var')
>>> var.name
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'ContextVar' object has no attribute 'name'
msg320639 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-06-27 22:58
Yeah, it seems that I forgot to implement ContextVars.name attribute.  Will have a PR shortly.

Expect to see this fixed in 3.7.1 in a couple of months.  Adding Ned to the issue just in case.
msg320677 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-06-28 17:20
New changeset 41cb0baea96a80360971908a0bd79d9d40dd5e44 by Yury Selivanov in branch 'master':
bpo-33985: Implement ContextVar.name attribute. (GH-7980)
https://github.com/python/cpython/commit/41cb0baea96a80360971908a0bd79d9d40dd5e44
msg320678 - (view) Author: miss-islington (miss-islington) Date: 2018-06-28 17:40
New changeset 4c20d2bf5daaaa174260558c71052b73d73b6c34 by Miss Islington (bot) in branch '3.7':
bpo-33985: Implement ContextVar.name attribute. (GH-7980)
https://github.com/python/cpython/commit/4c20d2bf5daaaa174260558c71052b73d73b6c34
History
Date User Action Args
2022-04-11 14:59:02adminsetgithub: 78166
2018-06-28 17:58:08yselivanovsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-06-28 17:40:03miss-islingtonsetnosy: + miss-islington
messages: + msg320678
2018-06-28 17:21:40miss-islingtonsetpull_requests: + pull_request7605
2018-06-28 17:20:57yselivanovsetpriority: release blocker -> high
2018-06-28 17:20:32yselivanovsetmessages: + msg320677
2018-06-27 22:59:11yselivanovsetkeywords: + patch
stage: patch review
pull_requests: + pull_request7591
2018-06-27 22:58:37yselivanovsetpriority: normal -> release blocker
versions: + Python 3.8
nosy: + ned.deily

messages: + msg320639

components: + Interpreter Core, - Library (Lib)
2018-06-27 22:45:59rvijayakcreate