mypy: Add Dict parameters for dropbox_image return type.

Also a note re using TypedDict in future, as the Dict looks constrained.
This commit is contained in:
neiljp (Neil Pilgrim) 2017-11-01 21:39:39 -07:00 committed by Tim Abbott
parent 737408f741
commit b693f32c0b

View File

@ -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/')