Skip to content

Commit 4bd8b1e

Browse files
authored
Merge branch 'main' into improve-fma-docs/65709
2 parents 953e322 + a7d5a6c commit 4bd8b1e

34 files changed

Lines changed: 1130 additions & 811 deletions

Doc/library/difflib.rst

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -728,18 +728,16 @@ Finally, we compare the two:
728728

729729
>>> from pprint import pprint
730730
>>> pprint(result)
731-
[
732-
' 1. Beautiful is better than ugly.\n',
733-
'- 2. Explicit is better than implicit.\n',
734-
'- 3. Simple is better than complex.\n',
735-
'+ 3. Simple is better than complex.\n',
736-
'? ++\n',
737-
'- 4. Complex is better than complicated.\n',
738-
'? ^ ---- ^\n',
739-
'+ 4. Complicated is better than complex.\n',
740-
'? ++++ ^ ^\n',
741-
'+ 5. Flat is better than nested.\n',
742-
]
731+
[' 1. Beautiful is better than ugly.\n',
732+
'- 2. Explicit is better than implicit.\n',
733+
'- 3. Simple is better than complex.\n',
734+
'+ 3. Simple is better than complex.\n',
735+
'? ++\n',
736+
'- 4. Complex is better than complicated.\n',
737+
'? ^ ---- ^\n',
738+
'+ 4. Complicated is better than complex.\n',
739+
'? ++++ ^ ^\n',
740+
'+ 5. Flat is better than nested.\n']
743741

744742
As a single multi-line string it looks like this:
745743

Doc/library/gzip.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Note that additional file formats which can be decompressed by the
2828
The module defines the following items:
2929

3030

31-
.. function:: open(filename, mode='rb', compresslevel=6, encoding=None, errors=None, newline=None)
31+
.. function:: open(filename, mode='rb', compresslevel=6, encoding=None, errors=None, newline=None, *, mtime=None)
3232

3333
Open a gzip-compressed file in binary or text mode, returning a :term:`file
3434
object`.
@@ -43,9 +43,12 @@ The module defines the following items:
4343
The *compresslevel* argument is an integer from 0 to 9, as for the
4444
:class:`GzipFile` constructor.
4545

46+
The keyword-only argument *mtime* represents a Unix timestamp.
47+
4648
For binary mode, this function is equivalent to the :class:`GzipFile`
47-
constructor: ``GzipFile(filename, mode, compresslevel)``. In this case, the
48-
*encoding*, *errors* and *newline* arguments must not be provided.
49+
constructor: ``GzipFile(filename, mode, compresslevel, mtime=mtime)``.
50+
In this case, the *encoding*, *errors* and *newline* arguments must not
51+
be provided.
4952

5053
For text mode, a :class:`GzipFile` object is created, and wrapped in an
5154
:class:`io.TextIOWrapper` instance with the specified encoding, error
@@ -66,6 +69,10 @@ The module defines the following items:
6669
It is the default level used by most compression tools and a better
6770
tradeoff between speed and performance.
6871

72+
.. versionchanged:: next
73+
Added keyword-only argument *mtime* which is passed to the class
74+
constructor of :class:`~gzip.GzipFile`.
75+
6976
.. exception:: BadGzipFile
7077

7178
An exception raised for invalid gzip files. It inherits from :exc:`OSError`.

0 commit comments

Comments
 (0)