Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Lazy entry points in verdi #6153
Lazy entry points in verdi #6153
Changes from 19 commits
ebf9fc0
3b5dde9
8559c37
47aa3ba
aebdb2a
82cefcd
a0dd26f
15b498f
2d6b8b0
9e01860
a66ba9c
2f8697a
ee62868
5c4488d
fd15352
57e1f26
4174c80
615a0aa
f036805
82b950a
ceb3ec9
8d88334
7a2cc44
2b82927
d4b2491
3e945c0
5d398c6
347f1b0
a3ca765
4b0d8aa
76b480e
bec3662
d356545
6930e79
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I am not sure how
cached_property
is implemented, but wouldn't it be easier to implement the "caching" ourselves here. E.g.:i.e. just make
entry_points
a public property and have_entry_points
beNone
initially and populate it the first timeentry_points
is called.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.
I guess we have a different definition of easier 😄 To me the decorator seems clearer, it's one less level of indirection, and allowed me to not change the code elsewhere (i.e. using the
entry_points
instead of_entry_points
). But I don't have a strong feeling if you think I should change it.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.
I shouldn't have said easier. I was mostly wondering how
cached_property
implements this under the hood. Will it be as efficient as the "manual" version? if there is no (noticable) difference, then I agree that using the cached_property is easier to read and fine to keep that.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.
Sure, I'll do a microbenchmark and report back. I would expect this to make much difference because I don't think this property should be accessed too many times.
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.
Please, don't spend too much time on it. It is not that important, we can keep the
cached_property
approachThere 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.
ok, I may do it later and we can revisit this later, but don't want to block this PR on this.