-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Support types as converters in attrs plugin #4917
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
Conversation
This unblocks: python-attrs/attrs#238 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding this! I went ahead and changed the type annotation to a type comment and I left a few requests w.r.t. the tests.
[file a.py] | ||
from typing import overload | ||
import attr | ||
class complex: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Especially since it is duplicated across several test cases, moving this to a fixture would be good.
test-data/unit/check-attr.test
Outdated
from typing import overload | ||
import attr | ||
|
||
class complex: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should be moved to a fixture?
class complex: | ||
@overload | ||
def __init__(self, re: float = 0.0, im: float = 0.0) -> None: ... | ||
@overload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add tests for an overloaded converter function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this note. It was actually broken!
Thanks for the review! I've addressed all your concerns and fixed some more things that were broken. |
@ethanhs is there a way to re-request review that I'm missing here? |
Thank you again for working on this @euresti ! |
Fixes #4729