> I have a predefined set of members, some of which are optional.
Having optional fields is also a good reason.
>>> What is the use of T_OBJECT_EX vs T_OBJECT in PyMemberDef then?
>> Right - this works for optional objects. However, it can't possibly
>> work for any of the other fields.
>
"Martin v. Löwis" wrote:
I have a predefined set of members, some of which are optional.
>>> Having optional fields is also a good reason.
>>
>> What is the use of T_OBJECT_EX vs T_OBJECT in PyMemberDef then?
>
> Right - this works for optional objects. However, it can't possibly
> work for
>>> I have a predefined set of members, some of which are optional.
>> Having optional fields is also a good reason.
>
> What is the use of T_OBJECT_EX vs T_OBJECT in PyMemberDef then?
Right - this works for optional objects. However, it can't possibly
work for any of the other fields.
> I woul
"Martin v. Löwis" wrote:
>> I have a predefined set of members, some of which are optional.
>
> Having optional fields is also a good reason.
What is the use of T_OBJECT_EX vs T_OBJECT in PyMemberDef then? I would
have though that the former describes an optional field, because the
behaviour of
> When would I use PyObject_SetAttrString/tp_dictoffset instead of tp_members?
When I have a variable list of attributes, and cannot statically know
what those attributes might be.
> I have a predefined set of members, some of which are optional.
Having optional fields is also a good reason.
>