Skip to content
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

web.view should accept Type[AbstractView] as handler instead of AbstractView #3653

Closed
trim21 opened this issue Mar 16, 2019 · 1 comment · Fixed by #3633
Closed

web.view should accept Type[AbstractView] as handler instead of AbstractView #3653

trim21 opened this issue Mar 16, 2019 · 1 comment · Fixed by #3633

Comments

@trim21
Copy link

trim21 commented Mar 16, 2019

Long story short

according to aiohttp's documents, web.view(path, handler) hanlder should be a class inherit from web.View

https://github.com/aio-libs/aiohttp/blob/master/aiohttp/web_routedef.py#L123

def view(path: str, handler: AbstractView, **kwargs: Any) -> RouteDef:
    return route(hdrs.METH_ANY, path, handler, **kwargs)

but type annotation means that handler should be a instance of AbstractView instead of a class.

Expected behaviour

web.view's handler annotation should be Type[AbstractView]

Actual behaviour

web.view's handler annotation should be AbstractView

Steps to reproduce

no

Your environment

server: aiohttp==3.5.4

@aio-libs-bot
Copy link

GitMate.io thinks the contributor most likely able to help you is @asvetlov.

Possibly related issues are #2098 (Web-handler cancellation), #1993 (Deprecate registering synchronous web handlers), #186 (Force aiohttp.web handlers to coroutines), #2492 (Change web handlers cancellation policy), and #931 (web.View and multiple route resolution issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants