-
-
Notifications
You must be signed in to change notification settings - Fork 518
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
Improve docstring and type annotation of as_cached #3729
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3729 +/- ##
==========================================
- Coverage 83.76% 83.76% -0.01%
==========================================
Files 210 210
Lines 30202 30203 +1
==========================================
Hits 25300 25300
- Misses 4902 4903 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I looked at the failing tests. They don't seem related to this PR as far as I can see. |
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 Marc!
In particular on the typing improvement, TIL!
I made a suggestion to improve the example.
Why did you pick the name as_cached. Its not a term I know from elsewhere. It does not give me associations to anything I already know and love which would have been helpful 😄 .
Naming is hard! I can't reply for Philipp, but if you have other names to suggest I guess it's never too late, in particular if they're a net improvement over the current state.
I looked at the failing tests. They don't seem related to this PR as far as I can see.
They seem related actually, pre-commit failed because of a trailing whitespace: https://github.com/holoviz/panel/runs/7589741660?check_suite_focus=true#step:5:79
Co-authored-by: Maxime Liquet <35924738+maximlt@users.noreply.github.com>
d91ddde
to
5fd0d94
Compare
I'm trying to help a user on discourse. I wanted to use
as_cached
for the first time.Its just much faster (for me) to look at an example before I study the more systematic documentation. So I added an example.
I added a better type annotation than return type
None
as described here https://stackoverflow.com/questions/62153257/specify-type-annotation-for-python-function-returning-type-of-argumentComments
as_cached
. Its not a term I know from elsewhere. It does not give me associations to anything I already know and love which would have been helpful 😄 .