-
-
Notifications
You must be signed in to change notification settings - Fork 386
auto_detect in mypy #793
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
Labels
Typing
Typing/stub/Mypy/PyRight related bugs.
Comments
I implemented the auto_detecting of attribs. But nothing else. You can file it there, but they'll probably just ping me about fixing it. Unless someone else is excited about learning the mypy plugin code. :) |
meshy
added a commit
to meshy/mypy
that referenced
this issue
Dec 23, 2023
This test demonstrates that addition of dunder methods in attrs classes isn't quite complete. While the existing test demonstrates that it was working for classes defined with `init=False`, the `__attrs_init__` method wasn't generated in the same way when `__init__` was defined with `auto_detect=True` enabled (either explicitly, or by default). This auto-generated `__attrs_init__` has been enabled in Attrs as of version 21.1.0. Related to: python#10328 Ref: python-attrs/attrs#793 Ref: https://www.attrs.org/en/stable/changelog.html
meshy
added a commit
to meshy/mypy
that referenced
this issue
Dec 23, 2023
This test demonstrates that addition of dunder methods in attrs classes isn't quite complete. While the existing test demonstrates that it was working for classes defined with `init=False`, the `__attrs_init__` method wasn't generated in the same way when `__init__` was defined with `auto_detect=True` enabled (either explicitly, or by default). This auto-generated `__attrs_init__` has been enabled in Attrs as of version 21.1.0. Related to: python#10328 Ref: python-attrs/attrs#793 Ref: https://www.attrs.org/en/stable/changelog.html
meshy
added a commit
to meshy/mypy
that referenced
this issue
Dec 23, 2023
This test demonstrates that addition of dunder methods in attrs classes isn't quite complete. While the existing test demonstrates that it was working for classes defined with `init=False`, the `__attrs_init__` method wasn't generated in the same way when `__init__` was defined with `auto_detect=True` enabled (either explicitly, or by default). This auto-generated `__attrs_init__` has been enabled in Attrs as of version 21.1.0. Related to: python#10328 Ref: python-attrs/attrs#793 Ref: https://www.attrs.org/en/stable/changelog.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Opening here for discussion, before moving into mypy's bug tracker.
It just painfully occurred to me that mypy doesn't support
auto_detect=True
which is True by default in NG.E.g. in
it forces you to pass
init=False
todefine
. Has that been raise to mypy? Would it be hard to implement? I think that's a really nice feature and am surprised myself, I didn't notice it before. @euresti any ideas?The text was updated successfully, but these errors were encountered: