-
Notifications
You must be signed in to change notification settings - Fork 4
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
change labels() method return type #58
base: main
Are you sure you want to change the base?
Conversation
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.
👋 hi, thanks a lot for catching this issue and the contribution!
Due to having to support older versions of python I think the best course of action would be to use the typing_extensions library to make direct use of Self
.
From my tests using "Self"
would still mark it as unknown
for pyright the returned object (although it fixes the error on the method).
Let me know if you want to work on it further or if you prefer for me to take over, regardless of choice I really appreciate you taking the time for raising and fixing this 🙌
So to recap the course of action would be:
- Add a dependency to typing_extensions
- Import
Self
without the need for theTYP_CHECKING
check - Replace
"Self"
->Self
I agree that using typing_extensions is the better solution. I have made the requested changes, |
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.
Looks good! 🙌
Thank you for your contribution 🙇
it actually doesn't seem to be enough as the return type now mismatch 😭 |
fix #57