You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If using multiple inheritance than the **kwargs need to be generated independent from eSuperTypes
{%- macro generate_class_init_args(c) -%}
{% if c.eStructuralFeatures | list %}, *, {% endif -%}
{{ c.eStructuralFeatures | map(attribute='name') | map('re_sub', '$', '=None') | join(', ') }}
{%- if c.eSuperTypes %}, **kwargs{% endif %}
{%- endmacro %}
{%- macro generate_super_init_args(c, user_module=False) -%}
{%- if user_module and c.eStructuralFeatures -%}
{{ c.eStructuralFeatures | map(attribute='name') | map('re_sub', '(.+)', '\g<0>= \g<0>') | join(', ') }}
{%- endif %}
{%- if c.eSuperTypes %}{{', ' if user_module and c.eStructuralFeatures else ''}}**kwargs{% endif %}
{%- endmacro %}
Following use case:
class A
aattr1
aattr2
class B
battr1
battr2
class C(A,B)
C(aattr1=1, battr1=2)
A.__init__ looks like this def __init__(self, *, aattr1=None, aattr2=None)
This lead to the problem that A.__init__ is called with a keyword argument (battr1) which is not known by the init function.
BR
Andreas
The text was updated successfully, but these errors were encountered:
If using multiple inheritance than the **kwargs need to be generated independent from eSuperTypes
Following use case:
A.__init__
looks like thisdef __init__(self, *, aattr1=None, aattr2=None)
This lead to the problem that
A.__init__
is called with a keyword argument (battr1) which is not known by the init function.BR
Andreas
The text was updated successfully, but these errors were encountered: