-
Notifications
You must be signed in to change notification settings - Fork 516
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
ref: ensure_integration_enabled
without original function
#2893
ref: ensure_integration_enabled
without original function
#2893
Conversation
if TYPE_CHECKING: | ||
|
||
@overload | ||
def ensure_integration_enabled_async( |
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.
I am confused about why mypy
is complaining about this overload, but not the ones for ensure_integration_enabled
. Do you have any idea? Maybe I am missing something.
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.
Sorry, no idea. Agree that it looks exactly like the sync case. Maybe we can just ignore the error?
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.
Yeah, I think that is the best option. Won't affect runtime anyway because we are in an if TYPE_CHECKING
guard
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.
The more I see of this advanced typing business the less I understand it 😆 But in addition to being the decorator master you're now also the typing master, so I trust this works and gives nice type hints as intended.
Found a couple typos, please fix, otherwise lgtm.
Co-authored-by: Ivana Kellyerova <[email protected]>
Co-authored-by: Ivana Kellyerova <[email protected]>
Yeah, at first glance it appears to work. Of course, if you or anyone else notices weird hinting behavior, let me know, and I can look into fixing it. |
ensure_integration_enabled
andensure_integration_enabled_async
can now decorate functions that returnNone
without an original function.