diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py index fee0957fc0d0..7939e3c82cad 100644 --- a/mypy/checkexpr.py +++ b/mypy/checkexpr.py @@ -1322,6 +1322,8 @@ def analyze_super(self, e: SuperExpr, is_lvalue: bool) -> Type: # There's an undefined base class, and we're # at the end of the chain. That's not an error. return AnyType() + if not self.chk.typing_mode_full(): + return AnyType() return analyze_member_access(e.name, self_type(e.info), e, is_lvalue, True, self.named_type, self.not_ready_callback, diff --git a/mypy/test/data/check-super.test b/mypy/test/data/check-super.test index ad07d431b970..0f2d7e7af466 100644 --- a/mypy/test/data/check-super.test +++ b/mypy/test/data/check-super.test @@ -108,3 +108,12 @@ class C(B): def __init__(self, arg=0): super(C, self).__init__(arg, arg=arg) [out] + +[case testSuperSilentInDynamicFunction] +class A: + pass + +class B(A): + def foo(self): + super(B, self).foo() # Not an error +[out]