[issue38908] Troubles with @runtime_checkable protocols

2021-05-27 Thread miss-islington
miss-islington added the comment: New changeset 09696a3e218404e77f8c1fbf187ca29a4a357a9d by Miss Islington (bot) in branch '3.10': [3.10] bpo-38908: [docs] Add changes to 3.10 whatsnew and fix some minor inaccuracies in news (GH-26096) (GH-26337)

[issue38908] Troubles with @runtime_checkable protocols

2021-05-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +24929 pull_request: https://github.com/python/cpython/pull/26337 ___ Python tracker ___

[issue38908] Troubles with @runtime_checkable protocols

2021-05-13 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +24736 pull_request: https://github.com/python/cpython/pull/26096 ___ Python tracker ___ ___

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread miss-islington
miss-islington added the comment: New changeset 9b90ce68503f4861ce4e9ac9444d9a82b3d943a5 by Ken Jin in branch '3.9': [3.9] Revert "[3.9] bpo-38908: Fix issue when non runtime_protocol does not raise TypeError (GH-26067)" (GH-26077)

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread Ken Jin
Ken Jin added the comment: Yurii and Kevin, thanks for pushing the patch forward! Thanks for the review too Guido. I'm closing this issue as all bugfix PRs have landed to bugfix branches. This will make its way into the next versions of Python for those respective branches. One point of

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +24717 pull_request: https://github.com/python/cpython/pull/26077 ___ Python tracker ___ ___

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread miss-islington
miss-islington added the comment: New changeset 88136bbd0500b688c05e914be031cd3c243e42d8 by Ken Jin in branch '3.9': [3.9] bpo-38908: Fix issue when non runtime_protocol does not raise TypeError (GH-26067) (GH-26075)

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread miss-islington
miss-islington added the comment: New changeset a2d94a0a9b8ae95d7d2b7fc34b501da5242ec22c by Miss Islington (bot) in branch '3.10': bpo-38908: Fix issue when non runtime_protocol failed to raise TypeError (GH-26067)

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj nosy_count: 5.0 -> 6.0 pull_requests: +24715 pull_request: https://github.com/python/cpython/pull/26075 ___ Python tracker ___

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +24713 pull_request: https://github.com/python/cpython/pull/26073 ___ Python tracker

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Please forget my previous msg, this bug still present at 3.11 version. PR contains fix proposed by Kevin. Sorry for making to much noise. -- ___ Python tracker

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: I checked and this bug is not present at 3.11 version. So I simply added test to cover case mentioned by Ivan. -- ___ Python tracker

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread Yurii Karabas
Yurii Karabas <1998uri...@gmail.com> added the comment: Hi Guido, I decided to help with this issue as far as Kevin did not respond. -- ___ Python tracker ___

[issue38908] Troubles with @runtime_checkable protocols

2021-05-12 Thread Yurii Karabas
Change by Yurii Karabas <1998uri...@gmail.com>: -- keywords: +patch nosy: +uriyyo nosy_count: 3.0 -> 4.0 pull_requests: +24708 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26067 ___ Python tracker

[issue38908] Troubles with @runtime_checkable protocols

2021-04-17 Thread Guido van Rossum
Guido van Rossum added the comment: Hi Kevin, If you want to work on this, could you come up with some test cases that try to explore edge cases for this behavior? Ideally some that already pass, and some that currently don't pass (because of the limitation mentioned by Ivan). It's possible

[issue38908] Troubles with @runtime_checkable protocols

2021-04-17 Thread Kevin Shweh
Kevin Shweh added the comment: It seems like the straightforward, minimal fix would be to just add if (getattr(cls, '_is_protocol', False) and not getattr(cls, '_is_runtime_protocol', False) and not _allow_reckless_class_cheks()): raise TypeError(...) to

[issue38908] Troubles with @runtime_checkable protocols

2019-11-26 Thread Guido van Rossum
Guido van Rossum added the comment: If the "little helper in abc" solves it, let's do that. The sys._getframe() hack has always been a bit smelly -- I assume we can get rid of that then? -- ___ Python tracker

[issue38908] Troubles with @runtime_checkable protocols

2019-11-24 Thread Ivan Levkivskyi
New submission from Ivan Levkivskyi : The PEP 544 specifies that: A protocol can be used as a second argument in isinstance() and issubclass() only if it is explicitly opt-in by @runtime_checkable decorator. It is not specified exactly whether this should be enforced by static type checkers