Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow LROPoller typing to accept the return type as a type argument #10605

Closed
iscai-msft opened this issue Apr 1, 2020 · 2 comments
Closed
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.
Milestone

Comments

@iscai-msft
Copy link
Contributor

This way, in typing I can have # type: (...) -> LROPoller[return type] instead of just -> LROPoller.

Currently, when adding the return type as a type argument, I get this error: "LROPoller" expects no type arguments, but 1 given

@iscai-msft iscai-msft added Client This issue points to a problem in the data-plane of the library. Azure.Core labels Apr 1, 2020
@lmazuel
Copy link
Member

lmazuel commented Apr 1, 2020

Should look like this:

HTTPResponseType = TypeVar("HTTPResponseType")
HTTPRequestType = TypeVar("HTTPRequestType")
_LOGGER = logging.getLogger(__name__)
class HTTPPolicy(ABC, Generic[HTTPRequestType, HTTPResponseType]): # type: ignore

@rakshith91
Copy link
Contributor

Fixed in #10653

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

No branches or pull requests

3 participants