From b693f32c0bfa1768cfed2c796d7f397e6f4fd414 Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Wed, 1 Nov 2017 21:39:39 -0700 Subject: [PATCH] mypy: Add Dict parameters for dropbox_image return type. Also a note re using TypedDict in future, as the Dict looks constrained. --- zerver/lib/bugdown/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zerver/lib/bugdown/__init__.py b/zerver/lib/bugdown/__init__.py index 504e344b76..d6f2907804 100644 --- a/zerver/lib/bugdown/__init__.py +++ b/zerver/lib/bugdown/__init__.py @@ -404,8 +404,8 @@ class InlineInterestingLinkProcessor(markdown.treeprocessors.Treeprocessor): return False def dropbox_image(self, url): - # type: (Text) -> Optional[Dict] - # TODO: specify details of returned Dict + # type: (Text) -> Optional[Dict[str, Any]] + # TODO: The returned Dict could possibly be a TypedDict in future. parsed_url = urllib.parse.urlparse(url) if (parsed_url.netloc == 'dropbox.com' or parsed_url.netloc.endswith('.dropbox.com')): is_album = parsed_url.path.startswith('/sc/') or parsed_url.path.startswith('/photos/')