Enable --disallow-subclassing-any (#3591)

Closes: #1446
This commit is contained in:
Sebastian Rittau
2020-01-08 20:51:44 +01:00
committed by Jelle Zijlstra
parent 885c2fd65e
commit fdeae5d00e
4 changed files with 5 additions and 3 deletions

View File

@@ -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:

View File

@@ -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): ...

View File

@@ -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): ...

View File

@@ -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): ...