diff --git a/library/datetime.po b/library/datetime.po index 1bec6171ca..7497e0bffb 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-09 00:15+0000\n" +"POT-Creation-Date: 2025-05-11 00:17+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -423,56 +423,76 @@ msgstr "" ">>> (d.days, d.seconds, d.microseconds)\n" "(-1, 86399, 999999)" -#: ../../library/datetime.rst:265 ../../library/datetime.rst:566 -#: ../../library/datetime.rst:1126 ../../library/datetime.rst:1764 -#: ../../library/datetime.rst:2369 +#: ../../library/datetime.rst:264 +msgid "" +"Since the string representation of :class:`!timedelta` objects can be " +"confusing, use the following recipe to produce a more readable format:" +msgstr "" + +#: ../../library/datetime.rst:267 +msgid "" +">>> def pretty_timedelta(td):\n" +"... if td.days >= 0:\n" +"... return str(td)\n" +"... return f'-({-td!s})'\n" +"...\n" +">>> d = timedelta(hours=-1)\n" +">>> str(d) # not human-friendly\n" +"'-1 day, 23:00:00'\n" +">>> pretty_timedelta(d)\n" +"'-(1:00:00)'" +msgstr "" + +#: ../../library/datetime.rst:281 ../../library/datetime.rst:582 +#: ../../library/datetime.rst:1142 ../../library/datetime.rst:1780 +#: ../../library/datetime.rst:2385 msgid "Class attributes:" msgstr "類別屬性:" -#: ../../library/datetime.rst:269 +#: ../../library/datetime.rst:285 msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." msgstr "" -#: ../../library/datetime.rst:274 +#: ../../library/datetime.rst:290 msgid "" "The most positive :class:`timedelta` object, ``timedelta(days=999999999, " "hours=23, minutes=59, seconds=59, microseconds=999999)``." msgstr "" -#: ../../library/datetime.rst:280 +#: ../../library/datetime.rst:296 msgid "" "The smallest possible difference between non-equal :class:`timedelta` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:283 +#: ../../library/datetime.rst:299 msgid "" "Note that, because of normalization, ``timedelta.max`` is greater than ``-" "timedelta.min``. ``-timedelta.max`` is not representable as a :class:" "`timedelta` object." msgstr "" -#: ../../library/datetime.rst:287 ../../library/datetime.rst:584 -#: ../../library/datetime.rst:1146 ../../library/datetime.rst:1784 +#: ../../library/datetime.rst:303 ../../library/datetime.rst:600 +#: ../../library/datetime.rst:1162 ../../library/datetime.rst:1800 msgid "Instance attributes (read-only):" msgstr "" -#: ../../library/datetime.rst:291 +#: ../../library/datetime.rst:307 msgid "Between -999,999,999 and 999,999,999 inclusive." msgstr "在 -999,999,999 到 999,999,999 (含)之間" -#: ../../library/datetime.rst:296 +#: ../../library/datetime.rst:312 msgid "Between 0 and 86,399 inclusive." msgstr "在 0 到 86,399 (含)之間" -#: ../../library/datetime.rst:300 +#: ../../library/datetime.rst:316 msgid "" "It is a somewhat common bug for code to unintentionally use this attribute " "when it is actually intended to get a :meth:`~timedelta.total_seconds` value " "instead:" msgstr "" -#: ../../library/datetime.rst:304 +#: ../../library/datetime.rst:320 msgid "" ">>> from datetime import timedelta\n" ">>> duration = timedelta(seconds=11235813)\n" @@ -488,130 +508,130 @@ msgstr "" ">>> duration.total_seconds()\n" "11235813.0" -#: ../../library/datetime.rst:315 +#: ../../library/datetime.rst:331 msgid "Between 0 and 999,999 inclusive." msgstr "在 0 到 999,999 (含)之間" -#: ../../library/datetime.rst:318 ../../library/datetime.rst:601 -#: ../../library/datetime.rst:1199 +#: ../../library/datetime.rst:334 ../../library/datetime.rst:617 +#: ../../library/datetime.rst:1215 msgid "Supported operations:" msgstr "" -#: ../../library/datetime.rst:323 ../../library/datetime.rst:604 -#: ../../library/datetime.rst:1202 +#: ../../library/datetime.rst:339 ../../library/datetime.rst:620 +#: ../../library/datetime.rst:1218 msgid "Operation" msgstr "" -#: ../../library/datetime.rst:323 ../../library/datetime.rst:604 -#: ../../library/datetime.rst:1202 +#: ../../library/datetime.rst:339 ../../library/datetime.rst:620 +#: ../../library/datetime.rst:1218 msgid "Result" msgstr "" -#: ../../library/datetime.rst:325 +#: ../../library/datetime.rst:341 msgid "``t1 = t2 + t3``" msgstr "``t1 = t2 + t3``" -#: ../../library/datetime.rst:325 +#: ../../library/datetime.rst:341 msgid "" "Sum of ``t2`` and ``t3``. Afterwards ``t1 - t2 == t3`` and ``t1 - t3 == t2`` " "are true. (1)" msgstr "" -#: ../../library/datetime.rst:329 +#: ../../library/datetime.rst:345 msgid "``t1 = t2 - t3``" msgstr "``t1 = t2 - t3``" -#: ../../library/datetime.rst:329 +#: ../../library/datetime.rst:345 msgid "" "Difference of ``t2`` and ``t3``. Afterwards ``t1 == t2 - t3`` and ``t2 == " "t1 + t3`` are true. (1)(6)" msgstr "" -#: ../../library/datetime.rst:333 +#: ../../library/datetime.rst:349 msgid "``t1 = t2 * i or t1 = i * t2``" msgstr "``t1 = t2 * i or t1 = i * t2``" -#: ../../library/datetime.rst:333 +#: ../../library/datetime.rst:349 msgid "" "Delta multiplied by an integer. Afterwards ``t1 // i == t2`` is true, " "provided ``i != 0``." msgstr "" -#: ../../library/datetime.rst:337 +#: ../../library/datetime.rst:353 msgid "In general, ``t1 * i == t1 * (i-1) + t1`` is true. (1)" msgstr "" -#: ../../library/datetime.rst:340 +#: ../../library/datetime.rst:356 msgid "``t1 = t2 * f or t1 = f * t2``" msgstr "``t1 = t2 * f or t1 = f * t2``" -#: ../../library/datetime.rst:340 +#: ../../library/datetime.rst:356 msgid "" "Delta multiplied by a float. The result is rounded to the nearest multiple " "of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:344 +#: ../../library/datetime.rst:360 msgid "``f = t2 / t3``" msgstr "``f = t2 / t3``" -#: ../../library/datetime.rst:344 +#: ../../library/datetime.rst:360 msgid "" "Division (3) of overall duration ``t2`` by interval unit ``t3``. Returns a :" "class:`float` object." msgstr "" -#: ../../library/datetime.rst:348 +#: ../../library/datetime.rst:364 msgid "``t1 = t2 / f or t1 = t2 / i``" msgstr "``t1 = t2 / f or t1 = t2 / i``" -#: ../../library/datetime.rst:348 +#: ../../library/datetime.rst:364 msgid "" "Delta divided by a float or an int. The result is rounded to the nearest " "multiple of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:352 +#: ../../library/datetime.rst:368 msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" msgstr "``t1 = t2 // i`` or ``t1 = t2 // t3``" -#: ../../library/datetime.rst:352 +#: ../../library/datetime.rst:368 msgid "" "The floor is computed and the remainder (if any) is thrown away. In the " "second case, an integer is returned. (3)" msgstr "" -#: ../../library/datetime.rst:356 +#: ../../library/datetime.rst:372 msgid "``t1 = t2 % t3``" msgstr "``t1 = t2 % t3``" -#: ../../library/datetime.rst:356 +#: ../../library/datetime.rst:372 msgid "The remainder is computed as a :class:`timedelta` object. (3)" msgstr "" -#: ../../library/datetime.rst:359 +#: ../../library/datetime.rst:375 msgid "``q, r = divmod(t1, t2)``" msgstr "``q, r = divmod(t1, t2)``" -#: ../../library/datetime.rst:359 +#: ../../library/datetime.rst:375 msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " "t2``. ``q`` is an integer and ``r`` is a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:364 +#: ../../library/datetime.rst:380 msgid "``+t1``" msgstr "``+t1``" -#: ../../library/datetime.rst:364 +#: ../../library/datetime.rst:380 msgid "Returns a :class:`timedelta` object with the same value. (2)" msgstr "" -#: ../../library/datetime.rst:367 +#: ../../library/datetime.rst:383 msgid "``-t1``" msgstr "``-t1``" -#: ../../library/datetime.rst:367 +#: ../../library/datetime.rst:383 msgid "" "Equivalent to ``timedelta(-t1.days, -t1.seconds, -t1.microseconds)``, and to " "``t1 * -1``. (1)(4)" @@ -619,65 +639,65 @@ msgstr "" "等價於 ``timedelta(-t1.days, -t1.seconds, -t1.microseconds)``,也等價於 ``t1 " "* -1``。 (1)(4)" -#: ../../library/datetime.rst:371 +#: ../../library/datetime.rst:387 msgid "``abs(t)``" msgstr "``abs(t)``" -#: ../../library/datetime.rst:371 +#: ../../library/datetime.rst:387 msgid "" "Equivalent to ``+t`` when ``t.days >= 0``, and to ``-t`` when ``t.days < " "0``. (2)" msgstr "" -#: ../../library/datetime.rst:374 +#: ../../library/datetime.rst:390 msgid "``str(t)``" msgstr "``str(t)``" -#: ../../library/datetime.rst:374 +#: ../../library/datetime.rst:390 msgid "" "Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is " "negative for negative ``t``. (5)" msgstr "" -#: ../../library/datetime.rst:378 +#: ../../library/datetime.rst:394 msgid "``repr(t)``" msgstr "``repr(t)``" -#: ../../library/datetime.rst:378 +#: ../../library/datetime.rst:394 msgid "" "Returns a string representation of the :class:`timedelta` object as a " "constructor call with canonical attribute values." msgstr "" -#: ../../library/datetime.rst:384 ../../library/datetime.rst:623 -#: ../../library/datetime.rst:2600 +#: ../../library/datetime.rst:400 ../../library/datetime.rst:639 +#: ../../library/datetime.rst:2616 msgid "Notes:" msgstr "註解:" -#: ../../library/datetime.rst:387 +#: ../../library/datetime.rst:403 msgid "This is exact but may overflow." msgstr "這是精確的,但可能會溢位。" -#: ../../library/datetime.rst:390 +#: ../../library/datetime.rst:406 msgid "This is exact and cannot overflow." msgstr "這是精確的,且不會溢位。" -#: ../../library/datetime.rst:393 +#: ../../library/datetime.rst:409 msgid "Division by zero raises :exc:`ZeroDivisionError`." msgstr "" -#: ../../library/datetime.rst:396 +#: ../../library/datetime.rst:412 msgid "``-timedelta.max`` is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:399 +#: ../../library/datetime.rst:415 msgid "" "String representations of :class:`timedelta` objects are normalized " "similarly to their internal representation. This leads to somewhat unusual " "results for negative timedeltas. For example::" msgstr "" -#: ../../library/datetime.rst:403 +#: ../../library/datetime.rst:419 msgid "" ">>> timedelta(hours=-5)\n" "datetime.timedelta(days=-1, seconds=68400)\n" @@ -689,21 +709,21 @@ msgstr "" ">>> print(_)\n" "-1 day, 19:00:00" -#: ../../library/datetime.rst:409 +#: ../../library/datetime.rst:425 msgid "" "The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" "t3)`` except when t3 is equal to ``timedelta.max``; in that case the former " "will produce a result while the latter will overflow." msgstr "" -#: ../../library/datetime.rst:413 +#: ../../library/datetime.rst:429 msgid "" "In addition to the operations listed above, :class:`timedelta` objects " "support certain additions and subtractions with :class:`date` and :class:`." "datetime` objects (see below)." msgstr "" -#: ../../library/datetime.rst:417 +#: ../../library/datetime.rst:433 msgid "" "Floor division and true division of a :class:`timedelta` object by another :" "class:`timedelta` object are now supported, as are remainder operations and " @@ -711,43 +731,43 @@ msgid "" "`timedelta` object by a :class:`float` object are now supported." msgstr "" -#: ../../library/datetime.rst:423 +#: ../../library/datetime.rst:439 msgid ":class:`timedelta` objects support equality and order comparisons." msgstr "" -#: ../../library/datetime.rst:425 +#: ../../library/datetime.rst:441 msgid "" "In Boolean contexts, a :class:`timedelta` object is considered to be true if " "and only if it isn't equal to ``timedelta(0)``." msgstr "" -#: ../../library/datetime.rst:428 ../../library/datetime.rst:665 -#: ../../library/datetime.rst:1289 ../../library/datetime.rst:1891 +#: ../../library/datetime.rst:444 ../../library/datetime.rst:681 +#: ../../library/datetime.rst:1305 ../../library/datetime.rst:1907 msgid "Instance methods:" msgstr "實例方法:" -#: ../../library/datetime.rst:432 +#: ../../library/datetime.rst:448 msgid "" "Return the total number of seconds contained in the duration. Equivalent to " "``td / timedelta(seconds=1)``. For interval units other than seconds, use " "the division form directly (e.g. ``td / timedelta(microseconds=1)``)." msgstr "" -#: ../../library/datetime.rst:436 +#: ../../library/datetime.rst:452 msgid "" "Note that for very large time intervals (greater than 270 years on most " "platforms) this method will lose microsecond accuracy." msgstr "" -#: ../../library/datetime.rst:442 +#: ../../library/datetime.rst:458 msgid "Examples of usage: :class:`timedelta`" msgstr "用法範例::class:`timedelta`" -#: ../../library/datetime.rst:444 +#: ../../library/datetime.rst:460 msgid "An additional example of normalization::" msgstr "" -#: ../../library/datetime.rst:446 +#: ../../library/datetime.rst:462 msgid "" ">>> # Components of another_year add up to exactly 365 days\n" ">>> from datetime import timedelta\n" @@ -760,11 +780,11 @@ msgid "" "31536000.0" msgstr "" -#: ../../library/datetime.rst:456 +#: ../../library/datetime.rst:472 msgid "Examples of :class:`timedelta` arithmetic::" msgstr "" -#: ../../library/datetime.rst:458 +#: ../../library/datetime.rst:474 msgid "" ">>> from datetime import timedelta\n" ">>> year = timedelta(days=365)\n" @@ -794,65 +814,65 @@ msgstr "" ">>> three_years, three_years.days // 365\n" "(datetime.timedelta(days=1095), 3)" -#: ../../library/datetime.rst:475 +#: ../../library/datetime.rst:491 msgid ":class:`date` Objects" msgstr ":class:`date` 物件" -#: ../../library/datetime.rst:477 +#: ../../library/datetime.rst:493 msgid "" "A :class:`date` object represents a date (year, month and day) in an " "idealized calendar, the current Gregorian calendar indefinitely extended in " "both directions." msgstr "" -#: ../../library/datetime.rst:481 +#: ../../library/datetime.rst:497 msgid "" "January 1 of year 1 is called day number 1, January 2 of year 1 is called " "day number 2, and so on. [#]_" msgstr "" -#: ../../library/datetime.rst:486 +#: ../../library/datetime.rst:502 msgid "" "All arguments are required. Arguments must be integers, in the following " "ranges:" msgstr "" -#: ../../library/datetime.rst:489 +#: ../../library/datetime.rst:505 msgid "``MINYEAR <= year <= MAXYEAR``" msgstr "``MINYEAR <= year <= MAXYEAR``" -#: ../../library/datetime.rst:490 +#: ../../library/datetime.rst:506 msgid "``1 <= month <= 12``" msgstr "``1 <= month <= 12``" -#: ../../library/datetime.rst:491 +#: ../../library/datetime.rst:507 msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:493 ../../library/datetime.rst:883 +#: ../../library/datetime.rst:509 ../../library/datetime.rst:899 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:496 ../../library/datetime.rst:888 +#: ../../library/datetime.rst:512 ../../library/datetime.rst:904 msgid "Other constructors, all class methods:" msgstr "" -#: ../../library/datetime.rst:500 +#: ../../library/datetime.rst:516 msgid "Return the current local date." msgstr "回傳目前的本地日期。" -#: ../../library/datetime.rst:502 +#: ../../library/datetime.rst:518 msgid "This is equivalent to ``date.fromtimestamp(time.time())``." msgstr "這等同於 ``date.fromtimestamp(time.time())``。" -#: ../../library/datetime.rst:506 +#: ../../library/datetime.rst:522 msgid "" "Return the local date corresponding to the POSIX timestamp, such as is " "returned by :func:`time.time`." msgstr "" -#: ../../library/datetime.rst:509 +#: ../../library/datetime.rst:525 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`localtime` function, and :exc:" @@ -862,7 +882,7 @@ msgid "" "ignored by :meth:`fromtimestamp`." msgstr "" -#: ../../library/datetime.rst:516 +#: ../../library/datetime.rst:532 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -870,45 +890,45 @@ msgid "" "`localtime` failure." msgstr "" -#: ../../library/datetime.rst:525 +#: ../../library/datetime.rst:541 msgid "" "Return the date corresponding to the proleptic Gregorian ordinal, where " "January 1 of year 1 has ordinal 1." msgstr "" -#: ../../library/datetime.rst:528 +#: ../../library/datetime.rst:544 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " "For any date ``d``, ``date.fromordinal(d.toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:535 +#: ../../library/datetime.rst:551 msgid "" "Return a :class:`date` corresponding to a *date_string* given in any valid " "ISO 8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:538 ../../library/datetime.rst:1048 +#: ../../library/datetime.rst:554 ../../library/datetime.rst:1064 msgid "" "Reduced precision dates are not currently supported (``YYYY-MM``, ``YYYY``)." msgstr "" -#: ../../library/datetime.rst:540 ../../library/datetime.rst:1050 +#: ../../library/datetime.rst:556 ../../library/datetime.rst:1066 msgid "" "Extended date representations are not currently supported (``±YYYYYY-MM-" "DD``)." msgstr "" -#: ../../library/datetime.rst:542 ../../library/datetime.rst:1052 +#: ../../library/datetime.rst:558 ../../library/datetime.rst:1068 msgid "Ordinal dates are not currently supported (``YYYY-OOO``)." msgstr "" -#: ../../library/datetime.rst:544 ../../library/datetime.rst:1054 -#: ../../library/datetime.rst:1520 +#: ../../library/datetime.rst:560 ../../library/datetime.rst:1070 +#: ../../library/datetime.rst:1536 msgid "Examples::" msgstr "範例: ::" -#: ../../library/datetime.rst:546 +#: ../../library/datetime.rst:562 msgid "" ">>> from datetime import date\n" ">>> date.fromisoformat('2019-12-04')\n" @@ -926,64 +946,64 @@ msgstr "" ">>> date.fromisoformat('2021-W01-1')\n" "datetime.date(2021, 1, 4)" -#: ../../library/datetime.rst:555 +#: ../../library/datetime.rst:571 msgid "Previously, this method only supported the format ``YYYY-MM-DD``." msgstr "" -#: ../../library/datetime.rst:560 +#: ../../library/datetime.rst:576 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " "year, week and day. This is the inverse of the function :meth:`date." "isocalendar`." msgstr "" -#: ../../library/datetime.rst:570 +#: ../../library/datetime.rst:586 msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." msgstr "" -#: ../../library/datetime.rst:575 +#: ../../library/datetime.rst:591 msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." msgstr "" -#: ../../library/datetime.rst:580 +#: ../../library/datetime.rst:596 msgid "" "The smallest possible difference between non-equal date objects, " "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:588 ../../library/datetime.rst:1150 +#: ../../library/datetime.rst:604 ../../library/datetime.rst:1166 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:593 ../../library/datetime.rst:1155 +#: ../../library/datetime.rst:609 ../../library/datetime.rst:1171 msgid "Between 1 and 12 inclusive." msgstr "在 1 到 12 (含)之間。" -#: ../../library/datetime.rst:598 ../../library/datetime.rst:1160 +#: ../../library/datetime.rst:614 ../../library/datetime.rst:1176 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" -#: ../../library/datetime.rst:606 +#: ../../library/datetime.rst:622 msgid "``date2 = date1 + timedelta``" msgstr "``date2 = date1 + timedelta``" -#: ../../library/datetime.rst:606 +#: ../../library/datetime.rst:622 msgid "``date2`` will be ``timedelta.days`` days after ``date1``. (1)" msgstr "" -#: ../../library/datetime.rst:609 +#: ../../library/datetime.rst:625 msgid "``date2 = date1 - timedelta``" msgstr "``date2 = date1 - timedelta``" -#: ../../library/datetime.rst:609 +#: ../../library/datetime.rst:625 msgid "Computes ``date2`` such that ``date2 + timedelta == date1``. (2)" msgstr "" -#: ../../library/datetime.rst:612 +#: ../../library/datetime.rst:628 msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:612 ../../library/datetime.rst:1208 +#: ../../library/datetime.rst:628 ../../library/datetime.rst:1224 msgid "\\(3)" msgstr "\\(3)" @@ -995,7 +1015,7 @@ msgstr "``date1 == date2``" msgid "``date1 != date2``" msgstr "``date1 != date2``" -#: ../../library/datetime.rst:614 ../../library/datetime.rst:1210 +#: ../../library/datetime.rst:630 ../../library/datetime.rst:1226 msgid "Equality comparison. (4)" msgstr "" @@ -1015,11 +1035,11 @@ msgstr "``date1 <= date2``" msgid "``date1 >= date2``" msgstr "``date1 >= date2``" -#: ../../library/datetime.rst:617 ../../library/datetime.rst:1213 +#: ../../library/datetime.rst:633 ../../library/datetime.rst:1229 msgid "Order comparison. (5)" msgstr "" -#: ../../library/datetime.rst:626 +#: ../../library/datetime.rst:642 msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " @@ -1028,41 +1048,41 @@ msgid "" "`MINYEAR` or larger than :const:`MAXYEAR`." msgstr "" -#: ../../library/datetime.rst:633 +#: ../../library/datetime.rst:649 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." msgstr "``timedelta.seconds`` 和 ``timedelta.microseconds`` 被忽略。" -#: ../../library/datetime.rst:636 +#: ../../library/datetime.rst:652 msgid "" "This is exact, and cannot overflow. ``timedelta.seconds`` and ``timedelta." "microseconds`` are 0, and ``date2 + timedelta == date1`` after." msgstr "" -#: ../../library/datetime.rst:640 +#: ../../library/datetime.rst:656 msgid ":class:`date` objects are equal if they represent the same date." msgstr "" -#: ../../library/datetime.rst:642 +#: ../../library/datetime.rst:658 msgid "" ":class:`!date` objects that are not also :class:`.datetime` instances are " "never equal to :class:`!datetime` objects, even if they represent the same " "date." msgstr "" -#: ../../library/datetime.rst:647 +#: ../../library/datetime.rst:663 msgid "" "*date1* is considered less than *date2* when *date1* precedes *date2* in " "time. In other words, ``date1 < date2`` if and only if ``date1.toordinal() < " "date2.toordinal()``." msgstr "" -#: ../../library/datetime.rst:651 +#: ../../library/datetime.rst:667 msgid "" "Order comparison between a :class:`!date` object that is not also a :class:`." "datetime` instance and a :class:`!datetime` object raises :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:655 ../../library/datetime.rst:1281 +#: ../../library/datetime.rst:671 ../../library/datetime.rst:1297 msgid "" "Comparison between :class:`.datetime` object and an instance of the :class:" "`date` subclass that is not a :class:`!datetime` subclass no longer converts " @@ -1071,22 +1091,22 @@ msgid "" "in subclasses." msgstr "" -#: ../../library/datetime.rst:663 +#: ../../library/datetime.rst:679 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" -#: ../../library/datetime.rst:669 +#: ../../library/datetime.rst:685 msgid "" "Return a new :class:`date` object with the same values, but with specified " "parameters updated." msgstr "" -#: ../../library/datetime.rst:672 ../../library/datetime.rst:1937 +#: ../../library/datetime.rst:688 ../../library/datetime.rst:1953 msgid "Example::" msgstr "範例: ::" -#: ../../library/datetime.rst:674 +#: ../../library/datetime.rst:690 msgid "" ">>> from datetime import date\n" ">>> d = date(2002, 12, 31)\n" @@ -1098,47 +1118,47 @@ msgstr "" ">>> d.replace(day=26)\n" "datetime.date(2002, 12, 26)" -#: ../../library/datetime.rst:679 +#: ../../library/datetime.rst:695 msgid "" "The generic function :func:`copy.replace` also supports :class:`date` " "objects." msgstr "" -#: ../../library/datetime.rst:685 ../../library/datetime.rst:1405 +#: ../../library/datetime.rst:701 ../../library/datetime.rst:1421 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." msgstr "" "回傳一個 :class:`time.struct_time`,如同 :func:`time.localtime` 所回傳。" -#: ../../library/datetime.rst:687 +#: ../../library/datetime.rst:703 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:689 ../../library/datetime.rst:1407 +#: ../../library/datetime.rst:705 ../../library/datetime.rst:1423 msgid "``d.timetuple()`` is equivalent to::" msgstr "``d.timetuple()`` 等價於: ::" -#: ../../library/datetime.rst:691 +#: ../../library/datetime.rst:707 msgid "" "time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" msgstr "" "time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" -#: ../../library/datetime.rst:693 +#: ../../library/datetime.rst:709 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with 1 for January 1st." msgstr "" -#: ../../library/datetime.rst:699 +#: ../../library/datetime.rst:715 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " "1 has ordinal 1. For any :class:`date` object ``d``, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:706 +#: ../../library/datetime.rst:722 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" @@ -1147,25 +1167,25 @@ msgstr "" "回傳一個代表星期幾的整數,星期一為 0、星期日為 6。例如 ``date(2002, 12, 4)." "weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" -#: ../../library/datetime.rst:713 +#: ../../library/datetime.rst:729 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" "meth:`weekday`, :meth:`isocalendar`." msgstr "" -#: ../../library/datetime.rst:720 +#: ../../library/datetime.rst:736 msgid "" "Return a :term:`named tuple` object with three components: ``year``, " "``week`` and ``weekday``." msgstr "" -#: ../../library/datetime.rst:723 +#: ../../library/datetime.rst:739 msgid "" "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" msgstr "" -#: ../../library/datetime.rst:725 +#: ../../library/datetime.rst:741 msgid "" "The ISO year consists of 52 or 53 full weeks, and where a week starts on a " "Monday and ends on a Sunday. The first week of an ISO year is the first " @@ -1174,13 +1194,13 @@ msgid "" "Gregorian year." msgstr "" -#: ../../library/datetime.rst:730 +#: ../../library/datetime.rst:746 msgid "" "For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " "begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" msgstr "" -#: ../../library/datetime.rst:733 +#: ../../library/datetime.rst:749 msgid "" ">>> from datetime import date\n" ">>> date(2003, 12, 29).isocalendar()\n" @@ -1194,16 +1214,16 @@ msgstr "" ">>> date(2004, 1, 4).isocalendar()\n" "datetime.IsoCalendarDate(year=2004, week=1, weekday=7)" -#: ../../library/datetime.rst:739 +#: ../../library/datetime.rst:755 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "" -#: ../../library/datetime.rst:744 +#: ../../library/datetime.rst:760 msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "回傳一以 ISO 8601 格式 ``YYYY-MM-DD`` 表示的日期字串: ::" -#: ../../library/datetime.rst:746 +#: ../../library/datetime.rst:762 msgid "" ">>> from datetime import date\n" ">>> date(2002, 12, 4).isoformat()\n" @@ -1213,15 +1233,15 @@ msgstr "" ">>> date(2002, 12, 4).isoformat()\n" "'2002-12-04'" -#: ../../library/datetime.rst:752 +#: ../../library/datetime.rst:768 msgid "For a date ``d``, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" -#: ../../library/datetime.rst:757 +#: ../../library/datetime.rst:773 msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:759 +#: ../../library/datetime.rst:775 msgid "" ">>> from datetime import date\n" ">>> date(2002, 12, 4).ctime()\n" @@ -1231,22 +1251,22 @@ msgstr "" ">>> date(2002, 12, 4).ctime()\n" "'Wed Dec 4 00:00:00 2002'" -#: ../../library/datetime.rst:763 ../../library/datetime.rst:1591 +#: ../../library/datetime.rst:779 ../../library/datetime.rst:1607 msgid "``d.ctime()`` is equivalent to::" msgstr "``d.ctime()`` 等價於: ::" -#: ../../library/datetime.rst:765 ../../library/datetime.rst:1593 +#: ../../library/datetime.rst:781 ../../library/datetime.rst:1609 msgid "time.ctime(time.mktime(d.timetuple()))" msgstr "time.ctime(time.mktime(d.timetuple()))" -#: ../../library/datetime.rst:767 +#: ../../library/datetime.rst:783 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " "the C standard." msgstr "" -#: ../../library/datetime.rst:774 +#: ../../library/datetime.rst:790 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " @@ -1254,7 +1274,7 @@ msgid "" "isoformat`." msgstr "" -#: ../../library/datetime.rst:781 +#: ../../library/datetime.rst:797 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals >> import time\n" ">>> from datetime import date\n" @@ -1306,11 +1326,11 @@ msgstr "" ">>> time_to_birthday.days\n" "202" -#: ../../library/datetime.rst:808 +#: ../../library/datetime.rst:824 msgid "More examples of working with :class:`date`:" msgstr "更多 :class:`date` 的用法範例:" -#: ../../library/datetime.rst:810 +#: ../../library/datetime.rst:826 msgid "" ">>> from datetime import date\n" ">>> d = date.fromordinal(730920) # 730920th day after 1. 1. 0001\n" @@ -1354,17 +1374,17 @@ msgid "" "datetime.date(2005, 3, 11)" msgstr "" -#: ../../library/datetime.rst:857 +#: ../../library/datetime.rst:873 msgid ":class:`.datetime` Objects" msgstr ":class:`.datetime` 物件" -#: ../../library/datetime.rst:859 +#: ../../library/datetime.rst:875 msgid "" "A :class:`.datetime` object is a single object containing all the " "information from a :class:`date` object and a :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:862 +#: ../../library/datetime.rst:878 msgid "" "Like a :class:`date` object, :class:`.datetime` assumes the current " "Gregorian calendar extended in both directions; like a :class:`.time` " @@ -1372,81 +1392,81 @@ msgid "" "every day." msgstr "" -#: ../../library/datetime.rst:866 +#: ../../library/datetime.rst:882 msgid "Constructor:" msgstr "" -#: ../../library/datetime.rst:870 +#: ../../library/datetime.rst:886 msgid "" "The *year*, *month* and *day* arguments are required. *tzinfo* may be " "``None``, or an instance of a :class:`tzinfo` subclass. The remaining " "arguments must be integers in the following ranges:" msgstr "" -#: ../../library/datetime.rst:874 +#: ../../library/datetime.rst:890 msgid "``MINYEAR <= year <= MAXYEAR``," msgstr "``MINYEAR <= year <= MAXYEAR``," -#: ../../library/datetime.rst:875 +#: ../../library/datetime.rst:891 msgid "``1 <= month <= 12``," msgstr "``1 <= month <= 12``," -#: ../../library/datetime.rst:876 +#: ../../library/datetime.rst:892 msgid "``1 <= day <= number of days in the given month and year``," msgstr "" -#: ../../library/datetime.rst:877 ../../library/datetime.rst:1755 +#: ../../library/datetime.rst:893 ../../library/datetime.rst:1771 msgid "``0 <= hour < 24``," msgstr "``0 <= hour < 24``," -#: ../../library/datetime.rst:878 ../../library/datetime.rst:1756 +#: ../../library/datetime.rst:894 ../../library/datetime.rst:1772 msgid "``0 <= minute < 60``," msgstr "``0 <= minute < 60``," -#: ../../library/datetime.rst:879 ../../library/datetime.rst:1757 +#: ../../library/datetime.rst:895 ../../library/datetime.rst:1773 msgid "``0 <= second < 60``," msgstr "``0 <= second < 60``," -#: ../../library/datetime.rst:880 ../../library/datetime.rst:1758 +#: ../../library/datetime.rst:896 ../../library/datetime.rst:1774 msgid "``0 <= microsecond < 1000000``," msgstr "``0 <= microsecond < 1000000``," -#: ../../library/datetime.rst:881 ../../library/datetime.rst:1759 +#: ../../library/datetime.rst:897 ../../library/datetime.rst:1775 msgid "``fold in [0, 1]``." msgstr "" -#: ../../library/datetime.rst:885 ../../library/datetime.rst:1326 -#: ../../library/datetime.rst:1904 +#: ../../library/datetime.rst:901 ../../library/datetime.rst:1342 +#: ../../library/datetime.rst:1920 msgid "Added the *fold* parameter." msgstr "新增 *fold* 參數。" -#: ../../library/datetime.rst:892 +#: ../../library/datetime.rst:908 msgid "Return the current local date and time, with :attr:`.tzinfo` ``None``." msgstr "回傳目前的本地日期與時間,且 :attr:`.tzinfo` 為 ``None``。" -#: ../../library/datetime.rst:894 +#: ../../library/datetime.rst:910 msgid "Equivalent to::" msgstr "等價於: ::" -#: ../../library/datetime.rst:896 +#: ../../library/datetime.rst:912 msgid "datetime.fromtimestamp(time.time())" msgstr "datetime.fromtimestamp(time.time())" -#: ../../library/datetime.rst:898 +#: ../../library/datetime.rst:914 msgid "See also :meth:`now`, :meth:`fromtimestamp`." msgstr "也請見 :meth:`now`、:meth:`fromtimestamp`。" -#: ../../library/datetime.rst:900 +#: ../../library/datetime.rst:916 msgid "" "This method is functionally equivalent to :meth:`now`, but without a ``tz`` " "parameter." msgstr "" -#: ../../library/datetime.rst:905 +#: ../../library/datetime.rst:921 msgid "Return the current local date and time." msgstr "" -#: ../../library/datetime.rst:907 +#: ../../library/datetime.rst:923 msgid "" "If optional argument *tz* is ``None`` or not specified, this is like :meth:" "`today`, but, if possible, supplies more precision than can be gotten from " @@ -1457,34 +1477,34 @@ msgstr "" "供比透過 :func:`time.time` 取得的時間戳記更多位數的資訊(例如,這在有提供 C :" "c:func:`gettimeofday` 函式的平台上可能可行)。" -#: ../../library/datetime.rst:913 +#: ../../library/datetime.rst:929 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the current date and time are converted to *tz*’s time zone." msgstr "" -#: ../../library/datetime.rst:916 +#: ../../library/datetime.rst:932 msgid "This function is preferred over :meth:`today` and :meth:`utcnow`." msgstr "" -#: ../../library/datetime.rst:920 +#: ../../library/datetime.rst:936 msgid "" "Subsequent calls to :meth:`!datetime.now` may return the same instant " "depending on the precision of the underlying clock." msgstr "" -#: ../../library/datetime.rst:925 +#: ../../library/datetime.rst:941 msgid "Return the current UTC date and time, with :attr:`.tzinfo` ``None``." msgstr "" -#: ../../library/datetime.rst:927 +#: ../../library/datetime.rst:943 msgid "" "This is like :meth:`now`, but returns the current UTC date and time, as a " "naive :class:`.datetime` object. An aware current UTC datetime can be " "obtained by calling ``datetime.now(timezone.utc)``. See also :meth:`now`." msgstr "" -#: ../../library/datetime.rst:933 +#: ../../library/datetime.rst:949 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1492,11 +1512,11 @@ msgid "" "current time in UTC is by calling ``datetime.now(timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:940 +#: ../../library/datetime.rst:956 msgid "Use :meth:`datetime.now` with :const:`UTC` instead." msgstr "" -#: ../../library/datetime.rst:945 +#: ../../library/datetime.rst:961 msgid "" "Return the local date and time corresponding to the POSIX timestamp, such as " "is returned by :func:`time.time`. If optional argument *tz* is ``None`` or " @@ -1504,13 +1524,13 @@ msgid "" "time, and the returned :class:`.datetime` object is naive." msgstr "" -#: ../../library/datetime.rst:950 +#: ../../library/datetime.rst:966 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the timestamp is converted to *tz*’s time zone." msgstr "" -#: ../../library/datetime.rst:953 +#: ../../library/datetime.rst:969 msgid "" ":meth:`fromtimestamp` may raise :exc:`OverflowError`, if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1523,7 +1543,7 @@ msgid "" "preferred over :meth:`utcfromtimestamp`." msgstr "" -#: ../../library/datetime.rst:964 +#: ../../library/datetime.rst:980 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1531,17 +1551,17 @@ msgid "" "`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:971 +#: ../../library/datetime.rst:987 msgid ":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." msgstr "" -#: ../../library/datetime.rst:976 +#: ../../library/datetime.rst:992 msgid "" "Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, " "with :attr:`.tzinfo` ``None``. (The resulting object is naive.)" msgstr "" -#: ../../library/datetime.rst:979 +#: ../../library/datetime.rst:995 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`gmtime` function, and :exc:" @@ -1549,33 +1569,33 @@ msgid "" "to years in 1970 through 2038." msgstr "" -#: ../../library/datetime.rst:984 +#: ../../library/datetime.rst:1000 msgid "To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`::" msgstr "" -#: ../../library/datetime.rst:986 +#: ../../library/datetime.rst:1002 msgid "datetime.fromtimestamp(timestamp, timezone.utc)" msgstr "datetime.fromtimestamp(timestamp, timezone.utc)" -#: ../../library/datetime.rst:988 +#: ../../library/datetime.rst:1004 msgid "" "On the POSIX compliant platforms, it is equivalent to the following " "expression::" msgstr "" -#: ../../library/datetime.rst:991 +#: ../../library/datetime.rst:1007 msgid "" "datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" msgstr "" "datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" -#: ../../library/datetime.rst:993 +#: ../../library/datetime.rst:1009 msgid "" "except the latter formula always supports the full years range: between :" "const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:998 +#: ../../library/datetime.rst:1014 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1584,7 +1604,7 @@ msgid "" "tz=timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:1004 +#: ../../library/datetime.rst:1020 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`gmtime` " @@ -1592,11 +1612,11 @@ msgid "" "`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:1012 +#: ../../library/datetime.rst:1028 msgid "Use :meth:`datetime.fromtimestamp` with :const:`UTC` instead." msgstr "" -#: ../../library/datetime.rst:1017 +#: ../../library/datetime.rst:1033 msgid "" "Return the :class:`.datetime` corresponding to the proleptic Gregorian " "ordinal, where January 1 of year 1 has ordinal 1. :exc:`ValueError` is " @@ -1605,7 +1625,7 @@ msgid "" "is ``None``." msgstr "" -#: ../../library/datetime.rst:1025 +#: ../../library/datetime.rst:1041 msgid "" "Return a new :class:`.datetime` object whose date components are equal to " "the given :class:`date` object's, and whose time components are equal to the " @@ -1616,35 +1636,35 @@ msgid "" "attr:`.tzinfo` attributes are ignored." msgstr "" -#: ../../library/datetime.rst:1033 +#: ../../library/datetime.rst:1049 msgid "" "For any :class:`.datetime` object ``d``, ``d == datetime.combine(d.date(), d." "time(), d.tzinfo)``." msgstr "" -#: ../../library/datetime.rst:1036 +#: ../../library/datetime.rst:1052 msgid "Added the *tzinfo* argument." msgstr "新增 *tzinfo* 引數。" -#: ../../library/datetime.rst:1042 +#: ../../library/datetime.rst:1058 msgid "" "Return a :class:`.datetime` corresponding to a *date_string* in any valid " "ISO 8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1045 ../../library/datetime.rst:1855 +#: ../../library/datetime.rst:1061 ../../library/datetime.rst:1871 msgid "Time zone offsets may have fractional seconds." msgstr "" -#: ../../library/datetime.rst:1046 +#: ../../library/datetime.rst:1062 msgid "The ``T`` separator may be replaced by any single unicode character." msgstr "" -#: ../../library/datetime.rst:1047 ../../library/datetime.rst:1860 +#: ../../library/datetime.rst:1063 ../../library/datetime.rst:1876 msgid "Fractional hours and minutes are not supported." msgstr "" -#: ../../library/datetime.rst:1056 +#: ../../library/datetime.rst:1072 msgid "" ">>> from datetime import datetime\n" ">>> datetime.fromisoformat('2011-11-04')\n" @@ -1690,13 +1710,13 @@ msgstr "" "datetime.datetime(2011, 11, 4, 0, 5, 23,\n" " tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" -#: ../../library/datetime.rst:1078 +#: ../../library/datetime.rst:1094 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`date.isoformat` or :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1085 +#: ../../library/datetime.rst:1101 msgid "" "Return a :class:`.datetime` corresponding to the ISO calendar date specified " "by year, week and day. The non-date components of the datetime are populated " @@ -1704,23 +1724,23 @@ msgid "" "`datetime.isocalendar`." msgstr "" -#: ../../library/datetime.rst:1094 +#: ../../library/datetime.rst:1110 msgid "" "Return a :class:`.datetime` corresponding to *date_string*, parsed according " "to *format*." msgstr "" -#: ../../library/datetime.rst:1097 +#: ../../library/datetime.rst:1113 msgid "" "If *format* does not contain microseconds or time zone information, this is " "equivalent to::" msgstr "" -#: ../../library/datetime.rst:1099 ../../library/datetime.rst:2580 +#: ../../library/datetime.rst:1115 ../../library/datetime.rst:2596 msgid "datetime(*(time.strptime(date_string, format)[0:6]))" msgstr "datetime(*(time.strptime(date_string, format)[0:6]))" -#: ../../library/datetime.rst:1101 +#: ../../library/datetime.rst:1117 msgid "" ":exc:`ValueError` is raised if the date_string and format can't be parsed " "by :func:`time.strptime` or if it returns a value which isn't a time tuple. " @@ -1728,7 +1748,7 @@ msgid "" "fromisoformat`." msgstr "" -#: ../../library/datetime.rst:1108 +#: ../../library/datetime.rst:1124 msgid "" "If *format* specifies a day of month without a year a :exc:" "`DeprecationWarning` is now emitted. This is to avoid a quadrennial leap " @@ -1739,7 +1759,7 @@ msgid "" "not have a year, explicitly add a year that is a leap year before parsing:" msgstr "" -#: ../../library/datetime.rst:1117 +#: ../../library/datetime.rst:1133 msgid "" ">>> from datetime import datetime\n" ">>> date_string = \"02/29\"\n" @@ -1749,44 +1769,44 @@ msgid "" "'February 29'" msgstr "" -#: ../../library/datetime.rst:1130 +#: ../../library/datetime.rst:1146 msgid "" "The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " "tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1136 +#: ../../library/datetime.rst:1152 msgid "" "The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " "59, 59, 999999, tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1142 +#: ../../library/datetime.rst:1158 msgid "" "The smallest possible difference between non-equal :class:`.datetime` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:1165 ../../library/datetime.rst:1788 +#: ../../library/datetime.rst:1181 ../../library/datetime.rst:1804 msgid "In ``range(24)``." msgstr "" -#: ../../library/datetime.rst:1170 ../../library/datetime.rst:1175 -#: ../../library/datetime.rst:1793 ../../library/datetime.rst:1798 +#: ../../library/datetime.rst:1186 ../../library/datetime.rst:1191 +#: ../../library/datetime.rst:1809 ../../library/datetime.rst:1814 msgid "In ``range(60)``." msgstr "" -#: ../../library/datetime.rst:1180 ../../library/datetime.rst:1803 +#: ../../library/datetime.rst:1196 ../../library/datetime.rst:1819 msgid "In ``range(1000000)``." msgstr "" -#: ../../library/datetime.rst:1185 +#: ../../library/datetime.rst:1201 msgid "" "The object passed as the *tzinfo* argument to the :class:`.datetime` " "constructor, or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1191 ../../library/datetime.rst:1814 +#: ../../library/datetime.rst:1207 ../../library/datetime.rst:1830 msgid "" "In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. " "(A repeated interval occurs when clocks are rolled back at the end of " @@ -1796,26 +1816,26 @@ msgid "" "time representation." msgstr "" -#: ../../library/datetime.rst:1204 +#: ../../library/datetime.rst:1220 msgid "``datetime2 = datetime1 + timedelta``" msgstr "``datetime2 = datetime1 + timedelta``" -#: ../../library/datetime.rst:1204 ../../library/datetime.rst:2427 -#: ../../library/datetime.rst:2432 ../../library/datetime.rst:2444 -#: ../../library/datetime.rst:2449 ../../library/datetime.rst:2509 -#: ../../library/datetime.rst:2514 ../../library/datetime.rst:2518 +#: ../../library/datetime.rst:1220 ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2448 ../../library/datetime.rst:2460 +#: ../../library/datetime.rst:2465 ../../library/datetime.rst:2525 +#: ../../library/datetime.rst:2530 ../../library/datetime.rst:2534 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/datetime.rst:1206 +#: ../../library/datetime.rst:1222 msgid "``datetime2 = datetime1 - timedelta``" msgstr "``datetime2 = datetime1 - timedelta``" -#: ../../library/datetime.rst:1206 ../../library/datetime.rst:2460 +#: ../../library/datetime.rst:1222 ../../library/datetime.rst:2476 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/datetime.rst:1208 +#: ../../library/datetime.rst:1224 msgid "``timedelta = datetime1 - datetime2``" msgstr "``timedelta = datetime1 - datetime2``" @@ -1843,7 +1863,7 @@ msgstr "``datetime1 <= datetime2``" msgid "``datetime1 >= datetime2``" msgstr "``datetime1 >= datetime2``" -#: ../../library/datetime.rst:1220 +#: ../../library/datetime.rst:1236 msgid "" "``datetime2`` is a duration of ``timedelta`` removed from ``datetime1``, " "moving forward in time if ``timedelta.days > 0``, or backward if ``timedelta." @@ -1854,7 +1874,7 @@ msgid "" "adjustments are done even if the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1229 +#: ../../library/datetime.rst:1245 msgid "" "Computes the ``datetime2`` such that ``datetime2 + timedelta == datetime1``. " "As for addition, the result has the same :attr:`~.datetime.tzinfo` attribute " @@ -1862,14 +1882,14 @@ msgid "" "input is aware." msgstr "" -#: ../../library/datetime.rst:1234 +#: ../../library/datetime.rst:1250 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: ../../library/datetime.rst:1238 +#: ../../library/datetime.rst:1254 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " @@ -1877,7 +1897,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1243 +#: ../../library/datetime.rst:1259 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if ``a`` and ``b`` were first converted to naive UTC " @@ -1886,17 +1906,17 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1249 +#: ../../library/datetime.rst:1265 msgid "" ":class:`.datetime` objects are equal if they represent the same date and " "time, taking into account the time zone." msgstr "" -#: ../../library/datetime.rst:1252 +#: ../../library/datetime.rst:1268 msgid "Naive and aware :class:`!datetime` objects are never equal." msgstr "" -#: ../../library/datetime.rst:1254 +#: ../../library/datetime.rst:1270 msgid "" "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " "the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " @@ -1907,19 +1927,19 @@ msgid "" "interval are never equal to :class:`!datetime` instances in other time zone." msgstr "" -#: ../../library/datetime.rst:1264 +#: ../../library/datetime.rst:1280 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time, taking into account the time zone." msgstr "" -#: ../../library/datetime.rst:1267 +#: ../../library/datetime.rst:1283 msgid "" "Order comparison between naive and aware :class:`.datetime` objects raises :" "exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1270 +#: ../../library/datetime.rst:1286 msgid "" "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " "the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " @@ -1929,33 +1949,33 @@ msgid "" "implementation never overflows." msgstr "" -#: ../../library/datetime.rst:1277 +#: ../../library/datetime.rst:1293 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1293 +#: ../../library/datetime.rst:1309 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1298 +#: ../../library/datetime.rst:1314 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: ../../library/datetime.rst:1301 ../../library/datetime.rst:1310 +#: ../../library/datetime.rst:1317 ../../library/datetime.rst:1326 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1307 +#: ../../library/datetime.rst:1323 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1318 +#: ../../library/datetime.rst:1334 msgid "" "Return a new :class:`datetime` object with the same attributes, but with " "specified parameters updated. Note that ``tzinfo=None`` can be specified to " @@ -1963,27 +1983,27 @@ msgid "" "and time data." msgstr "" -#: ../../library/datetime.rst:1323 +#: ../../library/datetime.rst:1339 msgid "" ":class:`.datetime` objects are also supported by generic function :func:" "`copy.replace`." msgstr "" -#: ../../library/datetime.rst:1332 +#: ../../library/datetime.rst:1348 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: ../../library/datetime.rst:1336 +#: ../../library/datetime.rst:1352 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system time zone." msgstr "" -#: ../../library/datetime.rst:1340 +#: ../../library/datetime.rst:1356 msgid "" "If called without arguments (or with ``tz=None``) the system local time zone " "is assumed for the target time zone. The ``.tzinfo`` attribute of the " @@ -1991,7 +2011,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1345 +#: ../../library/datetime.rst:1361 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -2000,7 +2020,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1351 +#: ../../library/datetime.rst:1367 msgid "" "If you merely want to attach a :class:`timezone` object *tz* to a datetime " "*dt* without adjustment of date and time data, use ``dt." @@ -2009,14 +2029,14 @@ msgid "" "use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1356 +#: ../../library/datetime.rst:1372 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " "Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" -#: ../../library/datetime.rst:1360 +#: ../../library/datetime.rst:1376 msgid "" "def astimezone(self, tz):\n" " if self.tzinfo is tz:\n" @@ -2027,49 +2047,49 @@ msgid "" " return tz.fromutc(utc)" msgstr "" -#: ../../library/datetime.rst:1368 +#: ../../library/datetime.rst:1384 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1371 +#: ../../library/datetime.rst:1387 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1378 +#: ../../library/datetime.rst:1394 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1382 ../../library/datetime.rst:1977 -#: ../../library/datetime.rst:2084 ../../library/datetime.rst:2329 -#: ../../library/datetime.rst:2341 ../../library/datetime.rst:2653 +#: ../../library/datetime.rst:1398 ../../library/datetime.rst:1993 +#: ../../library/datetime.rst:2100 ../../library/datetime.rst:2345 +#: ../../library/datetime.rst:2357 ../../library/datetime.rst:2669 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1388 +#: ../../library/datetime.rst:1404 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1392 ../../library/datetime.rst:1987 -#: ../../library/datetime.rst:2138 +#: ../../library/datetime.rst:1408 ../../library/datetime.rst:2003 +#: ../../library/datetime.rst:2154 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1398 +#: ../../library/datetime.rst:1414 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " "a string object," msgstr "" -#: ../../library/datetime.rst:1409 +#: ../../library/datetime.rst:1425 msgid "" "time.struct_time((d.year, d.month, d.day,\n" " d.hour, d.minute, d.second,\n" @@ -2079,7 +2099,7 @@ msgstr "" " d.hour, d.minute, d.second,\n" " d.weekday(), yday, dst))" -#: ../../library/datetime.rst:1413 +#: ../../library/datetime.rst:1429 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with 1 for January 1st. The :" @@ -2090,7 +2110,7 @@ msgid "" "to 0." msgstr "" -#: ../../library/datetime.rst:1424 +#: ../../library/datetime.rst:1440 msgid "" "If :class:`.datetime` instance ``d`` is naive, this is the same as ``d." "timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 " @@ -2098,7 +2118,7 @@ msgid "" "time." msgstr "" -#: ../../library/datetime.rst:1428 +#: ../../library/datetime.rst:1444 msgid "" "If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " @@ -2107,7 +2127,7 @@ msgid "" "and UTC adjustment spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1437 +#: ../../library/datetime.rst:1453 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -2117,20 +2137,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1446 +#: ../../library/datetime.rst:1462 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1451 +#: ../../library/datetime.rst:1467 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" -#: ../../library/datetime.rst:1455 +#: ../../library/datetime.rst:1471 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " @@ -2140,22 +2160,22 @@ msgid "" "future." msgstr "" -#: ../../library/datetime.rst:1462 +#: ../../library/datetime.rst:1478 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1465 +#: ../../library/datetime.rst:1481 msgid "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" msgstr "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" -#: ../../library/datetime.rst:1469 +#: ../../library/datetime.rst:1485 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1475 +#: ../../library/datetime.rst:1491 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -2163,57 +2183,57 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1481 +#: ../../library/datetime.rst:1497 msgid "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" msgstr "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" -#: ../../library/datetime.rst:1483 +#: ../../library/datetime.rst:1499 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1485 +#: ../../library/datetime.rst:1501 msgid "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" msgstr "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" -#: ../../library/datetime.rst:1489 +#: ../../library/datetime.rst:1505 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:1495 +#: ../../library/datetime.rst:1511 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" "`isocalendar`." msgstr "" -#: ../../library/datetime.rst:1502 +#: ../../library/datetime.rst:1518 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1508 +#: ../../library/datetime.rst:1524 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1510 +#: ../../library/datetime.rst:1526 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "``YYYY-MM-DDTHH:MM:SS.ffffff``,如果 :attr:`microsecond` 不是 0" -#: ../../library/datetime.rst:1511 +#: ../../library/datetime.rst:1527 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1513 +#: ../../library/datetime.rst:1529 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" -#: ../../library/datetime.rst:1516 +#: ../../library/datetime.rst:1532 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -2221,13 +2241,13 @@ msgstr "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` " "不是 0" -#: ../../library/datetime.rst:1518 +#: ../../library/datetime.rst:1534 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1522 +#: ../../library/datetime.rst:1538 msgid "" ">>> from datetime import datetime, timezone\n" ">>> datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat()\n" @@ -2241,13 +2261,13 @@ msgstr "" ">>> datetime(2019, 5, 18, 15, 17, tzinfo=timezone.utc).isoformat()\n" "'2019-05-18T15:17:00+00:00'" -#: ../../library/datetime.rst:1528 +#: ../../library/datetime.rst:1544 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1531 +#: ../../library/datetime.rst:1547 msgid "" ">>> from datetime import tzinfo, timedelta, datetime\n" ">>> class TZ(tzinfo):\n" @@ -2261,53 +2281,53 @@ msgid "" "'2009-11-27T00:00:00.000100-06:39'" msgstr "" -#: ../../library/datetime.rst:1542 ../../library/datetime.rst:1917 +#: ../../library/datetime.rst:1558 ../../library/datetime.rst:1933 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1546 ../../library/datetime.rst:1921 +#: ../../library/datetime.rst:1562 ../../library/datetime.rst:1937 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1548 ../../library/datetime.rst:1923 +#: ../../library/datetime.rst:1564 ../../library/datetime.rst:1939 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1549 ../../library/datetime.rst:1924 +#: ../../library/datetime.rst:1565 ../../library/datetime.rst:1940 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1550 ../../library/datetime.rst:1925 +#: ../../library/datetime.rst:1566 ../../library/datetime.rst:1941 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1552 ../../library/datetime.rst:1927 +#: ../../library/datetime.rst:1568 ../../library/datetime.rst:1943 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1554 ../../library/datetime.rst:1929 +#: ../../library/datetime.rst:1570 ../../library/datetime.rst:1945 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1558 ../../library/datetime.rst:1933 +#: ../../library/datetime.rst:1574 ../../library/datetime.rst:1949 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1560 +#: ../../library/datetime.rst:1576 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1563 +#: ../../library/datetime.rst:1579 msgid "" ">>> from datetime import datetime\n" ">>> datetime.now().isoformat(timespec='minutes')\n" @@ -2323,21 +2343,21 @@ msgstr "" ">>> dt.isoformat(timespec='microseconds')\n" "'2015-01-01T12:30:59.000000'" -#: ../../library/datetime.rst:1570 ../../library/datetime.rst:1948 +#: ../../library/datetime.rst:1586 ../../library/datetime.rst:1964 msgid "Added the *timespec* parameter." msgstr "新增 *timespec* 參數。" -#: ../../library/datetime.rst:1576 +#: ../../library/datetime.rst:1592 msgid "" "For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1582 +#: ../../library/datetime.rst:1598 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1584 +#: ../../library/datetime.rst:1600 msgid "" ">>> from datetime import datetime\n" ">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" @@ -2347,27 +2367,27 @@ msgstr "" ">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" "'Wed Dec 4 20:30:40 2002'" -#: ../../library/datetime.rst:1588 +#: ../../library/datetime.rst:1604 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1595 +#: ../../library/datetime.rst:1611 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " "to the C standard." msgstr "" -#: ../../library/datetime.rst:1602 +#: ../../library/datetime.rst:1618 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. See also :ref:`strftime-strptime-behavior` and :meth:" "`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1609 +#: ../../library/datetime.rst:1625 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -2375,15 +2395,15 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1616 +#: ../../library/datetime.rst:1632 msgid "Examples of Usage: :class:`.datetime`" msgstr "用法範例::class:`.datetime`" -#: ../../library/datetime.rst:1618 +#: ../../library/datetime.rst:1634 msgid "Examples of working with :class:`.datetime` objects:" msgstr "更多 :class:`.datetime` 的用法範例:" -#: ../../library/datetime.rst:1620 +#: ../../library/datetime.rst:1636 msgid "" ">>> from datetime import datetime, date, time, timezone\n" "\n" @@ -2437,14 +2457,14 @@ msgid "" "'The day is 21, the month is November, the time is 04:30PM.'" msgstr "" -#: ../../library/datetime.rst:1671 +#: ../../library/datetime.rst:1687 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: ../../library/datetime.rst:1675 +#: ../../library/datetime.rst:1691 msgid "" "from datetime import timedelta, datetime, tzinfo, timezone\n" "\n" @@ -2491,11 +2511,11 @@ msgid "" " return \"+04\"" msgstr "" -#: ../../library/datetime.rst:1718 +#: ../../library/datetime.rst:1734 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1720 +#: ../../library/datetime.rst:1736 msgid "" ">>> tz1 = KabulTz()\n" "\n" @@ -2519,63 +2539,63 @@ msgid "" "True" msgstr "" -#: ../../library/datetime.rst:1744 +#: ../../library/datetime.rst:1760 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1746 +#: ../../library/datetime.rst:1762 msgid "" "A :class:`.time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: ../../library/datetime.rst:1751 +#: ../../library/datetime.rst:1767 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" -#: ../../library/datetime.rst:1761 +#: ../../library/datetime.rst:1777 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to 0 except *tzinfo*, which defaults to ``None``." msgstr "" -#: ../../library/datetime.rst:1769 +#: ../../library/datetime.rst:1785 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1774 +#: ../../library/datetime.rst:1790 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1779 +#: ../../library/datetime.rst:1795 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." "time` objects is not supported." msgstr "" -#: ../../library/datetime.rst:1808 +#: ../../library/datetime.rst:1824 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1822 +#: ../../library/datetime.rst:1838 msgid "" ":class:`.time` objects support equality and order comparisons, where ``a`` " "is considered less than ``b`` when ``a`` precedes ``b`` in time." msgstr "" -#: ../../library/datetime.rst:1825 +#: ../../library/datetime.rst:1841 msgid "" "Naive and aware :class:`!time` objects are never equal. Order comparison " "between naive and aware :class:`!time` objects raises :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1829 +#: ../../library/datetime.rst:1845 msgid "" "If both comparands are aware, and have the same :attr:`~.time.tzinfo` " "attribute, the :attr:`!tzinfo` and :attr:`!fold` attributes are ignored and " @@ -2584,18 +2604,18 @@ msgid "" "subtracting their UTC offsets (obtained from ``self.utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1835 +#: ../../library/datetime.rst:1851 msgid "" "Equality comparisons between aware and naive :class:`.time` instances don't " "raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1839 +#: ../../library/datetime.rst:1855 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1841 +#: ../../library/datetime.rst:1857 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -2603,33 +2623,33 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1848 +#: ../../library/datetime.rst:1864 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1852 +#: ../../library/datetime.rst:1868 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1856 +#: ../../library/datetime.rst:1872 msgid "" "The leading ``T``, normally required in cases where there may be ambiguity " "between a date and a time, is not required." msgstr "" -#: ../../library/datetime.rst:1858 +#: ../../library/datetime.rst:1874 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1862 +#: ../../library/datetime.rst:1878 msgid "Examples:" msgstr "範例: ::" -#: ../../library/datetime.rst:1864 +#: ../../library/datetime.rst:1880 msgid "" ">>> from datetime import time\n" ">>> time.fromisoformat('04:23:01')\n" @@ -2669,13 +2689,13 @@ msgstr "" ">>> time.fromisoformat('04:23:01+00:00')\n" "datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" -#: ../../library/datetime.rst:1886 +#: ../../library/datetime.rst:1902 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat`." msgstr "" -#: ../../library/datetime.rst:1896 +#: ../../library/datetime.rst:1912 msgid "" "Return a new :class:`.time` with the same values, but with specified " "parameters updated. Note that ``tzinfo=None`` can be specified to create a " @@ -2683,41 +2703,41 @@ msgid "" "time data." msgstr "" -#: ../../library/datetime.rst:1901 +#: ../../library/datetime.rst:1917 msgid "" ":class:`.time` objects are also supported by generic function :func:`copy." "replace`." msgstr "" -#: ../../library/datetime.rst:1910 +#: ../../library/datetime.rst:1926 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1912 +#: ../../library/datetime.rst:1928 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1913 +#: ../../library/datetime.rst:1929 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1914 +#: ../../library/datetime.rst:1930 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1915 +#: ../../library/datetime.rst:1931 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1935 +#: ../../library/datetime.rst:1951 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1939 +#: ../../library/datetime.rst:1955 msgid "" ">>> from datetime import time\n" ">>> time(hour=12, minute=34, second=56, microsecond=123456)." @@ -2739,18 +2759,18 @@ msgstr "" ">>> dt.isoformat(timespec='auto')\n" "'12:34:56'" -#: ../../library/datetime.rst:1954 +#: ../../library/datetime.rst:1970 msgid "For a time ``t``, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1959 +#: ../../library/datetime.rst:1975 msgid "" "Return a string representing the time, controlled by an explicit format " "string. See also :ref:`strftime-strptime-behavior` and :meth:`time." "isoformat`." msgstr "" -#: ../../library/datetime.rst:1965 +#: ../../library/datetime.rst:1981 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals >> from datetime import time, tzinfo, timedelta\n" ">>> class TZ1(tzinfo):\n" @@ -2839,18 +2859,18 @@ msgstr "" ">>> 'The {} is {:%H:%M}.'.format(\"time\", t)\n" "'The time is 12:10.'" -#: ../../library/datetime.rst:2030 +#: ../../library/datetime.rst:2046 msgid ":class:`tzinfo` Objects" msgstr ":class:`tzinfo` 物件" -#: ../../library/datetime.rst:2034 +#: ../../library/datetime.rst:2050 msgid "" "This is an abstract base class, meaning that this class should not be " "instantiated directly. Define a subclass of :class:`tzinfo` to capture " "information about a particular time zone." msgstr "" -#: ../../library/datetime.rst:2038 +#: ../../library/datetime.rst:2054 msgid "" "An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the " "constructors for :class:`.datetime` and :class:`.time` objects. The latter " @@ -2860,7 +2880,7 @@ msgid "" "object passed to them." msgstr "" -#: ../../library/datetime.rst:2044 +#: ../../library/datetime.rst:2060 msgid "" "You need to derive a concrete subclass, and (at least) supply " "implementations of the standard :class:`tzinfo` methods needed by the :class:" @@ -2870,7 +2890,7 @@ msgid "" "American EST and EDT." msgstr "" -#: ../../library/datetime.rst:2051 +#: ../../library/datetime.rst:2067 msgid "" "Special requirement for pickling: A :class:`tzinfo` subclass must have an :" "meth:`~object.__init__` method that can be called with no arguments, " @@ -2878,20 +2898,20 @@ msgid "" "technical requirement that may be relaxed in the future." msgstr "" -#: ../../library/datetime.rst:2057 +#: ../../library/datetime.rst:2073 msgid "" "A concrete subclass of :class:`tzinfo` may need to implement the following " "methods. Exactly which methods are needed depends on the uses made of aware :" "mod:`!datetime` objects. If in doubt, simply implement all of them." msgstr "" -#: ../../library/datetime.rst:2064 +#: ../../library/datetime.rst:2080 msgid "" "Return offset of local time from UTC, as a :class:`timedelta` object that is " "positive east of UTC. If local time is west of UTC, this should be negative." msgstr "" -#: ../../library/datetime.rst:2067 +#: ../../library/datetime.rst:2083 msgid "" "This represents the *total* offset from UTC; for example, if a :class:" "`tzinfo` object represents both time zone and DST adjustments, :meth:" @@ -2902,31 +2922,31 @@ msgid "" "meth:`utcoffset` will probably look like one of these two::" msgstr "" -#: ../../library/datetime.rst:2075 +#: ../../library/datetime.rst:2091 msgid "" "return CONSTANT # fixed-offset class\n" "return CONSTANT + self.dst(dt) # daylight-aware class" msgstr "" -#: ../../library/datetime.rst:2078 +#: ../../library/datetime.rst:2094 msgid "" "If :meth:`utcoffset` does not return ``None``, :meth:`dst` should not return " "``None`` either." msgstr "" -#: ../../library/datetime.rst:2081 +#: ../../library/datetime.rst:2097 msgid "" "The default implementation of :meth:`utcoffset` raises :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2090 +#: ../../library/datetime.rst:2106 msgid "" "Return the daylight saving time (DST) adjustment, as a :class:`timedelta` " "object or ``None`` if DST information isn't known." msgstr "" -#: ../../library/datetime.rst:2094 +#: ../../library/datetime.rst:2110 msgid "" "Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, return " "the offset as a :class:`timedelta` object (see :meth:`utcoffset` for " @@ -2939,17 +2959,17 @@ msgid "" "to account for DST changes when crossing time zones." msgstr "" -#: ../../library/datetime.rst:2104 +#: ../../library/datetime.rst:2120 msgid "" "An instance *tz* of a :class:`tzinfo` subclass that models both standard and " "daylight times must be consistent in this sense:" msgstr "" -#: ../../library/datetime.rst:2107 +#: ../../library/datetime.rst:2123 msgid "``tz.utcoffset(dt) - tz.dst(dt)``" msgstr "``tz.utcoffset(dt) - tz.dst(dt)``" -#: ../../library/datetime.rst:2109 +#: ../../library/datetime.rst:2125 msgid "" "must return the same result for every :class:`.datetime` *dt* with ``dt." "tzinfo == tz``. For sane :class:`tzinfo` subclasses, this expression yields " @@ -2962,24 +2982,24 @@ msgid "" "astimezone` regardless." msgstr "" -#: ../../library/datetime.rst:2118 +#: ../../library/datetime.rst:2134 msgid "" "Most implementations of :meth:`dst` will probably look like one of these " "two::" msgstr "" -#: ../../library/datetime.rst:2120 +#: ../../library/datetime.rst:2136 msgid "" "def dst(self, dt):\n" " # a fixed-offset class: doesn't account for DST\n" " return timedelta(0)" msgstr "" -#: ../../library/datetime.rst:2124 +#: ../../library/datetime.rst:2140 msgid "or::" msgstr "或是: ::" -#: ../../library/datetime.rst:2126 +#: ../../library/datetime.rst:2142 msgid "" "def dst(self, dt):\n" " # Code to set dston and dstoff to the time zone's DST\n" @@ -2992,12 +3012,12 @@ msgid "" " return timedelta(0)" msgstr "" -#: ../../library/datetime.rst:2136 +#: ../../library/datetime.rst:2152 msgid "" "The default implementation of :meth:`dst` raises :exc:`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2144 +#: ../../library/datetime.rst:2160 msgid "" "Return the time zone name corresponding to the :class:`.datetime` object " "*dt*, as a string. Nothing about string names is defined by the :mod:`!" @@ -3011,13 +3031,13 @@ msgid "" "accounting for daylight time." msgstr "" -#: ../../library/datetime.rst:2154 +#: ../../library/datetime.rst:2170 msgid "" "The default implementation of :meth:`tzname` raises :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2157 +#: ../../library/datetime.rst:2173 msgid "" "These methods are called by a :class:`.datetime` or :class:`.time` object, " "in response to their methods of the same names. A :class:`.datetime` object " @@ -3027,7 +3047,7 @@ msgid "" "datetime`." msgstr "" -#: ../../library/datetime.rst:2163 +#: ../../library/datetime.rst:2179 msgid "" "When ``None`` is passed, it's up to the class designer to decide the best " "response. For example, returning ``None`` is appropriate if the class wishes " @@ -3036,7 +3056,7 @@ msgid "" "offset, as there is no other convention for discovering the standard offset." msgstr "" -#: ../../library/datetime.rst:2169 +#: ../../library/datetime.rst:2185 msgid "" "When a :class:`.datetime` object is passed in response to a :class:`." "datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:" @@ -3046,13 +3066,13 @@ msgid "" "zones." msgstr "" -#: ../../library/datetime.rst:2175 +#: ../../library/datetime.rst:2191 msgid "" "There is one more :class:`tzinfo` method that a subclass may wish to " "override:" msgstr "" -#: ../../library/datetime.rst:2180 +#: ../../library/datetime.rst:2196 msgid "" "This is called from the default :meth:`datetime.astimezone` implementation. " "When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time " @@ -3061,7 +3081,7 @@ msgid "" "datetime in *self*'s local time." msgstr "" -#: ../../library/datetime.rst:2186 +#: ../../library/datetime.rst:2202 msgid "" "Most :class:`tzinfo` subclasses should be able to inherit the default :meth:" "`fromutc` implementation without problems. It's strong enough to handle " @@ -3076,13 +3096,13 @@ msgid "" "offset changes." msgstr "" -#: ../../library/datetime.rst:2197 +#: ../../library/datetime.rst:2213 msgid "" "Skipping code for error cases, the default :meth:`fromutc` implementation " "acts like::" msgstr "" -#: ../../library/datetime.rst:2200 +#: ../../library/datetime.rst:2216 msgid "" "def fromutc(self, dt):\n" " # raise ValueError error if dt.tzinfo is not self\n" @@ -3100,13 +3120,13 @@ msgid "" " return dt" msgstr "" -#: ../../library/datetime.rst:2215 +#: ../../library/datetime.rst:2231 msgid "" "In the following :download:`tzinfo_examples.py <../includes/tzinfo_examples." "py>` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2219 +#: ../../library/datetime.rst:2235 msgid "" "from datetime import tzinfo, timedelta, datetime\n" "\n" @@ -3286,7 +3306,7 @@ msgid "" "Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" msgstr "" -#: ../../library/datetime.rst:2221 +#: ../../library/datetime.rst:2237 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -3295,7 +3315,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2227 +#: ../../library/datetime.rst:2243 msgid "" " UTC 3:MM 4:MM 5:MM 6:MM 7:MM 8:MM\n" " EST 22:MM 23:MM 0:MM 1:MM 2:MM 3:MM\n" @@ -3313,7 +3333,7 @@ msgstr "" "\n" " end 23:MM 0:MM 1:MM 1:MM 2:MM 3:MM" -#: ../../library/datetime.rst:2235 +#: ../../library/datetime.rst:2251 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -3322,7 +3342,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2240 +#: ../../library/datetime.rst:2256 msgid "" ">>> from datetime import datetime, timezone\n" ">>> from tzinfo_examples import HOUR, Eastern\n" @@ -3350,7 +3370,7 @@ msgstr "" "07:00:00 UTC = 03:00:00 EDT\n" "08:00:00 UTC = 04:00:00 EDT" -#: ../../library/datetime.rst:2254 +#: ../../library/datetime.rst:2270 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -3365,7 +3385,7 @@ msgid "" "Fall back transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2265 +#: ../../library/datetime.rst:2281 msgid "" ">>> u0 = datetime(2016, 11, 6, 4, tzinfo=timezone.utc)\n" ">>> for i in range(4):\n" @@ -3389,13 +3409,13 @@ msgstr "" "06:00:00 UTC = 01:00:00 EST 1\n" "07:00:00 UTC = 02:00:00 EST 0" -#: ../../library/datetime.rst:2276 +#: ../../library/datetime.rst:2292 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~.datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2279 +#: ../../library/datetime.rst:2295 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~.datetime.fold` attribute or avoid using hybrid :" @@ -3405,28 +3425,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2287 +#: ../../library/datetime.rst:2303 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2288 +#: ../../library/datetime.rst:2304 msgid "" "The :mod:`!datetime` module has a basic :class:`timezone` class (for " "handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` " "attribute (a UTC :class:`!timezone` instance)." msgstr "" -#: ../../library/datetime.rst:2292 +#: ../../library/datetime.rst:2308 msgid "" "``zoneinfo`` brings the *IANA time zone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2295 +#: ../../library/datetime.rst:2311 msgid "`IANA time zone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2296 +#: ../../library/datetime.rst:2312 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -3435,24 +3455,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2306 +#: ../../library/datetime.rst:2322 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2308 +#: ../../library/datetime.rst:2324 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a time zone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2312 +#: ../../library/datetime.rst:2328 msgid "" "Objects of this class cannot be used to represent time zone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2335 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -3460,25 +3480,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2324 +#: ../../library/datetime.rst:2340 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2335 ../../library/datetime.rst:2346 +#: ../../library/datetime.rst:2351 ../../library/datetime.rst:2362 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2338 +#: ../../library/datetime.rst:2354 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2349 +#: ../../library/datetime.rst:2365 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -3487,119 +3507,119 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2355 +#: ../../library/datetime.rst:2371 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2378 msgid "Always returns ``None``." msgstr "總是回傳 ``None``。" -#: ../../library/datetime.rst:2366 +#: ../../library/datetime.rst:2382 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2373 +#: ../../library/datetime.rst:2389 msgid "The UTC time zone, ``timezone(timedelta(0))``." msgstr "UTC 時區,``timezone(timedelta(0))``。" -#: ../../library/datetime.rst:2382 +#: ../../library/datetime.rst:2398 msgid ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Behavior" msgstr ":meth:`~.datetime.strftime` 與 :meth:`~.datetime.strptime` 的行為" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2400 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2388 +#: ../../library/datetime.rst:2404 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2408 msgid "" "The table below provides a high-level comparison of :meth:`~.datetime." "strftime` versus :meth:`~.datetime.strptime`:" msgstr "" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2412 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2412 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2414 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2414 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2414 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2416 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2416 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2416 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2418 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2418 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr ":class:`date`; :class:`.datetime`; :class:`.time`" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2418 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2404 +#: ../../library/datetime.rst:2420 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2404 +#: ../../library/datetime.rst:2420 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2404 +#: ../../library/datetime.rst:2420 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2427 msgid "" ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Format Codes" msgstr ":meth:`~.datetime.strftime` 與 :meth:`~.datetime.strptime` 格式碼" -#: ../../library/datetime.rst:2413 +#: ../../library/datetime.rst:2429 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2415 +#: ../../library/datetime.rst:2431 msgid "" ">>> datetime.strptime('31/01/22 23:59:59.999999',\n" "... '%d/%m/%y %H:%M:%S.%f')\n" @@ -3613,33 +3633,33 @@ msgstr "" ">>> _.strftime('%a %d %b %Y, %I:%M%p')\n" "'Mon 31 Jan 2022, 11:59PM'" -#: ../../library/datetime.rst:2421 +#: ../../library/datetime.rst:2437 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2425 ../../library/datetime.rst:2528 +#: ../../library/datetime.rst:2441 ../../library/datetime.rst:2544 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2425 ../../library/datetime.rst:2528 +#: ../../library/datetime.rst:2441 ../../library/datetime.rst:2544 msgid "Meaning" msgstr "含義" -#: ../../library/datetime.rst:2425 ../../library/datetime.rst:2528 +#: ../../library/datetime.rst:2441 ../../library/datetime.rst:2544 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2425 ../../library/datetime.rst:2528 +#: ../../library/datetime.rst:2441 ../../library/datetime.rst:2544 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2427 +#: ../../library/datetime.rst:2443 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2427 +#: ../../library/datetime.rst:2443 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -3651,11 +3671,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2432 +#: ../../library/datetime.rst:2448 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2432 +#: ../../library/datetime.rst:2448 msgid "Weekday as locale's full name." msgstr "" @@ -3667,42 +3687,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2453 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2453 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2453 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2441 +#: ../../library/datetime.rst:2457 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2441 +#: ../../library/datetime.rst:2457 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2441 +#: ../../library/datetime.rst:2457 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2441 ../../library/datetime.rst:2454 -#: ../../library/datetime.rst:2457 ../../library/datetime.rst:2463 -#: ../../library/datetime.rst:2466 ../../library/datetime.rst:2472 -#: ../../library/datetime.rst:2490 +#: ../../library/datetime.rst:2457 ../../library/datetime.rst:2470 +#: ../../library/datetime.rst:2473 ../../library/datetime.rst:2479 +#: ../../library/datetime.rst:2482 ../../library/datetime.rst:2488 +#: ../../library/datetime.rst:2506 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2444 +#: ../../library/datetime.rst:2460 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2444 +#: ../../library/datetime.rst:2460 msgid "Month as locale's abbreviated name." msgstr "" @@ -3714,11 +3734,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2465 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2465 msgid "Month as locale's full name." msgstr "" @@ -3730,67 +3750,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2454 +#: ../../library/datetime.rst:2470 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2454 +#: ../../library/datetime.rst:2470 msgid "Month as a zero-padded decimal number." msgstr "以零填充的並以十進位數字表示的月份。" -#: ../../library/datetime.rst:2454 ../../library/datetime.rst:2466 +#: ../../library/datetime.rst:2470 ../../library/datetime.rst:2482 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2473 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2473 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2473 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2460 +#: ../../library/datetime.rst:2476 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2460 +#: ../../library/datetime.rst:2476 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2460 ../../library/datetime.rst:2530 +#: ../../library/datetime.rst:2476 ../../library/datetime.rst:2546 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2479 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2479 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2479 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2466 +#: ../../library/datetime.rst:2482 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2466 +#: ../../library/datetime.rst:2482 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2469 +#: ../../library/datetime.rst:2485 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2469 +#: ../../library/datetime.rst:2485 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -3802,128 +3822,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2469 +#: ../../library/datetime.rst:2485 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2472 +#: ../../library/datetime.rst:2488 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2472 +#: ../../library/datetime.rst:2488 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2472 ../../library/datetime.rst:2475 +#: ../../library/datetime.rst:2488 ../../library/datetime.rst:2491 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2475 +#: ../../library/datetime.rst:2491 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2475 +#: ../../library/datetime.rst:2491 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2475 +#: ../../library/datetime.rst:2491 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2478 +#: ../../library/datetime.rst:2494 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2478 +#: ../../library/datetime.rst:2494 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2478 +#: ../../library/datetime.rst:2494 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2478 +#: ../../library/datetime.rst:2494 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2482 ../../library/datetime.rst:2641 +#: ../../library/datetime.rst:2498 ../../library/datetime.rst:2657 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2482 +#: ../../library/datetime.rst:2498 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2482 +#: ../../library/datetime.rst:2498 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2482 ../../library/datetime.rst:2487 -#: ../../library/datetime.rst:2544 +#: ../../library/datetime.rst:2498 ../../library/datetime.rst:2503 +#: ../../library/datetime.rst:2560 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2487 ../../library/datetime.rst:2667 +#: ../../library/datetime.rst:2503 ../../library/datetime.rst:2683 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2487 +#: ../../library/datetime.rst:2503 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2487 +#: ../../library/datetime.rst:2503 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2490 +#: ../../library/datetime.rst:2506 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2490 +#: ../../library/datetime.rst:2506 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2490 +#: ../../library/datetime.rst:2506 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2493 +#: ../../library/datetime.rst:2509 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2493 +#: ../../library/datetime.rst:2509 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2493 ../../library/datetime.rst:2501 +#: ../../library/datetime.rst:2509 ../../library/datetime.rst:2517 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2493 ../../library/datetime.rst:2501 +#: ../../library/datetime.rst:2509 ../../library/datetime.rst:2517 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2501 +#: ../../library/datetime.rst:2517 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2501 +#: ../../library/datetime.rst:2517 msgid "" "Week number of the year (Monday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2509 +#: ../../library/datetime.rst:2525 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2509 +#: ../../library/datetime.rst:2525 msgid "Locale's appropriate date and time representation." msgstr "" @@ -3935,11 +3955,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2514 +#: ../../library/datetime.rst:2530 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2514 +#: ../../library/datetime.rst:2530 msgid "Locale's appropriate date representation." msgstr "" @@ -3955,11 +3975,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2518 +#: ../../library/datetime.rst:2534 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2518 +#: ../../library/datetime.rst:2534 msgid "Locale's appropriate time representation." msgstr "" @@ -3971,83 +3991,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2521 +#: ../../library/datetime.rst:2537 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2521 +#: ../../library/datetime.rst:2537 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2521 +#: ../../library/datetime.rst:2537 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2540 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2530 +#: ../../library/datetime.rst:2546 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2530 +#: ../../library/datetime.rst:2546 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2530 +#: ../../library/datetime.rst:2546 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2535 +#: ../../library/datetime.rst:2551 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2535 +#: ../../library/datetime.rst:2551 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2535 +#: ../../library/datetime.rst:2551 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2538 +#: ../../library/datetime.rst:2554 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2538 +#: ../../library/datetime.rst:2554 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2538 +#: ../../library/datetime.rst:2554 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2538 +#: ../../library/datetime.rst:2554 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2544 ../../library/datetime.rst:2663 +#: ../../library/datetime.rst:2560 ../../library/datetime.rst:2679 msgid "``%:z``" msgstr "``%:z``" -#: ../../library/datetime.rst:2544 +#: ../../library/datetime.rst:2560 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: ../../library/datetime.rst:2544 +#: ../../library/datetime.rst:2560 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: ../../library/datetime.rst:2550 +#: ../../library/datetime.rst:2566 msgid "" "These may not be available on all platforms when used with the :meth:`~." "datetime.strftime` method. The ISO 8601 year and ISO 8601 week directives " @@ -4056,7 +4076,7 @@ msgid "" "directives will raise a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2555 +#: ../../library/datetime.rst:2571 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :c:func:`strftime` function, and " @@ -4066,44 +4086,44 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2561 +#: ../../library/datetime.rst:2577 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``、``%u`` 與 ``%V``。" -#: ../../library/datetime.rst:2564 +#: ../../library/datetime.rst:2580 msgid "``%:z`` was added." msgstr "新增 ``%:z``。" -#: ../../library/datetime.rst:2568 +#: ../../library/datetime.rst:2584 msgid "Technical Detail" msgstr "技術細節" -#: ../../library/datetime.rst:2570 +#: ../../library/datetime.rst:2586 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`~date.timetuple` method." msgstr "" -#: ../../library/datetime.rst:2574 +#: ../../library/datetime.rst:2590 msgid "" "For the :meth:`.datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2578 +#: ../../library/datetime.rst:2594 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2582 +#: ../../library/datetime.rst:2598 msgid "" "except when the format includes sub-second components or time zone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -#: ../../library/datetime.rst:2586 +#: ../../library/datetime.rst:2602 msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " "not be used, as :class:`!time` objects have no such values. If they're used " @@ -4113,7 +4133,7 @@ msgstr "" "time` 物件並沒有這些值。如果使用這些格式碼,年份會以 1900 代替、月及日會以 1 " "代替。" -#: ../../library/datetime.rst:2590 +#: ../../library/datetime.rst:2606 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " @@ -4122,7 +4142,7 @@ msgstr "" "對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" "`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 0 代替。" -#: ../../library/datetime.rst:2594 +#: ../../library/datetime.rst:2610 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -4131,7 +4151,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2603 +#: ../../library/datetime.rst:2619 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -4139,38 +4159,38 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2609 +#: ../../library/datetime.rst:2625 msgid "" "The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] " "range, but years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2612 +#: ../../library/datetime.rst:2628 msgid "" "In previous versions, :meth:`~.datetime.strftime` method was restricted to " "years >= 1900." msgstr "" -#: ../../library/datetime.rst:2616 +#: ../../library/datetime.rst:2632 msgid "" "In version 3.2, :meth:`~.datetime.strftime` method was restricted to years " ">= 1000." msgstr "" -#: ../../library/datetime.rst:2621 +#: ../../library/datetime.rst:2637 msgid "" "When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive " "only affects the output hour field if the ``%I`` directive is used to parse " "the hour." msgstr "" -#: ../../library/datetime.rst:2625 +#: ../../library/datetime.rst:2641 msgid "" "Unlike the :mod:`time` module, the :mod:`!datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2629 +#: ../../library/datetime.rst:2645 msgid "" "When used with the :meth:`~.datetime.strptime` method, the ``%f`` directive " "accepts from one to six digits and zero pads on the right. ``%f`` is an " @@ -4178,17 +4198,17 @@ msgid "" "separately in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2636 +#: ../../library/datetime.rst:2652 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: ../../library/datetime.rst:2639 +#: ../../library/datetime.rst:2655 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2642 +#: ../../library/datetime.rst:2658 msgid "" ":meth:`~.datetime.utcoffset` is transformed into a string of the form " "``±HHMM[SS[.ffffff]]``, where ``HH`` is a 2-digit string giving the number " @@ -4202,7 +4222,7 @@ msgid "" "replaced with the string ``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2656 +#: ../../library/datetime.rst:2672 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " "method, the UTC offsets can have a colon as a separator between hours, " @@ -4211,53 +4231,53 @@ msgid "" "``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2664 +#: ../../library/datetime.rst:2680 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: ../../library/datetime.rst:2668 +#: ../../library/datetime.rst:2684 msgid "" "In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :" "meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by " "the returned value, which must be a string." msgstr "" -#: ../../library/datetime.rst:2672 +#: ../../library/datetime.rst:2688 msgid ":meth:`~.datetime.strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2674 +#: ../../library/datetime.rst:2690 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2675 +#: ../../library/datetime.rst:2691 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2677 +#: ../../library/datetime.rst:2693 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2681 +#: ../../library/datetime.rst:2697 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " "method, an aware :class:`.datetime` object will be produced. The ``tzinfo`` " "of the result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2687 +#: ../../library/datetime.rst:2703 msgid "" "When used with the :meth:`~.datetime.strptime` method, ``%U`` and ``%W`` are " "only used in calculations when the day of the week and the calendar year " "(``%Y``) are specified." msgstr "" -#: ../../library/datetime.rst:2692 +#: ../../library/datetime.rst:2708 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:`~." @@ -4265,7 +4285,7 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2698 +#: ../../library/datetime.rst:2714 msgid "" "When used with the :meth:`~.datetime.strptime` method, the leading zero is " "optional for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, " @@ -4273,7 +4293,7 @@ msgid "" "zero." msgstr "" -#: ../../library/datetime.rst:2703 +#: ../../library/datetime.rst:2719 msgid "" "When parsing a month and day using :meth:`~.datetime.strptime`, always " "include a year in the format. If the value you need to parse lacks a year, " @@ -4282,7 +4302,7 @@ msgid "" "parser is not a leap year. Users run into this bug every four years..." msgstr "" -#: ../../library/datetime.rst:2709 +#: ../../library/datetime.rst:2725 msgid "" ">>> month_day = \"02/29\"\n" ">>> datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # No leap year " @@ -4290,7 +4310,7 @@ msgid "" "datetime.datetime(1984, 2, 29, 0, 0)" msgstr "" -#: ../../library/datetime.rst:2715 +#: ../../library/datetime.rst:2731 msgid "" ":meth:`~.datetime.strptime` calls using a format string containing a day of " "month without a year now emit a :exc:`DeprecationWarning`. In 3.15 or later " @@ -4298,15 +4318,15 @@ msgid "" "See :gh:`70647`." msgstr "" -#: ../../library/datetime.rst:2722 +#: ../../library/datetime.rst:2738 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2723 +#: ../../library/datetime.rst:2739 msgid "If, that is, we ignore the effects of Relativity" msgstr "也就是說,我們會忽略相對論的效應" -#: ../../library/datetime.rst:2725 +#: ../../library/datetime.rst:2741 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -4315,23 +4335,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2731 +#: ../../library/datetime.rst:2747 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2735 +#: ../../library/datetime.rst:2751 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since 1900 is not " "a leap year." msgstr "" -#: ../../library/datetime.rst:2376 +#: ../../library/datetime.rst:2392 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2376 +#: ../../library/datetime.rst:2392 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/shutil.po b/library/shutil.po index 2eac9779e4..c90e1f7a6c 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-20 00:16+0000\n" +"POT-Creation-Date: 2025-05-11 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,8 +35,8 @@ msgstr "" #: ../../library/shutil.rst:25 msgid "" -"Even the higher-level file copying functions " -"(:func:`shutil.copy`, :func:`shutil.copy2`) cannot copy all file metadata." +"Even the higher-level file copying functions (:func:`shutil.copy`, :func:" +"`shutil.copy2`) cannot copy all file metadata." msgstr "" #: ../../library/shutil.rst:28 @@ -98,8 +98,8 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.copyfile`` with " "arguments ``src``, ``dst``." msgstr "" -"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` " -"``shutil.copyfile``。" +"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` ``shutil." +"copyfile``。" #: ../../library/shutil.rst:72 msgid "" @@ -135,10 +135,10 @@ msgid "" "like object>` or path names given as strings. If *follow_symlinks* is false, " "and both *src* and *dst* are symbolic links, :func:`copymode` will attempt " "to modify the mode of *dst* itself (rather than the file it points to). " -"This functionality is not available on every platform; please " -"see :func:`copystat` for more information. If :func:`copymode` cannot " -"modify symbolic links on the local platform, and it is asked to do so, it " -"will do nothing and return." +"This functionality is not available on every platform; please see :func:" +"`copystat` for more information. If :func:`copymode` cannot modify symbolic " +"links on the local platform, and it is asked to do so, it will do nothing " +"and return." msgstr "" #: ../../library/shutil.rst:106 ../../library/shutil.rst:179 @@ -146,8 +146,8 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.copymode`` with " "arguments ``src``, ``dst``." msgstr "" -"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` " -"``shutil.copymode``。" +"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` ``shutil." +"copymode``。" #: ../../library/shutil.rst:108 msgid "Added *follow_symlinks* argument." @@ -190,9 +190,9 @@ msgstr "" #: ../../library/shutil.rst:140 msgid "" -"If ``os.chflags in os.supports_follow_symlinks`` is " -"``True``, :func:`copystat` can modify the flags of a symbolic link. " -"(``os.chflags`` is not available on all platforms.)" +"If ``os.chflags in os.supports_follow_symlinks`` is ``True``, :func:" +"`copystat` can modify the flags of a symbolic link. (``os.chflags`` is not " +"available on all platforms.)" msgstr "" #: ../../library/shutil.rst:145 @@ -211,8 +211,8 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.copystat`` with " "arguments ``src``, ``dst``." msgstr "" -"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` " -"``shutil.copystat``。" +"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` ``shutil." +"copystat``。" #: ../../library/shutil.rst:155 msgid "" @@ -260,16 +260,15 @@ msgid "" "attempts to copy all metadata from the *src* symbolic link to the newly " "created *dst* symbolic link. However, this functionality is not available on " "all platforms. On platforms where some or all of this functionality is " -"unavailable, :func:`copy2` will preserve all the metadata it " -"can; :func:`copy2` never raises an exception because it cannot preserve file " -"metadata." +"unavailable, :func:`copy2` will preserve all the metadata it can; :func:" +"`copy2` never raises an exception because it cannot preserve file metadata." msgstr "" #: ../../library/shutil.rst:204 msgid "" -":func:`copy2` uses :func:`copystat` to copy the file metadata. Please " -"see :func:`copystat` for more information about platform support for " -"modifying symbolic link metadata." +":func:`copy2` uses :func:`copystat` to copy the file metadata. Please see :" +"func:`copystat` for more information about platform support for modifying " +"symbolic link metadata." msgstr "" #: ../../library/shutil.rst:212 @@ -281,9 +280,9 @@ msgstr "" #: ../../library/shutil.rst:224 msgid "" -"This factory function creates a function that can be used as a callable " -"for :func:`copytree`\\'s *ignore* argument, ignoring files and directories " -"that match one of the glob-style *patterns* provided. See the example below." +"This factory function creates a function that can be used as a callable for :" +"func:`copytree`\\'s *ignore* argument, ignoring files and directories that " +"match one of the glob-style *patterns* provided. See the example below." msgstr "" #: ../../library/shutil.rst:233 @@ -310,9 +309,9 @@ msgstr "" #: ../../library/shutil.rst:245 msgid "" "When *symlinks* is false, if the file pointed to by the symlink doesn't " -"exist, an exception will be added in the list of errors raised in " -"an :exc:`Error` exception at the end of the copy process. You can set the " -"optional *ignore_dangling_symlinks* flag to true if you want to silence this " +"exist, an exception will be added in the list of errors raised in an :exc:" +"`Error` exception at the end of the copy process. You can set the optional " +"*ignore_dangling_symlinks* flag to true if you want to silence this " "exception. Notice that this option has no effect on platforms that don't " "support :func:`os.symlink`." msgstr "" @@ -345,8 +344,8 @@ msgstr "" #: ../../library/shutil.rst:269 msgid "" -"If *dirs_exist_ok* is false (the default) and *dst* already exists, " -"a :exc:`FileExistsError` is raised. If *dirs_exist_ok* is true, the copying " +"If *dirs_exist_ok* is false (the default) and *dst* already exists, a :exc:" +"`FileExistsError` is raised. If *dirs_exist_ok* is true, the copying " "operation will continue if it encounters existing directories, and files " "within the *dst* tree will be overwritten by corresponding files from the " "*src* tree." @@ -357,8 +356,8 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.copytree`` with " "arguments ``src``, ``dst``." msgstr "" -"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` " -"``shutil.copytree``。" +"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` ``shutil." +"copytree``。" #: ../../library/shutil.rst:277 msgid "" @@ -453,8 +452,8 @@ msgstr "新增 *onexc* 參數並棄用 *onerror*。" #: ../../library/shutil.rst:346 msgid "" ":func:`!rmtree` now ignores :exc:`FileNotFoundError` exceptions for all but " -"the top-level path. Exceptions other than :exc:`OSError` and subclasses " -"of :exc:`!OSError` are now always propagated to the caller." +"the top-level path. Exceptions other than :exc:`OSError` and subclasses of :" +"exc:`!OSError` are now always propagated to the caller." msgstr "" #: ../../library/shutil.rst:354 @@ -495,9 +494,9 @@ msgstr "" msgid "" "If *copy_function* is given, it must be a callable that takes two arguments, " "*src* and the destination, and will be used to copy *src* to the destination " -"if :func:`os.rename` cannot be used. If the source is a " -"directory, :func:`copytree` is called, passing it the *copy_function*. The " -"default *copy_function* is :func:`copy2`. Using :func:`~shutil.copy` as the " +"if :func:`os.rename` cannot be used. If the source is a directory, :func:" +"`copytree` is called, passing it the *copy_function*. The default " +"*copy_function* is :func:`copy2`. Using :func:`~shutil.copy` as the " "*copy_function* allows the move to succeed when it is not possible to also " "copy the metadata, at the expense of not copying any of the metadata." msgstr "" @@ -507,8 +506,8 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.move`` with arguments " "``src``, ``dst``." msgstr "" -"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` " -"``shutil.move``。" +"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` ``shutil." +"move``。" #: ../../library/shutil.rst:388 msgid "" @@ -587,13 +586,20 @@ msgstr "" #: ../../library/shutil.rst:452 msgid "" "*path* is a \"``PATH`` string\" specifying the directories to look in, " -"delimited by :data:`os.pathsep`. When no *path* is specified, " -"the :envvar:`PATH` environment variable is read from :data:`os.environ`, " -"falling back to :data:`os.defpath` if it is not set." +"delimited by :data:`os.pathsep`. When no *path* is specified, the :envvar:" +"`PATH` environment variable is read from :data:`os.environ`, falling back " +"to :data:`os.defpath` if it is not set." msgstr "" #: ../../library/shutil.rst:457 msgid "" +"If *cmd* contains a directory component, :func:`!which` only checks the " +"specified path directly and does not search the directories listed in *path* " +"or in the system's :envvar:`PATH` environment variable." +msgstr "" + +#: ../../library/shutil.rst:461 +msgid "" "On Windows, the current directory is prepended to the *path* if *mode* does " "not include ``os.X_OK``. When the *mode* does include ``os.X_OK``, the " "Windows API ``NeedCurrentDirectoryForExePathW`` will be consulted to " @@ -602,7 +608,7 @@ msgid "" "environment variable ``NoDefaultCurrentDirectoryInExePath``." msgstr "" -#: ../../library/shutil.rst:464 +#: ../../library/shutil.rst:468 msgid "" "Also on Windows, the :envvar:`PATHEXT` environment variable is used to " "resolve commands that may not already include an extension. For example, if " @@ -611,7 +617,7 @@ msgid "" "directories. For example, on Windows::" msgstr "" -#: ../../library/shutil.rst:470 +#: ../../library/shutil.rst:474 msgid "" ">>> shutil.which(\"python\")\n" "'C:\\\\Python33\\\\python.EXE'" @@ -619,13 +625,13 @@ msgstr "" ">>> shutil.which(\"python\")\n" "'C:\\\\Python33\\\\python.EXE'" -#: ../../library/shutil.rst:473 +#: ../../library/shutil.rst:477 msgid "" "This is also applied when *cmd* is a path that contains a directory " "component::" msgstr "" -#: ../../library/shutil.rst:476 +#: ../../library/shutil.rst:480 msgid "" ">>> shutil.which(\"C:\\\\Python33\\\\python\")\n" "'C:\\\\Python33\\\\python.EXE'" @@ -633,13 +639,13 @@ msgstr "" ">>> shutil.which(\"C:\\\\Python33\\\\python\")\n" "'C:\\\\Python33\\\\python.EXE'" -#: ../../library/shutil.rst:481 +#: ../../library/shutil.rst:485 msgid "" "The :class:`bytes` type is now accepted. If *cmd* type is :class:`bytes`, " "the result type is also :class:`bytes`." msgstr "" -#: ../../library/shutil.rst:485 +#: ../../library/shutil.rst:489 msgid "" "On Windows, the current directory is no longer prepended to the search path " "if *mode* includes ``os.X_OK`` and WinAPI " @@ -650,58 +656,58 @@ msgid "" "now be found." msgstr "" -#: ../../library/shutil.rst:496 +#: ../../library/shutil.rst:500 msgid "" "This exception collects exceptions that are raised during a multi-file " "operation. For :func:`copytree`, the exception argument is a list of 3-" "tuples (*srcname*, *dstname*, *exception*)." msgstr "" -#: ../../library/shutil.rst:503 +#: ../../library/shutil.rst:507 msgid "Platform-dependent efficient copy operations" msgstr "" -#: ../../library/shutil.rst:505 +#: ../../library/shutil.rst:509 msgid "" -"Starting from Python 3.8, all functions involving a file copy " -"(:func:`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, " -"and :func:`move`) may use platform-specific \"fast-copy\" syscalls in order " -"to copy the file more efficiently (see :issue:`33671`). \"fast-copy\" means " -"that the copying operation occurs within the kernel, avoiding the use of " -"userspace buffers in Python as in \"``outfd.write(infd.read())``\"." +"Starting from Python 3.8, all functions involving a file copy (:func:" +"`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" +"`move`) may use platform-specific \"fast-copy\" syscalls in order to copy " +"the file more efficiently (see :issue:`33671`). \"fast-copy\" means that the " +"copying operation occurs within the kernel, avoiding the use of userspace " +"buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:513 +#: ../../library/shutil.rst:517 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:515 +#: ../../library/shutil.rst:519 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: ../../library/shutil.rst:517 +#: ../../library/shutil.rst:521 msgid "" "On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB " -"instead of 64 KiB) and a :func:`memoryview`-based variant " -"of :func:`shutil.copyfileobj` is used." +"instead of 64 KiB) and a :func:`memoryview`-based variant of :func:`shutil." +"copyfileobj` is used." msgstr "" -#: ../../library/shutil.rst:521 +#: ../../library/shutil.rst:525 msgid "" "If the fast-copy operation fails and no data was written in the destination " -"file then shutil will silently fallback on using less " -"efficient :func:`copyfileobj` function internally." +"file then shutil will silently fallback on using less efficient :func:" +"`copyfileobj` function internally." msgstr "" -#: ../../library/shutil.rst:530 +#: ../../library/shutil.rst:534 msgid "copytree example" msgstr "copytree 範例" -#: ../../library/shutil.rst:532 +#: ../../library/shutil.rst:536 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:534 +#: ../../library/shutil.rst:538 msgid "" "from shutil import copytree, ignore_patterns\n" "\n" @@ -711,17 +717,17 @@ msgstr "" "\n" "copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*'))" -#: ../../library/shutil.rst:538 +#: ../../library/shutil.rst:542 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:541 +#: ../../library/shutil.rst:545 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:543 +#: ../../library/shutil.rst:547 msgid "" "from shutil import copytree\n" "import logging\n" @@ -733,11 +739,11 @@ msgid "" "copytree(source, destination, ignore=_logpath)" msgstr "" -#: ../../library/shutil.rst:556 +#: ../../library/shutil.rst:560 msgid "rmtree example" msgstr "rmtree 範例" -#: ../../library/shutil.rst:558 +#: ../../library/shutil.rst:562 msgid "" "This example shows how to remove a directory tree on Windows where some of " "the files have their read-only bit set. It uses the onexc callback to clear " @@ -745,7 +751,7 @@ msgid "" "propagate. ::" msgstr "" -#: ../../library/shutil.rst:563 +#: ../../library/shutil.rst:567 msgid "" "import os, stat\n" "import shutil\n" @@ -758,46 +764,46 @@ msgid "" "shutil.rmtree(directory, onexc=remove_readonly)" msgstr "" -#: ../../library/shutil.rst:576 +#: ../../library/shutil.rst:580 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:580 +#: ../../library/shutil.rst:584 msgid "Added support for the *xztar* format." msgstr "新增 *xztar* 格式的支援。" -#: ../../library/shutil.rst:584 +#: ../../library/shutil.rst:588 msgid "" "High-level utilities to create and read compressed and archived files are " "also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules." msgstr "" -#: ../../library/shutil.rst:589 +#: ../../library/shutil.rst:593 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:591 +#: ../../library/shutil.rst:595 msgid "" "*base_name* is the name of the file to create, including the path, minus any " "format-specific extension." msgstr "" -#: ../../library/shutil.rst:594 +#: ../../library/shutil.rst:598 msgid "" "*format* is the archive format: one of \"zip\" (if the :mod:`zlib` module is " "available), \"tar\", \"gztar\" (if the :mod:`zlib` module is available), " -"\"bztar\" (if the :mod:`bz2` module is available), or \"xztar\" (if " -"the :mod:`lzma` module is available)." +"\"bztar\" (if the :mod:`bz2` module is available), or \"xztar\" (if the :mod:" +"`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:599 +#: ../../library/shutil.rst:603 msgid "" "*root_dir* is a directory that will be the root directory of the archive, " "all paths in the archive will be relative to it; for example, we typically " "chdir into *root_dir* before creating the archive." msgstr "" -#: ../../library/shutil.rst:603 +#: ../../library/shutil.rst:607 msgid "" "*base_dir* is the directory where we start archiving from; i.e. *base_dir* " "will be the common prefix of all files and directories in the archive. " @@ -805,102 +811,102 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:609 +#: ../../library/shutil.rst:613 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:611 +#: ../../library/shutil.rst:615 msgid "" "If *dry_run* is true, no archive is created, but the operations that would " "be executed are logged to *logger*." msgstr "" -#: ../../library/shutil.rst:614 +#: ../../library/shutil.rst:618 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:617 +#: ../../library/shutil.rst:621 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: ../../library/shutil.rst:620 +#: ../../library/shutil.rst:624 msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:622 +#: ../../library/shutil.rst:626 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." msgstr "" -"引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的" -"\\ :ref:`稽核事件 ` ``shutil.make_archive``。" +"引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的\\ :" +"ref:`稽核事件 ` ``shutil.make_archive``。" -#: ../../library/shutil.rst:626 +#: ../../library/shutil.rst:630 msgid "" -"This function is not thread-safe when custom archivers registered " -"with :func:`register_archive_format` do not support the *root_dir* " -"argument. In this case it temporarily changes the current working directory " -"of the process to *root_dir* to perform archiving." +"This function is not thread-safe when custom archivers registered with :func:" +"`register_archive_format` do not support the *root_dir* argument. In this " +"case it temporarily changes the current working directory of the process to " +"*root_dir* to perform archiving." msgstr "" -#: ../../library/shutil.rst:632 +#: ../../library/shutil.rst:636 msgid "" "The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU " "format for archives created with ``format=\"tar\"``." msgstr "" -#: ../../library/shutil.rst:636 +#: ../../library/shutil.rst:640 msgid "" "This function is now made thread-safe during creation of standard ``.zip`` " "and tar archives." msgstr "" -#: ../../library/shutil.rst:642 +#: ../../library/shutil.rst:646 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:645 ../../library/shutil.rst:756 +#: ../../library/shutil.rst:649 ../../library/shutil.rst:760 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: ../../library/shutil.rst:647 +#: ../../library/shutil.rst:651 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:648 +#: ../../library/shutil.rst:652 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:649 ../../library/shutil.rst:761 +#: ../../library/shutil.rst:653 ../../library/shutil.rst:765 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:650 ../../library/shutil.rst:762 +#: ../../library/shutil.rst:654 ../../library/shutil.rst:766 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:651 ../../library/shutil.rst:763 +#: ../../library/shutil.rst:655 ../../library/shutil.rst:767 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:653 +#: ../../library/shutil.rst:657 msgid "" "You can register new formats or provide your own archiver for any existing " "formats, by using :func:`register_archive_format`." msgstr "" -#: ../../library/shutil.rst:659 +#: ../../library/shutil.rst:663 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:661 +#: ../../library/shutil.rst:665 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive the *base_name* of the file to create, followed by the " @@ -909,7 +915,7 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:667 +#: ../../library/shutil.rst:671 msgid "" "If *function* has the custom attribute ``function.supports_root_dir`` set to " "``True``, the *root_dir* argument is passed as a keyword argument. Otherwise " @@ -918,47 +924,46 @@ msgid "" "not thread-safe." msgstr "" -#: ../../library/shutil.rst:673 +#: ../../library/shutil.rst:677 msgid "" "If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be " "used as extra keywords arguments when the archiver callable is used." msgstr "" -#: ../../library/shutil.rst:676 +#: ../../library/shutil.rst:680 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:679 +#: ../../library/shutil.rst:683 msgid "Added support for functions supporting the *root_dir* argument." msgstr "" -#: ../../library/shutil.rst:685 +#: ../../library/shutil.rst:689 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:690 +#: ../../library/shutil.rst:694 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:692 +#: ../../library/shutil.rst:696 msgid "" "*extract_dir* is the name of the target directory where the archive is " "unpacked. If not provided, the current working directory is used." msgstr "" -#: ../../library/shutil.rst:695 +#: ../../library/shutil.rst:699 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " -"\"bztar\", or \"xztar\". Or any other format registered " -"with :func:`register_unpack_format`. If not " -"provided, :func:`unpack_archive` will use the archive file name extension " -"and see if an unpacker was registered for that extension. In case none is " -"found, a :exc:`ValueError` is raised." +"\"bztar\", or \"xztar\". Or any other format registered with :func:" +"`register_unpack_format`. If not provided, :func:`unpack_archive` will use " +"the archive file name extension and see if an unpacker was registered for " +"that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:702 +#: ../../library/shutil.rst:706 msgid "" "The keyword-only *filter* argument is passed to the underlying unpacking " "function. For zip files, *filter* is not accepted. For tar files, it is " @@ -968,7 +973,7 @@ msgid "" "Python 3.14." msgstr "" -#: ../../library/shutil.rst:710 +#: ../../library/shutil.rst:714 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." @@ -976,7 +981,7 @@ msgstr "" "引發一個附帶引數 ``filename``、``extract_dir``、``format`` 的\\ :ref:`稽核事" "件 ` ``shutil.unpack_archive``。" -#: ../../library/shutil.rst:714 +#: ../../library/shutil.rst:718 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -984,91 +989,91 @@ msgid "" "with \"/\" or filenames with two dots \"..\"." msgstr "" -#: ../../library/shutil.rst:719 +#: ../../library/shutil.rst:723 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:722 +#: ../../library/shutil.rst:726 msgid "Added the *filter* argument." msgstr "新增 *filter* 引數。" -#: ../../library/shutil.rst:727 +#: ../../library/shutil.rst:731 msgid "" "Registers an unpack format. *name* is the name of the format and " -"*extensions* is a list of extensions corresponding to the format, like " -"``.zip`` for Zip files." +"*extensions* is a list of extensions corresponding to the format, like ``." +"zip`` for Zip files." msgstr "" -#: ../../library/shutil.rst:731 +#: ../../library/shutil.rst:735 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive:" msgstr "" -#: ../../library/shutil.rst:734 +#: ../../library/shutil.rst:738 msgid "the path of the archive, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:735 +#: ../../library/shutil.rst:739 msgid "" "the directory the archive must be extracted to, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:736 +#: ../../library/shutil.rst:740 msgid "" -"possibly a *filter* keyword argument, if it was given " -"to :func:`unpack_archive`;" +"possibly a *filter* keyword argument, if it was given to :func:" +"`unpack_archive`;" msgstr "" -#: ../../library/shutil.rst:738 +#: ../../library/shutil.rst:742 msgid "" "additional keyword arguments, specified by *extra_args* as a sequence of " "``(name, value)`` tuples." msgstr "" -#: ../../library/shutil.rst:741 +#: ../../library/shutil.rst:745 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:747 +#: ../../library/shutil.rst:751 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:752 +#: ../../library/shutil.rst:756 msgid "" "Return a list of all registered formats for unpacking. Each element of the " "returned sequence is a tuple ``(name, extensions, description)``." msgstr "" -#: ../../library/shutil.rst:758 +#: ../../library/shutil.rst:762 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:760 +#: ../../library/shutil.rst:764 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:765 +#: ../../library/shutil.rst:769 msgid "" "You can register new formats or provide your own unpacker for any existing " "formats, by using :func:`register_unpack_format`." msgstr "" -#: ../../library/shutil.rst:772 +#: ../../library/shutil.rst:776 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:774 +#: ../../library/shutil.rst:778 msgid "" "In this example, we create a gzip'ed tar-file archive containing all files " "found in the :file:`.ssh` directory of the user::" msgstr "" -#: ../../library/shutil.rst:777 +#: ../../library/shutil.rst:781 msgid "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1078,11 +1083,11 @@ msgid "" "'/Users/tarek/myarchive.tar.gz'" msgstr "" -#: ../../library/shutil.rst:784 +#: ../../library/shutil.rst:788 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:786 +#: ../../library/shutil.rst:790 msgid "" "$ tar -tzvf /Users/tarek/myarchive.tar.gz\n" "drwx------ tarek/staff 0 2010-02-01 16:23:40 ./\n" @@ -1104,18 +1109,18 @@ msgstr "" "-rw-r--r-- tarek/staff 397 2008-06-09 13:26:54 ./id_rsa.pub\n" "-rw-r--r-- tarek/staff 37192 2010-02-06 18:23:10 ./known_hosts" -#: ../../library/shutil.rst:802 +#: ../../library/shutil.rst:806 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:804 +#: ../../library/shutil.rst:808 msgid "" "In this example, similar to the `one above `_, we " "show how to use :func:`make_archive`, but this time with the usage of " "*base_dir*. We now have the following directory structure:" msgstr "" -#: ../../library/shutil.rst:808 +#: ../../library/shutil.rst:812 msgid "" "$ tree tmp\n" "tmp\n" @@ -1133,13 +1138,13 @@ msgstr "" " └── please_add.txt\n" " └── do_not_add.txt" -#: ../../library/shutil.rst:818 +#: ../../library/shutil.rst:822 msgid "" -"In the final archive, :file:`please_add.txt` should be included, " -"but :file:`do_not_add.txt` should not. Therefore we use the following::" +"In the final archive, :file:`please_add.txt` should be included, but :file:" +"`do_not_add.txt` should not. Therefore we use the following::" msgstr "" -#: ../../library/shutil.rst:821 +#: ../../library/shutil.rst:825 msgid "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1163,11 +1168,11 @@ msgstr "" "... )\n" "'/Users/tarek/my_archive.tar'" -#: ../../library/shutil.rst:832 +#: ../../library/shutil.rst:836 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:834 +#: ../../library/shutil.rst:838 msgid "" "$ python -m tarfile -l /Users/tarek/myarchive.tar\n" "structure/content/\n" @@ -1177,29 +1182,29 @@ msgstr "" "structure/content/\n" "structure/content/please_add.txt" -#: ../../library/shutil.rst:842 +#: ../../library/shutil.rst:846 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:846 +#: ../../library/shutil.rst:850 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:848 +#: ../../library/shutil.rst:852 msgid "" "For each of the two dimensions, the environment variable, ``COLUMNS`` and " "``LINES`` respectively, is checked. If the variable is defined and the value " "is a positive integer, it is used." msgstr "" -#: ../../library/shutil.rst:852 +#: ../../library/shutil.rst:856 msgid "" "When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the " -"terminal connected to :data:`sys.__stdout__` is queried by " -"invoking :func:`os.get_terminal_size`." +"terminal connected to :data:`sys.__stdout__` is queried by invoking :func:" +"`os.get_terminal_size`." msgstr "" -#: ../../library/shutil.rst:856 +#: ../../library/shutil.rst:860 msgid "" "If the terminal size cannot be successfully queried, either because the " "system doesn't support querying, or because we are not connected to a " @@ -1208,17 +1213,17 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:862 +#: ../../library/shutil.rst:866 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:864 +#: ../../library/shutil.rst:868 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: ../../library/shutil.rst:869 +#: ../../library/shutil.rst:873 msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index fb08a83de7..b03e6092a8 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -31,8 +31,8 @@ msgstr "Adam Turner" #: ../../whatsnew/3.12.rst:48 msgid "" "This article explains the new features in Python 3.12, compared to 3.11. " -"Python 3.12 was released on October 2, 2023. For full details, see the :ref:" -"`changelog `." +"Python 3.12 was released on October 2, 2023. For full details, see " +"the :ref:`changelog `." msgstr "" "本文介紹了 Python 3.12 與 3.11 相比多了哪些新功能。 Python 3.12 於 2023 年 " "10 月 2 日發布。完整詳情請見 :ref:`changelog `。" @@ -55,18 +55,18 @@ msgid "" "improvements, and several modules have better performance." msgstr "" "Python 3.12 是 Python 程式語言的穩定版本,包含了語言和標準函式庫的綜合變更。" -"標準函式庫的變更主要集中在清理棄用的 API、可用性和正確性。值得注意的是,:mod:" -"`!distutils` 套件已從標準函式庫中移除。:mod:`os` 和 :mod:`pathlib` 中的檔案系" -"統支援進行了許多改進,並且有數個模組得到更好的效能。" +"標準函式庫的變更主要集中在清理棄用的 API、可用性和正確性。值得注意的" +"是,:mod:`!distutils` 套件已從標準函式庫中移除。:mod:`os` 和 :mod:`pathlib` " +"中的檔案系統支援進行了許多改進,並且有數個模組得到更好的效能。" #: ../../whatsnew/3.12.rst:69 msgid "" "The language changes focus on usability, as :term:`f-strings ` " "have had many limitations removed and 'Did you mean ...' suggestions " "continue to improve. The new :ref:`type parameter syntax ` and :keyword:`type` statement improve ergonomics for using :term:" -"`generic types ` and :term:`type aliases ` with " -"static type checkers." +"pep695>` and :keyword:`type` statement improve ergonomics for " +"using :term:`generic types ` and :term:`type aliases ` with static type checkers." msgstr "" "語言變更主要集中在可用性,因為 :term:`f-字串 `\\ 已經移除了許多限" "制,並且持續改進 'Did you mean ...' 建議。新的\\ :ref:`型別參數語法 " @@ -95,8 +95,8 @@ msgstr "新增語法特性:" #: ../../whatsnew/3.12.rst:92 msgid "" -":ref:`PEP 695 `, type parameter syntax and the :keyword:" -"`type` statement" +":ref:`PEP 695 `, type parameter syntax and " +"the :keyword:`type` statement" msgstr "" ":ref:`PEP 695 `,型別參數語法和 :keyword:`type` 陳述式" @@ -129,8 +129,8 @@ msgstr ":ref:`PEP 669 `,低影響監控" #: ../../whatsnew/3.12.rst:103 msgid "" -"`Improved 'Did you mean ...' suggestions `_ for :" -"exc:`NameError`, :exc:`ImportError`, and :exc:`SyntaxError` exceptions" +"`Improved 'Did you mean ...' suggestions `_ " +"for :exc:`NameError`, :exc:`ImportError`, and :exc:`SyntaxError` exceptions" msgstr "" #: ../../whatsnew/3.12.rst:106 @@ -157,15 +157,15 @@ msgstr ":mod:`os` 模組在 Windows 支援上有了數項改進" #: ../../whatsnew/3.12.rst:115 msgid "" -"A :ref:`command-line interface ` has been added to the :mod:" -"`sqlite3` module" +"A :ref:`command-line interface ` has been added to " +"the :mod:`sqlite3` module" msgstr "" "一個\\ :ref:`命令列介面 `\\ 已被加入 :mod:`sqlite3` 模組中" #: ../../whatsnew/3.12.rst:117 msgid "" -":func:`isinstance` checks against :func:`runtime-checkable protocols ` enjoy a speed up of between two and 20 times" +":func:`isinstance` checks against :func:`runtime-checkable protocols " +"` enjoy a speed up of between two and 20 times" msgstr "" #: ../../whatsnew/3.12.rst:119 @@ -236,8 +236,8 @@ msgid "" ":ref:`PEP 692 `, using :class:`~typing.TypedDict` to " "annotate :term:`**kwargs `" msgstr "" -":ref:`PEP 692 `、使用 :class:`~typing.TypedDict` 來標註 :" -"term:`**kwargs `" +":ref:`PEP 692 `、使用 :class:`~typing.TypedDict` 來標" +"註 :term:`**kwargs `" #: ../../whatsnew/3.12.rst:149 msgid ":ref:`PEP 698 `, :func:`typing.override` decorator" @@ -277,9 +277,9 @@ msgid "" "removed, along with several :class:`unittest.TestCase` `method aliases " "`_." msgstr "" -":mod:`!asynchat`、:mod:`!asyncore` 和 :mod:`!imp` 模組以及幾個 :class:" -"`unittest.TestCase` 的\\ `方法別名 `_\\ " -"已被刪除。" +":mod:`!asynchat`、:mod:`!asyncore` 和 :mod:`!imp` 模組以及幾" +"個 :class:`unittest.TestCase` 的\\ `方法別名 `_\\ 已被刪除。" #: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1840 msgid "New Features" @@ -298,8 +298,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:187 msgid "" -":pep:`695` introduces a new, more compact and explicit way to create :ref:" -"`generic classes ` and :ref:`functions ` and :ref:`functions `::" msgstr "" @@ -346,9 +346,9 @@ msgstr "type Point[T] = tuple[T, T]" #: ../../whatsnew/3.12.rst:210 msgid "" -"The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" -"`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " -"parameters with bounds or constraints::" +"The new syntax allows declaring :class:`~typing.TypeVarTuple` " +"and :class:`~typing.ParamSpec` parameters, as well " +"as :class:`~typing.TypeVar` parameters with bounds or constraints::" msgstr "" #: ../../whatsnew/3.12.rst:214 @@ -444,10 +444,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:290 msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " -"couldn't contain any ``\\`` character. This also affected unicode :ref:" -"`escape sequences ` (such as ``\\N{snowman}``) as these " -"contain the ``\\N`` part that previously could not be part of expression " -"components of f-strings. Now, you can define expressions like this:" +"couldn't contain any ``\\`` character. This also affected " +"unicode :ref:`escape sequences ` (such as ``\\N{snowman}" +"``) as these contain the ``\\N`` part that previously could not be part of " +"expression components of f-strings. Now, you can define expressions like " +"this:" msgstr "" #: ../../whatsnew/3.12.rst:303 @@ -587,16 +588,17 @@ msgstr "" #: ../../whatsnew/3.12.rst:386 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " -"` from Python code. Classes that implement the :meth:`~object." -"__buffer__` method are now usable as buffer types." +"` from Python code. Classes that implement " +"the :meth:`~object.__buffer__` method are now usable as buffer types." msgstr "" #: ../../whatsnew/3.12.rst:390 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " -"represent buffer objects, for example in type annotations. The new :class:" -"`inspect.BufferFlags` enum represents the flags that can be used to " -"customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" +"represent buffer objects, for example in type annotations. The " +"new :class:`inspect.BufferFlags` enum represents the flags that can be used " +"to customize buffer creation. (Contributed by Jelle Zijlstra " +"in :gh:`102500`.)" msgstr "" #: ../../whatsnew/3.12.rst:399 @@ -675,8 +677,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:459 msgid "" "Improve the :exc:`SyntaxError` error message when the user types ``import x " -"from y`` instead of ``from y import x``. (Contributed by Pablo Galindo in :" -"gh:`98931`.)" +"from y`` instead of ``from y import x``. (Contributed by Pablo Galindo " +"in :gh:`98931`.)" msgstr "" #: ../../whatsnew/3.12.rst:469 @@ -693,8 +695,8 @@ msgstr "型別提示相關的新特性" #: ../../whatsnew/3.12.rst:482 msgid "" -"This section covers major changes affecting :pep:`type hints <484>` and the :" -"mod:`typing` module." +"This section covers major changes affecting :pep:`type hints <484>` and " +"the :mod:`typing` module." msgstr "" "本節涵蓋了影響\\ :pep:`型別提示 <484>`\\ 和 :mod:`typing` 模組的主要變更。" @@ -801,17 +803,18 @@ msgid "" "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " "``re.compile(\"\\d+\\.\\d+\")`` now emits a :exc:`SyntaxWarning` " "(``\"\\d\"`` is an invalid escape sequence, use raw strings for regular " -"expression: ``re.compile(r\"\\d+\\.\\d+\")``). In a future Python version, :" -"exc:`SyntaxError` will eventually be raised, instead of :exc:" -"`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" +"expression: ``re.compile(r\"\\d+\\.\\d+\")``). In a future Python " +"version, :exc:`SyntaxError` will eventually be raised, instead " +"of :exc:`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" #: ../../whatsnew/3.12.rst:557 msgid "" "Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " -"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" -"exc:`DeprecationWarning`. In a future Python version they will be eventually " -"a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" +"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead " +"of :exc:`DeprecationWarning`. In a future Python version they will be " +"eventually a :exc:`SyntaxError`. (Contributed by Victor Stinner " +"in :gh:`98401`.)" msgstr "" #: ../../whatsnew/3.12.rst:563 @@ -834,9 +837,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:574 msgid "" "When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " -"and raises one other exception, that exception is no longer wrapped in an :" -"exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by Irit " -"Katriel in :gh:`103590`.)" +"and raises one other exception, that exception is no longer wrapped in " +"an :exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by " +"Irit Katriel in :gh:`103590`.)" msgstr "" #: ../../whatsnew/3.12.rst:579 @@ -845,8 +848,8 @@ msgid "" "Python bytecode evaluation loop instead of object allocations. The GC can " "also run when :c:func:`PyErr_CheckSignals` is called so C extensions that " "need to run for a long time without executing any Python code also have a " -"chance to execute the GC periodically. (Contributed by Pablo Galindo in :gh:" -"`97922`.)" +"chance to execute the GC periodically. (Contributed by Pablo Galindo " +"in :gh:`97922`.)" msgstr "" #: ../../whatsnew/3.12.rst:586 @@ -902,12 +905,13 @@ msgstr "" #: ../../whatsnew/3.12.rst:616 msgid "" "Add :ref:`support for the perf profiler ` through the new " -"environment variable :envvar:`PYTHONPERFSUPPORT` and command-line option :" -"option:`-X perf <-X>`, as well as the new :func:`sys." -"activate_stack_trampoline`, :func:`sys.deactivate_stack_trampoline`, and :" -"func:`sys.is_stack_trampoline_active` functions. (Design by Pablo Galindo. " -"Contributed by Pablo Galindo and Christian Heimes with contributions from " -"Gregory P. Smith [Google] and Mark Shannon in :gh:`96123`.)" +"environment variable :envvar:`PYTHONPERFSUPPORT` and command-line " +"option :option:`-X perf <-X>`, as well as the " +"new :func:`sys.activate_stack_trampoline`, :func:`sys.deactivate_stack_trampoline`, " +"and :func:`sys.is_stack_trampoline_active` functions. (Design by Pablo " +"Galindo. Contributed by Pablo Galindo and Christian Heimes with " +"contributions from Gregory P. Smith [Google] and Mark Shannon " +"in :gh:`96123`.)" msgstr "" #: ../../whatsnew/3.12.rst:628 @@ -928,8 +932,8 @@ msgstr "array" #: ../../whatsnew/3.12.rst:639 msgid "" -"The :class:`array.array` class now supports subscripting, making it a :term:" -"`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" +"The :class:`array.array` class now supports subscripting, making it " +"a :term:`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" #: ../../whatsnew/3.12.rst:643 @@ -946,25 +950,28 @@ msgstr "" #: ../../whatsnew/3.12.rst:650 msgid "" -"Add :func:`asyncio.eager_task_factory` and :func:`asyncio." -"create_eager_task_factory` functions to allow opting an event loop in to " -"eager task execution, making some use-cases 2x to 5x faster. (Contributed by " -"Jacob Bower & Itamar Oren in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" +"Add :func:`asyncio.eager_task_factory` " +"and :func:`asyncio.create_eager_task_factory` functions to allow opting an " +"event loop in to eager task execution, making some use-cases 2x to 5x " +"faster. (Contributed by Jacob Bower & Itamar Oren " +"in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" #: ../../whatsnew/3.12.rst:655 msgid "" "On Linux, :mod:`asyncio` uses :class:`asyncio.PidfdChildWatcher` by default " -"if :func:`os.pidfd_open` is available and functional instead of :class:" -"`asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya in :gh:`98024`.)" +"if :func:`os.pidfd_open` is available and functional instead " +"of :class:`asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya " +"in :gh:`98024`.)" msgstr "" #: ../../whatsnew/3.12.rst:660 msgid "" -"The event loop now uses the best available child watcher for each platform (:" -"class:`asyncio.PidfdChildWatcher` if supported and :class:`asyncio." -"ThreadedChildWatcher` otherwise), so manually configuring a child watcher is " -"not recommended. (Contributed by Kumar Aditya in :gh:`94597`.)" +"The event loop now uses the best available child watcher for each platform " +"(:class:`asyncio.PidfdChildWatcher` if supported " +"and :class:`asyncio.ThreadedChildWatcher` otherwise), so manually " +"configuring a child watcher is not recommended. (Contributed by Kumar Aditya " +"in :gh:`94597`.)" msgstr "" #: ../../whatsnew/3.12.rst:666 @@ -981,9 +988,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:673 msgid "" -":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" -"`asyncio` does not support legacy generator-based coroutines. (Contributed " -"by Kumar Aditya in :gh:`102748`.)" +":func:`asyncio.iscoroutine` now returns ``False`` for generators " +"as :mod:`asyncio` does not support legacy generator-based coroutines. " +"(Contributed by Kumar Aditya in :gh:`102748`.)" msgstr "" #: ../../whatsnew/3.12.rst:677 @@ -999,8 +1006,8 @@ msgstr "calendar" #: ../../whatsnew/3.12.rst:684 msgid "" "Add enums :data:`calendar.Month` and :data:`calendar.Day` defining months of " -"the year and days of the week. (Contributed by Prince Roshan in :gh:" -"`103636`.)" +"the year and days of the week. (Contributed by Prince Roshan " +"in :gh:`103636`.)" msgstr "" #: ../../whatsnew/3.12.rst:689 @@ -1010,8 +1017,8 @@ msgstr "csv" #: ../../whatsnew/3.12.rst:691 msgid "" "Add :const:`csv.QUOTE_NOTNULL` and :const:`csv.QUOTE_STRINGS` flags to " -"provide finer grained control of ``None`` and empty strings by :class:`~csv." -"reader` and :class:`~csv.writer` objects." +"provide finer grained control of ``None`` and empty strings " +"by :class:`~csv.reader` and :class:`~csv.writer` objects." msgstr "" #: ../../whatsnew/3.12.rst:696 @@ -1021,10 +1028,10 @@ msgstr "dis" #: ../../whatsnew/3.12.rst:698 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " -"in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" -"`HAVE_ARGUMENT` is still relevant to real opcodes, but it is not useful for " -"pseudo instructions. Use the new :data:`dis.hasarg` collection instead. " -"(Contributed by Irit Katriel in :gh:`94216`.)" +"in executable bytecode) are now exposed in the :mod:`dis` " +"module. :opcode:`HAVE_ARGUMENT` is still relevant to real opcodes, but it is " +"not useful for pseudo instructions. Use the new :data:`dis.hasarg` " +"collection instead. (Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" #: ../../whatsnew/3.12.rst:706 @@ -1118,8 +1125,8 @@ msgid "" "Add :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -"新增 :func:`math.sumprod` 以計算乘積總和。(由 Raymond Hettinger 於 :gh:" -"`100485` 中貢獻。)" +"新增 :func:`math.sumprod` 以計算乘積總和。(由 Raymond Hettinger " +"於 :gh:`100485` 中貢獻。)" #: ../../whatsnew/3.12.rst:752 msgid "" @@ -1134,16 +1141,16 @@ msgstr "os" #: ../../whatsnew/3.12.rst:759 msgid "" -"Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" -"func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" -"gh:`93312`.)" +"Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process " +"with :func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar " +"Aditya in :gh:`93312`.)" msgstr "" #: ../../whatsnew/3.12.rst:763 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " -"to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" -"`99547`.)" +"to check if the entry is a junction. (Contributed by Charles Machalow " +"in :gh:`99547`.)" msgstr "" #: ../../whatsnew/3.12.rst:767 @@ -1162,8 +1169,8 @@ msgid "" "with other platforms). ``st_dev`` may be up to 64 bits and ``st_ino`` up to " "128 bits depending on your file system, and ``st_rdev`` is always set to " "zero rather than incorrect values. Both functions may be significantly " -"faster on newer releases of Windows. (Contributed by Steve Dower in :gh:" -"`99726`.)" +"faster on newer releases of Windows. (Contributed by Steve Dower " +"in :gh:`99726`.)" msgstr "" #: ../../whatsnew/3.12.rst:782 @@ -1192,10 +1199,10 @@ msgstr "pathlib" #: ../../whatsnew/3.12.rst:793 msgid "" -"Add support for subclassing :class:`pathlib.PurePath` and :class:`pathlib." -"Path`, plus their Posix- and Windows-specific variants. Subclasses may " -"override the :meth:`pathlib.PurePath.with_segments` method to pass " -"information between path instances." +"Add support for subclassing :class:`pathlib.PurePath` " +"and :class:`pathlib.Path`, plus their Posix- and Windows-specific variants. " +"Subclasses may override the :meth:`pathlib.PurePath.with_segments` method to " +"pass information between path instances." msgstr "" #: ../../whatsnew/3.12.rst:798 @@ -1209,22 +1216,23 @@ msgstr "" msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " -"consistent with :func:`os.path.relpath`. (Contributed by Domenico Ragusa in :" -"gh:`84538`.)" +"consistent with :func:`os.path.relpath`. (Contributed by Domenico Ragusa " +"in :gh:`84538`.)" msgstr "" #: ../../whatsnew/3.12.rst:807 msgid "" -"Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." -"isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" +"Add :meth:`pathlib.Path.is_junction` as a proxy " +"to :func:`os.path.isjunction`. (Contributed by Charles Machalow " +"in :gh:`99547`.)" msgstr "" #: ../../whatsnew/3.12.rst:810 msgid "" -"Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" -"`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " -"path's case sensitivity, allowing for more precise control over the matching " -"process." +"Add *case_sensitive* optional parameter " +"to :meth:`pathlib.Path.glob`, :meth:`pathlib.Path.rglob` " +"and :meth:`pathlib.PurePath.match` for matching the path's case sensitivity, " +"allowing for more precise control over the matching process." msgstr "" #: ../../whatsnew/3.12.rst:815 @@ -1256,8 +1264,8 @@ msgstr "random" #: ../../whatsnew/3.12.rst:833 msgid "" -"Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :gh:" -"`81620`.)" +"Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger " +"in :gh:`81620`.)" msgstr "" "新增 :func:`random.binomialvariate`。(由 Raymond Hettinger 於 :gh:`81620` 中" "貢獻。)" @@ -1321,29 +1329,31 @@ msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -"新增\\ :ref:`命令列介面 `。(由 Erlend E. Aasland 於 :gh:" -"`77617` 中貢獻。)" +"新增\\ :ref:`命令列介面 `。(由 Erlend E. Aasland " +"於 :gh:`77617` 中貢獻。)" #: ../../whatsnew/3.12.rst:874 msgid "" -"Add the :attr:`sqlite3.Connection.autocommit` attribute to :class:`sqlite3." -"Connection` and the *autocommit* parameter to :func:`sqlite3.connect` to " -"control :pep:`249`-compliant :ref:`transaction handling `. (Contributed by Erlend E. Aasland in :gh:`83638`.)" +"Add the :attr:`sqlite3.Connection.autocommit` attribute " +"to :class:`sqlite3.Connection` and the *autocommit* parameter " +"to :func:`sqlite3.connect` to control :pep:`249`-compliant :ref:`transaction " +"handling `. (Contributed by Erlend " +"E. Aasland in :gh:`83638`.)" msgstr "" #: ../../whatsnew/3.12.rst:881 msgid "" -"Add *entrypoint* keyword-only parameter to :meth:`sqlite3.Connection." -"load_extension`, for overriding the SQLite extension entry point. " -"(Contributed by Erlend E. Aasland in :gh:`103015`.)" +"Add *entrypoint* keyword-only parameter " +"to :meth:`sqlite3.Connection.load_extension`, for overriding the SQLite " +"extension entry point. (Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" #: ../../whatsnew/3.12.rst:886 msgid "" -"Add :meth:`sqlite3.Connection.getconfig` and :meth:`sqlite3.Connection." -"setconfig` to :class:`sqlite3.Connection` to make configuration changes to a " -"database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" +"Add :meth:`sqlite3.Connection.getconfig` " +"and :meth:`sqlite3.Connection.setconfig` to :class:`sqlite3.Connection` to " +"make configuration changes to a database connection. (Contributed by Erlend " +"E. Aasland in :gh:`103489`.)" msgstr "" #: ../../whatsnew/3.12.rst:892 @@ -1364,27 +1374,28 @@ msgstr "sys" #: ../../whatsnew/3.12.rst:901 msgid "" "Add the :mod:`sys.monitoring` namespace to expose the new :ref:`PEP 669 " -"` monitoring API. (Contributed by Mark Shannon in :gh:" -"`103082`.)" +"` monitoring API. (Contributed by Mark Shannon " +"in :gh:`103082`.)" msgstr "" #: ../../whatsnew/3.12.rst:905 msgid "" -"Add :func:`sys.activate_stack_trampoline` and :func:`sys." -"deactivate_stack_trampoline` for activating and deactivating stack profiler " -"trampolines, and :func:`sys.is_stack_trampoline_active` for querying if " -"stack profiler trampolines are active. (Contributed by Pablo Galindo and " -"Christian Heimes with contributions from Gregory P. Smith [Google] and Mark " -"Shannon in :gh:`96123`.)" +"Add :func:`sys.activate_stack_trampoline` " +"and :func:`sys.deactivate_stack_trampoline` for activating and deactivating " +"stack profiler trampolines, and :func:`sys.is_stack_trampoline_active` for " +"querying if stack profiler trampolines are active. (Contributed by Pablo " +"Galindo and Christian Heimes with contributions from Gregory P. Smith " +"[Google] and Mark Shannon in :gh:`96123`.)" msgstr "" #: ../../whatsnew/3.12.rst:914 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " -"that have the same information in its legacy form: :data:`sys.last_type`, :" -"data:`sys.last_value` and :data:`sys.last_traceback`. (Contributed by Irit " -"Katriel in :gh:`102778`.)" +"that have the same information in its legacy " +"form: :data:`sys.last_type`, :data:`sys.last_value` " +"and :data:`sys.last_traceback`. (Contributed by Irit Katriel " +"in :gh:`102778`.)" msgstr "" #: ../../whatsnew/3.12.rst:920 ../../whatsnew/3.12.rst:1739 @@ -1428,10 +1439,10 @@ msgstr "threading" #: ../../whatsnew/3.12.rst:940 msgid "" -"Add :func:`threading.settrace_all_threads` and :func:`threading." -"setprofile_all_threads` that allow to set tracing and profiling functions in " -"all running threads in addition to the calling one. (Contributed by Pablo " -"Galindo in :gh:`93503`.)" +"Add :func:`threading.settrace_all_threads` " +"and :func:`threading.setprofile_all_threads` that allow to set tracing and " +"profiling functions in all running threads in addition to the calling one. " +"(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" #: ../../whatsnew/3.12.rst:946 @@ -1455,9 +1466,9 @@ msgstr "tokenize" #: ../../whatsnew/3.12.rst:959 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " -"(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" -"ref:`whatsnew312-porting-to-python312` for more information on the changes " -"to the :mod:`tokenize` module." +"(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) " +"See :ref:`whatsnew312-porting-to-python312` for more information on the " +"changes to the :mod:`tokenize` module." msgstr "" #: ../../whatsnew/3.12.rst:965 @@ -1466,9 +1477,9 @@ msgstr "types" #: ../../whatsnew/3.12.rst:967 msgid "" -"Add :func:`types.get_original_bases` to allow for further introspection of :" -"ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" -"Balfe and Alex Waygood in :gh:`101827`.)" +"Add :func:`types.get_original_bases` to allow for further introspection " +"of :ref:`user-defined-generics` when subclassed. (Contributed by James " +"Hilton-Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" #: ../../whatsnew/3.12.rst:974 @@ -1477,15 +1488,16 @@ msgstr "typing" #: ../../whatsnew/3.12.rst:976 msgid "" -":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" -"`hasattr` to lookup whether attributes exist. This means that descriptors " -"and :meth:`~object.__getattr__` methods are no longer unexpectedly evaluated " -"during ``isinstance()`` checks against runtime-checkable protocols. However, " -"it may also mean that some objects which used to be considered instances of " -"a runtime-checkable protocol may no longer be considered instances of that " -"protocol on Python 3.12+, and vice versa. Most users are unlikely to be " -"affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" +":func:`isinstance` checks against :func:`runtime-checkable protocols " +"` now use :func:`inspect.getattr_static` rather " +"than :func:`hasattr` to lookup whether attributes exist. This means that " +"descriptors and :meth:`~object.__getattr__` methods are no longer " +"unexpectedly evaluated during ``isinstance()`` checks against runtime-" +"checkable protocols. However, it may also mean that some objects which used " +"to be considered instances of a runtime-checkable protocol may no longer be " +"considered instances of that protocol on Python 3.12+, and vice versa. Most " +"users are unlikely to be affected by this change. (Contributed by Alex " +"Waygood in :gh:`102433`.)" msgstr "" #: ../../whatsnew/3.12.rst:987 @@ -1546,8 +1558,8 @@ msgid "" "Most ``isinstance()`` checks against protocols with only a few members " "should be at least 2x faster than in 3.11, and some may be 20x faster or " "more. However, ``isinstance()`` checks against protocols with many members " -"may be slower than in Python 3.11. (Contributed by Alex Waygood in :gh:" -"`74690` and :gh:`103193`.)" +"may be slower than in Python 3.11. (Contributed by Alex Waygood " +"in :gh:`74690` and :gh:`103193`.)" msgstr "" #: ../../whatsnew/3.12.rst:1020 @@ -1650,8 +1662,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1072 msgid "" -"Speed up the regular expression substitution (functions :func:`re.sub` and :" -"func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " +"Speed up the regular expression substitution (functions :func:`re.sub` " +"and :func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " "replacement strings containing group references by 2--3 times. (Contributed " "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" @@ -1667,16 +1679,16 @@ msgstr "" #: ../../whatsnew/3.12.rst:1080 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " -"are up to 64% faster as a side effect of the changes required to cover :pep:" -"`701` in the :mod:`tokenize` module. (Contributed by Marta Gómez Macías and " -"Pablo Galindo in :gh:`102856`.)" +"are up to 64% faster as a side effect of the changes required to " +"cover :pep:`701` in the :mod:`tokenize` module. (Contributed by Marta Gómez " +"Macías and Pablo Galindo in :gh:`102856`.)" msgstr "" #: ../../whatsnew/3.12.rst:1085 msgid "" -"Speed up :func:`super` method calls and attribute loads via the new :opcode:" -"`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " -"Matveev in :gh:`103497`.)" +"Speed up :func:`super` method calls and attribute loads via the " +"new :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and " +"Vladimir Matveev in :gh:`103497`.)" msgstr "" #: ../../whatsnew/3.12.rst:1091 @@ -1685,28 +1697,29 @@ msgstr "CPython 位元組碼變更" #: ../../whatsnew/3.12.rst:1093 msgid "" -"Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged into :" -"opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" -"`!LOAD_METHOD` instruction if the low bit of its oparg is set. (Contributed " -"by Ken Jin in :gh:`93429`.)" +"Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged " +"into :opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the " +"old :opcode:`!LOAD_METHOD` instruction if the low bit of its oparg is set. " +"(Contributed by Ken Jin in :gh:`93429`.)" msgstr "" -"移除 :opcode:`!LOAD_METHOD` 指令。它已經合併至 :opcode:`LOAD_ATTR`。:opcode:" -"`LOAD_ATTR` 現在會像舊的 :opcode:`!LOAD_METHOD` 指令一樣行為,如果其 oparg 的" -"低位元 (low bit) 有被設定。(由 Ken Jin 於 :gh:`93429` 中貢獻。)" +"移除 :opcode:`!LOAD_METHOD` 指令。它已經合併" +"至 :opcode:`LOAD_ATTR`。:opcode:`LOAD_ATTR` 現在會像舊的 :opcode:`!" +"LOAD_METHOD` 指令一樣行為,如果其 oparg 的低位元 (low bit) 有被設定。(由 " +"Ken Jin 於 :gh:`93429` 中貢獻。)" #: ../../whatsnew/3.12.rst:1098 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" -"JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" -"`102859`.)" +"JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel " +"in :gh:`102859`.)" msgstr "" "移除 :opcode:`!JUMP_IF_FALSE_OR_POP` 和 :opcode:`!JUMP_IF_TRUE_OR_POP` 指令。" "(由 Irit Katriel 於 :gh:`102859` 中貢獻。)" #: ../../whatsnew/3.12.rst:1101 msgid "" -"Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" -"gh:`92925`.)" +"Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon " +"in :gh:`92925`.)" msgstr "" "移除 :opcode:`!PRECALL` 指令。(由 Mark Shannon 於 :gh:`92925` 中貢獻。)" @@ -1744,8 +1757,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1116 msgid "" -"Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" -"`103082`.)" +"Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon " +"in :gh:`103082`.)" msgstr "" "新增 :opcode:`!END_SEND` 指令。(由 Mark Shannon 於 :gh:`103082` 中貢獻。)" @@ -1767,30 +1780,31 @@ msgstr "" #: ../../whatsnew/3.12.rst:1125 msgid "" -"Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" -"`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " -"the implementation of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` " -"opcode, which can be replaced with :opcode:`LOAD_LOCALS` plus :opcode:" -"`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" +"Add " +"the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:`LOAD_FROM_DICT_OR_GLOBALS`, " +"and :opcode:`LOAD_LOCALS` opcodes as part of the implementation " +"of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` opcode, which can be " +"replaced with :opcode:`LOAD_LOCALS` plus :opcode:`LOAD_FROM_DICT_OR_DEREF`. " +"(Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" "新增 :opcode:`LOAD_FROM_DICT_OR_DEREF`、:opcode:`LOAD_FROM_DICT_OR_GLOBALS` " "和 :opcode:`LOAD_LOCALS` 操作碼作為 :pep:`695` 實作的一部分。移除 :opcode:`!" -"LOAD_CLASSDEREF` 操作碼,可以用 :opcode:`LOAD_LOCALS` 加上 :opcode:" -"`LOAD_FROM_DICT_OR_DEREF` 來取代。(由 Jelle Zijlstra 於 :gh:`103764` 中貢" -"獻。)" +"LOAD_CLASSDEREF` 操作碼,可以用 :opcode:`LOAD_LOCALS` 加" +"上 :opcode:`LOAD_FROM_DICT_OR_DEREF` 來取代。(由 Jelle Zijlstra " +"於 :gh:`103764` 中貢獻。)" #: ../../whatsnew/3.12.rst:1131 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -"新增 :opcode:`LOAD_SUPER_ATTR` 指令。(由 Carl Meyer 和 Vladimir Matveev 於 :" -"gh:`103497` 中貢獻。)" +"新增 :opcode:`LOAD_SUPER_ATTR` 指令。(由 Carl Meyer 和 Vladimir Matveev " +"於 :gh:`103497` 中貢獻。)" #: ../../whatsnew/3.12.rst:1134 msgid "" -"Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :" -"gh:`101632`.)" +"Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang " +"in :gh:`101632`.)" msgstr "" "新增 :opcode:`RETURN_CONST` 指令。(由 Wenyang Wang 於 :gh:`101632` 中貢" "獻。)" @@ -1867,8 +1881,8 @@ msgstr ":class:`!ast.Ellipsis`" #: ../../whatsnew/3.12.rst:1168 #: ../../deprecations/pending-removal-in-3.14.rst:19 msgid "" -"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" -"`90953`.)" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka " +"in :gh:`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" @@ -1880,24 +1894,23 @@ msgstr ":mod:`asyncio`:" #: ../../whatsnew/3.12.rst:1173 msgid "" -"The child watcher classes :class:`asyncio.MultiLoopChildWatcher`, :class:" -"`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` and :class:" -"`asyncio.SafeChildWatcher` are deprecated and will be removed in Python " -"3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +"The child watcher " +"classes :class:`asyncio.MultiLoopChildWatcher`, :class:`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` " +"and :class:`asyncio.SafeChildWatcher` are deprecated and will be removed in " +"Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" #: ../../whatsnew/3.12.rst:1179 #: ../../deprecations/pending-removal-in-3.14.rst:30 msgid "" -":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" -"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." -"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " -"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:`asyncio.AbstractEventLoopPolicy.set_child_watcher` " +"and :meth:`asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated " +"and will be removed in Python 3.14. (Contributed by Kumar Aditya " +"in :gh:`94597`.)" msgstr "" -":func:`asyncio.set_child_watcher`、:func:`asyncio.get_child_watcher`、:meth:" -"`asyncio.AbstractEventLoopPolicy.set_child_watcher` 和 :meth:`asyncio." -"AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" -"除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" +":func:`asyncio.set_child_watcher`、:func:`asyncio.get_child_watcher`、:meth:`asyncio.AbstractEventLoopPolicy.set_child_watcher` " +"和 :meth:`asyncio.AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 " +"Python 3.14 中移除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" #: ../../whatsnew/3.12.rst:1185 #: ../../deprecations/pending-removal-in-3.14.rst:36 @@ -1915,8 +1928,9 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:39 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." -"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +"are deprecated and replaced by :data:`calendar.JANUARY` " +"and :data:`calendar.FEBRUARY`. (Contributed by Prince Roshan " +"in :gh:`103636`.)" msgstr "" ":mod:`calendar`:``calendar.January`` 和 ``calendar.February`` 常數已被棄用並" "被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince " @@ -1926,24 +1940,27 @@ msgstr "" msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." -"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" +"typing, prefer a union, like ``bytes | bytearray``, " +"or :class:`collections.abc.Buffer`. (Contributed by Shantanu Jain " +"in :gh:`91896`.)" msgstr "" #: ../../whatsnew/3.12.rst:1199 msgid "" -":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." -"utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " -"will be removed in a future version. Instead, use timezone-aware objects to " -"represent datetimes in UTC: respectively, call :meth:`~datetime.datetime." -"now` and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter " -"set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" +":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime.utcnow` " +"and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and will be " +"removed in a future version. Instead, use timezone-aware objects to " +"represent datetimes in UTC: respectively, " +"call :meth:`~datetime.datetime.now` " +"and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter set " +"to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" #: ../../whatsnew/3.12.rst:1207 msgid "" -":mod:`email`: Deprecate the *isdst* parameter in :func:`email.utils." -"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" +":mod:`email`: Deprecate the *isdst* parameter " +"in :func:`email.utils.localtime`. (Contributed by Alan Williams " +"in :gh:`72346`.)" msgstr "" ":mod:`email`:棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 中貢獻。)" @@ -1994,8 +2011,8 @@ msgid "" ":mod:`itertools`: Deprecate the support for copy, deepcopy, and pickle " "operations, which is undocumented, inefficient, historically buggy, and " "inconsistent. This will be removed in 3.14 for a significant reduction in " -"code volume and maintenance burden. (Contributed by Raymond Hettinger in :gh:" -"`101588`.)" +"code volume and maintenance burden. (Contributed by Raymond Hettinger " +"in :gh:`101588`.)" msgstr "" #: ../../whatsnew/3.12.rst:1230 @@ -2004,17 +2021,19 @@ msgid "" "start method will change to a safer one on Linux, BSDs, and other non-macOS " "POSIX platforms where ``'fork'`` is currently the default (:gh:`84559`). " "Adding a runtime warning about this was deemed too disruptive as the " -"majority of code is not expected to care. Use the :func:`~multiprocessing." -"get_context` or :func:`~multiprocessing.set_start_method` APIs to explicitly " -"specify when your code *requires* ``'fork'``. See :ref:`contexts and start " -"methods `." +"majority of code is not expected to care. Use " +"the :func:`~multiprocessing.get_context` " +"or :func:`~multiprocessing.set_start_method` APIs to explicitly specify when " +"your code *requires* ``'fork'``. See :ref:`contexts and start methods " +"`." msgstr "" #: ../../whatsnew/3.12.rst:1240 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " -"are deprecated and will be removed in Python 3.14; use :func:`importlib.util." -"find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" +"are deprecated and will be removed in Python 3.14; " +"use :func:`importlib.util.find_spec` instead. (Contributed by Nikita Sobolev " +"in :gh:`97850`.)" msgstr "" ":mod:`pkgutil`::func:`pkgutil.find_loader` 和 :func:`pkgutil.get_loader` 已" "被棄用並將在 Python 3.14 中移除;請改用 :func:`importlib.util.find_spec`。" @@ -2043,30 +2062,31 @@ msgstr "" #: ../../whatsnew/3.12.rst:1258 msgid "" -"On POSIX platforms, :func:`os.fork` can now raise a :exc:" -"`DeprecationWarning` when it can detect being called from a multithreaded " -"process. There has always been a fundamental incompatibility with the POSIX " -"platform when doing so. Even if such code *appeared* to work. We added the " -"warning to raise awareness as issues encountered by code doing this are " -"becoming more frequent. See the :func:`os.fork` documentation for more " -"details along with `this discussion on fork being incompatible with threads " -"`_ for *why* we're now surfacing this longstanding " +"On POSIX platforms, :func:`os.fork` can now raise " +"a :exc:`DeprecationWarning` when it can detect being called from a " +"multithreaded process. There has always been a fundamental incompatibility " +"with the POSIX platform when doing so. Even if such code *appeared* to work. " +"We added the warning to raise awareness as issues encountered by code doing " +"this are becoming more frequent. See the :func:`os.fork` documentation for " +"more details along with `this discussion on fork being incompatible with " +"threads `_ for *why* we're now surfacing this longstanding " "platform compatibility problem to developers." msgstr "" #: ../../whatsnew/3.12.rst:1268 msgid "" -"When this warning appears due to usage of :mod:`multiprocessing` or :mod:" -"`concurrent.futures` the fix is to use a different :mod:`multiprocessing` " -"start method such as ``\"spawn\"`` or ``\"forkserver\"``." +"When this warning appears due to usage of :mod:`multiprocessing` " +"or :mod:`concurrent.futures` the fix is to use a " +"different :mod:`multiprocessing` start method such as ``\"spawn\"`` or " +"``\"forkserver\"``." msgstr "" #: ../../whatsnew/3.12.rst:1272 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is " -"deprecated; use *onexc* instead. (Contributed by Irit Katriel in :gh:" -"`102828`.)" +"deprecated; use *onexc* instead. (Contributed by Irit Katriel " +"in :gh:`102828`.)" msgstr "" ":mod:`shutil`::func:`shutil.rmtree` 的 *onerror* 引數已被棄用,請改用 " "*onexc*。(由 Irit Katriel 於 :gh:`102828` 中貢獻。)" @@ -2095,13 +2115,14 @@ msgstr "" #: ../../whatsnew/3.12.rst:1290 msgid "" -":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." -"last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " -"(Contributed by Irit Katriel in :gh:`102778`.)" +":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` " +"and :data:`sys.last_traceback` fields are deprecated. " +"Use :data:`sys.last_exc` instead. (Contributed by Irit Katriel " +"in :gh:`102778`.)" msgstr "" -":mod:`sys`::data:`sys.last_type`、:data:`sys.last_value` 和 :data:`sys." -"last_traceback` 欄位已被棄用。請改用 :data:`sys.last_exc`。(由 Irit Katriel " -"於 :gh:`102778` 中貢獻。)" +":mod:`sys`::data:`sys.last_type`、:data:`sys.last_value` " +"和 :data:`sys.last_traceback` 欄位已被棄用。請改用 :data:`sys.last_exc`。" +"(由 Irit Katriel 於 :gh:`102778` 中貢獻。)" #: ../../whatsnew/3.12.rst:1294 msgid "" @@ -2117,16 +2138,16 @@ msgstr ":mod:`typing`:" #: ../../whatsnew/3.12.rst:1300 msgid "" -":class:`typing.Hashable` and :class:`typing.Sized`, aliases for :class:" -"`collections.abc.Hashable` and :class:`collections.abc.Sized` respectively, " -"are deprecated. (:gh:`94309`.)" +":class:`typing.Hashable` and :class:`typing.Sized`, aliases " +"for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized` " +"respectively, are deprecated. (:gh:`94309`.)" msgstr "" #: ../../whatsnew/3.12.rst:1304 msgid "" -":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" -"`DeprecationWarning` to be emitted when it is used. (Contributed by Alex " -"Waygood in :gh:`91896`.)" +":class:`typing.ByteString`, deprecated since Python 3.9, now causes " +"a :exc:`DeprecationWarning` to be emitted when it is used. (Contributed by " +"Alex Waygood in :gh:`91896`.)" msgstr "" #: ../../whatsnew/3.12.rst:1308 @@ -2140,26 +2161,26 @@ msgstr "" #: ../../whatsnew/3.12.rst:1314 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " -"`, :meth:`generator throw() ` and :meth:" -"`async generator throw() ` are deprecated and may be removed in " -"a future version of Python. Use the single-arg versions of these functions " -"instead. (Contributed by Ofey Chan in :gh:`89874`.)" +"`, :meth:`generator throw() ` " +"and :meth:`async generator throw() ` are deprecated and may be " +"removed in a future version of Python. Use the single-arg versions of these " +"functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" #: ../../whatsnew/3.12.rst:1320 msgid "" ":exc:`DeprecationWarning` is now raised when :attr:`~module.__package__` on " -"a module differs from :attr:`__spec__.parent ` (previously it was :exc:`ImportWarning`). (Contributed by Brett " -"Cannon in :gh:`65961`.)" +"a module differs from :attr:`__spec__.parent " +"` (previously it " +"was :exc:`ImportWarning`). (Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" #: ../../whatsnew/3.12.rst:1326 msgid "" "Setting :attr:`~module.__package__` or :attr:`~module.__cached__` on a " "module is deprecated, and will cease to be set or taken into consideration " -"by the import system in Python 3.14. (Contributed by Brett Cannon in :gh:" -"`65961`.)" +"by the import system in Python 3.14. (Contributed by Brett Cannon " +"in :gh:`65961`.)" msgstr "" #: ../../whatsnew/3.12.rst:1330 @@ -2174,13 +2195,13 @@ msgstr "" #: ../../whatsnew/3.12.rst:1336 msgid "" "Accessing :attr:`~codeobject.co_lnotab` on code objects was deprecated in " -"Python 3.10 via :pep:`626`, but it only got a proper :exc:" -"`DeprecationWarning` in 3.12. May be removed in 3.15. (Contributed by Nikita " -"Sobolev in :gh:`101866`.)" +"Python 3.10 via :pep:`626`, but it only got a " +"proper :exc:`DeprecationWarning` in 3.12. May be removed in 3.15. " +"(Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" -"自 3.10 起,於程式碼物件存取 :attr:`~codeobject.co_lnotab` 的功能已在 :pep:" -"`626` 中被棄用,但只在 3.12 中於適時發出 :exc:`DeprecationWarning`。可能在 " -"3.15 中移除。(由 Nikita Sobolev 於 :gh:`101866` 貢獻。)" +"自 3.10 起,於程式碼物件存取 :attr:`~codeobject.co_lnotab` 的功能已" +"在 :pep:`626` 中被棄用,但只在 3.12 中於適時發出 :exc:`DeprecationWarning`。" +"可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.13.rst:2 msgid "Pending Removal in Python 3.13" @@ -2372,32 +2393,35 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.14.rst:24 msgid "" -"The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" -"`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" -"class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " +"The child watcher " +"classes :class:`~asyncio.MultiLoopChildWatcher`, :class:`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` " +"and :class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " "Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -"已棄用並將在 Python 3.14 中移除的 child watcher 類別::class:`~asyncio." -"MultiLoopChildWatcher`、:class:`~asyncio.FastChildWatcher`、:class:`~asyncio." -"AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " -"Aditya 於 :gh:`94597` 貢獻。)" +"已棄用並將在 Python 3.14 中移除的 child watcher 類" +"別::class:`~asyncio.MultiLoopChildWatcher`、:class:`~asyncio.FastChildWatcher`、:class:`~asyncio.AbstractChildWatcher` " +"和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar Aditya 於 :gh:`94597` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:41 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." -"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" -msgstr "" -":mod:`collections.abc`:已棄用 :class:`~collections.abc.ByteString`。請改用 :" -"class:`!Sequence` 或 :class:`~collections.abc.Buffer`。在 typing 中使用時,請" -"改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " -"Shantanu Jain 於 :gh:`91896` 貢獻。)" +"typing, prefer a union, like ``bytes | bytearray``, " +"or :class:`collections.abc.Buffer`. (Contributed by Shantanu Jain " +"in :gh:`91896`.)" +msgstr "" +":mod:`collections.abc`:已棄用 :class:`~collections.abc.ByteString`。請改" +"用 :class:`!Sequence` 或 :class:`~collections.abc.Buffer`。在 typing 中使用" +"時,請改用聯集,如 ``bytes | bytearray``," +"或 :class:`collections.abc.Buffer`。(由 Shantanu Jain 於 :gh:`91896` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:47 msgid "" -":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." -"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" +":mod:`email`: Deprecated the *isdst* parameter " +"in :func:`email.utils.localtime`. (Contributed by Alan Williams " +"in :gh:`72346`.)" msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" @@ -2423,24 +2447,25 @@ msgid "" "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " "currently the default (:gh:`84559`). Adding a runtime warning about this was " "deemed too disruptive as the majority of code is not expected to care. Use " -"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." -"set_start_method` APIs to explicitly specify when your code *requires* " -"``'fork'``. See :ref:`multiprocessing-start-methods`." +"the :func:`~multiprocessing.get_context` " +"or :func:`~multiprocessing.set_start_method` APIs to explicitly specify when " +"your code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" ":mod:`multiprocessing`:預設的啟動方法將在 Linux、BSD 和其他非 macOS POSIX 平" "台上更改為更安全的 方法,目前 ``'fork'`` 是預設值 (:gh:`84559`)。對此增加一" -"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使用 :func:" -"`~multiprocessing.get_context` 或 :func:`~multiprocessing.set_start_method` " -"API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" -"`multiprocessing-start-methods`。" +"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使" +"用 :func:`~multiprocessing.get_context` " +"或 :func:`~multiprocessing.set_start_method` API 來明確指定你的程式碼何時\\ *" +"需要* ``'fork'``。請參閱 :ref:`multiprocessing-start-methods`。" #: ../../deprecations/pending-removal-in-3.14.rst:77 msgid "" -":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." -"PurePath.relative_to`: passing additional arguments is deprecated." +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` " +"and :meth:`~pathlib.PurePath.relative_to`: passing additional arguments is " +"deprecated." msgstr "" -":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" -"`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" +":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` " +"和 :meth:`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" #: ../../deprecations/pending-removal-in-3.14.rst:81 msgid "" @@ -2449,8 +2474,9 @@ msgid "" "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" ":mod:`pkgutil`::func:`~pkgutil.find_loader` 和 :func:`~pkgutil.get_loader` " -"現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." -"find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" +"現在會引發 :exc:`DeprecationWarning`;請改" +"用 :func:`importlib.util.find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" @@ -2470,9 +2496,9 @@ msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" #: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "" -":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" -"ref:`named placeholders ` are used and *parameters* is " -"a sequence instead of a :class:`dict`." +":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` " +"if :ref:`named placeholders ` are used and " +"*parameters* is a sequence instead of a :class:`dict`." msgstr "" ":meth:`~sqlite3.Cursor.execute` 和 :meth:`~sqlite3.Cursor.executemany`,如果" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" @@ -2489,8 +2515,8 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " -"intended to be a public API. (Contributed by Gregory P. Smith in :gh:" -"`88168`.)" +"intended to be a public API. (Contributed by Gregory P. Smith " +"in :gh:`88168`.)" msgstr "" ":mod:`urllib`::class:`!urllib.parse.Quoter` 已被棄用:它並非預期的公開 API。" "(由 Gregory P. Smith 於 :gh:`88168` 貢獻。)" @@ -2507,10 +2533,10 @@ msgstr "引入系統 (import system):" #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" -"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" -"`__spec__.cached ` is deprecated. In " -"Python 3.15, :attr:`!__cached__` will cease to be set or take into " -"consideration by the import system or standard library. (:gh:`97879`)" +"Setting :attr:`~module.__cached__` on a module while failing to " +"set :attr:`__spec__.cached ` is " +"deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or take " +"into consideration by the import system or standard library. (:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__cached__` 而沒有設定 :attr:`__spec__.cached " "` 的做法已被棄用。在 Python 3.15 中," @@ -2518,10 +2544,11 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:11 msgid "" -"Setting :attr:`~module.__package__` on a module while failing to set :attr:" -"`__spec__.parent ` is deprecated. In " -"Python 3.15, :attr:`!__package__` will cease to be set or take into " -"consideration by the import system or standard library. (:gh:`97879`)" +"Setting :attr:`~module.__package__` on a module while failing to " +"set :attr:`__spec__.parent ` is " +"deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or " +"take into consideration by the import system or standard library. " +"(:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__package__` 而沒有設定 :attr:`__spec__.parent " "` 的做法已被棄用。在 Python 3.15 中," @@ -2576,15 +2603,17 @@ msgstr ":class:`locale`:" #: ../../deprecations/pending-removal-in-3.15.rst:38 msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " -"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" -"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." -"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " -"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" +"Python 3.11. Its removal was originally planned for Python 3.13 " +"(:gh:`90817`), but has been postponed to Python 3.15. " +"Use :func:`~locale.getlocale`, :func:`~locale.setlocale`, " +"and :func:`~locale.getencoding` instead. (Contributed by Hugo van Kemenade " +"in :gh:`111187`.)" msgstr "" ":func:`~locale.getdefaultlocale` 已在 Python 3.11 中被棄用,原本計劃在 " -"Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :func:" -"`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale." -"getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" +"Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改" +"用 :func:`~locale.getlocale`、:func:`~locale.setlocale` " +"和 :func:`~locale.getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.15.rst:46 msgid ":mod:`pathlib`:" @@ -2592,11 +2621,11 @@ msgstr ":mod:`pathlib`:" #: ../../deprecations/pending-removal-in-3.15.rst:48 msgid "" -":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" -"func:`os.path.isreserved` to detect reserved paths on Windows." +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. " +"Use :func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" -":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." -"isreserved` 來偵測 Windows 上的保留路徑。" +":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請" +"用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" #: ../../deprecations/pending-removal-in-3.15.rst:52 msgid ":mod:`platform`:" @@ -2650,16 +2679,16 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" ":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" -"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" -"exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:" -"`101866` 貢獻。)" +"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發" +"出 :exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev " +"於 :gh:`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.15.rst:82 msgid "" -"The undocumented keyword argument syntax for creating :class:`~typing." -"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " -"has been deprecated since Python 3.13. Use the class-based syntax or the " -"functional syntax instead." +"The undocumented keyword argument syntax for " +"creating :class:`~typing.NamedTuple` classes (e.g. ``Point = " +"NamedTuple(\"Point\", x=int, y=int)``) has been deprecated since Python " +"3.13. Use the class-based syntax or the functional syntax instead." msgstr "" "用於建立 :class:`~typing.NamedTuple` 類別的未以文件記錄之關鍵字引數語法 " "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" @@ -2681,13 +2710,14 @@ msgstr ":mod:`wave`:" #: ../../deprecations/pending-removal-in-3.15.rst:95 msgid "" -"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." -"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" -"`~wave.Wave_write` classes have been deprecated since Python 3.13." +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, " +"and :meth:`~wave.Wave_read.getmarkers` methods of " +"the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes have been " +"deprecated since Python 3.13." msgstr "" -"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別的 :meth:" -"`~wave.Wave_read.getmark`、:meth:`!setmark` 和 :meth:`~wave.Wave_read." -"getmarkers` 方法自 Python 3.13 被棄用。" +"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別" +"的 :meth:`~wave.Wave_read.getmark`、:meth:`!setmark` " +"和 :meth:`~wave.Wave_read.getmarkers` 方法自 Python 3.13 被棄用。" #: ../../deprecations/pending-removal-in-3.16.rst:2 msgid "Pending removal in Python 3.16" @@ -2695,10 +2725,10 @@ msgstr "Python 3.16 中待移除的項目" #: ../../deprecations/pending-removal-in-3.16.rst:6 msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" -"`__spec__.loader ` is deprecated. In " -"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " -"consideration by the import system or the standard library." +"Setting :attr:`~module.__loader__` on a module while failing to " +"set :attr:`__spec__.loader ` is " +"deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or " +"taken into consideration by the import system or the standard library." msgstr "" "在模組上設定 :attr:`~module.__loader__` 而沒有設定 :attr:`__spec__.loader " "` 的做法將於 Python 3.16 被棄用。在 " @@ -2725,8 +2755,8 @@ msgid "" "by Jiahao Li and Kumar Aditya in :gh:`122875`.)" msgstr "" ":func:`!asyncio.iscoroutinefunction` 已被棄用並將在 Python 3.16 中移除,請改" -"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :" -"gh:`122875` 貢獻。)" +"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya " +"於 :gh:`122875` 貢獻。)" #: ../../deprecations/pending-removal-in-3.16.rst:26 #: ../../deprecations/pending-removal-in-future.rst:10 @@ -2832,17 +2862,17 @@ msgid "" "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " "ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " "``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " -"if the numeric literal is immediately followed by one of keywords :keyword:" -"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" -"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " -"syntax error. (:gh:`87999`)" +"if the numeric literal is immediately followed by one of " +"keywords :keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :keyword:`is` " +"and :keyword:`or`. In a future release it will be changed to a syntax " +"error. (:gh:`87999`)" msgstr "" "目前 Python 接受數值字面值後面立即接關鍵字,例如 ``0in x``、``1or x``、``0if " "1else 2``。它讓表達式模糊且容易混淆,如 ``[0x1for x in y]``\\ (可以解釋為 " -"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即接 :" -"keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:" -"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版" -"本中,它將被更改為語法錯誤。(:gh:`87999`)" +"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即" +"接 :keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:`in`、:keyword:`is` " +"和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版本中,它將被更改為語" +"法錯誤。(:gh:`87999`)" #: ../../deprecations/pending-removal-in-future.rst:24 msgid "" @@ -2855,18 +2885,18 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:27 msgid "" -"Support for ``__float__()`` method returning a strict subclass of :class:" -"`float`: these methods will be required to return an instance of :class:" -"`float`." +"Support for ``__float__()`` method returning a strict subclass " +"of :class:`float`: these methods will be required to return an instance " +"of :class:`float`." msgstr "" "回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回" "傳 :class:`float` 的實例。" #: ../../deprecations/pending-removal-in-future.rst:30 msgid "" -"Support for ``__complex__()`` method returning a strict subclass of :class:" -"`complex`: these methods will be required to return an instance of :class:" -"`complex`." +"Support for ``__complex__()`` method returning a strict subclass " +"of :class:`complex`: these methods will be required to return an instance " +"of :class:`complex`." msgstr "" "回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要" "回傳 :class:`complex` 的實例。" @@ -2877,10 +2907,10 @@ msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。" #: ../../deprecations/pending-removal-in-future.rst:34 msgid "" -"Passing a complex number as the *real* or *imag* argument in the :func:" -"`complex` constructor is now deprecated; it should only be passed as a " -"single positional argument. (Contributed by Serhiy Storchaka in :gh:" -"`109218`.)" +"Passing a complex number as the *real* or *imag* argument in " +"the :func:`complex` constructor is now deprecated; it should only be passed " +"as a single positional argument. (Contributed by Serhiy Storchaka " +"in :gh:`109218`.)" msgstr "" "在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" "它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" @@ -2898,19 +2928,19 @@ msgstr ":mod:`datetime`:" #: ../../deprecations/pending-removal-in-future.rst:49 msgid "" -":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." -"UTC)``." +":meth:`~datetime.datetime.utcnow`: use " +"``datetime.datetime.now(tz=datetime.UTC)``." msgstr "" -":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime." -"now(tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcnow`:請改用 " +"``datetime.datetime.now(tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:51 msgid "" -":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." -"fromtimestamp(timestamp, tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcfromtimestamp`: use " +"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``." msgstr "" -":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime." -"fromtimestamp(timestamp, tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcfromtimestamp`:請改用 " +"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:54 msgid ":mod:`gettext`: Plural value must be an integer." @@ -2941,8 +2971,8 @@ msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" -":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" -"`~logging.warning`。" +":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改" +"用 :meth:`~logging.warning`。" #: ../../deprecations/pending-removal-in-future.rst:69 msgid "" @@ -2999,11 +3029,11 @@ msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:92 msgid "" -":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" -"`!selected_npn_protocol` are deprecated: use ALPN instead." +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` " +"and :meth:`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" -":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" -"`!selected_npn_protocol` 已被棄用:請改用 ALPN。" +":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` " +"和 :meth:`!selected_npn_protocol` 已被棄用:請改用 ALPN。" #: ../../deprecations/pending-removal-in-future.rst:95 msgid "``ssl.OP_NO_SSL*`` options" @@ -3051,11 +3081,11 @@ msgstr ":mod:`threading` 方法:" #: ../../deprecations/pending-removal-in-future.rst:108 msgid "" -":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." -"notify_all`." +":meth:`!threading.Condition.notifyAll`: " +"use :meth:`~threading.Condition.notify_all`." msgstr "" -":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." -"notify_all`。" +":meth:`!threading.Condition.notifyAll`:請" +"用 :meth:`~threading.Condition.notify_all`。" #: ../../deprecations/pending-removal-in-future.rst:109 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." @@ -3063,19 +3093,19 @@ msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set` #: ../../deprecations/pending-removal-in-future.rst:110 msgid "" -":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" -"attr:`threading.Thread.daemon` attribute." +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: " +"use :attr:`threading.Thread.daemon` attribute." msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:112 msgid "" -":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" -"attr:`threading.Thread.name` attribute." +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: " +"use :attr:`threading.Thread.name` attribute." msgstr "" -":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" -"attr:`threading.Thread.name` 屬性。" +":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請" +"用 :attr:`threading.Thread.name` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:114 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." @@ -3151,13 +3181,13 @@ msgstr "``to_bytes()``" #: ../../deprecations/pending-removal-in-future.rst:136 msgid "" -":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" -"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " -"Use newer :func:`~urllib.request.urlopen` functions and methods." +":mod:`urllib.request`: :class:`~urllib.request.URLopener` " +"and :class:`~urllib.request.FancyURLopener` style of invoking requests is " +"deprecated. Use newer :func:`~urllib.request.urlopen` functions and methods." msgstr "" -":mod:`urllib.request`:呼叫請求的 :class:`~urllib.request.URLopener` 和 :" -"class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新的 :func:" -"`~urllib.request.urlopen` 函式和方法。" +":mod:`urllib.request`:呼叫請求的 :class:`~urllib.request.URLopener` " +"和 :class:`~urllib.request.FancyURLopener` 風格已被棄用。請改用更新" +"的 :func:`~urllib.request.urlopen` 函式和方法。" #: ../../deprecations/pending-removal-in-future.rst:140 msgid "" @@ -3167,22 +3197,22 @@ msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分 #: ../../deprecations/pending-removal-in-future.rst:143 msgid "" -":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." -"etree.ElementTree.Element` is deprecated. In a future release it will always " -"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " -"instead." +":mod:`xml.etree.ElementTree`: Testing the truth value of " +"an :class:`~xml.etree.ElementTree.Element` is deprecated. In a future " +"release it will always return ``True``. Prefer explicit ``len(elem)`` or " +"``elem is not None`` tests instead." msgstr "" -":mod:`xml.etree.ElementTree`:已棄用對 :class:`~xml.etree.ElementTree." -"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " -"``len(elem)`` 或 ``elem is not None`` 測試。" +":mod:`xml.etree.ElementTree`:已棄用" +"對 :class:`~xml.etree.ElementTree.Element` 的真值測試。在未來版本中,它將始終" +"回傳 ``True``。請改用明確的 ``len(elem)`` 或 ``elem is not None`` 測試。" #: ../../deprecations/pending-removal-in-future.rst:148 msgid "" -":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" -"`~zipimport.zipimporter.exec_module` instead." +":meth:`zipimport.zipimporter.load_module` is deprecated: " +"use :meth:`~zipimport.zipimporter.exec_module` instead." msgstr "" -":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport." -"zipimporter.exec_module`。" +":meth:`zipimport.zipimporter.load_module` 已被棄用:請改" +"用 :meth:`~zipimport.zipimporter.exec_module`。" #: ../../whatsnew/3.12.rst:1355 ../../whatsnew/3.12.rst:2237 msgid "Removed" @@ -3223,16 +3253,16 @@ msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -":mod:`configparser` 不再具有 ``SafeConfigParser`` 類別。請改用較短的 :class:" -"`~configparser.ConfigParser` 名稱。" +":mod:`configparser` 不再具有 ``SafeConfigParser`` 類別。請改用較短" +"的 :class:`~configparser.ConfigParser` 名稱。" #: ../../whatsnew/3.12.rst:1376 msgid "" -":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" -"meth:`~configparser.ConfigParser.read_file` instead." +":class:`configparser.ConfigParser` no longer has a ``readfp`` method. " +"Use :meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -":class:`configparser.ConfigParser` 不再具有 ``readfp`` 方法。請改用 :meth:" -"`~configparser.ConfigParser.read_file`。" +":class:`configparser.ConfigParser` 不再具有 ``readfp`` 方法。請改" +"用 :meth:`~configparser.ConfigParser.read_file`。" #: ../../whatsnew/3.12.rst:1382 msgid "distutils" @@ -3312,8 +3342,8 @@ msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " "instead. In write mode, the ``filename`` attribute added ``'.gz'`` file " -"extension if it was not present. (Contributed by Victor Stinner in :gh:" -"`94196`.)" +"extension if it was not present. (Contributed by Victor Stinner " +"in :gh:`94196`.)" msgstr "" #: ../../whatsnew/3.12.rst:1435 @@ -3322,11 +3352,11 @@ msgstr "hashlib" #: ../../whatsnew/3.12.rst:1437 msgid "" -"Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." -"pbkdf2_hmac`, deprecated in Python 3.10. Python 3.10 and newer requires " -"OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides a C implementation " -"of :func:`~hashlib.pbkdf2_hmac` which is faster. (Contributed by Victor " -"Stinner in :gh:`94199`.)" +"Remove the pure Python implementation " +"of :mod:`hashlib`'s :func:`hashlib.pbkdf2_hmac`, deprecated in Python 3.10. " +"Python 3.10 and newer requires OpenSSL 1.1.1 (:pep:`644`): this OpenSSL " +"version provides a C implementation of :func:`~hashlib.pbkdf2_hmac` which is " +"faster. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" #: ../../whatsnew/3.12.rst:1444 ../../whatsnew/3.12.rst:1473 @@ -3372,8 +3402,8 @@ msgstr "imp" #: ../../whatsnew/3.12.rst:1467 msgid "" -"The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" -"gh:`98040`.)" +"The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw " +"in :gh:`98040`.)" msgstr ":mod:`!imp` 模組已被移除。(由 Barry Warsaw 在 :gh:`98040` 中貢獻。)" #: ../../whatsnew/3.12.rst:1470 @@ -3418,11 +3448,11 @@ msgstr "``imp.get_suffixes()``" #: ../../whatsnew/3.12.rst:1479 msgid "" -":const:`importlib.machinery.SOURCE_SUFFIXES`, :const:`importlib.machinery." -"EXTENSION_SUFFIXES`, and :const:`importlib.machinery.BYTECODE_SUFFIXES`" +":const:`importlib.machinery.SOURCE_SUFFIXES`, :const:`importlib.machinery.EXTENSION_SUFFIXES`, " +"and :const:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -":const:`importlib.machinery.SOURCE_SUFFIXES`、:const:`importlib.machinery." -"EXTENSION_SUFFIXES` 和 :const:`importlib.machinery.BYTECODE_SUFFIXES`" +":const:`importlib.machinery.SOURCE_SUFFIXES`、:const:`importlib.machinery.EXTENSION_SUFFIXES` " +"和 :const:`importlib.machinery.BYTECODE_SUFFIXES`" #: ../../whatsnew/3.12.rst:1480 msgid "``imp.get_tag()``" @@ -3553,10 +3583,10 @@ msgstr "io" #: ../../whatsnew/3.12.rst:1521 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " -"in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." -"open`) function is a built-in function. Since Python 3.10, :func:`!_pyio." -"open` is also a static method. (Contributed by Victor Stinner in :gh:" -"`94169`.)" +"in Python 3.10: just use :func:`open` instead. The :func:`open` " +"(:func:`io.open`) function is a built-in function. Since Python " +"3.10, :func:`!_pyio.open` is also a static method. (Contributed by Victor " +"Stinner in :gh:`94169`.)" msgstr "" #: ../../whatsnew/3.12.rst:1528 @@ -3576,10 +3606,10 @@ msgstr "smtpd" #: ../../whatsnew/3.12.rst:1537 msgid "" -"The ``smtpd`` module has been removed according to the schedule in :pep:" -"`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use the :pypi:" -"`aiosmtpd` PyPI module or any other :mod:`asyncio`-based server instead. " -"(Contributed by Oleg Iarygin in :gh:`93243`.)" +"The ``smtpd`` module has been removed according to the schedule " +"in :pep:`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use " +"the :pypi:`aiosmtpd` PyPI module or any other :mod:`asyncio`-based server " +"instead. (Contributed by Oleg Iarygin in :gh:`93243`.)" msgstr "" "根據 :pep:`594` 的時間表移除 ``smtpd`` 模組,它在 Python 3.4.7 和 3.5.4 中已" "被棄用。請改用 PyPI 上的 :pypi:`aiosmtpd` 模組或任何其他基於 :mod:`asyncio` " @@ -3609,9 +3639,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:1555 msgid "" -"The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" -"`str` since Python 3.3. Code that previously set the text factory to " -"``OptimizedUnicode`` can either use ``str`` explicitly, or rely on the " +"The ``sqlite3.OptimizedUnicode`` text factory has been an alias " +"for :class:`str` since Python 3.3. Code that previously set the text factory " +"to ``OptimizedUnicode`` can either use ``str`` explicitly, or rely on the " "default value which is also ``str``." msgstr "" @@ -3641,12 +3671,12 @@ msgstr "" #: ../../whatsnew/3.12.rst:1575 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " -"instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." -"SSLContext.wrap_socket` method. Any package that still uses :func:`!ssl." -"wrap_socket` is broken and insecure. The function neither sends a SNI TLS " -"extension nor validates the server hostname. Code is subject to :cwe:`295` " -"(Improper Certificate Validation). (Contributed by Victor Stinner in :gh:" -"`94199`.)" +"instead, create a :class:`ssl.SSLContext` object and call " +"its :class:`ssl.SSLContext.wrap_socket` method. Any package that still " +"uses :func:`!ssl.wrap_socket` is broken and insecure. The function neither " +"sends a SNI TLS extension nor validates the server hostname. Code is subject " +"to :cwe:`295` (Improper Certificate Validation). (Contributed by Victor " +"Stinner in :gh:`94199`.)" msgstr "" #: ../../whatsnew/3.12.rst:1586 @@ -3804,9 +3834,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:1618 msgid "" -"Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " -"since Python 3.5)." +"Undocumented :meth:`TestLoader.loadTestsFromModule " +"` parameter *use_load_tests* " +"(deprecated and ignored since Python 3.5)." msgstr "" #: ../../whatsnew/3.12.rst:1622 @@ -3852,8 +3882,9 @@ msgstr "zipimport" #: ../../whatsnew/3.12.rst:1646 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " -"deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" -"`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" +"deprecated in Python 3.10: use the ``find_spec()`` method instead. " +"See :pep:`451` for the rationale. (Contributed by Victor Stinner " +"in :gh:`94379`.)" msgstr "" #: ../../whatsnew/3.12.rst:1652 @@ -3862,20 +3893,20 @@ msgstr "其他" #: ../../whatsnew/3.12.rst:1654 msgid "" -"Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" -"file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:" -"`98179`.)" +"Remove the ``suspicious`` rule from the documentation :file:`Makefile` " +"and :file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `_. (Contributed by Julien Palard " +"in :gh:`98179`.)" msgstr "" #: ../../whatsnew/3.12.rst:1659 msgid "" -"Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" -"`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " -"*cert_file* and *check_hostname* parameters from the :mod:`http.client` " -"module, all deprecated since Python 3.6. Use the *context* parameter " -"(*ssl_context* in :mod:`imaplib`) instead. (Contributed by Victor Stinner " -"in :gh:`94172`.)" +"Remove the *keyfile* and *certfile* parameters from " +"the :mod:`ftplib`, :mod:`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, " +"and the *key_file*, *cert_file* and *check_hostname* parameters from " +"the :mod:`http.client` module, all deprecated since Python 3.6. Use the " +"*context* parameter (*ssl_context* in :mod:`imaplib`) instead. (Contributed " +"by Victor Stinner in :gh:`94172`.)" msgstr "" #: ../../whatsnew/3.12.rst:1667 @@ -3888,8 +3919,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1670 msgid "" -"Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" -"`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" +"Remove ``_use_broken_old_ctypes_structure_semantics_`` flag " +"from :mod:`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" msgstr "" "移除 :mod:`ctypes` 模組中的 ``_use_broken_old_ctypes_structure_semantics_`` " "旗標。(由 Nikita Sobolev 於 :gh:`99285` 中貢獻。)" @@ -3925,8 +3956,8 @@ msgid "" "integer values such as ``randrange(10.5)`` or ``randrange('10')`` has been " "changed from :exc:`ValueError` to :exc:`TypeError`. This also prevents bugs " "where ``randrange(1e25)`` would silently select from a larger range than " -"``randrange(10**25)``. (Originally suggested by Serhiy Storchaka :gh:" -"`86388`.)" +"``randrange(10**25)``. (Originally suggested by Serhiy " +"Storchaka :gh:`86388`.)" msgstr "" #: ../../whatsnew/3.12.rst:1701 @@ -3942,8 +3973,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1707 msgid "" "Remove the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " -"and 3.5.4. A recommended replacement is the :mod:`asyncio`-based :pypi:" -"`aiosmtpd` PyPI module." +"and 3.5.4. A recommended replacement is the :mod:`asyncio`-" +"based :pypi:`aiosmtpd` PyPI module." msgstr "" #: ../../whatsnew/3.12.rst:1711 @@ -3955,10 +3986,10 @@ msgstr "" #: ../../whatsnew/3.12.rst:1716 msgid "" -"The :mod:`os` module no longer accepts bytes-like paths, like :class:" -"`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " -"type is accepted for bytes strings. (Contributed by Victor Stinner in :gh:" -"`98393`.)" +"The :mod:`os` module no longer accepts bytes-like paths, " +"like :class:`bytearray` and :class:`memoryview` types: only the " +"exact :class:`bytes` type is accepted for bytes strings. (Contributed by " +"Victor Stinner in :gh:`98393`.)" msgstr "" #: ../../whatsnew/3.12.rst:1721 @@ -3987,21 +4018,23 @@ msgstr "" #: ../../whatsnew/3.12.rst:1743 msgid "" -"When extracting tar files using :mod:`tarfile` or :func:`shutil." -"unpack_archive`, pass the *filter* argument to limit features that may be " -"surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." +"When extracting tar files using :mod:`tarfile` " +"or :func:`shutil.unpack_archive`, pass the *filter* argument to limit " +"features that may be surprising or dangerous. See :ref:`tarfile-extraction-" +"filter` for details." msgstr "" #: ../../whatsnew/3.12.rst:1748 msgid "" -"The output of the :func:`tokenize.tokenize` and :func:`tokenize." -"generate_tokens` functions is now changed due to the changes introduced in :" -"pep:`701`. This means that ``STRING`` tokens are not emitted any more for f-" -"strings and the tokens described in :pep:`701` are now produced instead: " -"``FSTRING_START``, ``FSTRING_MIDDLE`` and ``FSTRING_END`` are now emitted " -"for f-string \"string\" parts in addition to the appropriate tokens for the " -"tokenization in the expression components. For example for the f-string " -"``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" +"The output of the :func:`tokenize.tokenize` " +"and :func:`tokenize.generate_tokens` functions is now changed due to the " +"changes introduced in :pep:`701`. This means that ``STRING`` tokens are not " +"emitted any more for f-strings and the tokens described in :pep:`701` are " +"now produced instead: ``FSTRING_START``, ``FSTRING_MIDDLE`` and " +"``FSTRING_END`` are now emitted for f-string \"string\" parts in addition to " +"the appropriate tokens for the tokenization in the expression components. " +"For example for the f-string ``f\"start {1+1} end\"`` the old version of the " +"tokenizer emitted::" msgstr "" #: ../../whatsnew/3.12.rst:1757 @@ -4106,11 +4139,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:1813 msgid "" -"Add ``COMPILEALL_OPTS`` variable in :file:`Makefile` to override :mod:" -"`compileall` options (default: ``-j0``) in ``make install``. Also merged the " -"3 ``compileall`` commands into a single command to build .pyc files for all " -"optimization levels (0, 1, 2) at once. (Contributed by Victor Stinner in :gh:" -"`99289`.)" +"Add ``COMPILEALL_OPTS`` variable in :file:`Makefile` to " +"override :mod:`compileall` options (default: ``-j0``) in ``make install``. " +"Also merged the 3 ``compileall`` commands into a single command to " +"build .pyc files for all optimization levels (0, 1, 2) at once. (Contributed " +"by Victor Stinner in :gh:`99289`.)" msgstr "" #: ../../whatsnew/3.12.rst:1819 @@ -4229,8 +4262,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1873 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " -"to allow safely extending certain variable-sized types, including :c:var:" -"`PyType_Type`." +"to allow safely extending certain variable-sized types, " +"including :c:var:`PyType_Type`." msgstr "" #: ../../whatsnew/3.12.rst:1876 @@ -4245,10 +4278,10 @@ msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" #: ../../whatsnew/3.12.rst:1881 msgid "" -"Add the new :ref:`limited C API ` function :c:func:" -"`PyType_FromMetaclass`, which generalizes the existing :c:func:" -"`PyType_FromModuleAndSpec` using an additional metaclass argument. " -"(Contributed by Wenzel Jakob in :gh:`93012`.)" +"Add the new :ref:`limited C API ` " +"function :c:func:`PyType_FromMetaclass`, which generalizes the " +"existing :c:func:`PyType_FromModuleAndSpec` using an additional metaclass " +"argument. (Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" #: ../../whatsnew/3.12.rst:1886 @@ -4280,16 +4313,16 @@ msgid "" "makes vectorcall safe to use with mutable types (i.e. heap types without the " "immutable flag, :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`). Mutable types that do " "not override :c:member:`~PyTypeObject.tp_call` now inherit the " -"``Py_TPFLAGS_HAVE_VECTORCALL`` flag. (Contributed by Petr Viktorin in :gh:" -"`93274`.)" +"``Py_TPFLAGS_HAVE_VECTORCALL`` flag. (Contributed by Petr Viktorin " +"in :gh:`93274`.)" msgstr "" #: ../../whatsnew/3.12.rst:1903 msgid "" -"The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" -"`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " -"classes to support object :attr:`~object.__dict__` and weakrefs with less " -"bookkeeping, using less memory and with faster access." +"The :c:macro:`Py_TPFLAGS_MANAGED_DICT` " +"and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows " +"extensions classes to support object :attr:`~object.__dict__` and weakrefs " +"with less bookkeeping, using less memory and with faster access." msgstr "" #: ../../whatsnew/3.12.rst:1908 @@ -4319,9 +4352,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:1920 msgid "" -"Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" -"func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " -"functions in all running threads in addition to the calling one. " +"Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` " +"and :c:func:`PyEval_SetTraceAllThreads`, that allow to set tracing and " +"profiling functions in all running threads in addition to the calling one. " "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" @@ -4334,11 +4367,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:1930 msgid "" -"The C API now permits registering callbacks via :c:func:" -"`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " -"whenever a dictionary is modified. This is intended for use by optimizing " -"interpreters, JIT compilers, or debuggers. (Contributed by Carl Meyer in :gh:" -"`91052`.)" +"The C API now permits registering callbacks " +"via :c:func:`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to " +"be called whenever a dictionary is modified. This is intended for use by " +"optimizing interpreters, JIT compilers, or debuggers. (Contributed by Carl " +"Meyer in :gh:`91052`.)" msgstr "" #: ../../whatsnew/3.12.rst:1936 @@ -4358,18 +4391,18 @@ msgstr "" #: ../../whatsnew/3.12.rst:1945 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " -"get a frame variable by its name. (Contributed by Victor Stinner in :gh:" -"`91248`.)" +"get a frame variable by its name. (Contributed by Victor Stinner " +"in :gh:`91248`.)" msgstr "" #: ../../whatsnew/3.12.rst:1949 msgid "" -"Add :c:func:`PyErr_GetRaisedException` and :c:func:" -"`PyErr_SetRaisedException` for saving and restoring the current exception. " -"These functions return and accept a single exception object, rather than the " -"triple arguments of the now-deprecated :c:func:`PyErr_Fetch` and :c:func:" -"`PyErr_Restore`. This is less error prone and a bit more efficient. " -"(Contributed by Mark Shannon in :gh:`101578`.)" +"Add :c:func:`PyErr_GetRaisedException` " +"and :c:func:`PyErr_SetRaisedException` for saving and restoring the current " +"exception. These functions return and accept a single exception object, " +"rather than the triple arguments of the now-deprecated :c:func:`PyErr_Fetch` " +"and :c:func:`PyErr_Restore`. This is less error prone and a bit more " +"efficient. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" #: ../../whatsnew/3.12.rst:1957 @@ -4382,9 +4415,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:1961 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " -"convenience functions for retrieving and modifying the :attr:`~BaseException." -"args` passed to the exception's constructor. (Contributed by Mark Shannon " -"in :gh:`101578`.)" +"convenience functions for retrieving and modifying " +"the :attr:`~BaseException.args` passed to the exception's constructor. " +"(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" #: ../../whatsnew/3.12.rst:1966 @@ -4453,17 +4486,18 @@ msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" #: ../../whatsnew/3.12.rst:1990 msgid "" -":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" -"c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " -"with their own GILs. (See :ref:`whatsnew312-pep684` for more info.) " -"(Contributed by Eric Snow in :gh:`104110`.)" +":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function " +"and :c:type:`PyInterpreterConfig`, which may be used to create sub-" +"interpreters with their own GILs. (See :ref:`whatsnew312-pep684` for more " +"info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" #: ../../whatsnew/3.12.rst:1996 msgid "" -"In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" -"`Py_DECREF` functions are now implemented as opaque function calls to hide " -"implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" +"In the limited C API version 3.12, :c:func:`Py_INCREF` " +"and :c:func:`Py_DECREF` functions are now implemented as opaque function " +"calls to hide implementation details. (Contributed by Victor Stinner " +"in :gh:`105387`.)" msgstr "" #: ../../whatsnew/3.12.rst:2004 @@ -4498,8 +4532,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:2023 msgid "" -"To get a list of subclasses, call the Python method :py:meth:`~type." -"__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." +"To get a list of subclasses, call the Python " +"method :py:meth:`~type.__subclasses__` (using :c:func:`PyObject_CallMethod`, " +"for example)." msgstr "" #: ../../whatsnew/3.12.rst:2027 @@ -4507,37 +4542,38 @@ msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " "strings, variable width and precision) in :c:func:`PyUnicode_FromFormat` " -"and :c:func:`PyUnicode_FromFormatV`. (Contributed by Serhiy Storchaka in :gh:" -"`98836`.)" +"and :c:func:`PyUnicode_FromFormatV`. (Contributed by Serhiy Storchaka " +"in :gh:`98836`.)" msgstr "" #: ../../whatsnew/3.12.rst:2033 msgid "" -"An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" -"func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " -"versions it caused all the rest of the format string to be copied as-is to " -"the result string, and any extra arguments discarded. (Contributed by Serhiy " -"Storchaka in :gh:`95781`.)" +"An unrecognized format character in :c:func:`PyUnicode_FromFormat` " +"and :c:func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In " +"previous versions it caused all the rest of the format string to be copied " +"as-is to the result string, and any extra arguments discarded. (Contributed " +"by Serhiy Storchaka in :gh:`95781`.)" msgstr "" #: ../../whatsnew/3.12.rst:2039 msgid "" -"Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" -"`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" +"Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` " +"and :c:func:`PyUnicode_FromFormatV`. (Contributed by Philip Georgi " +"in :gh:`95504`.)" msgstr "" #: ../../whatsnew/3.12.rst:2043 msgid "" "Extension classes wanting to add a :attr:`~object.__dict__` or weak " -"reference slot should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" -"`Py_TPFLAGS_MANAGED_WEAKREF` instead of ``tp_dictoffset`` and " +"reference slot should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` " +"and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead of ``tp_dictoffset`` and " "``tp_weaklistoffset``, respectively. The use of ``tp_dictoffset`` and " "``tp_weaklistoffset`` is still supported, but does not fully support " "multiple inheritance (:gh:`95589`), and performance may be worse. Classes " "declaring :c:macro:`Py_TPFLAGS_MANAGED_DICT` must call :c:func:`!" "_PyObject_VisitManagedDict` and :c:func:`!_PyObject_ClearManagedDict` to " -"traverse and clear their instance's dictionaries. To clear weakrefs, call :c:" -"func:`PyObject_ClearWeakRefs`, as before." +"traverse and clear their instance's dictionaries. To clear weakrefs, " +"call :c:func:`PyObject_ClearWeakRefs`, as before." msgstr "" #: ../../whatsnew/3.12.rst:2055 @@ -4558,10 +4594,10 @@ msgstr "" #: ../../whatsnew/3.12.rst:2065 msgid "" -"The interpreter's error indicator is now always normalized. This means that :" -"c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " -"that set the error indicator now normalize the exception before storing it. " -"(Contributed by Mark Shannon in :gh:`101578`.)" +"The interpreter's error indicator is now always normalized. This means " +"that :c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other " +"functions that set the error indicator now normalize the exception before " +"storing it. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" #: ../../whatsnew/3.12.rst:2070 @@ -4601,8 +4637,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:2087 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " -"disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" -"`~object.__new__` in Python)." +"disallows creating classes whose metaclass overrides ``tp_new`` " +"(:meth:`~object.__new__` in Python)." msgstr "" #: ../../whatsnew/3.12.rst:2091 @@ -4620,16 +4656,16 @@ msgstr "" #: ../../whatsnew/3.12.rst:2100 msgid "" -"If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." -"tp_init` instead." +"If initialization can be skipped, it can be done " +"in :c:member:`~PyTypeObject.tp_init` instead." msgstr "" #: ../../whatsnew/3.12.rst:2102 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " -"``tp_new`` to ``NULL`` using the :c:macro:" -"`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag. This makes it acceptable for " -"``PyType_From*`` functions." +"``tp_new`` to ``NULL`` using " +"the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag. This makes it " +"acceptable for ``PyType_From*`` functions." msgstr "" #: ../../whatsnew/3.12.rst:2107 @@ -4665,10 +4701,10 @@ msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " "they are used by some extension modules. The internal fields should no " -"longer be accessed directly, instead the API functions beginning ``PyLong_..." -"`` should be used instead. Two new *unstable* API functions are provided for " -"efficient access to the value of :c:struct:`PyLongObject`\\s which fit into " -"a single machine word:" +"longer be accessed directly, instead the API functions beginning " +"``PyLong_...`` should be used instead. Two new *unstable* API functions are " +"provided for efficient access to the value of :c:struct:`PyLongObject`\\s " +"which fit into a single machine word:" msgstr "" #: ../../whatsnew/3.12.rst:2131 @@ -4690,11 +4726,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:2144 msgid "" -"In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" -"`PyDictObject` is deprecated for extension modules. Accessing this field " -"will generate a compiler warning at compile time. This field will be removed " -"in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " -"PEP by Ken Jin.)" +"In accordance with :pep:`699`, the ``ma_version_tag`` field " +"in :c:type:`PyDictObject` is deprecated for extension modules. Accessing " +"this field will generate a compiler warning at compile time. This field will " +"be removed in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya " +"in :gh:`101193`. PEP by Ken Jin.)" msgstr "" #: ../../whatsnew/3.12.rst:2149 @@ -4744,8 +4780,8 @@ msgstr "" msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -":c:var:`Py_IgnoreEnvironmentFlag`: 請改用 :c:member:`PyConfig." -"use_environment`" +":c:var:`Py_IgnoreEnvironmentFlag`: 請改" +"用 :c:member:`PyConfig.use_environment`" #: ../../whatsnew/3.12.rst:2161 msgid "" @@ -4757,8 +4793,8 @@ msgstr "" msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -":c:var:`Py_NoUserSiteDirectory`: 請改用 :c:member:`PyConfig." -"user_site_directory`" +":c:var:`Py_NoUserSiteDirectory`: 請改" +"用 :c:member:`PyConfig.user_site_directory`" #: ../../whatsnew/3.12.rst:2163 msgid "" @@ -4780,56 +4816,57 @@ msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" #: ../../whatsnew/3.12.rst:2167 msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." -"legacy_windows_fs_encoding`" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: " +"use :c:member:`PyPreConfig.legacy_windows_fs_encoding`" msgstr "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." -"legacy_windows_fs_encoding`" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改" +"用 :c:member:`PyPreConfig.legacy_windows_fs_encoding`" #: ../../whatsnew/3.12.rst:2168 msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." -"legacy_windows_stdio`" +":c:var:`Py_LegacyWindowsStdioFlag`: " +"use :c:member:`PyConfig.legacy_windows_stdio`" msgstr "" -":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." -"legacy_windows_stdio`" +":c:var:`Py_LegacyWindowsStdioFlag`: 請改" +"用 :c:member:`PyConfig.legacy_windows_stdio`" #: ../../whatsnew/3.12.rst:2169 msgid "" -":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." -"filesystem_encoding`" +":c:var:`!Py_FileSystemDefaultEncoding`: " +"use :c:member:`PyConfig.filesystem_encoding`" msgstr "" -":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." -"filesystem_encoding`" +":c:var:`!Py_FileSystemDefaultEncoding`: 請改" +"用 :c:member:`PyConfig.filesystem_encoding`" #: ../../whatsnew/3.12.rst:2170 msgid "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." -"filesystem_encoding`" +":c:var:`!Py_HasFileSystemDefaultEncoding`: " +"use :c:member:`PyConfig.filesystem_encoding`" msgstr "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." -"filesystem_encoding`" +":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改" +"用 :c:member:`PyConfig.filesystem_encoding`" #: ../../whatsnew/3.12.rst:2171 msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." -"filesystem_errors`" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: " +"use :c:member:`PyConfig.filesystem_errors`" msgstr "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." -"filesystem_errors`" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改" +"用 :c:member:`PyConfig.filesystem_errors`" #: ../../whatsnew/3.12.rst:2172 msgid "" -":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" -"`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` " +"(see :c:func:`Py_PreInitialize`)" msgstr "" -":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" -"func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參" +"見 :c:func:`Py_PreInitialize`)" #: ../../whatsnew/3.12.rst:2174 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" -"`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" +"The :c:func:`Py_InitializeFromConfig` API should be used " +"with :c:type:`PyConfig` instead. (Contributed by Victor Stinner " +"in :gh:`77782`.)" msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" @@ -4854,11 +4891,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:2187 msgid "" -":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" -"`PyMember_SetOne`" +":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` " +"and :c:func:`PyMember_SetOne`" msgstr "" -":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" -"`PyMember_SetOne`" +":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` " +"和 :c:func:`PyMember_SetOne`" #: ../../whatsnew/3.12.rst:2189 msgid "" @@ -4868,11 +4905,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:2191 msgid "" -"The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" -"`Py_AUDIT_READ` (previously all uppercase)" +"The flags :c:macro:`Py_READONLY` (previously ``READONLY``) " +"and :c:macro:`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" -"`Py_AUDIT_READ`\\ (先前全大寫)旗標" +":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)" +"和 :c:macro:`Py_AUDIT_READ`\\ (先前全大寫)旗標" #: ../../whatsnew/3.12.rst:2194 msgid "Several items are not exposed from :file:`Python.h`:" @@ -4892,16 +4929,17 @@ msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" #: ../../whatsnew/3.12.rst:2199 msgid "" -"The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" -"`Py_AUDIT_READ`." +"The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents " +"of :c:macro:`Py_AUDIT_READ`." msgstr "" -"``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" -"`Py_AUDIT_READ`。" +"``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當" +"於 :c:macro:`Py_AUDIT_READ`。" #: ../../whatsnew/3.12.rst:2201 msgid "" -"In some configurations, ```` is not included from :file:`Python." -"h`. It should be included manually when using ``offsetof()``." +"In some configurations, ```` is not included " +"from :file:`Python.h`. It should be included manually when using " +"``offsetof()``." msgstr "" #: ../../whatsnew/3.12.rst:2204 @@ -4919,9 +4957,10 @@ msgstr "" #: ../../whatsnew/3.12.rst:2212 msgid "" -":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" -"func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " -"instead. (Contributed by Mark Shannon in :gh:`101578`.)" +":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. " +"Use :c:func:`PyErr_GetRaisedException` " +"and :c:func:`PyErr_SetRaisedException` instead. (Contributed by Mark Shannon " +"in :gh:`101578`.)" msgstr "" #: ../../whatsnew/3.12.rst:2217 @@ -4942,29 +4981,30 @@ msgstr "" #: ../../whatsnew/3.12.rst:2223 msgid "" -"Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" -"func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" -"c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." +"Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` " +"or :c:func:`PyType_FromModuleAndSpec` to create a class whose metaclass " +"overrides :c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass " +"instead." msgstr "" -"使用 :c:func:`PyType_FromSpec`、:c:func:`PyType_FromSpecWithBases` 或 :c:" -"func:`PyType_FromModuleAndSpec` 建立一個其元類別覆寫 :c:member:" -"`~PyTypeObject.tp_new` 的類別已被棄用。請改為呼叫元類別。" +"使用 :c:func:`PyType_FromSpec`、:c:func:`PyType_FromSpecWithBases` " +"或 :c:func:`PyType_FromModuleAndSpec` 建立一個其元類別覆" +"寫 :c:member:`~PyTypeObject.tp_new` 的類別已被棄用。請改為呼叫元類別。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:4 msgid "" "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " "(:pep:`699`; :gh:`101193`)." msgstr "" -":c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位,用於擴充模組 (:pep:" -"`699`;:gh:`101193`)。" +":c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位,用於擴充模組 " +"(:pep:`699`;:gh:`101193`)。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:7 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases (:gh:`95388`)." msgstr "" -"使用可變基底建立\\ :c:data:`不可變型別 ` (:gh:" -"`95388`)。" +"使用可變基底建立\\ :c:data:`不可變型別 ` " +"(:gh:`95388`)。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:10 msgid "" @@ -4994,8 +5034,8 @@ msgstr ":c:func:`!Py_SetPythonHome()`:請改以 :c:member:`PyConfig.home` 設 #: ../../deprecations/c-api-pending-removal-in-3.14.rst:21 #: ../../deprecations/c-api-pending-removal-in-3.14.rst:71 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" -"`PyConfig` instead." +"The :c:func:`Py_InitializeFromConfig` API should be used " +"with :c:type:`PyConfig` instead." msgstr "" ":c:func:`Py_InitializeFromConfig` API 應該與 :c:type:`PyConfig` 一起使用。" @@ -5052,24 +5092,24 @@ msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " "instead." msgstr "" -":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." -"use_environment`。" +":c:var:`Py_IgnoreEnvironmentFlag`:請改" +"用 :c:member:`PyConfig.use_environment`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:46 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " "instead." msgstr "" -":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig." -"write_bytecode`。" +":c:var:`Py_DontWriteBytecodeFlag`:請改" +"用 :c:member:`PyConfig.write_bytecode`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:48 msgid "" -":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." -"user_site_directory` instead." +":c:var:`Py_NoUserSiteDirectory`: " +"Use :c:member:`PyConfig.user_site_directory` instead." msgstr "" -":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." -"user_site_directory`。" +":c:var:`Py_NoUserSiteDirectory`:請改" +"用 :c:member:`PyConfig.user_site_directory`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:50 msgid "" @@ -5092,51 +5132,51 @@ msgstr ":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:57 msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." -"legacy_windows_fs_encoding` instead." +":c:var:`Py_LegacyWindowsFSEncodingFlag`: " +"Use :c:member:`PyPreConfig.legacy_windows_fs_encoding` instead." msgstr "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." -"legacy_windows_fs_encoding`。" +":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改" +"用 :c:member:`PyPreConfig.legacy_windows_fs_encoding`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:59 msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." -"legacy_windows_stdio` instead." +":c:var:`Py_LegacyWindowsStdioFlag`: " +"Use :c:member:`PyConfig.legacy_windows_stdio` instead." msgstr "" -":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." -"legacy_windows_stdio`。" +":c:var:`Py_LegacyWindowsStdioFlag`:請改" +"用 :c:member:`PyConfig.legacy_windows_stdio`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:61 msgid "" -":c:var:`!Py_FileSystemDefaultEncoding`: Use :c:member:`PyConfig." -"filesystem_encoding` instead." +":c:var:`!Py_FileSystemDefaultEncoding`: " +"Use :c:member:`PyConfig.filesystem_encoding` instead." msgstr "" -":c:var:`!Py_FileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." -"filesystem_encoding`。" +":c:var:`!Py_FileSystemDefaultEncoding`:請改" +"用 :c:member:`PyConfig.filesystem_encoding`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:63 msgid "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." -"filesystem_encoding` instead." +":c:var:`!Py_HasFileSystemDefaultEncoding`: " +"Use :c:member:`PyConfig.filesystem_encoding` instead." msgstr "" -":c:var:`!Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." -"filesystem_encoding`。" +":c:var:`!Py_HasFileSystemDefaultEncoding`:請改" +"用 :c:member:`PyConfig.filesystem_encoding`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:65 msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." -"filesystem_errors` instead." +":c:var:`!Py_FileSystemDefaultEncodeErrors`: " +"Use :c:member:`PyConfig.filesystem_errors` instead." msgstr "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." -"filesystem_errors`。" +":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改" +"用 :c:member:`PyConfig.filesystem_errors`。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:67 msgid "" -":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. (see :" -"c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` instead. " +"(see :c:func:`Py_PreInitialize`)" msgstr "" -":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`。(請見 :c:" -"func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`。(請" +"見 :c:func:`Py_PreInitialize`)" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:4 msgid "The bundled copy of ``libmpdecimal``." @@ -5144,27 +5184,27 @@ msgstr "``libmpdecimal`` 的打包副本 (bundled copy)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:5 msgid "" -"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" -"`PyImport_ImportModule` instead." +"The :c:func:`PyImport_ImportModuleNoBlock`: " +"Use :c:func:`PyImport_ImportModule` instead." msgstr "" -":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" -"`PyImport_ImportModule`。" +":c:func:`PyImport_ImportModuleNoBlock`:請改" +"用 :c:func:`PyImport_ImportModule`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:7 msgid "" -":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" -"func:`PyWeakref_GetRef` instead." +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: " +"Use :c:func:`PyWeakref_GetRef` instead." msgstr "" -":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改用 :c:" -"func:`PyWeakref_GetRef`。" +":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改" +"用 :c:func:`PyWeakref_GetRef`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:9 msgid "" -":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" -"type:`wchar_t` instead." +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: " +"Use :c:type:`wchar_t` instead." msgstr "" -":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改用 :c:type:" -"`wchar_t`。" +":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改" +"用 :c:type:`wchar_t`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:11 msgid "Python initialization functions:" @@ -5175,16 +5215,16 @@ msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" -"data:`!warnings.filters`。" +":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` " +"和 :data:`!warnings.filters`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 msgid "" -":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` and :data:`sys." -"exec_prefix` instead." +":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` " +"and :data:`sys.exec_prefix` instead." msgstr "" -":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.base_exec_prefix` 與 :data:" -"`sys.exec_prefix`。" +":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.base_exec_prefix` " +"與 :data:`sys.exec_prefix`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." @@ -5195,8 +5235,8 @@ msgid "" ":c:func:`Py_GetPrefix`: Get :data:`sys.base_prefix` and :data:`sys.prefix` " "instead." msgstr "" -":c:func:`Py_GetPrefix`:請改用 :data:`sys.base_prefix` 與 :data:`sys." -"prefix`。" +":c:func:`Py_GetPrefix`:請改用 :data:`sys.base_prefix` " +"與 :data:`sys.prefix`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." @@ -5208,11 +5248,11 @@ msgstr ":c:func:`Py_GetProgramName`:請改用 :data:`sys.executable`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 msgid "" -":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" -"`PYTHONHOME` environment variable instead." +":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or " +"the :envvar:`PYTHONHOME` environment variable instead." msgstr "" -":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` 或 :envvar:" -"`PYTHONHOME` 環境變數。" +":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` " +"或 :envvar:`PYTHONHOME` 環境變數。" #: ../../deprecations/c-api-pending-removal-in-future.rst:4 msgid "" @@ -5233,8 +5273,8 @@ msgid "" ":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " "instead." msgstr "" -":c:func:`PyErr_NormalizeException`:請改用 :c:func:" -"`PyErr_GetRaisedException`。" +":c:func:`PyErr_NormalizeException`:請改" +"用 :c:func:`PyErr_GetRaisedException`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:13 msgid "" @@ -5254,11 +5294,11 @@ msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:19 msgid "" -":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" -"`PySlice_AdjustIndices` instead." +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` " +"and :c:func:`PySlice_AdjustIndices` instead." msgstr "" -":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" -"`PySlice_AdjustIndices`。" +":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` " +"和 :c:func:`PySlice_AdjustIndices`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:21 msgid "" @@ -5304,8 +5344,8 @@ msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead." msgstr "" -":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼叫 :c:func:" -"`PyObject_Hash`。" +":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼" +"叫 :c:func:`PyObject_Hash`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:37 msgid ":c:member:`!PyDictObject.ma_version_tag` member." @@ -5351,9 +5391,9 @@ msgid "" "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -"移除 :file:`token.h` 標頭檔案。從未有任何公開的 tokenizer C API。:file:" -"`token.h` 標頭檔案的設計是僅限用於 Python 內部。(由 Victor Stinner 於 :gh:" -"`92651` 中貢獻。)" +"移除 :file:`token.h` 標頭檔案。從未有任何公開的 tokenizer C " +"API。:file:`token.h` 標頭檔案的設計是僅限用於 Python 內部。(由 Victor " +"Stinner 於 :gh:`92651` 中貢獻。)" #: ../../whatsnew/3.12.rst:2244 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." @@ -5400,8 +5440,8 @@ msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -"移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner 於 :gh:" -"`85858` 中貢獻。)" +"移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner " +"於 :gh:`85858` 中貢獻。)" #~ msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" #~ msgstr ":mod:`array` 的 ``'u'`` 格式碼 (:gh:`57281`)"