-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
10231 Fix type annotation for inlineCallbacks
#1632
Conversation
|
Thanks for the quick PR. I will the cherry pick it in the release branch. Thanks |
|
sure, done |
|
I'm not really sure what the point of setting an accurate return type annotation on inlineCallbacks is at all. Currently the lack of ParamSpec support means the arguments of the decorated function can't be preserved, and if you can use |
I don't agree with the last part of this. There are still situations where it is useful to use
|
|
You can still make a deferred returning function from an async function, and it preserves the call signature: async def _request(self, ham: int) -> None:
await x
def request(self, ham: int) -> Deferred[None]:
return Deferred.fromCoroutine(self._request(ham)) |
Well, I can, but the fact I can work around it seems a poor argument against improving the type annotation on |
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.
Newsfragment typo
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 you all for the contribution.
The news fragment make sense for me now.
As long as this change is not braking anything else, I think that is OK to merge it.
@graingert any comment against merging it?
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
|
closing and re-opening to kick off azure pipelines |
inlineCallbacksinlineCallbacks
Scope and purpose
Propagate the ReturnType of the generators wrapped by
inlineCallbacks.Contributor Checklist:
tox -e lintto format my patch to meet the Twisted Coding Standard#character).reviewto the keywords field in Trac, and putting a link to this PR in the comment; it shows up in https://twisted.reviews/ now.The first line is automatically generated by GitHub based on PR ID and branch name.
The other lines generated by GitHub should be replaced.