From 929311642b3799cfdeae80979f21b8441dd907bc Mon Sep 17 00:00:00 2001 From: Zixuan James Li Date: Fri, 29 Jul 2022 16:53:37 -0400 Subject: [PATCH] legacy_urls: Add type annotation to legacy_urls. Mypy previously infers this to be `List[URLPattern]` which is incompatible with other urls lists that we concatenate this with. Signed-off-by: Zixuan James Li --- zproject/legacy_urls.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zproject/legacy_urls.py b/zproject/legacy_urls.py index 8b5c0e1878..ad178bb52d 100644 --- a/zproject/legacy_urls.py +++ b/zproject/legacy_urls.py @@ -1,4 +1,6 @@ -from django.urls import path +from typing import List, Union + +from django.urls import URLPattern, URLResolver, path import zerver.views import zerver.views.auth @@ -8,7 +10,7 @@ import zerver.views.tutorial # Future endpoints should add to urls.py, which includes these legacy URLs -legacy_urls = [ +legacy_urls: List[Union[URLPattern, URLResolver]] = [ # These are json format views used by the web client. They require a logged in browser. # We should remove this endpoint and all code related to it. # It returns a 404 if the stream doesn't exist, which is confusing