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
Interface: Make annotation check optional #5775
Conversation
Fixes: pyca#5774 Signed-off-by: Christian Heimes <cheimes@redhat.com>
src/cryptography/utils.py
Outdated
def strip_annotation(signature): | ||
return inspect.Signature( | ||
[ | ||
inspect.Parameter( | ||
param.name, | ||
param.kind, | ||
default=param.default, | ||
annotation=inspect.Parameter.empty, | ||
) | ||
for param in signature.parameters.values() | ||
] | ||
) |
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.
What about replace
methods?
for example,
return signature.replace(
parameters=[
param.replace(annotation=inspect.Parameter.empty)
for param in signature.parameters.values()
],
return_annotation=inspect.Signature.empty,
)
Co-authored-by: Stanislav Levin <slev@altlinux.org> Signed-off-by: Christian Heimes <cheimes@redhat.com>
Interesting, I hadn't realized anyone was using |
If we're breaking people on this we should definitely merge a fix. I'm fine with this approach. |
Note that this does change the default on whether it verifies sigs, I suppose that's fine? |
Yeah I'm fine with that to be clear :) |
* Interface: Make annotation check optional Fixes: pyca#5774 Signed-off-by: Christian Heimes <cheimes@redhat.com> * Use param.replace() Co-authored-by: Stanislav Levin <slev@altlinux.org> Signed-off-by: Christian Heimes <cheimes@redhat.com> Co-authored-by: Stanislav Levin <slev@altlinux.org>
* Interface: Make annotation check optional Fixes: #5774 Signed-off-by: Christian Heimes <cheimes@redhat.com> * Use param.replace() Co-authored-by: Stanislav Levin <slev@altlinux.org> Signed-off-by: Christian Heimes <cheimes@redhat.com> Co-authored-by: Stanislav Levin <slev@altlinux.org> Co-authored-by: Stanislav Levin <slev@altlinux.org>
Fixes: #5774
Signed-off-by: Christian Heimes cheimes@redhat.com