-
-
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
Some docstrings always show up (but they should not) #20064
Comments
I just checked on the lastest master. The docstring for julia> using Dates
help?> Date() + Time()
+(x, y...)
Addition operator. x+y+z+... calls this function with all arguments, i.e. +(x, y, z, ...).
Examples
≡≡≡≡≡≡≡≡≡≡
julia> 1 + 20 + 4
25
julia> +(1, 20, 4)
25
dt::Date + t::Time -> DateTime
The addition of a Date with a Time produces a DateTime. The hour, minute, second, and millisecond parts of the Time are used along with the year, month, and day of the Date to create the new
DateTime. Non-zero microseconds or nanoseconds in the Time type will result in an InexactError being thrown. julia> versioninfo()
Julia Version 0.7.0-DEV.3478
Commit 9028130* (2018-01-20 09:44 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, ivybridge)
Environment: |
What's the problem with the output you show? |
The problem is that you get two concetanated docstrings: The generic one for help?> length("a")
length(s::AbstractString) -> Int
length(s::AbstractString, i::Integer, j::Integer) -> Int
The number of characters in string s from indices i through j. This is computed as the number of code unit indices from i to j which are valid character indices. Without only a single string
argument, this computes the number of characters in the entire string. With i and j arguments it computes the number of indices between i and j inclusive that are valid indices in the string
s. In addition to in-bounds values, i may take the out-of-bounds value ncodeunits(s) + 1 and j may take the out-of-bounds value 0.
See also: isvalid, ncodeunits, endof, thisind, nextind, prevind
Examples
≡≡≡≡≡≡≡≡≡≡
julia> length("jμΛIα")
5 Here you don't get the docstring for the Because you get also the docstring for the Base types, this makes it impossible to write nice looking documentations using Documenter: Whenever you include the docstring for say
I think this is a problem. You don't see this in the julia manual, because for some reason (https://docs.julialang.org/en/latest/stdlib/Dates/#stdlib-dates-1) does not include the documentation for |
There are no
You get the docstrings for everything that matches your query so it doesn't really have anything to do with base types. However, showing only the more specific methods probably makes sense. On 0.6, we had:
so this looks like a regression? |
Ok, the difference in 0.6 and 0.7 is due to that on 0.6, the |
There is a docstring for
Base.length
, which shows up for any input type (but it should not). This makes itimpossiblevery hard to automatically build documentations in case one wants to document a customlength
function.Happens also for builtin typesThe text was updated successfully, but these errors were encountered: