[Python-ideas] Restore the __members__ behavior to python3 for C extension writers
Nathaniel Smith
njs at pobox.com
Thu Jun 15 18:15:22 EDT 2017
On Thu, Jun 15, 2017 at 2:44 PM, Barry Scott <barry at barrys-emacs.org> wrote:
>
> On 15 Jun 2017, at 04:45, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> dir_result = PyObject_CallMethod(base_type, "__dir__", "O", self);
>> /* Add any additional attributes to the dir_result list */
>> return dir_result;
>
>
> But I need the result of __dir__ for my object not its base.
Yes, that's what that code should give you. Try it :-)
-n
--
Nathaniel J. Smith -- https://vorpus.org
More information about the Python-ideas
mailing list