-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
add docstring for new kwargs in code_typed #40719
Conversation
base/reflection.jl
Outdated
possible options are `:source` or `:none`. | ||
- `world=Base.get_world_counter()`: controls the world age to use when looking up methods. | ||
- `interp=Core.Compiler.NativeInterpreter(world)`: controls the interpreter to use. |
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.
Are these two (Base.get_world_counter()
and Core.Compiler.NativeInterpreter
) referenced from anywhere else? Otherwise, it seems a bit odd to have it in a docstring like this.
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 don't think they are documented in other places yet, should I just remove them from here then?
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.
Or should I also add a docstring for them?
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 add a docstring for them as well
I removed the references to internal functions, hope this looks good now. |
I still claim that these new keyword arguments ( |
We do document |
Documented means "exist in the manual". A docstring on an internal function is pretty much just a glorified comment (this is one reason why I don't think docstrings on internal functions are ideal because people constantly get confused about if it is an internal function or not). The manual (excluding the devdocs) should be consistent, you should be able to figure out what you can pass for every argument for every function just by reading it. And this does not mean that |
OK what should I do here? maybe move it to dev doc? |
I think the main issue here is that I find not mentioning the new keyword arguments (world, interp) in docstring makes things confusing when using it. what about if we just mention these two keyword argument should be considered for who knows internal? I'm planning to submit other similar docstring updates to improve the experience programming compiler plugins, so would be nice to have some clarification on this type of documentation. |
I would add in the docstring a separate heading denotation these Kearns as internal and referencing the devdocs |
@vchuravy like this? what is "Kearns"? you mean Kwargs? |
@staticfloat Some strange Buildkite failures here. |
Is this not just because this branch needs to be rebased? |
Ah, maybe that's it. @Roger-luo can you rebase on the latest master? |
any idea why linux64 fails after merging master into this branch? |
I find the docstring for
interp
andworld
is missing in 1.6+, so I just add them here.I also add an example to help people remember whether the signature is
Tuple{Float64, Float64}
or(Float64, Float64)
I find I mix them up quite often