diff --git a/tests/mypy_test.py b/tests/mypy_test.py index 48ad62e98a2e..4fae05b3bc18 100755 --- a/tests/mypy_test.py +++ b/tests/mypy_test.py @@ -135,6 +135,7 @@ def main(): flags.append('--show-traceback') flags.append('--no-implicit-optional') flags.append('--disallow-any-generics') + flags.append('--disallow-subclassing-any') if args.warn_unused_ignores: flags.append('--warn-unused-ignores') if args.platform: diff --git a/third_party/2/fb303/FacebookService.pyi b/third_party/2/fb303/FacebookService.pyi index ead5d24fe7a3..763c3c83aa1e 100644 --- a/third_party/2/fb303/FacebookService.pyi +++ b/third_party/2/fb303/FacebookService.pyi @@ -58,7 +58,7 @@ class Client(Iface): def shutdown(self): ... def send_shutdown(self): ... -class Processor(Iface, TProcessor): +class Processor(Iface, TProcessor): # type: ignore def __init__(self, handler) -> None: ... def process(self, iprot, oprot): ... def process_getName(self, seqid, iprot, oprot): ... diff --git a/third_party/2/scribe/scribe.pyi b/third_party/2/scribe/scribe.pyi index 3530bf80a809..c170447e14c8 100644 --- a/third_party/2/scribe/scribe.pyi +++ b/third_party/2/scribe/scribe.pyi @@ -13,7 +13,7 @@ class Client(fb303.FacebookService.Client, Iface): def send_Log(self, messages): ... def recv_Log(self): ... -class Processor(fb303.FacebookService.Processor, Iface, TProcessor): +class Processor(fb303.FacebookService.Processor, Iface, TProcessor): # type: ignore def __init__(self, handler) -> None: ... def process(self, iprot, oprot): ... def process_Log(self, seqid, iprot, oprot): ... diff --git a/third_party/2and3/google/protobuf/internal/containers.pyi b/third_party/2and3/google/protobuf/internal/containers.pyi index fc97c7330ce3..2b0a5f1e196a 100644 --- a/third_party/2and3/google/protobuf/internal/containers.pyi +++ b/third_party/2and3/google/protobuf/internal/containers.pyi @@ -50,7 +50,8 @@ class RepeatedCompositeFieldContainer(BaseContainer[_T]): def __eq__(self, other: object) -> bool: ... # Classes not yet typed -class Mapping(Any): ... +class Mapping(object): + def __getattr__(self, name: str) -> Any: ... # incomplete class MutableMapping(Mapping): ... class ScalarMap(MutableMapping): ... class MessageMap(MutableMapping): ...