The issue here is that Python gave a misleading error message. The error message one would expect in this case is this:
AttributeError: 'function' object has no attribute 'toAscii'
But instead, Python gave a misleading error message:
AttributeError: 'Render' object has no attribute 'html'
That is, an AttributeError
generated within the property function was presented as if it were an AttributeError
for the property itself.
This strange behavior occurs when the class with your @property
is derived from QObject
. It is a known issue in PyQt. In fact, the PyQt maintainers claim it is expected behavior (wrongly, IMHO). See this thread for details. (In that thread, it is claimed that QObject
behaves identically to Python's built-in object
class, but my own testing indicates otherwise.)