Skip to content

Commit 384b0ee

Browse files
committed
add the module path to the mangled name of an internal dataclass symbol
1 parent 4a01786 commit 384b0ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/plugins/dataclasses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ def _mangle_internal_sym_name(type_fullname: str, member_name: str) -> str:
975975
"""Create an internal symbol name with the class name mangled in as usual, but that also
976976
contains the class module path to avoid false positives when subclassing a dataclass with
977977
same name."""
978-
module_name, type_name = type_fullname.rsplit(".")
978+
module_name, _, type_name = type_fullname.rpartition(".")
979979
module_name = module_name.replace(".", "-")
980980
type_name = type_name.lstrip("_")
981981
return f"_{type_name}__{module_name}__{member_name}"

0 commit comments

Comments
 (0)