Author pitrou
Recipients eli.bendersky, ethan.furman, pitrou
Date 2013-09-08.16:49:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1378658975.3251.8.camel@fsol>
In-reply-to <>
> It seems that currently inspect is geared towards instances and
> classes, not metaclasses.  Consequently, so is help.

I'm afraid I don't really understand what you're talking about. A
metaclass is just a slightly different kind of class :-)

> def classify_class_attrs(cls):
>     """Return list of attribute-descriptor tuples.
>     For each name in dir(cls), the return list contains a 4-tuple
>     with these elements:
> We could add additional 'kind' of 'hidden class method', and 'hidden
> class attributes' and then have classify_class_attrs explicitly search
> metaclasses.

The docstring is clear: "For each name in dir(cls)". If you want stuff
that hidden's in the cls.__class__ (and, consequently, not in dir(cls)),
then you are not looking for the right function, I think.

I can understand wanting to better automate lookup of methods on
classes, rather than on instances, but it would probably deserve another

But I have another question first: doesn't calling
classify_class_attrs() on the metaclass already do what you want?
Date User Action Args
2013-09-08 16:49:38pitrousetrecipients: + pitrou, eli.bendersky, ethan.furman
2013-09-08 16:49:38pitroulinkissue18929 messages
2013-09-08 16:49:38pitroucreate