Skip to content

Fix __signature__ support if object has a __file__ #992

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

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

gpotter2
Copy link
Contributor

@gpotter2 gpotter2 commented Jul 9, 2023

Followup to #932. I missed an edge-case :(

If a class uses exotic __signature__ typings, but also has a __file__ (that inspect.getsourcelines finds), then it is ignored whenever _fix_default_values doesn't work. In this case it should just 'trust' the __signature__.

@codecov-commenter
Copy link

codecov-commenter commented Jul 9, 2023

Codecov Report

Merging #992 (7424efe) into main (26fc2b5) will decrease coverage by 0.01%.
The diff coverage is 92.85%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #992      +/-   ##
==========================================
- Coverage   76.36%   76.35%   -0.01%     
==========================================
  Files          61       61              
  Lines        8284     8291       +7     
==========================================
+ Hits         6326     6331       +5     
- Misses       1958     1960       +2     
Impacted Files Coverage Δ
bpython/inspection.py 89.82% <83.33%> (+0.23%) ⬆️
bpython/test/test_repl.py 97.85% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

@sebastinas
Copy link
Contributor

Could you please add a test case covering such a class?

@gpotter2
Copy link
Contributor Author

I updated the previous test to test this edge case :p

@sebastinas sebastinas merged commit d58e392 into bpython:main Jul 20, 2023
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.

3 participants