Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork940
Fix typing issues with delete_head and Remote.add#1346
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Ah, hm, I missed the impact on |
delete_head and Head.delete historically accept either Head objectsor a str name of a head. Adjust the typing to match. Thisunfortunately requires suppressing type warnings in the signature ofRemoteReference.delete, since it inherits from Head but does notaccept str (since it needs access to the richer data ofRemoteReference).Using assignment to make add an alias for create unfortunatelyconfuses mypy, since it loses track of the fact that it's aclassmethod and starts treating it like a staticmethod. Replacewith a stub wrapper instead.
Amended with a possible fix. Alternately, perhaps the intent was not to allow strs for |
FYI, for background, this fixes issues that I saw inhttps://github.com/lsst-sqre/neophile after updating GitPython, namely:
The last three messages are from calling |
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.
Thanks a lot for this contribution, it's much appreciated. Let's allow@Yobmod to also take a look in case I am missing something.
delete_head and Head.delete historically accept either Head objects
or a str name of a head. Adjust the typing to match.
Using assignment to make add an alias for create unfortunately
confuses mypy, since it loses track of the fact that it's a
classmethod and starts treating it like a staticmethod. Replace
with a stub wrapper instead.