[issue5062] Rlcompleter.Completer does not use __dir__ magic method

Carl Johnson report at bugs.python.org
Tue Jan 27 07:15:39 CET 2009


Carl Johnson <carl at carlsensei.com> added the comment:

I think that checking to see which things really exist with
getattr/hasattr made sense back in the days before the __dir__, since in
those days the real API for an object could diverge wildly from what was
reported by dir(object), but nowadays, if someone goes to the trouble of
defining the __dir__ method, then we should just trust that as being
"the API" and not do any other checking.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5062>
_______________________________________


More information about the Python-bugs-list mailing list