Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Use of with_init with inhitence fails. #37

Open
tomprince opened this issue Feb 29, 2016 · 0 comments
Open

Use of with_init with inhitence fails. #37

tomprince opened this issue Feb 29, 2016 · 0 comments

Comments

@tomprince
Copy link
Contributor

Trying to use with_init in both a base class and a derived class fails. It appears that the generated base class' __init__ is getting called twice. It looks like this is due to a confusion with both classes trying to control __original_init__.

from characteristic import attributes

@attributes(["base"])
def Base(Exception):
    pass

@attributes(["derived"])
def Derived(Base):
    pass

Derived(base="base", derived="dervied")

fails with

Traceback (most recent call last):
  File "test.py", line 11, in <module>
    Derived(base="base", derived="dervied")
TypeError: Derived() got an unexpected keyword argument 'base
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant