| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
* Fix star in signatures
* Fix comma in signatures
(cherry picked from commit 60eccd095624f39195cc5ae0b49a59022bbbb028)
Co-authored-by: Andre Delfino <adelfino@gmail.com>
|
|
|
|
|
|
|
|
| |
This is more informative and avoids the question of whether the period should go inside or outside the quotation marks.
See also GH-20007.
(cherry picked from commit 2e76820a50b8ce2a9a5f6cdef6cef1859a89c460)
Co-authored-by: Mathieu Dupuy <mathieu.dupuy@doctolib.com>
|
|
|
|
|
| |
(cherry picked from commit 4eba67783eb2084b2dad875ed1cbffdaf8a9202e)
Co-authored-by: Mathieu Dupuy <mathieu.dupuy@doctolib.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes a nearly word for word duplication of a sentence that appears
earlier in the caution section of datetime.datetime.fromisoformat in
Doc/Library/datetime.rst.
No issue created as it's a trivial change.
Automerge-Triggered-By: @pganssle
(cherry picked from commit e7b406f4e20e248d24079f97d7c8b93e5a45249e)
Co-authored-by: Michael Morehouse <640167+yawpitch@users.noreply.github.com>
|
|
|
|
|
|
| |
"HH", "MM" and "ffffff" are enclosed with double back quotes, but "SS" is left being bare
(cherry picked from commit 068768faf6b82478de239d7ab903dfb249ad96a4)
Co-authored-by: cocoatomo <cocoatomo77@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 575d0b46d122292ca6e0576a91265d7abf7cbc3d)
Co-authored-by: Ofek Lev <ofekmeister@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
(GH-15773)
https://bugs.python.org/issue37488
Automerge-Triggered-By: @pganssle
(cherry picked from commit 1a53c785e62e00bad87ae19466c3a32ebcebb915)
Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 3fb1363fe87a24cdb2ee1dd9746f1c49046af958)
Co-authored-by: Brad <brad.solomon.1124@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds a link to `dateutil.parser.isoparse` in the documentation.
It would be nice to set up intersphinx for things like this, but I think we can leave that for a separate PR.
CC: @pitrou
[bpo-37979](https://bugs.python.org/issue37979)
https://bugs.python.org/issue37979
Automerge-Triggered-By: @pitrou
(cherry picked from commit 59725f3badb3028636c8906ecac4ceb0a37f3982)
Co-authored-by: Paul Ganssle <paul@ganssle.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"Arguments may be integers... " could be misunderstand as they also
could be strings.
New wording makes it clear that arguments have to be integers.
modified: Doc/library/datetime.rst
Automerge-Triggered-By: @pganssle
(cherry picked from commit c5218fce02d6bd7bb343db20c8f14e8d9640783a)
Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>
Automerge-Triggered-By: @pganssle
|
|
|
|
|
|
|
|
|
|
| |
For datetime.datetime.strptime(), the leading zero for some two-digit formats is optional.
This adds a footnote to the strftime/strptime documentation to reflect this fact, and adds some tests to ensure that it is true.
bpo-34903
(cherry picked from commit 6b9c204ee77a0de87d6f51a3d4547a18604cef9e)
Co-authored-by: Mike Gleen <mike.gleen@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Improve example on tzinfo instances
Move from GMTX to TZX when naming the classes, as GMT1 might be rather
confusing as seen in the reported issue.
In addition, move to UTC over GMT and improve the tzname implementation.
* Simplify datetime with tzinfo example
Move the example in the documentation to just use timezone.utc and a
user defined Kabul timezone rather than having two user defined
timezones with DST.
Kabul timezone is still interesting as it changes its offset but not
based on DST. This is more accurate as the previous example was missing
information about the fold attribute. Additionally, implementing the fold
attribute was rather complex and probably not relevant enough for the
section "datetime with tzinfo".
|
|
|
|
| |
for Feb 29. (GH-10243)
|
|
|
|
| |
This commit implements the first version of date.fromisocalendar, the
inverse function for date.isocalendar.
|
|
|
|
|
|
| |
(GH-12137)
Be explicit that timedelta division converts an overall duration to the interval
units given by the denominator.
|
|
|
|
| |
format strings (GH-8948)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Documentation of UTC offset update
Since changes in the UTC offset that allows sub-minute offsets, the documentation needs update:
- "%z" format code documentation update
Karthikeyan Singaravelan commented on bugs.python.org:
Added as part of 018d353c1c8c87767d2335cd884017c2ce12e045 and a fix regarding duplicate words for that part was added at bac2d5ba30339298db7d4caa9c8cd31d807cf081.
Relevant format string at https://github.com/python/cpython/pull/2896/files#diff-25e2d173c84057d069b7890450714eddR214.
Relevant test case with 6-digit string for microsecond : https://github.com/python/cpython/pull/2896/files#diff-acc40bec51c7de832de3361db3edae52R309.
Table at https://docs.python.org/3.7/library/datetime.html#strftime-and-strptime-behavior could also be updated with microseconds being optional in the second column
%z | UTC offset in the form ±HHMM[SS] (empty string if the object is naive). | (empty), +0000, -0400, +1030
- isoformat documentation update
According to me, needs confirmation:
Relevant format string at https://github.com/python/cpython/pull/4699/files#diff-25e2d173c84057d069b7890450714eddR176
Relevant test case at https://github.com/python/cpython/pull/4699/files#diff-25e2d173c84057d069b7890450714edd
* From Martin Panter: some style improvment;
From @pganssle: using f for fractional part of seconds in all file.
|
|
|
|
|
|
|
|
| |
Python 3.x does not fall back to comparing object addresses when comparing two `dt` objects.
<!-- issue-number: [bpo-34365](https://www.bugs.python.org/issue34365) -->
https://bugs.python.org/issue34365
<!-- /issue-number -->
|
|
|
|
|
| |
This commit fixes the -timedelta overfllow issue not documented properly.
Signed-off-by: Farhaan Bukhsh <farhaan.bukhsh@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A datetime object d is aware if d.tzinfo is not None and
d.tzinfo.utcoffset(d) does not return None. If d.tzinfo is None,
or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None,
d is naive.
This commit ensures that instances with non-None d.tzinfo, but
d.tzinfo.utcoffset(d) returning None are treated as naive.
In addition, C acceleration code will raise TypeError if
d.tzinfo.utcoffset(d) returns an object with the type other than
timedelta.
* Updated the documentation.
Assume that the term "naive" is defined elsewhere and remove the
not entirely correct clarification. Thanks, Tim.
|
|
|
| |
Most of them have been added in 3.7.
|
|
|
| |
Closes bpo-15873.
|
|
|
|
| |
This is a fix to the documentation to reflect the changes merged
in as part of bpo-30302.
|
|
|
| |
Add support to strptime to parse time offsets with a colon between the hour and the minutes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Closes issue bpo-5288: Allow tzinfo objects with sub-minute offsets.
* bpo-5288: Implemented %z formatting of sub-minute offsets.
* bpo-5288: Removed mentions of the whole minute limitation on TZ offsets.
* bpo-5288: Removed one more mention of the whole minute limitation.
Thanks @csabella!
* Fix a formatting error in the docs
* Addressed review comments.
Thanks, @haypo.
|
|
|
|
|
|
| |
* Update 'Porting to .37' section.
* Fix a minor example in the doc.
|
| |
|
|
|
| |
Replace `datetuil` into `dateutil`
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| | |
Patch by Dhushyanth Ramasamy.
|
|\ \
| |/
| |
| | |
names.
|
| |
| |
| |
| | |
names.
|
| | |
|
| | |
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| |
| | |
Reformat header above separator line (added if missing) to a common format.
Patch by Yoni Lavi.
|
| | |
|
| | |
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/
| |
| | |
Patch by Alex Chan.
|
| |
| |
| |
| | |
Patch by Alex Chan.
|
|\ \
| |/ |
|