Eric V. Smith <e...@trueblade.com> added the comment:
I agree on your analysis. You'll get the same error on any name that type defines (like __class__), but "mro" looks like the only one without dunders. I'm not sure the best way to fix this. I'll give it some thought. Another problem is that assigning a default value breaks the .mro() call: @dataclass class A: mro: object = 3 >>> A.mro() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'int' object is not callable ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45531> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com