Skip to content

attrs plugin: incorrect handling of attr.ib(default=42, init=False) #5148

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
hynek opened this issue Jun 5, 2018 · 0 comments
Closed

attrs plugin: incorrect handling of attr.ib(default=42, init=False) #5148

hynek opened this issue Jun 5, 2018 · 0 comments
Labels
bug mypy got something wrong false-positive mypy gave an error on correct code priority-1-normal topic-attrs

Comments

@hynek
Copy link
Member

hynek commented Jun 5, 2018

If attr.ib() has init=False and a default value, it should be possible to add more non-default attributes. However, currently this breaks:

import attr

@attr.s
class C:
   x = attr.ib(init=False, default=42)
   y = attr.ib()

with error: Non-default attributes not allowed after default attributes..

ref python-attrs/attrs#389

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong false-positive mypy gave an error on correct code priority-1-normal topic-attrs
Projects
None yet
Development

No branches or pull requests

2 participants