-
-
Couldn't load subscription status.
- Fork 5.7k
Add specific docstrings to Int and UInt #45415
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
|
See also #45221 which mentions that there is this default for |
|
CI failure seems unrelated. |
base/docs/basedocs.jl
Outdated
| end | ||
|
|
||
| """ | ||
| $(Int) <: Signed |
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.
| $(Int) <: Signed | |
| Int <: Signed |
Isn't more reasonable if we hardcode 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.
The idea is that it will show up as e.g. Int64 on 64-bit systems, not Int, since Int64 is the canonical name of the type, and Int is an alias.
|
If this is approved, can you clarify what you envisage happening with the earlier #45221? That also aims to explain the Int default, but does not make a separate |
|
It seems like we can access to both documentations even if we have a separate documentation for julia> @eval begin
"""
Parent
Documentation for `Parent`
"""
struct Parent end
"""
Aliased
Documentation for `Aliased`
"""
const Aliased = Parent
end
Aliased
help?> Parent
search: Parent parent parentmodule parentindices
Parent
Documentation for Parent
help?> Aliased
search: Aliased
Aliased
Documentation for Aliased |
|
I thought the example was showing that That seems a little confusing to me, what details should appear in one and not the other? I would never think to read both, when |
|
Oh sorry, you are right! I did not understand Shuhei's example. Yeah, I agree, this is not what I want here. There should only be one docstring, |
|
Is this good to merge? I am rebasing it to master to be able to run CI (which was quite broken the last time it ran here). |
|
@ViralBShah I see there are some CI failures with building the docs. I'll iron them out, then ping you when tests pass and it can be merged |
|
@ViralBShah After having skimmed them, I think the numerous CI failures are all unrelated to this change. This is ready to merge. |
Co-authored-by: Allen Hill <halleysfifthinc@users.noreply.github.com>
|
It still seems confusing to me to have two docstrings for I also still wonder what the plan is with the earlier PR #45221, which also expands the docstring for |
|
Since PR #45221 has been merged, there are docstrings for (If you'd like to tweak the new docstrings, I'd recommend opening a new PR to make sure it gets proper attention) |

Anecdotally, it is not always clear for beginners that
IntandInt64is the same type, and this leads to some confusion for newcomers. This is described in the manual, but it would be nice to also have it in the docstring.Furthermore, mention that
Intis used as the default integer type in Julia. Where some languages useUIntfor things such as array sizes, Julia nearly universally usesIntas the integer type.