<p dir="ltr"><br>
On 10 Oct 2013 03:39, "Ethan Furman" <<a href="mailto:ethan@stoneleaf.us">ethan@stoneleaf.us</a>> wrote:<br>
><br>
> On 10/09/2013 09:40 AM, Brett Cannon wrote:<br>
><br>
>> On Tue, Oct 8, 2013 at 5:29 PM, Ethan Furman wrote:<br>
>>><br>
>>><br>
>>> Currently, inspect() is dependent on dir().<br>
>><br>
>><br>
>> What's inspect()? I don't know of any global with that name and you are obviously not talking about the module.<br>
><br>
><br>
> 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.</p>
<p dir="ltr">Those have to depend on __dir__ so classes (especially proxies) can accurately report *extra* dynamically accessible names.</p>
<p dir="ltr">It's also the mechanism by which custom metaclasses, descriptors and __getattribute__ implementations can report the right names to the introspection machinery.</p>
<p dir="ltr">However, it may make sense to offer a separate introspection utility to help debug custom __dir__ implementations.</p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
><br>
> --<br>
> ~Ethan~<br>
> _______________________________________________<br>
> Python-Dev mailing list<br>
> <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a><br>
> Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com">https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com</a><br>
</p>