From 962ba32d434d86a283296a749918d88254e47b29 Mon Sep 17 00:00:00 2001 From: Ilya Chichak Date: Mon, 1 Jul 2019 15:12:04 +0700 Subject: [PATCH 1/3] fixed type annotation in method add_view for class UrlDispatcher to accept View subclasses --- aiohttp/web_urldispatcher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_urldispatcher.py index 1bd4fd8dc8c..f7c41deacb2 100644 --- a/aiohttp/web_urldispatcher.py +++ b/aiohttp/web_urldispatcher.py @@ -27,6 +27,7 @@ Set, Sized, Tuple, + Type, Union, cast, ) @@ -1112,7 +1113,7 @@ def add_delete(self, path: str, handler: _WebHandler, """ return self.add_route(hdrs.METH_DELETE, path, handler, **kwargs) - def add_view(self, path: str, handler: AbstractView, + def add_view(self, path: str, handler: Type[AbstractView], **kwargs: Any) -> AbstractRoute: """ Shortcut for add_route with ANY methods for a class-based view From 3edc575be3612715c0169bdc7d63843af362e74d Mon Sep 17 00:00:00 2001 From: Ilya Chichak Date: Mon, 1 Jul 2019 15:31:38 +0700 Subject: [PATCH 2/3] added myself to contributors --- CONTRIBUTORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 67425115145..3e529755727 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -110,6 +110,7 @@ Igor Alexandrov Igor Davydenko Igor Mozharovsky Igor Pavlov +Ilya Chichak Ingmar Steen Ivan Larin Jacob Champion From d5492a606d98463a90e846b948837683a50d51c2 Mon Sep 17 00:00:00 2001 From: Ilya Chichak Date: Wed, 3 Jul 2019 13:27:41 +0700 Subject: [PATCH 3/3] added changes description --- CHANGES/3880.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 CHANGES/3880.bugfix diff --git a/CHANGES/3880.bugfix b/CHANGES/3880.bugfix new file mode 100644 index 00000000000..d921f229a1b --- /dev/null +++ b/CHANGES/3880.bugfix @@ -0,0 +1 @@ +Fixed type annotation for add_view method of UrlDispatcher to accept any subclass of View \ No newline at end of file