Skip to content

Wrong/missing code formats in datetime documentation #85453

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

Open
yyyyyyyan mannequin opened this issue Jul 12, 2020 · 16 comments
Open

Wrong/missing code formats in datetime documentation #85453

yyyyyyyan mannequin opened this issue Jul 12, 2020 · 16 comments
Labels
docs Documentation in the Doc dir easy type-feature A feature request or enhancement

Comments

@yyyyyyyan
Copy link
Mannequin

yyyyyyyan mannequin commented Jul 12, 2020

BPO 41281
Nosy @ezio-melotti, @merwok, @willingc, @JulienPalard, @yyyyyyyan
PRs
  • gh-85453: Fix missing/wrong backquotes and role texts in datetime documentation #21447
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2020-07-12.05:26:29.849>
    labels = ['type-feature', '3.8', '3.9', '3.10', 'docs']
    title = 'Wrong/missing code formats in datetime documentation'
    updated_at = <Date 2020-07-12.05:29:56.710>
    user = 'https://github.com/yyyyyyyan'

    bugs.python.org fields:

    activity = <Date 2020-07-12.05:29:56.710>
    actor = 'yyyyyyyan'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation']
    creation = <Date 2020-07-12.05:26:29.849>
    creator = 'yyyyyyyan'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41281
    keywords = ['patch']
    message_count = 1.0
    messages = ['373547']
    nosy_count = 6.0
    nosy_names = ['ezio.melotti', 'eric.araujo', 'docs@python', 'willingc', 'mdk', 'yyyyyyyan']
    pr_nums = ['21447']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue41281'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    Linked PRs

    @yyyyyyyan
    Copy link
    Mannequin Author

    yyyyyyyan mannequin commented Jul 12, 2020

    The datetime page in the docs is missing a lot of needed backquotes syntax for inline code samples. There are some wrong role links too, due to ambiguity in the text roles.

    @yyyyyyyan yyyyyyyan mannequin added 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes labels Jul 12, 2020
    @yyyyyyyan yyyyyyyan mannequin assigned docspython Jul 12, 2020
    @yyyyyyyan yyyyyyyan mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes labels Jul 12, 2020
    @yyyyyyyan yyyyyyyan mannequin assigned docspython Jul 12, 2020
    @yyyyyyyan yyyyyyyan mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Jul 12, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @erlend-aasland erlend-aasland added easy and removed 3.10 only security fixes 3.9 only security fixes 3.8 (EOL) end of life labels Feb 9, 2024
    @uatach
    Copy link
    Contributor

    uatach commented Apr 18, 2024

    hello @erlend-aasland, I would like to help with this

    @erlend-aasland
    Copy link
    Contributor

    Great, @uatach, go ahead! Let me know if you have any questions.

    @erlend-aasland
    Copy link
    Contributor

    In PR #118068, code formatting was removed from many numeric literals; let's follow up with a PR to make that consistent across datetime.rst. The following lines still contain numeric literals marked up with double backticks:

    • L94
    • L2564
    • L2711

    @erlend-aasland
    Copy link
    Contributor

    Remark by Serhiy #118068 (comment) for L373:

    I understand what it means, but it would be nice to explain what does "zero" mean. Is it already explained anywhere?

    Division by zero raises :exc:`ZeroDivisionError`.

    @erlend-aasland
    Copy link
    Contributor

    Remark by Serhiy #118068 (comment):

    Should not the sentence start with the title case?

    | ``-t1`` | equivalent to ``timedelta(-t1.days, |
    | | -t1.seconds*, -t1.microseconds)``, |
    | | and to ``t1 * -1``. (1)(4) |
    +--------------------------------+-----------------------------------------------+
    | ``abs(t)`` | equivalent to ``+t`` when ``t.days >= 0``, |
    | | and to ``-t`` when ``t.days < 0``. (2) |

    Check the whole file and fix up any incorrect capitalisation.

    @erlend-aasland
    Copy link
    Contributor

    Remark by Serhiy #118068 (comment):

    Needed a reference to (3).

    | ``t1 = t2 / f or t1 = t2 / i`` | Delta divided by a float or an int. The result|
    | | is rounded to the nearest multiple of |
    | | timedelta.resolution using round-half-to-even.|

    erlend-aasland added a commit that referenced this issue Apr 24, 2024
    …ppets and variables (#118068)
    
    Also remove formatting from numeric literals.
    
    Co-authored-by: Serhiy Storchaka <[email protected]>
    Co-authored-by: Jelle Zijlstra <[email protected]>
    Co-authored-by: Erlend E. Aasland <[email protected]>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Apr 24, 2024
    …de snippets and variables (pythonGH-118068)
    
    Also remove formatting from numeric literals.
    
    (cherry picked from commit 809aa9a)
    
    Co-authored-by: edson duarte <[email protected]>
    Co-authored-by: Serhiy Storchaka <[email protected]>
    Co-authored-by: Jelle Zijlstra <[email protected]>
    Co-authored-by: Erlend E. Aasland <[email protected]>
    @ayushman2046
    Copy link

    Is this issue still open? I would like to contribute.

    @merwok
    Copy link
    Member

    merwok commented Jul 9, 2024

    Could the docs editorial board review this?

    I am not convinced of the necessity of avoiding timezone or datetime.
    Timezone, like filesystem, is a form with a special meaning, now common in normal English to represent the concept.
    Things like the current datetime are not common, but they are readily understandable in the context of the python datetime module docs.

    @willingc
    Copy link
    Contributor

    @python/editorial-board Please review thoughts on moving from timezone in prose docs to time zone. I'm leaning toward @merwok's perspective that the change is not a necessity. Looking for additional perspective on this.

    @gvanrossum
    Copy link
    Member

    @python/editorial-board Please review thoughts on moving from timezone in prose docs to time zone. I'm leaning toward @merwok's perspective that the change is not a necessity. Looking for additional perspective on this.

    There are already plenty of places where the docs use "time zone" (when referring to the general concept, not the module or object). I Googled and the consensus seems to be that it's two words.

    Regarding "datetime" vs. "date time", neither is correct English. IMO the concept ought to be referred to as "date and time", or could possibly shortened as "date/time". But I'm more open to keeping "datetime" as a form of jargon we're inventing. (Though I don't feel that way about "timezone".)

    @erlend-aasland
    Copy link
    Contributor

    IMO the concept ought to be referred to as "date and time", [...]

    Yes, this is what #118449 proposes.

    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 16, 2024
    …etime.rst (pythonGH-118449)
    
    (cherry picked from commit 1755df7)
    
    Co-authored-by: edson duarte <[email protected]>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 16, 2024
    …etime.rst (pythonGH-118449)
    
    (cherry picked from commit 1755df7)
    
    Co-authored-by: edson duarte <[email protected]>
    erlend-aasland pushed a commit that referenced this issue Jul 16, 2024
    …tetime.rst (GH-118449) (#121838)
    
    (cherry picked from commit 1755df7)
    
    Co-authored-by: edson duarte <[email protected]>
    estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
    erlend-aasland pushed a commit that referenced this issue Jul 23, 2024
    …tetime.rst (GH-118449) (#121837)
    
    (cherry picked from commit 1755df7)
    
    Co-authored-by: edson duarte <[email protected]>
    hugovk added a commit that referenced this issue Sep 5, 2024
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 5, 2024
    …ythonGH-123655)
    
    (cherry picked from commit 9aea9c1)
    
    Co-authored-by: edson duarte <[email protected]>
    Co-authored-by: Hugo van Kemenade <[email protected]>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 5, 2024
    …ythonGH-123655)
    
    (cherry picked from commit 9aea9c1)
    
    Co-authored-by: edson duarte <[email protected]>
    Co-authored-by: Hugo van Kemenade <[email protected]>
    hugovk added a commit that referenced this issue Sep 5, 2024
    hugovk added a commit that referenced this issue Sep 5, 2024
    erlend-aasland pushed a commit that referenced this issue Oct 14, 2024
    Variables and literals are marked up using backticks.
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 14, 2024
    …20702)
    
    Variables and literals are marked up using backticks.
    (cherry picked from commit 2a5cdb2)
    
    Co-authored-by: edson duarte <[email protected]>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 14, 2024
    …20702)
    
    Variables and literals are marked up using backticks.
    (cherry picked from commit 2a5cdb2)
    
    Co-authored-by: edson duarte <[email protected]>
    erlend-aasland pushed a commit that referenced this issue Oct 14, 2024
    #125490)
    
    Variables and literals are marked up using backticks.
    (cherry picked from commit 2a5cdb2)
    
    Co-authored-by: edson duarte <[email protected]>
    erlend-aasland pushed a commit that referenced this issue Oct 14, 2024
    #125491)
    
    Variables and literals are marked up using backticks.
    (cherry picked from commit 2a5cdb2)
    
    Co-authored-by: edson duarte <[email protected]>
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir easy type-feature A feature request or enhancement
    Projects
    Development

    No branches or pull requests

    8 participants