Skip to content

Commit bc7912b

Browse files
Deploy preview for PR 1123 🛫
1 parent 5f6b3ff commit bc7912b

File tree

556 files changed

+653
-663
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

556 files changed

+653
-663
lines changed

pr-preview/pr-1123/_sources/library/enum.rst.txt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,16 +504,31 @@ Data Types
504504

505505
.. class:: StrEnum
506506

507-
``StrEnum`` is the same as :class:`Enum`, but its members are also strings and can be used
508-
in most of the same places that a string can be used. The result of any string
509-
operation performed on or with a *StrEnum* member is not part of the enumeration.
507+
*StrEnum* is the same as :class:`Enum`, but its members are also strings and
508+
can be used in most of the same places that a string can be used. The result
509+
of any string operation performed on or with a *StrEnum* member is not part
510+
of the enumeration.
511+
512+
>>> from enum import StrEnum, auto
513+
>>> class Color(StrEnum):
514+
... RED = 'r'
515+
... GREEN = 'g'
516+
... BLUE = 'b'
517+
... UNKNOWN = auto()
518+
...
519+
>>> Color.RED
520+
<Color.RED: 'r'>
521+
>>> Color.UNKNOWN
522+
<Color.UNKNOWN: 'unknown'>
523+
>>> str(Color.UNKNOWN)
524+
'unknown'
510525

511526
.. note::
512527

513528
There are places in the stdlib that check for an exact :class:`str`
514529
instead of a :class:`str` subclass (i.e. ``type(unknown) == str``
515530
instead of ``isinstance(unknown, str)``), and in those locations you
516-
will need to use ``str(StrEnum.member)``.
531+
will need to use ``str(MyStrEnum.MY_MEMBER)``.
517532

518533
.. note::
519534

pr-preview/pr-1123/_sources/library/os.path.rst.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ the :mod:`glob` module.)
9494
Any iterable can now be passed, rather than just sequences.
9595

9696

97-
.. function:: commonprefix(list)
97+
.. function:: commonprefix(list, /)
9898

9999
Return the longest path prefix (taken character-by-character) that is a
100100
prefix of all paths in *list*. If *list* is empty, return the empty string
@@ -199,14 +199,14 @@ the :mod:`glob` module.)
199199
Accepts a :term:`path-like object`.
200200

201201

202-
.. function:: getatime(path)
202+
.. function:: getatime(path, /)
203203

204204
Return the time of last access of *path*. The return value is a floating-point number giving
205205
the number of seconds since the epoch (see the :mod:`time` module). Raise
206206
:exc:`OSError` if the file does not exist or is inaccessible.
207207

208208

209-
.. function:: getmtime(path)
209+
.. function:: getmtime(path, /)
210210

211211
Return the time of last modification of *path*. The return value is a floating-point number
212212
giving the number of seconds since the epoch (see the :mod:`time` module).
@@ -216,7 +216,7 @@ the :mod:`glob` module.)
216216
Accepts a :term:`path-like object`.
217217

218218

219-
.. function:: getctime(path)
219+
.. function:: getctime(path, /)
220220

221221
Return the system's ctime which, on some systems (like Unix) is the time of the
222222
last metadata change, and, on others (like Windows), is the creation time for *path*.
@@ -228,7 +228,7 @@ the :mod:`glob` module.)
228228
Accepts a :term:`path-like object`.
229229

230230

231-
.. function:: getsize(path)
231+
.. function:: getsize(path, /)
232232

233233
Return the size, in bytes, of *path*. Raise :exc:`OSError` if the file does
234234
not exist or is inaccessible.
@@ -351,7 +351,7 @@ the :mod:`glob` module.)
351351
.. versionadded:: 3.13
352352

353353

354-
.. function:: join(path, *paths)
354+
.. function:: join(path, /, *paths)
355355

356356
Join one or more path segments intelligently. The return value is the
357357
concatenation of *path* and all members of *\*paths*, with exactly one
@@ -402,7 +402,7 @@ the :mod:`glob` module.)
402402
Accepts a :term:`path-like object`.
403403

404404

405-
.. function:: realpath(path, *, strict=False)
405+
.. function:: realpath(path, /, *, strict=False)
406406

407407
Return the canonical path of the specified filename, eliminating any symbolic
408408
links encountered in the path (if they are supported by the operating
@@ -471,7 +471,7 @@ the :mod:`glob` module.)
471471
Accepts a :term:`path-like object`.
472472

473473

474-
.. function:: samefile(path1, path2)
474+
.. function:: samefile(path1, path2, /)
475475

476476
Return ``True`` if both pathname arguments refer to the same file or directory.
477477
This is determined by the device number and i-node number and raises an
@@ -498,7 +498,7 @@ the :mod:`glob` module.)
498498
Accepts a :term:`path-like object`.
499499

500500

501-
.. function:: samestat(stat1, stat2)
501+
.. function:: samestat(stat1, stat2, /)
502502

503503
Return ``True`` if the stat tuples *stat1* and *stat2* refer to the same file.
504504
These structures may have been returned by :func:`os.fstat`,

pr-preview/pr-1123/_sources/library/urllib.request.rst.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -784,10 +784,13 @@ The following attribute and methods should only be used by classes derived from
784784
errors. It will be called automatically by the :class:`OpenerDirector` getting
785785
the error, and should not normally be called in other circumstances.
786786

787-
*req* will be a :class:`Request` object, *fp* will be a file-like object with
788-
the HTTP error body, *code* will be the three-digit code of the error, *msg*
789-
will be the user-visible explanation of the code and *hdrs* will be a mapping
790-
object with the headers of the error.
787+
:class:`OpenerDirector` will call this method with five positional arguments:
788+
789+
1. a :class:`Request` object,
790+
#. a file-like object with the HTTP error body,
791+
#. the three-digit code of the error, as a string,
792+
#. the user-visible explanation of the code, as as string, and
793+
#. the headers of the error, as a mapping object.
791794

792795
Return values and exceptions raised should be the same as those of
793796
:func:`urlopen`.

pr-preview/pr-1123/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ <h3>瀏覽</h3>
320320
<a href="https://www.python.org/psf/donations/">Please donate.</a>
321321
<br>
322322
<br>
323-
最後更新於 7月 22, 2025 (00:22 UTC)。
323+
最後更新於 7月 23, 2025 (00:22 UTC)。
324324

325325
<a href="/bugs.html">Found a bug</a>?
326326

pr-preview/pr-1123/bugs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ <h3>瀏覽</h3>
359359
<a href="https://www.python.org/psf/donations/">Please donate.</a>
360360
<br>
361361
<br>
362-
最後更新於 7月 22, 2025 (00:22 UTC)。
362+
最後更新於 7月 23, 2025 (00:22 UTC)。
363363

364364
<a href="/bugs.html">Found a bug</a>?
365365

pr-preview/pr-1123/c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ <h3>瀏覽</h3>
329329
<a href="https://www.python.org/psf/donations/">Please donate.</a>
330330
<br>
331331
<br>
332-
最後更新於 7月 22, 2025 (00:22 UTC)。
332+
最後更新於 7月 23, 2025 (00:22 UTC)。
333333

334334
<a href="/bugs.html">Found a bug</a>?
335335

pr-preview/pr-1123/c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ <h3>瀏覽</h3>
346346
<a href="https://www.python.org/psf/donations/">Please donate.</a>
347347
<br>
348348
<br>
349-
最後更新於 7月 22, 2025 (00:22 UTC)。
349+
最後更新於 7月 23, 2025 (00:22 UTC)。
350350

351351
<a href="/bugs.html">Found a bug</a>?
352352

pr-preview/pr-1123/c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h3>瀏覽</h3>
376376
<a href="https://www.python.org/psf/donations/">Please donate.</a>
377377
<br>
378378
<br>
379-
最後更新於 7月 22, 2025 (00:22 UTC)。
379+
最後更新於 7月 23, 2025 (00:22 UTC)。
380380

381381
<a href="/bugs.html">Found a bug</a>?
382382

pr-preview/pr-1123/c-api/arg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ <h3>瀏覽</h3>
931931
<a href="https://www.python.org/psf/donations/">Please donate.</a>
932932
<br>
933933
<br>
934-
最後更新於 7月 22, 2025 (00:22 UTC)。
934+
最後更新於 7月 23, 2025 (00:22 UTC)。
935935

936936
<a href="/bugs.html">Found a bug</a>?
937937

pr-preview/pr-1123/c-api/bool.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ <h3>瀏覽</h3>
340340
<a href="https://www.python.org/psf/donations/">Please donate.</a>
341341
<br>
342342
<br>
343-
最後更新於 7月 22, 2025 (00:22 UTC)。
343+
最後更新於 7月 23, 2025 (00:22 UTC)。
344344

345345
<a href="/bugs.html">Found a bug</a>?
346346

0 commit comments

Comments
 (0)