[issue38008] ContextManager and AsyncContextManager protocols can't be subclassed

2019-09-02 Thread Divij Rajkumar


Change by Divij Rajkumar :


--
nosy: divijrajkumar
priority: normal
severity: normal
status: open
title: ContextManager and AsyncContextManager protocols can't be subclassed
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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



[issue38008] ContextManager and AsyncContextManager protocols can't be subclassed

2019-09-02 Thread Divij Rajkumar


New submission from Divij Rajkumar :

Reported this initially on github - https://github.com/python/typing/pull/650

The problem is in the typing code that checks if any of the parent classes for 
a Protocol are builtin protocols. The code today maintains a whitelist of 
builtin protocols that are okay to be subclassed, but expects them all to live 
within the 'collections.abc' module. This means 'typing.ContextManager' and 
'typing.AsyncContextManager' cannot be subclassed, even though those protocols 
are listing in the whitelist.

--

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



[issue38008] ContextManager and AsyncContextManager protocols can't be subclassed

2019-09-02 Thread Divij Rajkumar


Divij Rajkumar  added the comment:

I'd like to take a stab at putting up a patch for this but I've never 
contributed anything to Python before, so I'll have a read through the 
contribution docs and put up a PR.

--

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



[issue38008] ContextManager and AsyncContextManager protocols can't be subclassed

2019-09-02 Thread Divij Rajkumar


Change by Divij Rajkumar :


--
keywords: +patch
pull_requests: +15313
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15647

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