GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.8] bpo-36960: Overhaul datetime documentation (GH-13410) by miss-islington · Pull Request #16056 · python/cpython

Conversation

@miss-islington

@miss-islington miss-islington commented Sep 12, 2019 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This is a restructuring of the datetime documentation to hopefully make
them more user-friendly and approachable to new users without losing any
of the detail.

Changes include:

  • Creating dedicated subsections for some concepts such as:
    • "Constants"
    • "Naive vs Aware"
    • "Determining if an Object is Aware"
  • Give 'naive vs aware' its own subsection
  • Give 'constants' their own subsection
  • Overhauling the strftime-strptime section by:
    • Breaking it into logical, linkable, and digestable parts
    • Adding a high-level comparison table
    • Moving the technical detail to bottom: readers come to this
      section primarily to remind themselves to things:
      • How do I write the format code for X?
      • strptime/strftime: which one is which again?
  • Touching up fromisoformat + isoformat sections by:
    • Revising fromisoformat + isoformat for date, time, and
      datetime
    • Adding basic examples
    • Enforcing consistency about putting formats (i.e. HH:MM)
      in double backticks. This was previously done in some places
      but not all
    • Putting long 'supported formats', on their own line to improve
      readability
  • Moving the 'seealso' section to the top and add a link to dateutil
    Rationale: This doesn't really belong nested under the
    'constants' section. Let readers know right away that
    datetime is one of several related tools.
  • Moving common features of several types into one place:
    Previously, each type went out of its way to note separately
    that it was hashable and picklable. These can be brought
    into one single place that is more prominent.
  • Reducing some verbose explanations to improve readability
  • Breaking up long paragraphs into digestable chunks
  • Displaying longer "equivalent to" examples, as short code blocks
  • Using the dot notation for datetime/time classes:
    Use :class:.time and :class:.datetime rather than :class:time and
    :class:datetime; otherwise, the generated links will route to the
    respective modules, not classes.
  • Rewording the tzinfo class description
    The top paragraph should get straight to the point of telling the reader
    what subclasses of tzinfo do. Previously, that was hidden in a later
    paragraph.
  • Adding a note on .today() versus .now()
  • Rearranging and expanding example blocks, including:
    • Moved long, multiline inline examples to standalone examples
    • Simplified the example block for timedelta arithmetic:
      • Broke the example into two logical sections:
        1. normalization/parameter 'merging'
        2. timedelta arithmetic
      • Reduced the complexity of the some of the examples. Show
        reasonable, real-world uses cases that are easy to follow
        along with and progres in difficult slightly.
    • Broke up the example sections for date and datetime sections by putting
      the easy examples first, progressing to more esoteric situations and
      breaking it up into logical sections based on what the methods are
      doing at a high level.
    • Simplified the KabulTz example:
      • Put the class definition itself into a non-REPL block since there is
        no interactive output involved there
      • Briefly explained what's happening before launching into the code
      • Broke the example section into visually separate chunks
  • Various whitespace, formatting, style and grammar fixes including:
    • Consistently using backctics for 'date_string' formats
    • Consistently using one space after periods.
    • Consistently using bold for vocab terms
    • Consistently using italics when referring to params:
      See https://devguide.python.org/documenting/GH-id4
    • Using '::' to lead into code blocks
      Per https://devguide.python.org/documenting/GH-source-code, this will
      let the reader use the 'expand/collapse' top-right button for REPL
      blocks to hide or show the prompt.
    • Using consistent captialization schemes
    • Removing use of the default role
    • Put 'example' blocks in Markdown subsections

This is a combination of 66 commits.

See bpo-36960: https://bugs.python.org/issue36960
(cherry picked from commit 3fb1363)

Co-authored-by: Brad [email protected]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bsolomon1124 @miss-islington
Overhaul datetime documentation (pythonGH-13410)
6998a70
This is a restructuring of the datetime documentation to hopefully make
them more user-friendly and approachable to new users without losing any
of the detail.

Changes include:
 - Creating dedicated subsections for some concepts such as:
    - "Constants"
    - "Naive vs Aware"
    - "Determining if an Object is Aware"
 - Give 'naive vs aware' its own subsection
 - Give 'constants' their own subsection
 - Overhauling the strftime-strptime section by:
    - Breaking it into logical, linkable, and digestable parts
    - Adding a high-level comparison table
    - Moving the technical detail to bottom: readers come to this
      section primarily to remind themselves to things:
      - How do I write the format code for X?
      - strptime/strftime: which one is which again?
 - Touching up fromisoformat + isoformat sections by:
    - Revising fromisoformat + isoformat for date, time, and
      datetime
    - Adding basic examples
    - Enforcing consistency about putting formats (i.e. ``HH:MM``)
      in double backticks.  This was previously done in some places
      but not all
    - Putting long 'supported formats', on their own line to improve
      readability
 - Moving the 'seealso' section to the top and add a link to dateutil
    Rationale: This doesn't really belong nested under the
    'constants' section.  Let readers know right away that
    datetime is one of several related tools.
 - Moving common features of several types into one place:
    Previously, each type went out of its way to note separately
    that it was hashable and picklable.  These can be brought
    into one single place that is more prominent.
 - Reducing some verbose explanations to improve readability
 - Breaking up long paragraphs into digestable chunks
 - Displaying longer "equivalent to" examples, as short code blocks
 - Using the dot notation for datetime/time classes:
    Use :class:`.time` and :class:`.datetime` rather than :class:`time` and
    :class:`datetime`; otherwise, the generated links will route to the
    respective modules, not classes.
 - Rewording the tzinfo class description
    The top paragraph should get straight to the point of telling the reader
    what subclasses of tzinfo _do_.  Previously, that was hidden in a later
    paragraph.
 - Adding a note on .today() versus .now()
 - Rearranging and expanding example blocks, including:
    - Moved long, multiline inline examples to standalone examples
    - Simplified the example block for timedelta arithmetic:
        - Broke the example into two logical sections:
          1. normalization/parameter 'merging'
          2. timedelta arithmetic
        - Reduced the complexity of the some of the examples.  Show
          reasonable, real-world uses cases that are easy to follow
          along with and progres in difficult slightly.
    - Broke up the example sections for date and datetime sections by putting
      the easy examples first, progressing to more esoteric situations and
      breaking it up into logical sections based on what the methods are
      doing at a high level.
    - Simplified the KabulTz example:
        - Put the class definition itself into a non-REPL block since there is
          no interactive output involved there
        - Briefly explained what's happening before launching into the code
        - Broke the example section into visually separate chunks
 - Various whitespace, formatting, style and grammar fixes including:
    - Consistently using backctics for 'date_string' formats
    - Consistently using one space after periods.
    - Consistently using bold for vocab terms
    - Consistently using italics when referring to params:
      See https://devguide.python.org/documenting/GH-id4
    - Using '::' to lead into code blocks
        Per https://devguide.python.org/documenting/GH-source-code, this will
        let the reader use the 'expand/collapse' top-right button for REPL
        blocks to hide or show the prompt.
    - Using consistent captialization schemes
    - Removing use of the default role
    - Put 'example' blocks in Markdown subsections

This is a combination of 66 commits.

See bpo-36960: https://bugs.python.org/issue36960
(cherry picked from commit 3fb1363)

Co-authored-by: Brad <[email protected]>
@bedevere-bot bedevere-bot mentioned this pull request Sep 12, 2019
bpo-36960: Make datetime docs more user-friendly #13410
Merged
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Sep 12, 2019
@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Sep 12, 2019
@pganssle pganssle changed the title [3.8] Overhaul datetime documentation (GH-13410) [3.8] bpo-36960: Overhaul datetime documentation (GH-13410) Sep 12, 2019
@pganssle pganssle added skip issue skip news and removed skip issue labels Sep 12, 2019
pganssle
pganssle approved these changes Sep 12, 2019
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Sep 12, 2019
@miss-islington

miss-islington commented Sep 12, 2019

Copy link
Copy Markdown
Contributor Author

@bsolomon1124 and @pganssle: Status check is done, and it's a success ✅ .

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington
miss-islington merged commit 8976359 into python:3.8 Sep 12, 2019
@miss-islington
miss-islington deleted the backport-3fb1363-3.8 branch September 12, 2019 14:37
@bedevere-bot bedevere-bot removed the awaiting merge label Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pganssle pganssle pganssle approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@miss-islington @pganssle @the-knights-who-say-ni @bedevere-bot @bsolomon1124
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.