gh-109653: Just import recursive_repr in dataclasses#109822
gh-109653: Just import recursive_repr in dataclasses#109822ericvsmith merged 1 commit intopython:mainfrom
recursive_repr in dataclasses#109822Conversation
|
The windows failure is known and unrelated: #109739 |
|
I don't think this change is worth making. It seems mostly like code churn: there's no actual problem being solved. |
|
Is there a difference if the A |
|
@AA-Turner it makes no difference, because
But, it still does not improve the import time: I also tried to defer |
@sobolevn I get similar numbers (scale-wise) from pyperf but they don't match with other timings I've done.
Which lines up roughly with the timings I get from From previous experiments mentioned in #109653 (comment) I would expect deferring Slightly more directly related, and also mentioned in #109653 (comment) the definition of Footnotes
|
|
A change in the other direction (per A |
|
@AA-Turner we still have |
ericvsmith
left a comment
There was a problem hiding this comment.
As long as there's not a performance regression due to importing reprlib, I'm okay with this. I have not checked the performance.
You're already importing |
|
Agreed that reprlib is already imported (checked with 3.11). |
Import time is unchanged. Before:
After:
But, we now drop two dependencies:
functoolsand_threadand add just one:reprlibhttps://github.com/python/cpython/blame/f2eaa92b0cc5a37a9e6010c7c6f5ad1a230ea49b/Lib/dataclasses.py#L248-L266
It was strange to have
But import two other heavier modules. The most interesting part is that
functoolsalways importsreprlibinside. See #109653 (comment)