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

Raymond Hettinger raymond.hettinger at gmail.com
Sat Sep 14 22:54:06 CEST 2013

On Sep 14, 2013, at 12:15 PM, David Halter <davidhalter88 at gmail.com> wrote:

> After discussions, I realized that I should probably bring this up in python-ideas, I think the current implementation can be very confusing for people trying to introspect classes with `dir`, which is IMHO its typical use case.

The current behavior of dir() is a bit irritating when I am teaching how Python works.

That said, the irritation is minor and easily overcome.

I would not want to change the behavior and risk breaking
existing introspection code (that code is tends to be more
fragile and implementation than most other code).

In other words, I just don't think it is worth changing something
that has been in-place for a very long long time.  The minor
benefit doesn't want the downsides that goes with API churn.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130914/563ad534/attachment-0001.html>

More information about the Python-ideas mailing list