Ethan Furman added the comment: dir(obj) is only confused if it returns attributes that are not found in obj.__dict__ (aka virtual attributes).
For these virtual attributes, setting __objclass__ solves the problem. Armin, when you say it's a workaround do you mean __objclass__ itself, or the way Ronald and I are using it? It looks like Ronald is using it the way it was intended (on a descriptor), although I may be abusing it by putting it on an Enum member. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16938> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com