Skip to content
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

don't use inspect.signature, prefer code object #804

Merged
merged 4 commits into from
Jul 19, 2024

Conversation

t-vi
Copy link
Collaborator

@t-vi t-vi commented Jul 18, 2024

Fixes #803

The reason this is needed is that inspect uses the (global) sentinel inspect._empty to signify absence of (e.g. default) values. But this means that we cannot properly inspect things in the inspect module itself, and libraries do this (e.g. transformers when running BERT).

This patch avoiding signature makes the problem of signatures inside inspect being potentially misleading go away.

Copy link
Collaborator

@lantiga lantiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

@t-vi t-vi enabled auto-merge (squash) July 19, 2024 11:51
@t-vi t-vi merged commit 2358a38 into main Jul 19, 2024
36 checks passed
@t-vi t-vi deleted the tom/dont_use_inspect_signature branch July 19, 2024 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

replace use of inspect.signature in interpreter._setup_frame_and_run_python_function
2 participants