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

João Bernardo jbvsmo at gmail.com
Sat Sep 14 22:21:52 CEST 2013


2013/9/14 David Halter <davidhalter88 at gmail.com>

> I recently stumbled over `dir()` not working correctly in the case of
> classes:
>
> http://jedidjah.ch/code/2013/9/8/wrong_dir_function/
>
>
That's expected and the right behavior IMHO. If you need your classes (or
metaclasses) to behave differently, set the __dir__ method.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130914/6b2b5718/attachment.html>


More information about the Python-ideas mailing list