Clarify error message for non @runtime_checkable
decorated protocols
#178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi
typing-extension
team.typing-extension
version 4.6.0 just came out. It has caused some of the CI failures on our side (https://github.com/metaopt/optree/actions/runs/5054617196/jobs/9069750456). We are going to fix this misusage as a bug on our side (as the new behavior will be the standard API in future Python releases). But I found the error message that was raised is not very clear.typing_extensions/src/typing_extensions.py
Lines 703 to 704 in 356934c
typing_extensions/src/typing_extensions.py
Lines 759 to 760 in 356934c
This PR changes deprecated
@runtime
to formal API@runtime_checkable
in the error message.The error in https://github.com/metaopt/optree/actions/runs/5054617196/jobs/9069750456 was raised by:
Refs:
Protocol
fixes from 3.12 #161@runtime_checkable
, not@runtime
#134@runtime_checkable
decorator forCustomTreeNode
protocol class metaopt/optree#56