[issue13814] Document why generators don't support the context management protocol

2021-06-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Note: Rietveld patch reviews are no longer accessible so I could not look at R. 
David's comments.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2021-06-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2021-06-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 1e16217204c0e8e595c4d1e869c81899bfe3376b by Miss Islington (bot) 
in branch '3.10':
bpo-13814: Explain why generators are not context managers (GH-26835)
https://github.com/python/cpython/commit/1e16217204c0e8e595c4d1e869c81899bfe3376b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2021-06-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset d881002fbdf12ddbd93db3e182dc5cdeb1f90386 by Miss Islington (bot) 
in branch '3.9':
bpo-13814: Explain why generators are not context managers (GH-26835)
https://github.com/python/cpython/commit/d881002fbdf12ddbd93db3e182dc5cdeb1f90386


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2021-06-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25418
pull_request: https://github.com/python/cpython/pull/26837

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2021-06-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 51f45d085dad3b708f6fe166af517aba69e7e9f7 by Terry Jan Reedy in 
branch 'main':
bpo-13814: Explain why generators are not context managers (GH-26835)
https://github.com/python/cpython/commit/51f45d085dad3b708f6fe166af517aba69e7e9f7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2021-06-21 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +25417
pull_request: https://github.com/python/cpython/pull/26836

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2021-06-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I added a simplified answer after a similar question about assignment and CMs.

--
keywords:  -easy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2021-06-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +25416
pull_request: https://github.com/python/cpython/pull/26835

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2021-06-21 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy -patch
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2016-01-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage: needs patch -> patch review
versions: +Python 3.5, Python 3.6 -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2015-04-21 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


--
nosy: +vadmium

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13814
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2015-04-13 Thread Aidan Lowe

Changes by Aidan Lowe megadud...@gmail.com:


--
keywords: +patch
versions: +Python 3.4 -Python 3.3
Added file: http://bugs.python.org/file38955/design.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13814
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2015-04-13 Thread R. David Murray

R. David Murray added the comment:

Looks like the right approach, I hadn't thought of the design FAQ, but it makes 
sense as a place to put it.  I made a couple of review comments.

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13814
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2012-01-22 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
nosy: +meador.inge

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13814
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13814] Document why generators don't support the context management protocol

2012-01-21 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Generators deliberately don't support the context management protocol. This is 
so that they raise an explicit TypeError or AttributeError (pointing out that 
__exit__ is missing) if you leave out the @contextmanager decorator when you're 
using a generator to write an actual context manager.

Generators supporting the context management protocol natively would turn that 
into a far more subtle (and confusing) error: your code would silently fail to 
invoke the generator body.

Ensuring this common error remains easy to detect is far more important than 
making it easier to invoke close() on a generator object (particularly when 
contextlib.closing() already makes that very easy).

--
assignee:  - docs@python
components: +Documentation
nosy: +docs@python
stage: test needed - needs patch
status: pending - open
title: Generators as context managers. - Document why generators don't support 
the context management protocol

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13814
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com