Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
assignee = None
closed_at = <Date 2020-11-09.13:24:59.262>
created_at = <Date 2020-08-13.20:58:48.583>
labels = ['type-feature', 'library', '3.10', 'expert-asyncio']
title = "contextlib.nullcontext doesn't work with async context managers"
updated_at = <Date 2020-11-09.13:24:59.261>
user = 'https://github.com/tomgrin10'
activity = <Date 2020-11-09.13:24:59.261>
actor = 'asvetlov'
assignee = 'none'
closed = True
closed_date = <Date 2020-11-09.13:24:59.262>
closer = 'asvetlov'
components = ['Library (Lib)', 'asyncio']
creation = <Date 2020-08-13.20:58:48.583>
creator = 'tomgrin10'
dependencies = 
files = 
hgrepos = 
issue_num = 41543
keywords = ['patch']
message_count = 4.0
messages = ['375346', '375351', '375357', '380582']
nosy_count = 4.0
nosy_names = ['njs', 'asvetlov', 'yselivanov', 'tomgrin10']
pr_nums = ['21870']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue41543'
versions = ['Python 3.10']
The text was updated successfully, but these errors were encountered:
contextlib.nullcontext cannot be used with async conetext managers, because it implements only __enter__ and __exit__, and doesn't implement __aenter__ and __aexit__.
Sorry, something went wrong.
I typically don't like objects that support both with and async with, but in this case I think that's appropriate. Nathaniel, Andrew, what do you think?
It does seem pretty harmless in this case.
New changeset a117167 by Tom Gringauz in branch 'master':
bpo-41543: contextlib.nullcontext can fill in for an async context manager (GH-21870)
No branches or pull requests