-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
clarify Timer docstrings, add example #24184
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
| wait(t) | ||
| sleep(.5) | ||
| close(t) | ||
| end |
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.
Typically we use the preferred style even in REPL examples. So this should be written:
julia> begin
i = 0
cb(timer) = (global i += 1; println(i))
t = Timer(cb, 2, 0.2)
wait(t)
sleep(0.5)
close(t)
end
|
Please don't ci skip unless (at least) running |
|
For doc changes it's also a good idea to build the docs locally to ensure they render how you expect them to. |
|
I'm a bit confused about the expectations on documentation PRs. One the one hand, CONTRIBUTING.md says to build locally, and I've been asked to do so. On the other hand, when you browse the docs there is a "Edit on Github" link, and a "Source" link next to every method entry. Those suggest that clicking on them, editing, and submitting a PR might be helpful. It seems like a mixed message. Thanks for the corrections. Can I run |
|
Editing on github can be conveninent for minor changes, but for larger changes I would recommend doing the work locally. It is fine to do the changes on github if you prefer. |
|
We could also turn off whitespace failures in favor of automatically fixing them (e.g. with a bot), which I've been in favor of since it's much friendlier to people making changes, e.g. from the web. |
|
It would also be nice for it to correct things like indentation. |
I was confused by the
Timerdocstrings, so I tried to make them more clear. I didn't add a doc test because it seems wasteful to have a test that is mostly sleeping. I don't have a local build of julia to build the docs with, so I just tried to get the formatting right.Normally I would have re-used most of the text and just made a small entry for the callback variant, but one docstring is on a type, and one is on a method, so I just repeated everything.