SIP Enums and docstring

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SIP Enums and docstring

Denis Rouzaud
Hi list, hi Phil,

I am currently at a way of documenting enums and I am not sure what is the best approach.

1) SIP uses a custom type for enums and not the native Python one available since 3.4. Is it worth switching?

2) SIP errors when you try to documents enums. That would need to be fixed in sipgen, correct? Would we document the enum only or its members too? What would be the syntax?

3) In SIP lib, we would need to adapt the creation of enums to handle the docstring. A new member needs to be added to _sipEnumTypeObject to save the docstring. But then how handling this in createEnum?

I would be very grateful for any hint.

Cheers,

Denis
--

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: SIP Enums and docstring

Phil Thompson-5
On 5 Mar 2019, at 9:02 am, Denis Rouzaud <[hidden email]> wrote:
>
> Hi list, hi Phil,
>
> I am currently at a way of documenting enums and I am not sure what is the best approach.
>
> 1) SIP uses a custom type for enums and not the native Python one available since 3.4. Is it worth switching?

Python enums are used to wrap C++11 scoped enums. In PyQt6 they will be used for all enums.

> 2) SIP errors when you try to documents enums. That would need to be fixed in sipgen, correct? Would we document the enum only or its members too? What would be the syntax?

I don't see what the issue is with the syntax - do the same as with classes and attributes.

> 3) In SIP lib, we would need to adapt the creation of enums to handle the docstring. A new member needs to be added to _sipEnumTypeObject to save the docstring. But then how handling this in createEnum?

I'm not willing to make any changes to data structures that will require the major version of the SIP ABI to be changed at this stage. I want the change required by SIP5 to be the next and last one.

Phil
_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt