I first ask this on python users. But I think the only people that can answer 
are the core developers.

I have a python3 C++ extension that works written using the PyCXX C++ interface.

But dir(obj) does not return the list of member variables.

With the python2 version supporting the __members__ variable was all that was 
needed.
But __members__ been removed from python3.

How should I support dir() from the C API?

I cannot use tp_members, not appropiate to the code I'm writing.
If I provide __dir__ I then hit the problem I need the C API version of:

        all_attr = super( mytype, obj ).__dir__();
        all_attr.extend( mytype_variable_names );
        return all_attr

I'm not getting inspiration from the python 3.6 sources for this problem.

I did find the object_dir function in typeobject.c, but that has not helped
get me move forward.

What is the the patten that I should implement?

Barry
PyCXX

_______________________________________________
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

Reply via email to