On 10 Oct 2013 03:39, "Ethan Furman" <et...@stoneleaf.us> wrote: > > On 10/09/2013 09:40 AM, Brett Cannon wrote: > >> On Tue, Oct 8, 2013 at 5:29 PM, Ethan Furman wrote: >>> >>> >>> Currently, inspect() is dependent on dir(). >> >> >> What's inspect()? I don't know of any global with that name and you are obviously not talking about the module. > > > My apologies. I am actually talking about the module. I meant inspect.get_members() and inspect.classify_class_attrs(), which, as near as I can tell, are the only two functions in inspect that attempt to retrieve/look at all of an object's attributes.
Those have to depend on __dir__ so classes (especially proxies) can accurately report *extra* dynamically accessible names. It's also the mechanism by which custom metaclasses, descriptors and __getattribute__ implementations can report the right names to the introspection machinery. However, it may make sense to offer a separate introspection utility to help debug custom __dir__ implementations. Cheers, Nick. > > > -- > ~Ethan~ > _______________________________________________ > 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/ncoghlan%40gmail.com
_______________________________________________ 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