gh-90562: Improve zero argument support for super() in dataclasses when slots=True#124692
gh-90562: Improve zero argument support for super() in dataclasses when slots=True#124692Bobronium wants to merge 18 commits into
super() in dataclasses when slots=True#124692Conversation
Sorry, something went wrong.
2e0ca01 to
3b65acf
Compare
September 27, 2024 18:10
sobolevn
left a comment
There was a problem hiding this comment.
Great find, thanks a lot for your work! 👍
Sorry, something went wrong.
Co-authored-by: sobolevn <mail@sobolevn.me>
carljm
left a comment
There was a problem hiding this comment.
This looks OK to me; I'll let @ericvsmith give it final approval/merge.
I don't love that we've opened the door to an infinite fractal of complexity here; at some point it would probably be better to bite the bullet and introduce a __classcell__ attribute on classes that allows reliably finding this cell in O(1) time.
Sorry, something went wrong.
|
I agree that the complexity is unfortunate. |
Sorry, something went wrong.
This uses builtins.dir, which will trigger custom __getattibute__ if any, and will trigger __get__ on __dict__ descriptor.
Good idea. I've changed the implementation to use |
Sorry, something went wrong.
|
As I mentioned above, I would rather have @ericvsmith approve/merge this, since it was his review comments you addressed. |
Sorry, something went wrong.
|
I've been busy, but it's on my list of things to do. |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
Added two tests for two cases that weren't covered in original PR: