From 47f22a341e6e79a91adabf43808566e1a837520b Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Thu, 13 Sep 2018 12:59:13 -0700 Subject: [PATCH] Add `def __getattr__(name) -> Any: ...` to all docutils stubs (#2439) The stubs are very incomplete causing false positive when used. Add a fallback to until they can become more complete. --- third_party/3/docutils/__init__.pyi | 3 +++ third_party/3/docutils/examples.pyi | 2 ++ third_party/3/docutils/nodes.pyi | 2 ++ third_party/3/docutils/parsers/__init__.pyi | 3 +++ third_party/3/docutils/parsers/rst/__init__.pyi | 3 +++ third_party/3/docutils/parsers/rst/nodes.pyi | 3 +++ third_party/3/docutils/parsers/rst/roles.pyi | 2 ++ third_party/3/docutils/parsers/rst/states.pyi | 3 +++ 8 files changed, 21 insertions(+) diff --git a/third_party/3/docutils/__init__.pyi b/third_party/3/docutils/__init__.pyi index e69de29bb2d1..024e962b10df 100644 --- a/third_party/3/docutils/__init__.pyi +++ b/third_party/3/docutils/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/third_party/3/docutils/examples.pyi b/third_party/3/docutils/examples.pyi index 0abfc7b45d6e..96b4f9997e4c 100644 --- a/third_party/3/docutils/examples.pyi +++ b/third_party/3/docutils/examples.pyi @@ -1,3 +1,5 @@ from typing import Any html_parts = ... # type: Any + +def __getattr__(name) -> Any: ... diff --git a/third_party/3/docutils/nodes.pyi b/third_party/3/docutils/nodes.pyi index f747fb10812f..382112bffe15 100644 --- a/third_party/3/docutils/nodes.pyi +++ b/third_party/3/docutils/nodes.pyi @@ -6,3 +6,5 @@ class reference: text: str = ..., *children: List[Any], **attributes) -> None: ... + +def __getattr__(name) -> Any: ... diff --git a/third_party/3/docutils/parsers/__init__.pyi b/third_party/3/docutils/parsers/__init__.pyi index e69de29bb2d1..024e962b10df 100644 --- a/third_party/3/docutils/parsers/__init__.pyi +++ b/third_party/3/docutils/parsers/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/third_party/3/docutils/parsers/rst/__init__.pyi b/third_party/3/docutils/parsers/rst/__init__.pyi index e69de29bb2d1..024e962b10df 100644 --- a/third_party/3/docutils/parsers/rst/__init__.pyi +++ b/third_party/3/docutils/parsers/rst/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/third_party/3/docutils/parsers/rst/nodes.pyi b/third_party/3/docutils/parsers/rst/nodes.pyi index e69de29bb2d1..024e962b10df 100644 --- a/third_party/3/docutils/parsers/rst/nodes.pyi +++ b/third_party/3/docutils/parsers/rst/nodes.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/third_party/3/docutils/parsers/rst/roles.pyi b/third_party/3/docutils/parsers/rst/roles.pyi index 7307e587befe..58b9cd73c350 100644 --- a/third_party/3/docutils/parsers/rst/roles.pyi +++ b/third_party/3/docutils/parsers/rst/roles.pyi @@ -8,3 +8,5 @@ def register_local_role(name: str, Tuple[List[docutils.nodes.reference], List[docutils.nodes.reference]]] ) -> None: ... + +def __getattr__(name) -> Any: ... diff --git a/third_party/3/docutils/parsers/rst/states.pyi b/third_party/3/docutils/parsers/rst/states.pyi index e39d2bcf630e..ac00fe1bfe8e 100644 --- a/third_party/3/docutils/parsers/rst/states.pyi +++ b/third_party/3/docutils/parsers/rst/states.pyi @@ -1,5 +1,8 @@ import typing +from typing import Any class Inliner: def __init__(self) -> None: ... + +def __getattr__(name) -> Any: ...