-
Notifications
You must be signed in to change notification settings - Fork 16
Use ~~dataclasses~~ attrs for pt.Array #365
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
5ca0093 to
291847c
Compare
|
This generally seems worthwhile, I think.
Is this something we could check for in
Ah well. Maybe just disable |
Yep, I will do that for now. Related pylint issue: pylint-dev/pylint#7623. |
e7921a8 to
b63e2fb
Compare
|
The pylint errors have been ignored. But the current refactoring depends on kw_only argument of |
Yes, I think so. I will try to give it a shot. |
Is there a way to avoid that? Requiring 3.10 is a healthy ways down the road in my view, given that we're not even completely switched over to 3.8. |
We could use |
As long as it's easy enough to switch back to dataclasses, I would not be oppposed. |
b63e2fb to
af8eeff
Compare
af8eeff to
b3c35c5
Compare
Sure! It should take us an afternoon to switch to dataclasses from |
Pros:
frozen=True)__init__.Cons:
eq=Falsein their call todataclass, otherwisedataclasseswill implement its own default which has a complexity ofdef __hash__(self) -> int: return super().__hash__(), otherwisedataclasseswill implement its own default._shape,_dtypeinstead ofshape,dtypeaspt.Arrayalready has properties of that name.