Skip to content
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 docstrings for days of the week #31574

Merged
merged 1 commit into from May 23, 2019
Merged

Add docstrings for days of the week #31574

merged 1 commit into from May 23, 2019

Conversation

kshyatt
Copy link
Contributor

@kshyatt kshyatt commented Apr 1, 2019

Following #31218...

@kshyatt kshyatt added domain:docs This change adds or pertains to documentation domain:dates Dates, times, and the Dates stdlib module labels Apr 1, 2019
@kshyatt kshyatt requested a review from quinnj April 1, 2019 19:44
@fredrikekre
Copy link
Member

How about this pattern instead:

const Monday, ...., = 1, ...
const Mon, ..., = 1, ...

"""
    Monday
    Mon

The first day of the week.

# Examples
```jldoctest
julia> Monday
1
```
"""
Mon, Monday

...

@kshyatt
Copy link
Contributor Author

kshyatt commented Apr 2, 2019

@fredrikekre I tried to match the pattern already in place for the months.

@fredrikekre
Copy link
Member

@fredrikekre I tried to match the pattern already in place for the months.

Change that too then :) I just think it is completely unecessary to maintain two different docstrings for aliases to the integers 1-7 (and 1-12 for the months).

@StefanKarpinski
Copy link
Sponsor Member

Is it possible to attache a single doc string to the symbols for the days? It would be pretty weird for the Monday doc string to be attached to the number 1.

@dkarrasch
Copy link
Member

x-ref #31202

@kshyatt
Copy link
Contributor Author

kshyatt commented May 9, 2019

@fredrikekre is this better? I checked and tests passed and docs build (and the docstring lookup works).

@kshyatt
Copy link
Contributor Author

kshyatt commented May 10, 2019

Win32 and Travis errors are unrelated.

@fredrikekre
Copy link
Member

I still don't think we need separate docstrings for the long and short names, why not just

const Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday = 1, 2, 3, 4, 5, 6, 7
const Mon, Tue, Wed, Thu, Fri, Sat, Sun = 1, 2, 3, 4, 5, 6, 7

"""
    Monday
    Mon

The first day of the week.

# Examples
```jldoctest
julia> Monday
1
```
"""
Monday, Mon

"""
    Tuesday
    Tue

The second day of the week.

# Examples
```jldoctest
julia> Tuesday
2
```
"""
Tuesday, Tue

...

etc?

@kshyatt
Copy link
Contributor Author

kshyatt commented May 10, 2019

Now even more sm0l

@kshyatt
Copy link
Contributor Author

kshyatt commented May 21, 2019

Anything else we want for this?

@fredrikekre fredrikekre merged commit c532cf2 into master May 23, 2019
@fredrikekre fredrikekre deleted the ksh/weekdays branch May 23, 2019 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:dates Dates, times, and the Dates stdlib module domain:docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants