[Python-ideas] Should we improve `dir`?

Mark Janssen dreamingforward at gmail.com
Sun Sep 15 03:47:41 CEST 2013


> Right, this is one of the behavioural differences between classes and
> instances, and, as far as I am aware, it isn't an accident.

In fact, I'd argue that is a critical distinction.  A language
definition has to help enforce this distinction, otherwise confusion
abounds.

> If introspection tools want to show all the operations available *on the
> class*, then they need to include "dir(type(cls))" as well.

If users want to find the operations available "on the class", they
should learn Python.

--mark


More information about the Python-ideas mailing list