Steven D'Aprano wrote:
    [quote]
If the object has a method named __dir__(), this method will be called and must return the list of attributes.
    [end quote]

The first inaccuracy is that like all (nearly all?) dunder methods, Python
only looks for __dir__ on the class, not the instance itself.

It says "method", not "attribute", so technically
it's correct. The methods of an object are defined
by what's in its class.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to