I think that the AttributeError message in this Python session
>>> class A: pass
...
>>> A().x
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'A' object has no attribute 'x'
is implemented in the function _PyObject_GenericGetAttrWithDict at these lines in CPython:
if (!suppress) {
PyErr_Format(PyExc_AttributeError,
"'%.50s' object has no attribute '%U'",
tp->tp_name, name);
}
However I cannot find where the AttributeError message in this Python session
>>> class A: __slots__ = ('x',)
...
>>> A().x
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: x
is implemented in CPython. Could you provide a link to the exact lines in the GitHub repository?