From 8a732f3fb3b9fca1e32c63e24c966ad64fef4965 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 12 Nov 2022 20:02:54 +0000 Subject: [PATCH 1/2] sync with cpython edf74499 --- howto/enum.po | 429 +++++++++++++++++++++++++-------------------- library/enum.po | 362 ++++++++++++++++++++------------------ library/sqlite3.po | 40 ++--- 3 files changed, 453 insertions(+), 378 deletions(-) diff --git a/howto/enum.po b/howto/enum.po index 926f9f2cd8..3cac97121c 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-09 09:57+0000\n" +"POT-Creation-Date: 2022-11-12 20:01+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -149,34 +149,34 @@ msgid "" "yourself some work and use :func:`auto()` for the values::" msgstr "" -#: ../../howto/enum.rst:182 +#: ../../howto/enum.rst:183 msgid "Programmatic access to enumeration members and their attributes" msgstr "" -#: ../../howto/enum.rst:184 +#: ../../howto/enum.rst:185 msgid "" "Sometimes it's useful to access members in enumerations programmatically (i." "e. situations where ``Color.RED`` won't do because the exact color is not " "known at program-writing time). ``Enum`` allows such access::" msgstr "" -#: ../../howto/enum.rst:193 +#: ../../howto/enum.rst:194 msgid "If you want to access enum members by *name*, use item access::" msgstr "" -#: ../../howto/enum.rst:200 +#: ../../howto/enum.rst:201 msgid "If you have an enum member and need its :attr:`name` or :attr:`value`::" msgstr "" -#: ../../howto/enum.rst:210 +#: ../../howto/enum.rst:211 msgid "Duplicating enum members and values" msgstr "" -#: ../../howto/enum.rst:212 +#: ../../howto/enum.rst:213 msgid "Having two enum members with the same name is invalid::" msgstr "" -#: ../../howto/enum.rst:222 +#: ../../howto/enum.rst:223 msgid "" "However, an enum member can have other names associated with it. Given two " "entries ``A`` and ``B`` with the same value (and ``A`` defined first), ``B`` " @@ -185,93 +185,105 @@ msgid "" "member ``A``. By-name lookup of ``B`` will also return the member ``A``::" msgstr "" -#: ../../howto/enum.rst:243 +#: ../../howto/enum.rst:244 msgid "" "Attempting to create a member with the same name as an already defined " "attribute (another member, a method, etc.) or attempting to create an " "attribute with the same name as a member is not allowed." msgstr "" -#: ../../howto/enum.rst:249 +#: ../../howto/enum.rst:250 msgid "Ensuring unique enumeration values" msgstr "" -#: ../../howto/enum.rst:251 +#: ../../howto/enum.rst:252 msgid "" "By default, enumerations allow multiple names as aliases for the same value. " "When this behavior isn't desired, you can use the :func:`unique` decorator::" msgstr "" -#: ../../howto/enum.rst:268 +#: ../../howto/enum.rst:269 msgid "Using automatic values" msgstr "" -#: ../../howto/enum.rst:270 +#: ../../howto/enum.rst:271 msgid "If the exact value is unimportant you can use :class:`auto`::" msgstr "" -#: ../../howto/enum.rst:281 +#: ../../howto/enum.rst:282 msgid "" "The values are chosen by :func:`_generate_next_value_`, which can be " "overridden::" msgstr "" -#: ../../howto/enum.rst:299 +#: ../../howto/enum.rst:300 msgid "" "The :meth:`_generate_next_value_` method must be defined before any members." msgstr "" -#: ../../howto/enum.rst:302 +#: ../../howto/enum.rst:303 msgid "Iteration" msgstr "" -#: ../../howto/enum.rst:304 +#: ../../howto/enum.rst:305 msgid "Iterating over the members of an enum does not provide the aliases::" msgstr "" -#: ../../howto/enum.rst:309 +#: ../../howto/enum.rst:312 +msgid "" +"Note that the aliases ``Shape.ALIAS_FOR_SQUARE`` and ``Weekday.WEEKEND`` " +"aren't shown." +msgstr "" + +#: ../../howto/enum.rst:314 msgid "" "The special attribute ``__members__`` is a read-only ordered mapping of " "names to members. It includes all names defined in the enumeration, " "including the aliases::" msgstr "" -#: ../../howto/enum.rst:321 +#: ../../howto/enum.rst:326 msgid "" "The ``__members__`` attribute can be used for detailed programmatic access " "to the enumeration members. For example, finding all the aliases::" msgstr "" -#: ../../howto/enum.rst:329 +#: ../../howto/enum.rst:334 +msgid "" +"Aliases for flags include values with multiple flags set, such as ``3``, and " +"no flags set, i.e. ``0``." +msgstr "" + +#: ../../howto/enum.rst:339 msgid "Comparisons" msgstr "" -#: ../../howto/enum.rst:331 +#: ../../howto/enum.rst:341 msgid "Enumeration members are compared by identity::" msgstr "" -#: ../../howto/enum.rst:340 +#: ../../howto/enum.rst:350 msgid "" "Ordered comparisons between enumeration values are *not* supported. Enum " "members are not integers (but see `IntEnum`_ below)::" msgstr "" -#: ../../howto/enum.rst:348 +#: ../../howto/enum.rst:358 msgid "Equality comparisons are defined though::" msgstr "" -#: ../../howto/enum.rst:357 +#: ../../howto/enum.rst:367 msgid "" "Comparisons against non-enumeration values will always compare not equal " "(again, :class:`IntEnum` was explicitly designed to behave differently, see " "below)::" msgstr "" -#: ../../howto/enum.rst:366 +#: ../../howto/enum.rst:376 msgid "Allowed members and attributes of enumerations" msgstr "" -#: ../../howto/enum.rst:368 +#: ../../howto/enum.rst:378 msgid "" "Most of the examples above use integers for enumeration values. Using " "integers is short and handy (and provided by default by the `Functional " @@ -280,17 +292,17 @@ msgid "" "*is* important, enumerations can have arbitrary values." msgstr "" -#: ../../howto/enum.rst:374 +#: ../../howto/enum.rst:384 msgid "" "Enumerations are Python classes, and can have methods and special methods as " "usual. If we have this enumeration::" msgstr "" -#: ../../howto/enum.rst:394 +#: ../../howto/enum.rst:404 msgid "Then::" msgstr "" -#: ../../howto/enum.rst:403 +#: ../../howto/enum.rst:413 msgid "" "The rules for what is allowed are as follows: names that start and end with " "a single underscore are reserved by enum and cannot be used; all other " @@ -300,35 +312,35 @@ msgid "" "names listed in :attr:`_ignore_`." msgstr "" -#: ../../howto/enum.rst:410 +#: ../../howto/enum.rst:420 msgid "" "Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` " "then any value(s) given to the enum member will be passed into those " "methods. See `Planet`_ for an example." msgstr "" -#: ../../howto/enum.rst:416 +#: ../../howto/enum.rst:426 msgid "Restricted Enum subclassing" msgstr "" -#: ../../howto/enum.rst:418 +#: ../../howto/enum.rst:428 msgid "" "A new :class:`Enum` class must have one base enum class, up to one concrete " "data type, and as many :class:`object`-based mixin classes as needed. The " "order of these base classes is::" msgstr "" -#: ../../howto/enum.rst:425 +#: ../../howto/enum.rst:435 msgid "" "Also, subclassing an enumeration is allowed only if the enumeration does not " "define any members. So this is forbidden::" msgstr "" -#: ../../howto/enum.rst:435 +#: ../../howto/enum.rst:445 msgid "But this is allowed::" msgstr "" -#: ../../howto/enum.rst:446 +#: ../../howto/enum.rst:456 msgid "" "Allowing subclassing of enums that define members would lead to a violation " "of some important invariants of types and instances. On the other hand, it " @@ -336,49 +348,49 @@ msgid "" "enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" -#: ../../howto/enum.rst:453 +#: ../../howto/enum.rst:463 msgid "Pickling" msgstr "" -#: ../../howto/enum.rst:455 +#: ../../howto/enum.rst:465 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../howto/enum.rst:462 +#: ../../howto/enum.rst:472 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " "in the top level of a module, since unpickling requires them to be " "importable from that module." msgstr "" -#: ../../howto/enum.rst:468 +#: ../../howto/enum.rst:478 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../howto/enum.rst:471 +#: ../../howto/enum.rst:481 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" "meth:`__reduce_ex__` in the enumeration class." msgstr "" -#: ../../howto/enum.rst:476 +#: ../../howto/enum.rst:486 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:478 +#: ../../howto/enum.rst:488 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:488 +#: ../../howto/enum.rst:498 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " "first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" -#: ../../howto/enum.rst:491 +#: ../../howto/enum.rst:501 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -390,14 +402,14 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:507 +#: ../../howto/enum.rst:517 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but by default enum members all " "evaluate to ``True``." msgstr "" -#: ../../howto/enum.rst:511 +#: ../../howto/enum.rst:521 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -406,14 +418,14 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:521 +#: ../../howto/enum.rst:531 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -#: ../../howto/enum.rst:525 +#: ../../howto/enum.rst:535 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~definition.__qualname__` being set to the location where pickle will be " @@ -421,7 +433,7 @@ msgid "" "class SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:532 +#: ../../howto/enum.rst:542 msgid "The complete signature is::" msgstr "" @@ -429,7 +441,7 @@ msgstr "" msgid "value" msgstr "" -#: ../../howto/enum.rst:544 +#: ../../howto/enum.rst:554 msgid "What the new enum class will record as its name." msgstr "" @@ -437,21 +449,21 @@ msgstr "" msgid "names" msgstr "" -#: ../../howto/enum.rst:546 +#: ../../howto/enum.rst:556 msgid "" "The enum members. This can be a whitespace- or comma-separated string " "(values will start at 1 unless otherwise specified)::" msgstr "" -#: ../../howto/enum.rst:551 +#: ../../howto/enum.rst:561 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:555 +#: ../../howto/enum.rst:565 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:559 +#: ../../howto/enum.rst:569 msgid "or a mapping::" msgstr "" @@ -459,7 +471,7 @@ msgstr "" msgid "module" msgstr "" -#: ../../howto/enum.rst:563 +#: ../../howto/enum.rst:573 msgid "name of module where new enum class can be found." msgstr "" @@ -467,7 +479,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../howto/enum.rst:565 +#: ../../howto/enum.rst:575 msgid "where in module new enum class can be found." msgstr "" @@ -475,7 +487,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../howto/enum.rst:567 +#: ../../howto/enum.rst:577 msgid "type to mix in to new enum class." msgstr "" @@ -483,23 +495,23 @@ msgstr "" msgid "start" msgstr "" -#: ../../howto/enum.rst:569 +#: ../../howto/enum.rst:579 msgid "number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:571 +#: ../../howto/enum.rst:581 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:576 +#: ../../howto/enum.rst:586 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:579 +#: ../../howto/enum.rst:589 msgid "IntEnum" msgstr "" -#: ../../howto/enum.rst:581 +#: ../../howto/enum.rst:591 msgid "" "The first variation of :class:`Enum` that is provided is also a subclass of :" "class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " @@ -507,22 +519,22 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:602 +#: ../../howto/enum.rst:612 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:615 +#: ../../howto/enum.rst:625 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:626 +#: ../../howto/enum.rst:636 msgid "StrEnum" msgstr "" -#: ../../howto/enum.rst:628 +#: ../../howto/enum.rst:638 msgid "" "The second variation of :class:`Enum` that is provided is also a subclass " "of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " @@ -530,11 +542,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:637 +#: ../../howto/enum.rst:647 msgid "IntFlag" msgstr "" -#: ../../howto/enum.rst:639 +#: ../../howto/enum.rst:649 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -544,60 +556,60 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:647 +#: ../../howto/enum.rst:657 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:650 +#: ../../howto/enum.rst:660 msgid "" "Bit-wise operations that result in invalid :class:`IntFlag` values will lose " "the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." msgstr "" -#: ../../howto/enum.rst:657 +#: ../../howto/enum.rst:667 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:673 +#: ../../howto/enum.rst:683 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:689 +#: ../../howto/enum.rst:699 msgid "" "Named combinations are considered aliases. Aliases do not show up during " "iteration, but can be returned from by-value lookups." msgstr "" -#: ../../howto/enum.rst:694 +#: ../../howto/enum.rst:704 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " "that if no flags are set (the value is 0), its boolean evaluation is :data:" "`False`::" msgstr "" -#: ../../howto/enum.rst:702 +#: ../../howto/enum.rst:712 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" -#: ../../howto/enum.rst:713 +#: ../../howto/enum.rst:723 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:719 +#: ../../howto/enum.rst:729 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:728 +#: ../../howto/enum.rst:738 msgid "Flag" msgstr "" -#: ../../howto/enum.rst:730 +#: ../../howto/enum.rst:740 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -607,29 +619,29 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:739 +#: ../../howto/enum.rst:749 msgid "" "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -#: ../../howto/enum.rst:753 +#: ../../howto/enum.rst:763 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " -"8, ...), while combinations of flags won't::" +"8, ...), while combinations of flags will not::" msgstr "" -#: ../../howto/enum.rst:765 +#: ../../howto/enum.rst:775 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:779 +#: ../../howto/enum.rst:789 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:789 +#: ../../howto/enum.rst:799 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -640,42 +652,42 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:799 +#: ../../howto/enum.rst:809 msgid "Others" msgstr "" -#: ../../howto/enum.rst:801 +#: ../../howto/enum.rst:811 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:807 +#: ../../howto/enum.rst:817 msgid "" "This demonstrates how similar derived enumerations can be defined; for " "example a :class:`FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" -#: ../../howto/enum.rst:810 +#: ../../howto/enum.rst:820 msgid "Some rules:" msgstr "" -#: ../../howto/enum.rst:812 +#: ../../howto/enum.rst:822 msgid "" "When subclassing :class:`Enum`, mix-in types must appear before :class:" "`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " "above." msgstr "" -#: ../../howto/enum.rst:815 +#: ../../howto/enum.rst:825 msgid "" "Mix-in types must be subclassable. For example, :class:`bool` and :class:" "`range` are not subclassable and will throw an error during Enum creation if " "used as the mix-in type." msgstr "" -#: ../../howto/enum.rst:818 +#: ../../howto/enum.rst:828 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " "additional type, all the members must have values of that type, e.g. :class:" @@ -683,157 +695,157 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:822 +#: ../../howto/enum.rst:832 msgid "" "When another data type is mixed in, the :attr:`value` attribute is *not the " "same* as the enum member itself, although it is equivalent and will compare " "equal." msgstr "" -#: ../../howto/enum.rst:825 +#: ../../howto/enum.rst:835 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" "`__str__` and :meth:`__repr__` respectively; other codes (such as ``%i`` or " "``%h`` for IntEnum) treat the enum member as its mixed-in type." msgstr "" -#: ../../howto/enum.rst:828 +#: ../../howto/enum.rst:838 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:833 +#: ../../howto/enum.rst:843 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" "`__str__` method has been reset to their data types :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:839 +#: ../../howto/enum.rst:849 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:841 +#: ../../howto/enum.rst:851 msgid "" ":meth:`__new__` must be used whenever you want to customize the actual value " "of the :class:`Enum` member. Any other modifications may go in either :meth:" "`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:845 +#: ../../howto/enum.rst:855 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../howto/enum.rst:872 +#: ../../howto/enum.rst:882 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:875 +#: ../../howto/enum.rst:885 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:877 +#: ../../howto/enum.rst:887 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:880 +#: ../../howto/enum.rst:890 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../howto/enum.rst:886 +#: ../../howto/enum.rst:896 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:888 +#: ../../howto/enum.rst:898 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:889 +#: ../../howto/enum.rst:899 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:891 +#: ../../howto/enum.rst:901 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:893 +#: ../../howto/enum.rst:903 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../howto/enum.rst:896 +#: ../../howto/enum.rst:906 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:898 +#: ../../howto/enum.rst:908 msgid "" "``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" "`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:904 +#: ../../howto/enum.rst:914 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:907 +#: ../../howto/enum.rst:917 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../howto/enum.rst:910 +#: ../../howto/enum.rst:920 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:911 +#: ../../howto/enum.rst:921 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:913 +#: ../../howto/enum.rst:923 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " "can be provided. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" -#: ../../howto/enum.rst:931 +#: ../../howto/enum.rst:941 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " "order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:936 +#: ../../howto/enum.rst:946 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:938 +#: ../../howto/enum.rst:948 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:945 +#: ../../howto/enum.rst:955 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:947 +#: ../../howto/enum.rst:957 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In Python versions ``3.5`` to ``3.10`` you could " @@ -841,22 +853,22 @@ msgid "" "``3.11`` :class:`Enum` returns to not allowing it::" msgstr "" -#: ../../howto/enum.rst:968 +#: ../../howto/enum.rst:978 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:970 +#: ../../howto/enum.rst:980 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:982 +#: ../../howto/enum.rst:992 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:984 +#: ../../howto/enum.rst:994 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -865,137 +877,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:993 +#: ../../howto/enum.rst:1003 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:997 +#: ../../howto/enum.rst:1007 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:999 +#: ../../howto/enum.rst:1009 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1010 +#: ../../howto/enum.rst:1020 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1012 +#: ../../howto/enum.rst:1022 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1030 +#: ../../howto/enum.rst:1040 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1032 +#: ../../howto/enum.rst:1042 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1043 +#: ../../howto/enum.rst:1053 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1045 +#: ../../howto/enum.rst:1055 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1046 +#: ../../howto/enum.rst:1056 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1047 +#: ../../howto/enum.rst:1057 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1052 +#: ../../howto/enum.rst:1062 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1061 +#: ../../howto/enum.rst:1071 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1066 +#: ../../howto/enum.rst:1076 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1077 +#: ../../howto/enum.rst:1087 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1083 +#: ../../howto/enum.rst:1093 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1092 +#: ../../howto/enum.rst:1102 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1095 +#: ../../howto/enum.rst:1105 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1096 +#: ../../howto/enum.rst:1106 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1097 +#: ../../howto/enum.rst:1107 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1101 +#: ../../howto/enum.rst:1111 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1099 +#: ../../howto/enum.rst:1109 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1100 +#: ../../howto/enum.rst:1110 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1101 +#: ../../howto/enum.rst:1111 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1103 +#: ../../howto/enum.rst:1113 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1111 -msgid "How are Enums different?" +#: ../../howto/enum.rst:1121 +msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1113 +#: ../../howto/enum.rst:1123 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1118 +#: ../../howto/enum.rst:1128 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1120 +#: ../../howto/enum.rst:1130 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1006,11 +1018,24 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1130 +#: ../../howto/enum.rst:1139 +msgid "Flag Classes" +msgstr "" + +#: ../../howto/enum.rst:1141 +msgid "" +"Flags have an expanded view of aliasing: to be canonical, the value of a " +"flag needs to be a power-of-two value, and not a duplicate name. So, in " +"addition to the :class:`Enum` definition of alias, a flag with no value (a.k." +"a. ``0``) or with more than one power-of-two value (e.g. ``3``) is " +"considered an alias." +msgstr "" + +#: ../../howto/enum.rst:1147 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1132 +#: ../../howto/enum.rst:1149 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1019,7 +1044,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1141 +#: ../../howto/enum.rst:1155 +msgid "Flag Members" +msgstr "" + +#: ../../howto/enum.rst:1157 +msgid "" +"Flag members can be iterated over just like the :class:`Flag` class, and " +"only the canonical members will be returned. For example::" +msgstr "" + +#: ../../howto/enum.rst:1163 +msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" +msgstr "" + +#: ../../howto/enum.rst:1165 +msgid "" +"Inverting a flag member returns the corresponding positive value, rather " +"than a negative value --- for example::" +msgstr "" + +#: ../../howto/enum.rst:1171 +msgid "" +"Flag members have a length corresponding to the number of power-of-two " +"values they contain. For example::" +msgstr "" + +#: ../../howto/enum.rst:1181 +msgid "Enum Cookbook" +msgstr "" + +#: ../../howto/enum.rst:1184 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1027,149 +1082,149 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1148 +#: ../../howto/enum.rst:1191 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1150 +#: ../../howto/enum.rst:1193 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1153 +#: ../../howto/enum.rst:1196 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1154 +#: ../../howto/enum.rst:1197 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1155 +#: ../../howto/enum.rst:1198 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1156 +#: ../../howto/enum.rst:1199 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1159 +#: ../../howto/enum.rst:1202 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1208 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1167 +#: ../../howto/enum.rst:1210 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1179 +#: ../../howto/enum.rst:1222 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1181 +#: ../../howto/enum.rst:1224 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1191 +#: ../../howto/enum.rst:1234 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1207 +#: ../../howto/enum.rst:1250 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1209 +#: ../../howto/enum.rst:1252 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1221 +#: ../../howto/enum.rst:1264 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1223 +#: ../../howto/enum.rst:1266 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1240 +#: ../../howto/enum.rst:1283 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1250 +#: ../../howto/enum.rst:1293 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1269 +#: ../../howto/enum.rst:1312 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1275 +#: ../../howto/enum.rst:1318 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1277 +#: ../../howto/enum.rst:1320 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1311 +#: ../../howto/enum.rst:1354 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1313 +#: ../../howto/enum.rst:1356 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1338 +#: ../../howto/enum.rst:1381 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1344 +#: ../../howto/enum.rst:1387 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1346 +#: ../../howto/enum.rst:1389 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1375 +#: ../../howto/enum.rst:1418 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1377 +#: ../../howto/enum.rst:1420 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1396 +#: ../../howto/enum.rst:1439 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1398 +#: ../../howto/enum.rst:1441 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/library/enum.po b/library/enum.po index 09e343f332..9a26833893 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-07 00:19+0000\n" +"POT-Creation-Date: 2022-11-12 20:01+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,223 +53,225 @@ msgid "is a set of symbolic names (members) bound to unique values" msgstr "" #: ../../library/enum.rst:30 -msgid "can be iterated over to return its members in definition order" +msgid "" +"can be iterated over to return its canonical (i.e. non-alias) members in " +"definition order" msgstr "" -#: ../../library/enum.rst:31 +#: ../../library/enum.rst:32 msgid "uses *call* syntax to return members by value" msgstr "" -#: ../../library/enum.rst:32 +#: ../../library/enum.rst:33 msgid "uses *index* syntax to return members by name" msgstr "" -#: ../../library/enum.rst:34 +#: ../../library/enum.rst:35 msgid "" "Enumerations are created either by using :keyword:`class` syntax, or by " "using function-call syntax::" msgstr "" -#: ../../library/enum.rst:48 +#: ../../library/enum.rst:49 msgid "" "Even though we can use :keyword:`class` syntax to create Enums, Enums are " "not normal Python classes. See :ref:`How are Enums different? ` for more details." msgstr "" -#: ../../library/enum.rst:52 +#: ../../library/enum.rst:53 msgid "Nomenclature" msgstr "" -#: ../../library/enum.rst:54 +#: ../../library/enum.rst:55 msgid "The class :class:`Color` is an *enumeration* (or *enum*)" msgstr "" -#: ../../library/enum.rst:55 +#: ../../library/enum.rst:56 msgid "" "The attributes :attr:`Color.RED`, :attr:`Color.GREEN`, etc., are " "*enumeration members* (or *members*) and are functionally constants." msgstr "" -#: ../../library/enum.rst:57 +#: ../../library/enum.rst:58 msgid "" "The enum members have *names* and *values* (the name of :attr:`Color.RED` is " "``RED``, the value of :attr:`Color.BLUE` is ``3``, etc.)" msgstr "" -#: ../../library/enum.rst:64 +#: ../../library/enum.rst:65 msgid "Module Contents" msgstr "模組內容" -#: ../../library/enum.rst:66 +#: ../../library/enum.rst:67 msgid ":class:`EnumType`" msgstr ":class:`EnumType`" -#: ../../library/enum.rst:68 +#: ../../library/enum.rst:69 msgid "The ``type`` for Enum and its subclasses." msgstr "" -#: ../../library/enum.rst:70 +#: ../../library/enum.rst:71 msgid ":class:`Enum`" msgstr ":class:`Enum`" -#: ../../library/enum.rst:72 +#: ../../library/enum.rst:73 msgid "Base class for creating enumerated constants." msgstr "" -#: ../../library/enum.rst:74 +#: ../../library/enum.rst:75 msgid ":class:`IntEnum`" msgstr ":class:`IntEnum`" -#: ../../library/enum.rst:76 +#: ../../library/enum.rst:77 msgid "" "Base class for creating enumerated constants that are also subclasses of :" "class:`int`. (`Notes`_)" msgstr "" -#: ../../library/enum.rst:79 +#: ../../library/enum.rst:80 msgid ":class:`StrEnum`" msgstr ":class:`StrEnum`" -#: ../../library/enum.rst:81 +#: ../../library/enum.rst:82 msgid "" "Base class for creating enumerated constants that are also subclasses of :" "class:`str`. (`Notes`_)" msgstr "" -#: ../../library/enum.rst:84 +#: ../../library/enum.rst:85 msgid ":class:`Flag`" msgstr ":class:`Flag`" -#: ../../library/enum.rst:86 +#: ../../library/enum.rst:87 msgid "" "Base class for creating enumerated constants that can be combined using the " "bitwise operations without losing their :class:`Flag` membership." msgstr "" -#: ../../library/enum.rst:89 +#: ../../library/enum.rst:90 msgid ":class:`IntFlag`" msgstr ":class:`IntFlag`" -#: ../../library/enum.rst:91 +#: ../../library/enum.rst:92 msgid "" "Base class for creating enumerated constants that can be combined using the " "bitwise operators without losing their :class:`IntFlag` membership. :class:" "`IntFlag` members are also subclasses of :class:`int`. (`Notes`_)" msgstr "" -#: ../../library/enum.rst:95 +#: ../../library/enum.rst:96 msgid ":class:`ReprEnum`" msgstr ":class:`ReprEnum`" -#: ../../library/enum.rst:97 +#: ../../library/enum.rst:98 msgid "" "Used by :class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag` to keep " "the :class:`str() ` of the mixed-in type." msgstr "" -#: ../../library/enum.rst:100 +#: ../../library/enum.rst:101 msgid ":class:`EnumCheck`" msgstr ":class:`EnumCheck`" -#: ../../library/enum.rst:102 +#: ../../library/enum.rst:103 msgid "" "An enumeration with the values ``CONTINUOUS``, ``NAMED_FLAGS``, and " "``UNIQUE``, for use with :func:`verify` to ensure various constraints are " "met by a given enumeration." msgstr "" -#: ../../library/enum.rst:106 +#: ../../library/enum.rst:107 msgid ":class:`FlagBoundary`" msgstr ":class:`FlagBoundary`" -#: ../../library/enum.rst:108 +#: ../../library/enum.rst:109 msgid "" "An enumeration with the values ``STRICT``, ``CONFORM``, ``EJECT``, and " "``KEEP`` which allows for more fine-grained control over how invalid values " "are dealt with in an enumeration." msgstr "" -#: ../../library/enum.rst:112 +#: ../../library/enum.rst:113 msgid ":class:`auto`" msgstr ":class:`auto`" -#: ../../library/enum.rst:114 +#: ../../library/enum.rst:115 msgid "" "Instances are replaced with an appropriate value for Enum members. :class:" "`StrEnum` defaults to the lower-cased version of the member name, while " "other Enums default to 1 and increase from there." msgstr "" -#: ../../library/enum.rst:118 +#: ../../library/enum.rst:119 msgid ":func:`~enum.property`" msgstr ":func:`~enum.property`" -#: ../../library/enum.rst:120 +#: ../../library/enum.rst:121 msgid "" "Allows :class:`Enum` members to have attributes without conflicting with " "member names." msgstr "" -#: ../../library/enum.rst:123 +#: ../../library/enum.rst:124 msgid ":func:`unique`" msgstr ":func:`unique`" -#: ../../library/enum.rst:125 +#: ../../library/enum.rst:126 msgid "" "Enum class decorator that ensures only one name is bound to any one value." msgstr "" -#: ../../library/enum.rst:127 +#: ../../library/enum.rst:128 msgid ":func:`verify`" msgstr ":func:`verify`" -#: ../../library/enum.rst:129 +#: ../../library/enum.rst:130 msgid "" "Enum class decorator that checks user-selectable constraints on an " "enumeration." msgstr "" -#: ../../library/enum.rst:132 +#: ../../library/enum.rst:133 msgid ":func:`member`" msgstr ":func:`member`" -#: ../../library/enum.rst:134 +#: ../../library/enum.rst:135 msgid "Make ``obj`` a member. Can be used as a decorator." msgstr "" -#: ../../library/enum.rst:136 +#: ../../library/enum.rst:137 msgid ":func:`nonmember`" msgstr ":func:`nonmember`" -#: ../../library/enum.rst:138 +#: ../../library/enum.rst:139 msgid "Do not make ``obj`` a member. Can be used as a decorator." msgstr "" -#: ../../library/enum.rst:140 +#: ../../library/enum.rst:141 msgid ":func:`global_enum`" msgstr ":func:`global_enum`" -#: ../../library/enum.rst:142 +#: ../../library/enum.rst:143 msgid "" "Modify the :class:`str() ` and :func:`repr` of an enum to show its " "members as belonging to the module instead of its class. Should only be used " "if the enum members will be exported to the module global namespace." msgstr "" -#: ../../library/enum.rst:147 +#: ../../library/enum.rst:148 msgid ":func:`show_flag_values`" msgstr ":func:`show_flag_values`" -#: ../../library/enum.rst:149 +#: ../../library/enum.rst:150 msgid "Return a list of all power-of-two integers contained in a flag." msgstr "" -#: ../../library/enum.rst:152 +#: ../../library/enum.rst:153 msgid "``Flag``, ``IntFlag``, ``auto``" msgstr "``Flag``, ``IntFlag``, ``auto``" -#: ../../library/enum.rst:153 +#: ../../library/enum.rst:154 msgid "" "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " "``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" @@ -277,18 +279,18 @@ msgstr "" "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " "``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" -#: ../../library/enum.rst:158 +#: ../../library/enum.rst:159 msgid "Data Types" msgstr "" -#: ../../library/enum.rst:163 +#: ../../library/enum.rst:164 msgid "" "*EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible " "to subclass *EnumType* -- see :ref:`Subclassing EnumType ` for details." msgstr "" -#: ../../library/enum.rst:167 +#: ../../library/enum.rst:168 msgid "" "*EnumType* is responsible for setting the correct :meth:`__repr__`, :meth:" "`__str__`, :meth:`__format__`, and :meth:`__reduce__` methods on the final " @@ -296,88 +298,88 @@ msgid "" "providing iteration over the enum class, etc." msgstr "" -#: ../../library/enum.rst:174 +#: ../../library/enum.rst:175 msgid "Returns ``True`` if member belongs to the ``cls``::" msgstr "" -#: ../../library/enum.rst:182 +#: ../../library/enum.rst:183 msgid "" "In Python 3.12 it will be possible to check for member values and not just " "members; until then, a ``TypeError`` will be raised if a non-Enum-member is " "used in a containment check." msgstr "" -#: ../../library/enum.rst:188 +#: ../../library/enum.rst:189 msgid "" "Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " "names of the members in *cls*::" msgstr "" -#: ../../library/enum.rst:196 +#: ../../library/enum.rst:197 msgid "" "Returns the Enum member in *cls* matching *name*, or raises an :exc:" "`AttributeError`::" msgstr "" -#: ../../library/enum.rst:203 +#: ../../library/enum.rst:204 msgid "" "Returns the Enum member in *cls* matching *name*, or raises an :exc:" "`KeyError`::" msgstr "" -#: ../../library/enum.rst:210 +#: ../../library/enum.rst:211 msgid "Returns each member in *cls* in definition order::" msgstr "" -#: ../../library/enum.rst:217 +#: ../../library/enum.rst:218 msgid "Returns the number of member in *cls*::" msgstr "" -#: ../../library/enum.rst:224 +#: ../../library/enum.rst:225 msgid "Returns each member in *cls* in reverse definition order::" msgstr "" -#: ../../library/enum.rst:232 +#: ../../library/enum.rst:233 msgid "*Enum* is the base class for all *enum* enumerations." msgstr "" -#: ../../library/enum.rst:236 +#: ../../library/enum.rst:237 msgid "The name used to define the ``Enum`` member::" msgstr "" -#: ../../library/enum.rst:243 +#: ../../library/enum.rst:244 msgid "The value given to the ``Enum`` member::" msgstr "" -#: ../../library/enum.rst:248 +#: ../../library/enum.rst:249 msgid "Enum member values" msgstr "" -#: ../../library/enum.rst:250 +#: ../../library/enum.rst:251 msgid "" "Member values can be anything: :class:`int`, :class:`str`, etc.. If the " "exact value is unimportant you may use :class:`auto` instances and an " "appropriate value will be chosen for you. See :class:`auto` for the details." msgstr "" -#: ../../library/enum.rst:257 +#: ../../library/enum.rst:258 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." msgstr "" -#: ../../library/enum.rst:260 +#: ../../library/enum.rst:261 msgid "" "``_ignore_`` is a list of names that will not become members, and whose " "names will also be removed from the completed enumeration. See :ref:" "`TimePeriod ` for an example." msgstr "" -#: ../../library/enum.rst:266 +#: ../../library/enum.rst:267 msgid "This method is called in two different ways:" msgstr "" -#: ../../library/enum.rst:268 +#: ../../library/enum.rst:269 msgid "to look up an existing member:" msgstr "" @@ -385,7 +387,7 @@ msgstr "" msgid "cls" msgstr "cls" -#: ../../library/enum.rst:270 ../../library/enum.rst:275 +#: ../../library/enum.rst:271 ../../library/enum.rst:276 msgid "The enum class being called." msgstr "" @@ -393,15 +395,15 @@ msgstr "" msgid "value" msgstr "" -#: ../../library/enum.rst:271 +#: ../../library/enum.rst:272 msgid "The value to lookup." msgstr "" -#: ../../library/enum.rst:273 +#: ../../library/enum.rst:274 msgid "to use the ``cls`` enum to create a new enum:" msgstr "" -#: ../../library/enum.rst:276 +#: ../../library/enum.rst:277 msgid "The name of the new Enum to create." msgstr "" @@ -409,7 +411,7 @@ msgstr "" msgid "names" msgstr "" -#: ../../library/enum.rst:277 +#: ../../library/enum.rst:278 msgid "The names/values of the members for the new Enum." msgstr "" @@ -417,7 +419,7 @@ msgstr "" msgid "module" msgstr "模組" -#: ../../library/enum.rst:278 +#: ../../library/enum.rst:279 msgid "The name of the module the new Enum is created in." msgstr "" @@ -425,7 +427,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../library/enum.rst:279 +#: ../../library/enum.rst:280 msgid "The actual location in the module where this Enum can be found." msgstr "" @@ -433,7 +435,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../library/enum.rst:280 +#: ../../library/enum.rst:281 msgid "A mix-in type for the new Enum." msgstr "" @@ -441,7 +443,7 @@ msgstr "" msgid "start" msgstr "" -#: ../../library/enum.rst:281 +#: ../../library/enum.rst:282 msgid "The first integer value for the Enum (used by :class:`auto`)" msgstr "" @@ -449,12 +451,12 @@ msgstr "" msgid "boundary" msgstr "" -#: ../../library/enum.rst:282 +#: ../../library/enum.rst:283 msgid "" "How to handle out-of-range values from bit operations (:class:`Flag` only)" msgstr "" -#: ../../library/enum.rst:286 +#: ../../library/enum.rst:287 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" @@ -464,11 +466,11 @@ msgstr "" msgid "name" msgstr "" -#: ../../library/enum.rst:306 +#: ../../library/enum.rst:307 msgid "The name of the member being defined (e.g. 'RED')." msgstr "" -#: ../../library/enum.rst:307 +#: ../../library/enum.rst:308 msgid "The start value for the Enum; the default is 1." msgstr "" @@ -476,7 +478,7 @@ msgstr "" msgid "count" msgstr "" -#: ../../library/enum.rst:308 +#: ../../library/enum.rst:309 msgid "The number of members currently defined, not including this one." msgstr "" @@ -484,53 +486,53 @@ msgstr "" msgid "last_values" msgstr "" -#: ../../library/enum.rst:309 +#: ../../library/enum.rst:310 msgid "A list of the previous values." msgstr "" -#: ../../library/enum.rst:311 +#: ../../library/enum.rst:312 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" msgstr "" -#: ../../library/enum.rst:326 +#: ../../library/enum.rst:327 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "" -#: ../../library/enum.rst:331 +#: ../../library/enum.rst:332 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" msgstr "" -#: ../../library/enum.rst:352 +#: ../../library/enum.rst:353 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" msgstr "" -#: ../../library/enum.rst:367 +#: ../../library/enum.rst:368 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" msgstr "" -#: ../../library/enum.rst:381 +#: ../../library/enum.rst:382 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` returns, but can be overridden::" msgstr "" -#: ../../library/enum.rst:395 +#: ../../library/enum.rst:396 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr "" -#: ../../library/enum.rst:401 +#: ../../library/enum.rst:402 msgid "" "*IntEnum* is the same as *Enum*, but its members are also integers and can " "be used anywhere that an integer can be used. If any integer operation is " @@ -538,20 +540,20 @@ msgid "" "enumeration status." msgstr "" -#: ../../library/enum.rst:421 +#: ../../library/enum.rst:422 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr "" -#: ../../library/enum.rst:424 ../../library/enum.rst:595 +#: ../../library/enum.rst:425 msgid "" ":meth:`__str__` is now :func:`int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`__format__` was " "already :func:`int.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:431 +#: ../../library/enum.rst:432 msgid "" "*StrEnum* is the same as *Enum*, but its members are also strings and can be " "used in most of the same places that a string can be used. The result of " @@ -559,7 +561,7 @@ msgid "" "the enumeration." msgstr "" -#: ../../library/enum.rst:435 +#: ../../library/enum.rst:438 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -567,268 +569,286 @@ msgid "" "``str(StrEnum.member)``." msgstr "" -#: ../../library/enum.rst:442 +#: ../../library/enum.rst:445 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr "" -#: ../../library/enum.rst:445 +#: ../../library/enum.rst:450 msgid "" -":meth:`__str__` is :func:`str.__str__` to better support the *replacement of " -"existing constants* use-case. :meth:`__format__` is likewise :func:`str." -"__format__` for that same reason." +":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " +"*replacement of existing constants* use-case. :meth:`~object.__format__` is " +"likewise :meth:`!str.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:453 +#: ../../library/enum.rst:458 msgid "" "*Flag* members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), " "``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are " "members of the enumeration." msgstr "" -#: ../../library/enum.rst:459 +#: ../../library/enum.rst:464 msgid "Returns *True* if value is in self::" msgstr "" -#: ../../library/enum.rst:479 -msgid "Returns all contained members::" +#: ../../library/enum.rst:484 +msgid "Returns all contained non-alias members::" msgstr "" -#: ../../library/enum.rst:488 -msgid "Returns number of members in flag::" +#: ../../library/enum.rst:493 +msgid "Aliases are no longer returned during iteration." msgstr "" #: ../../library/enum.rst:497 +msgid "Returns number of members in flag::" +msgstr "" + +#: ../../library/enum.rst:506 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "" -#: ../../library/enum.rst:509 +#: ../../library/enum.rst:518 msgid "Returns current flag binary or'ed with other::" msgstr "" -#: ../../library/enum.rst:516 +#: ../../library/enum.rst:525 msgid "Returns current flag binary and'ed with other::" msgstr "" -#: ../../library/enum.rst:525 +#: ../../library/enum.rst:534 msgid "Returns current flag binary xor'ed with other::" msgstr "" -#: ../../library/enum.rst:534 +#: ../../library/enum.rst:543 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "" -#: ../../library/enum.rst:545 +#: ../../library/enum.rst:554 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." msgstr "" -#: ../../library/enum.rst:550 +#: ../../library/enum.rst:559 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr "" -#: ../../library/enum.rst:553 +#: ../../library/enum.rst:562 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "" -#: ../../library/enum.rst:561 +#: ../../library/enum.rst:570 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." msgstr "" -#: ../../library/enum.rst:574 +#: ../../library/enum.rst:583 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "" -#: ../../library/enum.rst:580 +#: ../../library/enum.rst:589 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" msgstr "" -#: ../../library/enum.rst:582 +#: ../../library/enum.rst:591 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "" -#: ../../library/enum.rst:583 +#: ../../library/enum.rst:592 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "" -#: ../../library/enum.rst:585 +#: ../../library/enum.rst:594 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "" -#: ../../library/enum.rst:592 +#: ../../library/enum.rst:601 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" -#: ../../library/enum.rst:601 +#: ../../library/enum.rst:606 +msgid "" +":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " +"*replacement of existing constants* use-case. :meth:`~object.__format__` " +"was already :meth:`!int.__format__` for that same reason." +msgstr "" + +#: ../../library/enum.rst:610 +msgid "" +"Inversion of a :class:`!IntFlag` now returns a positive value that is the " +"union of all flags not in the given flag, rather than a negative value. This " +"matches the existing :class:`Flag` behavior." +msgstr "" + +#: ../../library/enum.rst:616 msgid "" ":class:`!ReprEum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" msgstr "" -#: ../../library/enum.rst:604 +#: ../../library/enum.rst:619 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:605 +#: ../../library/enum.rst:620 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "" -#: ../../library/enum.rst:607 +#: ../../library/enum.rst:622 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" "default :meth:`str() `." msgstr "" -#: ../../library/enum.rst:616 +#: ../../library/enum.rst:631 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." msgstr "" -#: ../../library/enum.rst:621 +#: ../../library/enum.rst:636 msgid "Ensure that each value has only one name::" msgstr "" -#: ../../library/enum.rst:637 +#: ../../library/enum.rst:652 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "" -#: ../../library/enum.rst:652 +#: ../../library/enum.rst:667 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`" msgstr "" -#: ../../library/enum.rst:669 +#: ../../library/enum.rst:684 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "" -#: ../../library/enum.rst:675 +#: ../../library/enum.rst:690 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "" -#: ../../library/enum.rst:680 +#: ../../library/enum.rst:695 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "" -#: ../../library/enum.rst:697 +#: ../../library/enum.rst:712 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "" -#: ../../library/enum.rst:710 +#: ../../library/enum.rst:725 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`. " "This is the default for :class:`IntFlag`::" msgstr "" -#: ../../library/enum.rst:723 +#: ../../library/enum.rst:738 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is " "used for some stdlib flags:" msgstr "" -#: ../../library/enum.rst:739 +#: ../../library/enum.rst:754 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../library/enum.rst:741 +#: ../../library/enum.rst:756 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../library/enum.rst:744 +#: ../../library/enum.rst:759 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../library/enum.rst:750 +#: ../../library/enum.rst:765 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../library/enum.rst:752 +#: ../../library/enum.rst:767 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../library/enum.rst:753 +#: ../../library/enum.rst:768 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../library/enum.rst:755 +#: ../../library/enum.rst:770 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../library/enum.rst:757 +#: ../../library/enum.rst:772 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../library/enum.rst:760 +#: ../../library/enum.rst:775 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:762 +#: ../../library/enum.rst:777 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "" -#: ../../library/enum.rst:767 +#: ../../library/enum.rst:782 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../library/enum.rst:770 +#: ../../library/enum.rst:785 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../library/enum.rst:773 +#: ../../library/enum.rst:788 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:774 +#: ../../library/enum.rst:789 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:779 +#: ../../library/enum.rst:794 msgid "Utilities and Decorators" msgstr "" -#: ../../library/enum.rst:783 +#: ../../library/enum.rst:798 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`_generate_next_value_` to get an appropriate value. " @@ -839,52 +859,52 @@ msgid "" "specified values." msgstr "" -#: ../../library/enum.rst:791 +#: ../../library/enum.rst:806 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "" -#: ../../library/enum.rst:793 +#: ../../library/enum.rst:808 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "" -#: ../../library/enum.rst:794 +#: ../../library/enum.rst:809 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" -#: ../../library/enum.rst:795 +#: ../../library/enum.rst:810 msgid "used to create the ``SECOND`` enum member;" msgstr "" -#: ../../library/enum.rst:796 +#: ../../library/enum.rst:811 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" -#: ../../library/enum.rst:799 +#: ../../library/enum.rst:814 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: ../../library/enum.rst:802 +#: ../../library/enum.rst:817 msgid "" "in 3.13 the default ``\"generate_next_value_`` will always return the " "highest member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: ../../library/enum.rst:808 +#: ../../library/enum.rst:823 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: ../../library/enum.rst:812 +#: ../../library/enum.rst:827 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -892,29 +912,29 @@ msgid "" "``name``." msgstr "" -#: ../../library/enum.rst:821 +#: ../../library/enum.rst:836 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`__members__`, gathering any aliases it finds; if any " "are found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:839 +#: ../../library/enum.rst:854 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: ../../library/enum.rst:847 +#: ../../library/enum.rst:862 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: ../../library/enum.rst:853 +#: ../../library/enum.rst:868 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: ../../library/enum.rst:859 +#: ../../library/enum.rst:874 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -922,41 +942,41 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: ../../library/enum.rst:869 +#: ../../library/enum.rst:884 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: ../../library/enum.rst:876 +#: ../../library/enum.rst:891 msgid "Notes" msgstr "" -#: ../../library/enum.rst:878 +#: ../../library/enum.rst:893 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:880 +#: ../../library/enum.rst:895 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: ../../library/enum.rst:883 +#: ../../library/enum.rst:898 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: ../../library/enum.rst:885 +#: ../../library/enum.rst:900 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: ../../library/enum.rst:888 +#: ../../library/enum.rst:903 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: ../../library/enum.rst:895 +#: ../../library/enum.rst:910 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" diff --git a/library/sqlite3.po b/library/sqlite3.po index 4af031fc2f..db44c8b70d 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-04 00:20+0000\n" +"POT-Creation-Date: 2022-11-12 20:01+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-" @@ -1864,11 +1864,11 @@ msgstr "" msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2090 +#: ../../library/sqlite3.rst:2109 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2092 +#: ../../library/sqlite3.rst:2111 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1880,11 +1880,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2133 +#: ../../library/sqlite3.rst:2152 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2135 +#: ../../library/sqlite3.rst:2154 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1894,61 +1894,61 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:2144 +#: ../../library/sqlite3.rst:2163 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:2149 +#: ../../library/sqlite3.rst:2168 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2182 +#: ../../library/sqlite3.rst:2201 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2184 +#: ../../library/sqlite3.rst:2203 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2186 +#: ../../library/sqlite3.rst:2205 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2195 +#: ../../library/sqlite3.rst:2214 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2205 +#: ../../library/sqlite3.rst:2224 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2219 +#: ../../library/sqlite3.rst:2238 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2228 +#: ../../library/sqlite3.rst:2247 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2233 +#: ../../library/sqlite3.rst:2252 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2235 +#: ../../library/sqlite3.rst:2254 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:2238 +#: ../../library/sqlite3.rst:2257 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -1962,7 +1962,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2251 +#: ../../library/sqlite3.rst:2270 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -1972,14 +1972,14 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2259 +#: ../../library/sqlite3.rst:2278 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2263 +#: ../../library/sqlite3.rst:2282 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." From 9ae4573a18795113cd1a9368677f3a41e2970377 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 14 Nov 2022 00:20:39 +0000 Subject: [PATCH 2/2] sync with cpython 51c68cf4 --- library/signal.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/signal.po b/library/signal.po index 0410cd82c0..6dc0ae9943 100644 --- a/library/signal.po +++ b/library/signal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-11-14 00:18+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-" @@ -413,9 +413,9 @@ msgstr "" #: ../../library/signal.rst:365 msgid "" -"Return the system description of the signal *signalnum*, such as \"Interrupt" -"\", \"Segmentation fault\", etc. Returns :const:`None` if the signal is not " -"recognized." +"Returns the description of signal *signalnum*, such as \"Interrupt\" for :" +"const:`SIGINT`. Returns :const:`None` if *signalnum* has no description. " +"Raises :exc:`ValueError` if *signalnum* is invalid." msgstr "" #: ../../library/signal.rst:374