For slots classes, attr._make.attributes overwrites name with qualname. This shouldn't happen on Python 3. (Nothing happens on Python 2, as qualname is never set.) I think the correct fix is to change:
if repr_ns is None:
cls_name = getattr(cls, "__qualname__", cls.__name__)
else:
cls_name = cls.__name__
cls = type(cls_name, cls.__bases__, cls_dict)
To:
cls = type(cls.__name__, cls.__bases__, cls_dict)
However, this doesn't preserve qualname, and I fear I'm missing something else.
For slots classes, attr._make.attributes overwrites name with qualname. This shouldn't happen on Python 3. (Nothing happens on Python 2, as qualname is never set.) I think the correct fix is to change:
To:
However, this doesn't preserve qualname, and I fear I'm missing something else.