Skip to content

Commit d8c7c3e

Browse files
committed
after rebasing: adjust infer_variance to mangled __mypy-replace members
1 parent aec6a87 commit d8c7c3e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mypy/subtypes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,9 +2056,10 @@ def infer_variance(info: TypeInfo, i: int) -> bool:
20562056
tvar = info.defn.type_vars[i]
20572057
self_type = fill_typevars(info)
20582058
for member in all_non_object_members(info):
2059-
# __mypy-replace is an implementation detail of the dataclass plugin
2060-
if member in ("__init__", "__new__", "__mypy-replace"):
2059+
if member in ("__init__", "__new__"):
20612060
continue
2061+
if "mypy-" in member:
2062+
continue # skip internally added methods
20622063

20632064
if isinstance(self_type, TupleType):
20642065
self_type = mypy.typeops.tuple_fallback(self_type)

0 commit comments

Comments
 (0)