On Fri, 06 Sep 2013 10:01:32 -0700, Ethan Furman <et...@stoneleaf.us> wrote: > On 09/06/2013 09:37 AM, R. David Murray wrote: > > On Fri, 06 Sep 2013 08:59:02 -0700, Ethan Furman <et...@stoneleaf.us> wrote: > >> > >> For the short term I can restrict the change to > >> inspect.classify_class_attrs(). > > > > Sounds like the best course. > > There is one other function in inspect that calls getmro(): > > def getmembers(object, predicate=None): > """Return all members of an object as (name, value) pairs sorted by name. > Optionally, only return members that satisfy a given predicate.""" > if isclass(object): > mro = (object,) + getmro(object) > > Should I add `+ getmro(type(object))` here as well?
Not unless you want to void the warranty on the docs :) Note getmembers() does not return metaclass attributes when the argument is a class (this behavior is inherited from the dir() function). --David _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com