Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(58)

#25609: Add a ContextManager ABC and type

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 year, 8 months ago by brett
Modified:
1 year, 7 months ago
Reviewers:
pitrou, guido
CC:
gvanrossum, brett.cannon, rhettinger, Nick Coghlan, devnull_psf.upfronthosting.co.za, Martin Panter, jstasiak, nanwu, supriyantomaftuh_yahoo.com
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/library/contextlib.rst View 1 1 chunk +11 lines, -0 lines 0 comments Download
Doc/library/typing.rst View 1 2 chunks +6 lines, -2 lines 0 comments Download
Lib/contextlib.py View 1 7 chunks +31 lines, -10 lines 0 comments Download
Lib/test/test_contextlib.py View 1 1 chunk +33 lines, -0 lines 0 comments Download
Lib/test/test_typing.py View 1 2 chunks +14 lines, -0 lines 2 comments Download
Lib/typing.py View 1 3 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 2
AntoinePitrou
https://bugs.python.org/review/25609/diff/16824/Lib/test/test_typing.py File Lib/test/test_typing.py (right): https://bugs.python.org/review/25609/diff/16824/Lib/test/test_typing.py#newcode1221 Lib/test/test_typing.py:1221: assert isinstance(cm, typing.ContextManager[int]) Does this really inspect the generator's ...
1 year, 7 months ago #1
gvanrossum
1 year, 7 months ago #2
https://bugs.python.org/review/25609/diff/16824/Lib/test/test_typing.py
File Lib/test/test_typing.py (right):

https://bugs.python.org/review/25609/diff/16824/Lib/test/test_typing.py#newco...
Lib/test/test_typing.py:1221: assert isinstance(cm, typing.ContextManager[int])
On 2016/04/07 15:56:21, AntoinePitrou wrote:
> Does this really inspect the generator's bytecode to detect that an integer is
> yielded?
> Or is it always true, e.g. this would pass with `typing.ContextManager[str]`
> instead? (ew...)

Note that in fact PEP 484's BDFL-delegate insisted that isinstance() shouldn't
be supported at all (https://github.com/python/typing/issues/135).
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7