GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — gh-105834: Add tests for calling `issubclass()` between two protocols by AlexWaygood · Pull Request #105835 · python/cpython Conversation
|
|
When you're done making the requested changes, leave the comment: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @JelleZijlstra! I knew I had to be missing something 😖 Here's a complete repro: >>> from typing import * >>> @runtime_checkable ... class CallableMembersProto(Protocol): ... def meth(self): ... ... >>> class NonCallableMembersProto(Protocol): ... meth: Callable[[], None] ... >>> issubclass(NonCallableMembersProto, CallableMembersProto) True The last line would be I can see arguments both ways in terms of whether it's desirable behaviour, and it seems really unlikely to come up in practice. (PEP-544 doesn't seem to discuss this point at all.) But given that this has been established behaviour since Python 3.8, I agree that we should probably keep it. (I also can't find any significant performance improvement from removing this block of code.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
typing.pyissubclass() between two protocols
|
I have made the requested changes; please review again |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for making the requested changes! @carljm, @JelleZijlstra: please review the changes made to this pull request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @AlexWaygood, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-105859 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…tocols (pythonGH-105835) Some parts of the implementation of `typing.Protocol` had poor test coverage (cherry picked from commit 70c075c) Co-authored-by: Alex Waygood <[email protected]>
…two protocols (python#105835) Some parts of the implementation of `typing.Protocol` had poor test coverage
|
GH-105860 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…otocols (GH-105835) (#105859) Some parts of the implementation of `typing.Protocol` had poor test coverage (cherry picked from commit 70c075c) Co-authored-by: Alex Waygood <[email protected]>
* main: pythongh-104799: PEP 695 backward compatibility for ast.unparse (python#105846) pythongh-105834: Add tests for calling `issubclass()` between two protocols (python#105835) CI: Remove docs build from Azure Pipelines (python#105823) pythongh-105844: Consistently use 'minor version' for X.Y versions (python#105851) Fix inaccuracies in "Assorted Topics" section of "Defining Extension Types" tutorial (python#104969) pythongh-105433: Add `pickle` tests for PEP695 (python#105443) bpo-44530: Document the change in MAKE_FUNCTION behavior (python#93189) pythonGH-103124: Multiline statement support for pdb (pythonGH-103125) pythonGH-105588: Add missing error checks to some obj2ast_* converters (pythonGH-105589)
…tocols (python#105835) Some parts of the implementation of `typing.Protocol` had poor test coverage
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.