diff --git a/mypy/subtypes.py b/mypy/subtypes.py index e1609717e160..a5523fbe0d45 100644 --- a/mypy/subtypes.py +++ b/mypy/subtypes.py @@ -2049,8 +2049,9 @@ def infer_class_variances(info: TypeInfo) -> bool: if not info.defn.type_args: return True tvs = info.defn.type_vars + success = True for i, tv in enumerate(tvs): - if isinstance(tv, TypeVarType): + if isinstance(tv, TypeVarType) and tv.variance == VARIANCE_NOT_READY: if not infer_variance(info, i): - return False - return True + success = False + return success