[issue34067] Problem with contextlib.nullcontext

2020-11-02 Thread Irit Katriel
Change by Irit Katriel : -- stage: patch review -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34067] Problem with contextlib.nullcontext

2020-11-02 Thread Irit Katriel
Change by Irit Katriel : -- pull_requests: -21767 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue34067] Problem with contextlib.nullcontext

2020-10-20 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.10, Python 3.9 -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue34067] Problem with contextlib.nullcontext

2020-10-20 Thread Irit Katriel
Change by Irit Katriel : -- pull_requests: +21767 pull_request: https://github.com/python/cpython/pull/22811 ___ Python tracker ___

[issue34067] Problem with contextlib.nullcontext

2020-10-11 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue34067] Problem with contextlib.nullcontext

2020-10-09 Thread Irit Katriel
Irit Katriel added the comment: For the original problem, how about this? def process_file(file_or_path): if isinstance(file_or_path, str): # If string, open file cm = open else: # Caller is responsible for closing file

[issue34067] Problem with contextlib.nullcontext

2018-07-11 Thread Nick Coghlan
Nick Coghlan added the comment: Right, the merged PR adds a simpler example that handles "ignore exceptions or not" by selecting between suppress() and nullcontext(). The documentation still needs updating to improve or remove the file-based example, and point out that for resources that get

[issue34067] Problem with contextlib.nullcontext

2018-07-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, the merged PR is not directly related to the original issue. -- ___ Python tracker ___ ___

[issue34067] Problem with contextlib.nullcontext

2018-07-11 Thread STINNER Victor
STINNER Victor added the comment: Can we close this issue? -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue34067] Problem with contextlib.nullcontext

2018-07-09 Thread miss-islington
miss-islington added the comment: New changeset 1b6e21730417c56748d500a96cafebbaa1bd0120 by Miss Islington (bot) in branch '3.7': bpo-34067: Include a more easily understood example for nullcontext (GH-8158) https://github.com/python/cpython/commit/1b6e21730417c56748d500a96cafebbaa1bd0120 -

[issue34067] Problem with contextlib.nullcontext

2018-07-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +7752 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue34067] Problem with contextlib.nullcontext

2018-07-09 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset c287545d62edf1a1ee65727d3c57befa8c99c13a by Nick Coghlan (Daniel Porteous) in branch 'master': bpo-34067: Include a more easily understood example for nullcontext (GH-8158) https://github.com/python/cpython/commit/c287545d62edf1a1ee65727d3c57befa8

[issue34067] Problem with contextlib.nullcontext

2018-07-09 Thread Daniel Porteous
Change by Daniel Porteous : -- keywords: +patch pull_requests: +7751 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-

[issue34067] Problem with contextlib.nullcontext

2018-07-07 Thread Nick Coghlan
Nick Coghlan added the comment: That's certainly similar to the problems with contextlib.nested, but I don't think it's as inherently flawed as nested was. What I'd suggest we change the existing example to is this: from functools import partial from os import fspath def p

[issue34067] Problem with contextlib.nullcontext

2018-07-07 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue34067] Problem with contextlib.nullcontext

2018-07-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : There is a flaw in the example in the documentation for contextlib.nullcontext. def process_file(file_or_path): if isinstance(file_or_path, str): # If string, open file cm = open(file_or_path) else: