-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ForwardRef
on 3.12
#25
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Do they not happen locally? |
type_params: ( | ||
tuple[typing.TypeVar | typing.ParamSpec | typing.TypeVarTuple, ...] | ||
| frozenset[str] | ||
| None | ||
) = None, | ||
recursive_guard: frozenset[str] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type_params: ( | |
tuple[typing.TypeVar | typing.ParamSpec | typing.TypeVarTuple, ...] | |
| frozenset[str] | |
| None | |
) = None, | |
recursive_guard: frozenset[str] | None = None, | |
*args: Any, **kwargs: Any |
and then pass those through, much simpler and safer. I don't think this version of ForwardRef
needs to be particularly user-friendly or well-hinted, and accurate hints depend on the Python version anyway. @bswck wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PerchunPak if you're happy with this suggestion then you can go ahead with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and then pass those through, much simpler and safer. I don't think this version of
ForwardRef
needs to be particularly user-friendly or well-hinted, and accurate hints depend on the Python version anyway. @bswck wdyt?
Agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can @functools.wraps(ForwardRef._evaluate)
in case we want to be pedantic.
That... *should*... work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea, thanks!
Python 3.12 added a new argument which broke the library. It also made one of the arguments keyword-only which I also fixed.
Thanks @PerchunPak! |
Python 3.12 added a new argument which broke the library. It also made one of the arguments keyword-only which I also fixed.
Fixes #24