Skip to content

Multi-level inheritance: duplicate arguments in ctors #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aldanor opened this issue Feb 19, 2016 · 2 comments
Closed

Multi-level inheritance: duplicate arguments in ctors #33

aldanor opened this issue Feb 19, 2016 · 2 comments

Comments

@aldanor
Copy link

aldanor commented Feb 19, 2016

A seemingly harmless example:

@attr.s
class Foo(object):
    a = attr.ib()

@attr.s
class Bar(Foo):
    pass

@attr.s
class Baz(Bar):
    pass

fails with

  File "<attrs generated init 5250a51181cb781b2576810943a33169c4fea664>", line 1
SyntaxError: duplicate argument 'a' in function definition

Looks like attrs tries to include a twice in parameter list of Baz#__init__?

(possibly related: #24)

@aldanor aldanor changed the title Wrong generated ctors in multi-level inheritance Multi-level inheritance: duplicate arguments in ctors Feb 19, 2016
@hynek
Copy link
Member

hynek commented Feb 19, 2016

That looks like the same bug as #24 and your example works fine for me. Are you using an old release by accident? Check attr.__version__ please, it should be 15.2.0.

@aldanor
Copy link
Author

aldanor commented Feb 19, 2016

Whoah, indeed -- I had 15.1 installed, and it now works perfectly fine on 15.2 👍 Sorry for the hassle!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants