From 86e0864125826055622650304288bb93c25b065a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 5 Nov 2021 00:10:25 +0000 Subject: [PATCH 1/7] sync with cpython 0e34a591 --- library/typing.po | 729 +++++++++++++++++++++++----------------------- 1 file changed, 364 insertions(+), 365 deletions(-) diff --git a/library/typing.po b/library/typing.po index e71e994f03..7887333084 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-29 16:03+0000\n" +"POT-Creation-Date: 2021-11-05 00:08+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,169 +36,168 @@ msgstr "" #: ../../library/typing.rst:20 msgid "" "This module provides runtime support for type hints. The most fundamental " -"support consists of the types :data:`Any`, :data:`Union`, :data:`Tuple`, :" -"data:`Callable`, :class:`TypeVar`, and :class:`Generic`. For a full " -"specification, please see :pep:`484`. For a simplified introduction to type " -"hints, see :pep:`483`." +"support consists of the types :data:`Any`, :data:`Union`, :data:`Callable`, :" +"class:`TypeVar`, and :class:`Generic`. For a full specification, please see :" +"pep:`484`. For a simplified introduction to type hints, see :pep:`483`." msgstr "" -#: ../../library/typing.rst:27 +#: ../../library/typing.rst:26 msgid "" "The function below takes and returns a string and is annotated as follows::" msgstr "" -#: ../../library/typing.rst:32 +#: ../../library/typing.rst:31 msgid "" "In the function ``greeting``, the argument ``name`` is expected to be of " "type :class:`str` and the return type :class:`str`. Subtypes are accepted as " "arguments." msgstr "" -#: ../../library/typing.rst:39 +#: ../../library/typing.rst:38 msgid "Relevant PEPs" msgstr "" -#: ../../library/typing.rst:41 +#: ../../library/typing.rst:40 msgid "" "Since the initial introduction of type hints in :pep:`484` and :pep:`483`, a " "number of PEPs have modified and enhanced Python's framework for type " "annotations. These include:" msgstr "" -#: ../../library/typing.rst:46 +#: ../../library/typing.rst:45 msgid ":pep:`526`: Syntax for Variable Annotations" msgstr "" -#: ../../library/typing.rst:46 +#: ../../library/typing.rst:45 msgid "" "*Introducing* syntax for annotating variables outside of function " "definitions, and :data:`ClassVar`" msgstr "" -#: ../../library/typing.rst:49 +#: ../../library/typing.rst:48 msgid ":pep:`544`: Protocols: Structural subtyping (static duck typing)" msgstr "" -#: ../../library/typing.rst:49 +#: ../../library/typing.rst:48 msgid "" "*Introducing* :class:`Protocol` and the :func:" "`@runtime_checkable` decorator" msgstr "" -#: ../../library/typing.rst:52 +#: ../../library/typing.rst:51 msgid ":pep:`585`: Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/typing.rst:52 +#: ../../library/typing.rst:51 msgid "" -"*Introducing* the ability to use builtin collections and ABCs as :term:" -"`generic types`" +"*Introducing* :class:`types.GenericAlias` and the ability to use standard " +"library classes as :ref:`generic types`" msgstr "" -#: ../../library/typing.rst:54 +#: ../../library/typing.rst:53 msgid ":pep:`586`: Literal Types" msgstr "" -#: ../../library/typing.rst:55 +#: ../../library/typing.rst:54 msgid "*Introducing* :data:`Literal`" msgstr "" -#: ../../library/typing.rst:56 +#: ../../library/typing.rst:55 msgid "" ":pep:`589`: TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys" msgstr "" -#: ../../library/typing.rst:57 +#: ../../library/typing.rst:56 msgid "*Introducing* :class:`TypedDict`" msgstr "" -#: ../../library/typing.rst:58 +#: ../../library/typing.rst:57 msgid ":pep:`591`: Adding a final qualifier to typing" msgstr "" -#: ../../library/typing.rst:59 +#: ../../library/typing.rst:58 msgid "*Introducing* :data:`Final` and the :func:`@final` decorator" msgstr "" -#: ../../library/typing.rst:60 +#: ../../library/typing.rst:59 msgid ":pep:`593`: Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:61 +#: ../../library/typing.rst:60 msgid "*Introducing* :data:`Annotated`" msgstr "" -#: ../../library/typing.rst:64 +#: ../../library/typing.rst:63 msgid ":pep:`604`: Allow writing union types as ``X | Y``" msgstr "" -#: ../../library/typing.rst:63 +#: ../../library/typing.rst:62 msgid "" "*Introducing* :data:`types.UnionType` and the ability to use the binary-or " "operator ``|`` to signify a :ref:`union of types`" msgstr "" -#: ../../library/typing.rst:66 +#: ../../library/typing.rst:65 msgid ":pep:`612`: Parameter Specification Variables" msgstr "" -#: ../../library/typing.rst:67 +#: ../../library/typing.rst:66 msgid "*Introducing* :class:`ParamSpec` and :data:`Concatenate`" msgstr "" -#: ../../library/typing.rst:68 +#: ../../library/typing.rst:67 msgid ":pep:`613`: Explicit Type Aliases" msgstr "" -#: ../../library/typing.rst:69 +#: ../../library/typing.rst:68 msgid "*Introducing* :data:`TypeAlias`" msgstr "" -#: ../../library/typing.rst:71 +#: ../../library/typing.rst:70 msgid ":pep:`647`: User-Defined Type Guards" msgstr "" -#: ../../library/typing.rst:71 +#: ../../library/typing.rst:70 msgid "*Introducing* :data:`TypeGuard`" msgstr "" -#: ../../library/typing.rst:76 +#: ../../library/typing.rst:75 msgid "Type aliases" msgstr "" -#: ../../library/typing.rst:78 +#: ../../library/typing.rst:77 msgid "" "A type alias is defined by assigning the type to the alias. In this example, " "``Vector`` and ``list[float]`` will be treated as interchangeable synonyms::" msgstr "" -#: ../../library/typing.rst:89 +#: ../../library/typing.rst:88 msgid "" "Type aliases are useful for simplifying complex type signatures. For " "example::" msgstr "" -#: ../../library/typing.rst:107 +#: ../../library/typing.rst:106 msgid "" "Note that ``None`` as a type hint is a special case and is replaced by " "``type(None)``." msgstr "" -#: ../../library/typing.rst:113 +#: ../../library/typing.rst:112 msgid "NewType" msgstr "" -#: ../../library/typing.rst:115 +#: ../../library/typing.rst:114 msgid "Use the :class:`NewType` helper class to create distinct types::" msgstr "" -#: ../../library/typing.rst:122 +#: ../../library/typing.rst:121 msgid "" "The static type checker will treat the new type as if it were a subclass of " "the original type. This is useful in helping catch logical errors::" msgstr "" -#: ../../library/typing.rst:134 +#: ../../library/typing.rst:133 msgid "" "You may still perform all ``int`` operations on a variable of type " "``UserId``, but the result will always be of type ``int``. This lets you " @@ -206,7 +205,7 @@ msgid "" "you from accidentally creating a ``UserId`` in an invalid way::" msgstr "" -#: ../../library/typing.rst:142 +#: ../../library/typing.rst:141 msgid "" "Note that these checks are enforced only by the static type checker. At " "runtime, the statement ``Derived = NewType('Derived', Base)`` will make " @@ -215,31 +214,31 @@ msgid "" "class or introduce much overhead beyond that of a regular function call." msgstr "" -#: ../../library/typing.rst:148 +#: ../../library/typing.rst:147 msgid "" "More precisely, the expression ``some_value is Derived(some_value)`` is " "always true at runtime." msgstr "" -#: ../../library/typing.rst:151 +#: ../../library/typing.rst:150 msgid "It is invalid to create a subtype of ``Derived``::" msgstr "" -#: ../../library/typing.rst:160 +#: ../../library/typing.rst:159 msgid "" "However, it is possible to create a :class:`NewType` based on a 'derived' " "``NewType``::" msgstr "" -#: ../../library/typing.rst:168 +#: ../../library/typing.rst:167 msgid "and typechecking for ``ProUserId`` will work as expected." msgstr "" -#: ../../library/typing.rst:170 +#: ../../library/typing.rst:169 msgid "See :pep:`484` for more details." msgstr "" -#: ../../library/typing.rst:174 +#: ../../library/typing.rst:173 msgid "" "Recall that the use of a type alias declares two types to be *equivalent* to " "one another. Doing ``Alias = Original`` will make the static type checker " @@ -247,7 +246,7 @@ msgid "" "This is useful when you want to simplify complex type signatures." msgstr "" -#: ../../library/typing.rst:179 +#: ../../library/typing.rst:178 msgid "" "In contrast, ``NewType`` declares one type to be a *subtype* of another. " "Doing ``Derived = NewType('Derived', Original)`` will make the static type " @@ -257,36 +256,36 @@ msgid "" "errors with minimal runtime cost." msgstr "" -#: ../../library/typing.rst:188 +#: ../../library/typing.rst:187 msgid "" "``NewType`` is now a class rather than a function. There is some additional " "runtime cost when calling ``NewType`` over a regular function. However, " "this cost will be reduced in 3.11.0." msgstr "" -#: ../../library/typing.rst:195 +#: ../../library/typing.rst:194 msgid "Callable" msgstr "" -#: ../../library/typing.rst:197 +#: ../../library/typing.rst:196 msgid "" "Frameworks expecting callback functions of specific signatures might be type " "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:200 ../../library/typing.rst:1011 -#: ../../library/typing.rst:2089 +#: ../../library/typing.rst:199 ../../library/typing.rst:1010 +#: ../../library/typing.rst:2088 msgid "For example::" msgstr "" -#: ../../library/typing.rst:211 +#: ../../library/typing.rst:210 msgid "" "It is possible to declare the return type of a callable without specifying " "the call signature by substituting a literal ellipsis for the list of " "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:215 ../../library/typing.rst:701 +#: ../../library/typing.rst:214 ../../library/typing.rst:700 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -297,97 +296,97 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:223 ../../library/typing.rst:713 +#: ../../library/typing.rst:222 ../../library/typing.rst:712 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more information." msgstr "" -#: ../../library/typing.rst:228 +#: ../../library/typing.rst:227 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:234 +#: ../../library/typing.rst:233 msgid "Generics" msgstr "" -#: ../../library/typing.rst:236 +#: ../../library/typing.rst:235 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, abstract base classes have been extended to " "support subscription to denote expected types for container elements." msgstr "" -#: ../../library/typing.rst:247 +#: ../../library/typing.rst:246 msgid "" "Generics can be parameterized by using a new factory available in typing " "called :class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:262 +#: ../../library/typing.rst:261 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:264 +#: ../../library/typing.rst:263 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:290 +#: ../../library/typing.rst:289 msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:294 +#: ../../library/typing.rst:293 msgid "" -"The :class:`Generic` base class defines :meth:`__class_getitem__` so that " -"``LoggedVar[t]`` is valid as a type::" +"The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " +"that ``LoggedVar[t]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:303 +#: ../../library/typing.rst:302 msgid "" "A generic type can have any number of type variables, and type variables may " "be constrained::" msgstr "" -#: ../../library/typing.rst:315 +#: ../../library/typing.rst:314 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:326 +#: ../../library/typing.rst:325 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:336 +#: ../../library/typing.rst:335 msgid "" "When inheriting from generic classes, some type variables could be fixed::" msgstr "" -#: ../../library/typing.rst:346 +#: ../../library/typing.rst:345 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:348 +#: ../../library/typing.rst:347 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``::" msgstr "" -#: ../../library/typing.rst:356 +#: ../../library/typing.rst:355 msgid "User defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:373 +#: ../../library/typing.rst:372 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:376 +#: ../../library/typing.rst:375 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -397,7 +396,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:393 +#: ../../library/typing.rst:392 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -405,20 +404,20 @@ msgid "" "converted to the former and are thus equivalent::" msgstr "" -#: ../../library/typing.rst:405 +#: ../../library/typing.rst:404 msgid "" "Do note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:409 +#: ../../library/typing.rst:408 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:413 +#: ../../library/typing.rst:412 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -426,24 +425,24 @@ msgid "" "hashable and comparable for equality." msgstr "" -#: ../../library/typing.rst:420 +#: ../../library/typing.rst:419 msgid "The :data:`Any` type" msgstr "" -#: ../../library/typing.rst:422 +#: ../../library/typing.rst:421 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:426 +#: ../../library/typing.rst:425 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:444 +#: ../../library/typing.rst:443 msgid "" "Notice that no typechecking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -452,19 +451,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:450 +#: ../../library/typing.rst:449 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:463 +#: ../../library/typing.rst:462 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:466 +#: ../../library/typing.rst:465 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -472,7 +471,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:471 +#: ../../library/typing.rst:470 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -480,24 +479,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:493 +#: ../../library/typing.rst:492 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:498 +#: ../../library/typing.rst:497 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:500 +#: ../../library/typing.rst:499 msgid "" "Initially :pep:`484` defined Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:504 +#: ../../library/typing.rst:503 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -506,7 +505,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:517 +#: ../../library/typing.rst:516 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -515,22 +514,22 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:533 +#: ../../library/typing.rst:532 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:538 +#: ../../library/typing.rst:537 msgid "Module contents" msgstr "" -#: ../../library/typing.rst:540 +#: ../../library/typing.rst:539 msgid "The module defines the following classes, functions and decorators." msgstr "" -#: ../../library/typing.rst:544 +#: ../../library/typing.rst:543 msgid "" "This module defines several types that are subclasses of pre-existing " "standard library classes which also extend :class:`Generic` to support type " @@ -538,7 +537,7 @@ msgid "" "corresponding pre-existing classes were enhanced to support ``[]``." msgstr "" -#: ../../library/typing.rst:550 +#: ../../library/typing.rst:549 msgid "" "The redundant types are deprecated as of Python 3.9 but no deprecation " "warnings will be issued by the interpreter. It is expected that type " @@ -546,147 +545,147 @@ msgid "" "Python 3.9 or newer." msgstr "" -#: ../../library/typing.rst:555 +#: ../../library/typing.rst:554 msgid "" "The deprecated types will be removed from the :mod:`typing` module in the " "first Python version released 5 years after the release of Python 3.9.0. See " "details in :pep:`585`—*Type Hinting Generics In Standard Collections*." msgstr "" -#: ../../library/typing.rst:561 +#: ../../library/typing.rst:560 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:564 +#: ../../library/typing.rst:563 msgid "Special types" msgstr "" -#: ../../library/typing.rst:566 +#: ../../library/typing.rst:565 msgid "These can be used as types in annotations and do not support ``[]``." msgstr "" -#: ../../library/typing.rst:570 +#: ../../library/typing.rst:569 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:572 +#: ../../library/typing.rst:571 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:573 +#: ../../library/typing.rst:572 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:577 +#: ../../library/typing.rst:576 msgid "Special type indicating that a function never returns. For example::" msgstr "" -#: ../../library/typing.rst:590 +#: ../../library/typing.rst:589 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `. For example::" msgstr "" -#: ../../library/typing.rst:597 +#: ../../library/typing.rst:596 msgid "See :pep:`613` for more details about explicit type aliases." msgstr "" -#: ../../library/typing.rst:602 +#: ../../library/typing.rst:601 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:604 +#: ../../library/typing.rst:603 msgid "" "These can be used as types in annotations using ``[]``, each having a unique " "syntax." msgstr "" -#: ../../library/typing.rst:608 +#: ../../library/typing.rst:607 msgid "" "Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items with the " "first item of type X and the second of type Y. The type of the empty tuple " "can be written as ``Tuple[()]``." msgstr "" -#: ../../library/typing.rst:612 +#: ../../library/typing.rst:611 msgid "" "Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " "variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " "float and a string." msgstr "" -#: ../../library/typing.rst:616 +#: ../../library/typing.rst:615 msgid "" "To specify a variable-length tuple of homogeneous type, use literal " "ellipsis, e.g. ``Tuple[int, ...]``. A plain :data:`Tuple` is equivalent to " "``Tuple[Any, ...]``, and in turn to :class:`tuple`." msgstr "" -#: ../../library/typing.rst:620 +#: ../../library/typing.rst:619 msgid "" ":class:`builtins.tuple ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:626 +#: ../../library/typing.rst:625 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:628 +#: ../../library/typing.rst:627 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Details:" msgstr "" -#: ../../library/typing.rst:630 +#: ../../library/typing.rst:629 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:632 +#: ../../library/typing.rst:631 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:636 +#: ../../library/typing.rst:635 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:640 +#: ../../library/typing.rst:639 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:644 +#: ../../library/typing.rst:643 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:648 +#: ../../library/typing.rst:647 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:650 +#: ../../library/typing.rst:649 msgid "You cannot write ``Union[X][Y]``." msgstr "" -#: ../../library/typing.rst:652 +#: ../../library/typing.rst:651 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:655 +#: ../../library/typing.rst:654 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:661 +#: ../../library/typing.rst:660 msgid "Optional type." msgstr "" -#: ../../library/typing.rst:663 +#: ../../library/typing.rst:662 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:665 +#: ../../library/typing.rst:664 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -694,31 +693,31 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:673 +#: ../../library/typing.rst:672 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:680 +#: ../../library/typing.rst:679 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:686 +#: ../../library/typing.rst:685 msgid "Callable type; ``Callable[[int], str]`` is a function of (int) -> str." msgstr "" -#: ../../library/typing.rst:688 +#: ../../library/typing.rst:687 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " "types or an ellipsis; the return type must be a single type." msgstr "" -#: ../../library/typing.rst:693 +#: ../../library/typing.rst:692 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -728,19 +727,19 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:709 +#: ../../library/typing.rst:708 msgid "" ":class:`collections.abc.Callable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:718 +#: ../../library/typing.rst:717 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:723 +#: ../../library/typing.rst:722 msgid "" "Used with :data:`Callable` and :class:`ParamSpec` to type annotate a higher " "order callable which adds, removes, or transforms parameters of another " @@ -750,7 +749,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec`." msgstr "" -#: ../../library/typing.rst:730 +#: ../../library/typing.rst:729 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -761,17 +760,17 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:770 ../../library/typing.rst:1190 +#: ../../library/typing.rst:769 ../../library/typing.rst:1189 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:772 +#: ../../library/typing.rst:771 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr "" -#: ../../library/typing.rst:777 +#: ../../library/typing.rst:776 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``Type[C]`` may accept values that are " @@ -779,11 +778,11 @@ msgid "" "``C``. For example::" msgstr "" -#: ../../library/typing.rst:786 +#: ../../library/typing.rst:785 msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:798 +#: ../../library/typing.rst:797 msgid "" "The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " "should implement the same constructor signature and class method signatures " @@ -793,39 +792,39 @@ msgid "" "particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:806 +#: ../../library/typing.rst:805 msgid "" "The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:812 +#: ../../library/typing.rst:811 msgid "" "``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " "``type``, which is the root of Python's metaclass hierarchy." msgstr "" -#: ../../library/typing.rst:817 +#: ../../library/typing.rst:816 msgid "" ":class:`builtins.type ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:823 +#: ../../library/typing.rst:822 msgid "" "A type that can be used to indicate to type checkers that the corresponding " "variable or function parameter has a value equivalent to the provided " "literal (or one of several literals). For example::" msgstr "" -#: ../../library/typing.rst:837 +#: ../../library/typing.rst:836 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:843 +#: ../../library/typing.rst:842 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -833,22 +832,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:851 +#: ../../library/typing.rst:850 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:853 +#: ../../library/typing.rst:852 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:861 +#: ../../library/typing.rst:860 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:863 +#: ../../library/typing.rst:862 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -856,19 +855,19 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:877 +#: ../../library/typing.rst:876 msgid "" "A special typing construct to indicate to type checkers that a name cannot " "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:889 ../../library/typing.rst:1984 +#: ../../library/typing.rst:888 ../../library/typing.rst:1983 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:896 +#: ../../library/typing.rst:895 msgid "" "A type, introduced in :pep:`593` (``Flexible function and variable " "annotations``), to decorate existing types with context-specific metadata " @@ -885,7 +884,7 @@ msgid "" "``x`` within a specific application." msgstr "" -#: ../../library/typing.rst:910 +#: ../../library/typing.rst:909 msgid "" "Ultimately, the responsibility of how to interpret the annotations (if at " "all) is the responsibility of the tool or library encountering the " @@ -894,21 +893,21 @@ msgid "" "using ``isinstance()``)." msgstr "" -#: ../../library/typing.rst:916 +#: ../../library/typing.rst:915 msgid "" "When a tool or a library does not support annotations or encounters an " "unknown annotation it should just ignore it and treat annotated type as the " "underlying type." msgstr "" -#: ../../library/typing.rst:920 +#: ../../library/typing.rst:919 msgid "" "It's up to the tool consuming the annotations to decide whether the client " "is allowed to have several annotations on one type and how to merge those " "annotations." msgstr "" -#: ../../library/typing.rst:924 +#: ../../library/typing.rst:923 msgid "" "Since the ``Annotated`` type allows you to put several annotations of the " "same (or different) type(s) on any node, the tools or libraries consuming " @@ -916,59 +915,59 @@ msgid "" "example, if you are doing value range analysis you might allow this::" msgstr "" -#: ../../library/typing.rst:933 +#: ../../library/typing.rst:932 msgid "" "Passing ``include_extras=True`` to :func:`get_type_hints` lets one access " "the extra annotations at runtime." msgstr "" -#: ../../library/typing.rst:936 +#: ../../library/typing.rst:935 msgid "The details of the syntax:" msgstr "" -#: ../../library/typing.rst:938 +#: ../../library/typing.rst:937 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:940 +#: ../../library/typing.rst:939 msgid "" "Multiple type annotations are supported (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:945 +#: ../../library/typing.rst:944 msgid "" "``Annotated`` must be called with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:948 +#: ../../library/typing.rst:947 msgid "" "The order of the annotations is preserved and matters for equality checks::" msgstr "" -#: ../../library/typing.rst:955 +#: ../../library/typing.rst:954 msgid "" "Nested ``Annotated`` types are flattened, with metadata ordered starting " "with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:962 +#: ../../library/typing.rst:961 msgid "Duplicated annotations are not removed::" msgstr "" -#: ../../library/typing.rst:968 +#: ../../library/typing.rst:967 msgid "``Annotated`` can be used with nested and generic aliases::" msgstr "" -#: ../../library/typing.rst:981 +#: ../../library/typing.rst:980 msgid "" "Special typing form used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:985 +#: ../../library/typing.rst:984 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -977,44 +976,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1000 +#: ../../library/typing.rst:999 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1004 +#: ../../library/typing.rst:1003 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1007 +#: ../../library/typing.rst:1006 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1008 +#: ../../library/typing.rst:1007 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1025 +#: ../../library/typing.rst:1024 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1029 +#: ../../library/typing.rst:1028 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1035 +#: ../../library/typing.rst:1034 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``List[object]`` " @@ -1023,47 +1022,47 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1041 +#: ../../library/typing.rst:1040 msgid "" "``TypeGuard`` also works with type variables. For more information, see :" "pep:`647` (User-Defined Type Guards)." msgstr "" -#: ../../library/typing.rst:1048 +#: ../../library/typing.rst:1047 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1050 +#: ../../library/typing.rst:1049 msgid "" "These are not used in annotations. They are building blocks for creating " "generic types." msgstr "" -#: ../../library/typing.rst:1054 +#: ../../library/typing.rst:1053 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1056 +#: ../../library/typing.rst:1055 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1065 +#: ../../library/typing.rst:1064 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1078 +#: ../../library/typing.rst:1077 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1080 ../../library/typing.rst:1119 -#: ../../library/typing.rst:1296 +#: ../../library/typing.rst:1079 ../../library/typing.rst:1118 +#: ../../library/typing.rst:1295 msgid "Usage::" msgstr "" -#: ../../library/typing.rst:1085 +#: ../../library/typing.rst:1084 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1071,7 +1070,7 @@ msgid "" "types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1098 +#: ../../library/typing.rst:1097 msgid "" "The latter example's signature is essentially the overloading of ``(str, " "str) -> str`` and ``(bytes, bytes) -> bytes``. Also note that if the " @@ -1079,13 +1078,13 @@ msgid "" "still plain :class:`str`." msgstr "" -#: ../../library/typing.rst:1103 +#: ../../library/typing.rst:1102 msgid "" "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general, :" "func:`isinstance` and :func:`issubclass` should not be used with types." msgstr "" -#: ../../library/typing.rst:1106 +#: ../../library/typing.rst:1105 msgid "" "Type variables may be marked covariant or contravariant by passing " "``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " @@ -1095,13 +1094,13 @@ msgid "" "must be a subclass of the boundary type, see :pep:`484`." msgstr "" -#: ../../library/typing.rst:1116 +#: ../../library/typing.rst:1115 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1123 +#: ../../library/typing.rst:1122 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1111,7 +1110,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1130 +#: ../../library/typing.rst:1129 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1119,27 +1118,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1154 +#: ../../library/typing.rst:1153 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1158 +#: ../../library/typing.rst:1157 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1160 +#: ../../library/typing.rst:1159 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1167 +#: ../../library/typing.rst:1166 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1152,7 +1151,7 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1177 +#: ../../library/typing.rst:1176 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1161,17 +1160,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1186 +#: ../../library/typing.rst:1185 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1192 +#: ../../library/typing.rst:1191 msgid ":class:`Callable` and :class:`Concatenate`." msgstr "" -#: ../../library/typing.rst:1197 +#: ../../library/typing.rst:1196 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1179,36 +1178,36 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1202 +#: ../../library/typing.rst:1201 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``::" msgstr "" -#: ../../library/typing.rst:1214 +#: ../../library/typing.rst:1213 msgid "" "``AnyStr`` is a type variable defined as ``AnyStr = TypeVar('AnyStr', str, " "bytes)``." msgstr "" -#: ../../library/typing.rst:1217 +#: ../../library/typing.rst:1216 msgid "" "It is meant to be used for functions that may accept any kind of string " "without allowing different kinds of strings to mix. For example::" msgstr "" -#: ../../library/typing.rst:1229 +#: ../../library/typing.rst:1228 msgid "" "Base class for protocol classes. Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1235 +#: ../../library/typing.rst:1234 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1247 +#: ../../library/typing.rst:1246 msgid "" "See :pep:`544` for details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1216,15 +1215,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1252 +#: ../../library/typing.rst:1251 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1262 +#: ../../library/typing.rst:1261 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1264 +#: ../../library/typing.rst:1263 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1233,7 +1232,7 @@ msgid "" "For example::" msgstr "" -#: ../../library/typing.rst:1277 +#: ../../library/typing.rst:1276 msgid "" ":func:`runtime_checkable` will check only the presence of the required " "methods, not their type signatures. For example, :class:`ssl.SSLObject` is a " @@ -1243,35 +1242,35 @@ msgid "" "making it impossible to call (instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:1288 +#: ../../library/typing.rst:1287 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1290 +#: ../../library/typing.rst:1289 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1294 +#: ../../library/typing.rst:1293 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1302 +#: ../../library/typing.rst:1301 msgid "This is equivalent to::" msgstr "" -#: ../../library/typing.rst:1306 +#: ../../library/typing.rst:1305 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1315 +#: ../../library/typing.rst:1314 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1317 +#: ../../library/typing.rst:1316 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1279,52 +1278,52 @@ msgid "" "attribute both of which are part of the namedtuple API.)" msgstr "" -#: ../../library/typing.rst:1323 +#: ../../library/typing.rst:1322 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1333 +#: ../../library/typing.rst:1332 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1337 +#: ../../library/typing.rst:1336 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1340 +#: ../../library/typing.rst:1339 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1343 +#: ../../library/typing.rst:1342 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1347 +#: ../../library/typing.rst:1346 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1353 +#: ../../library/typing.rst:1352 msgid "" "A helper class to indicate a distinct type to a typechecker, see :ref:" "`distinct`. At runtime it returns an object that returns its argument when " "called. Usage::" msgstr "" -#: ../../library/typing.rst:1363 +#: ../../library/typing.rst:1362 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1368 +#: ../../library/typing.rst:1367 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1371 +#: ../../library/typing.rst:1370 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1332,7 +1331,7 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1387 +#: ../../library/typing.rst:1386 msgid "" "The type info for introspection can be accessed via ``Point2D." "__annotations__``, ``Point2D.__total__``, ``Point2D.__required_keys__``, and " @@ -1341,13 +1340,13 @@ msgid "" "two additional equivalent syntactic forms::" msgstr "" -#: ../../library/typing.rst:1397 +#: ../../library/typing.rst:1396 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "override this by specifying totality. Usage::" msgstr "" -#: ../../library/typing.rst:1405 +#: ../../library/typing.rst:1404 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1355,152 +1354,152 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1410 +#: ../../library/typing.rst:1409 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1415 +#: ../../library/typing.rst:1414 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1418 +#: ../../library/typing.rst:1417 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1422 +#: ../../library/typing.rst:1421 msgid "" "A generic version of :class:`dict`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Mapping`." msgstr "" -#: ../../library/typing.rst:1426 +#: ../../library/typing.rst:1425 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1431 +#: ../../library/typing.rst:1430 msgid "" ":class:`builtins.dict ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1437 +#: ../../library/typing.rst:1436 msgid "" "Generic version of :class:`list`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Sequence` or :class:`Iterable`." msgstr "" -#: ../../library/typing.rst:1442 +#: ../../library/typing.rst:1441 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1452 +#: ../../library/typing.rst:1451 msgid "" ":class:`builtins.list ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1458 +#: ../../library/typing.rst:1457 msgid "" "A generic version of :class:`builtins.set `. Useful for annotating " "return types. To annotate arguments it is preferred to use an abstract " "collection type such as :class:`AbstractSet`." msgstr "" -#: ../../library/typing.rst:1462 +#: ../../library/typing.rst:1461 msgid "" ":class:`builtins.set ` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1468 +#: ../../library/typing.rst:1467 msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:1470 +#: ../../library/typing.rst:1469 msgid "" ":class:`builtins.frozenset ` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1474 +#: ../../library/typing.rst:1473 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:1477 +#: ../../library/typing.rst:1476 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:1481 +#: ../../library/typing.rst:1480 msgid "A generic version of :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:1485 +#: ../../library/typing.rst:1484 msgid "" ":class:`collections.defaultdict` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1491 +#: ../../library/typing.rst:1490 msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:1495 +#: ../../library/typing.rst:1494 msgid "" ":class:`collections.OrderedDict` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1501 +#: ../../library/typing.rst:1500 msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:1506 +#: ../../library/typing.rst:1505 msgid "" ":class:`collections.ChainMap` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1512 +#: ../../library/typing.rst:1511 msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:1517 +#: ../../library/typing.rst:1516 msgid "" ":class:`collections.Counter` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1523 +#: ../../library/typing.rst:1522 msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:1528 +#: ../../library/typing.rst:1527 msgid "" ":class:`collections.deque` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1533 +#: ../../library/typing.rst:1532 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:1539 +#: ../../library/typing.rst:1538 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:1546 +#: ../../library/typing.rst:1545 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:1551 +#: ../../library/typing.rst:1550 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1508,413 +1507,413 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:1561 +#: ../../library/typing.rst:1560 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:1562 +#: ../../library/typing.rst:1561 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1568 +#: ../../library/typing.rst:1567 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:1572 +#: ../../library/typing.rst:1571 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1580 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:1584 +#: ../../library/typing.rst:1583 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:1588 +#: ../../library/typing.rst:1587 msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:1590 +#: ../../library/typing.rst:1589 msgid "" ":class:`collections.abc.Set` now supports ``[]``. See :pep:`585` and :ref:" "`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1596 +#: ../../library/typing.rst:1595 msgid "A generic version of :class:`collections.abc.ByteString`." msgstr "" -#: ../../library/typing.rst:1598 +#: ../../library/typing.rst:1597 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:1601 +#: ../../library/typing.rst:1600 msgid "" "As a shorthand for this type, :class:`bytes` can be used to annotate " "arguments of any of the types mentioned above." msgstr "" -#: ../../library/typing.rst:1604 +#: ../../library/typing.rst:1603 msgid "" ":class:`collections.abc.ByteString` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1610 +#: ../../library/typing.rst:1609 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:1614 +#: ../../library/typing.rst:1613 msgid "" ":class:`collections.abc.Collection` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1620 +#: ../../library/typing.rst:1619 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:1622 +#: ../../library/typing.rst:1621 msgid "" ":class:`collections.abc.Container` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1628 +#: ../../library/typing.rst:1627 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:1630 +#: ../../library/typing.rst:1629 msgid "" ":class:`collections.abc.ItemsView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1636 +#: ../../library/typing.rst:1635 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:1638 +#: ../../library/typing.rst:1637 msgid "" ":class:`collections.abc.KeysView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1644 +#: ../../library/typing.rst:1643 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:1650 +#: ../../library/typing.rst:1649 msgid "" ":class:`collections.abc.Mapping` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1656 +#: ../../library/typing.rst:1655 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:1658 +#: ../../library/typing.rst:1657 msgid "" ":class:`collections.abc.MappingView` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1664 +#: ../../library/typing.rst:1663 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:1666 +#: ../../library/typing.rst:1665 msgid "" ":class:`collections.abc.MutableMapping` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1671 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:1674 +#: ../../library/typing.rst:1673 msgid "" ":class:`collections.abc.MutableSequence` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1680 +#: ../../library/typing.rst:1679 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:1682 +#: ../../library/typing.rst:1681 msgid "" ":class:`collections.abc.MutableSet` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1688 +#: ../../library/typing.rst:1687 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:1690 +#: ../../library/typing.rst:1689 msgid "" ":class:`collections.abc.Sequence` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1696 +#: ../../library/typing.rst:1695 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:1698 +#: ../../library/typing.rst:1697 msgid "" ":class:`collections.abc.ValuesView` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1703 +#: ../../library/typing.rst:1702 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:1707 +#: ../../library/typing.rst:1706 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:1709 +#: ../../library/typing.rst:1708 msgid "" ":class:`collections.abc.Iterable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1715 +#: ../../library/typing.rst:1714 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:1717 +#: ../../library/typing.rst:1716 msgid "" ":class:`collections.abc.Iterator` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1722 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:1732 +#: ../../library/typing.rst:1731 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:1736 +#: ../../library/typing.rst:1735 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:1744 +#: ../../library/typing.rst:1743 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:1752 +#: ../../library/typing.rst:1751 msgid "" ":class:`collections.abc.Generator` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1758 +#: ../../library/typing.rst:1757 msgid "An alias to :class:`collections.abc.Hashable`" msgstr "" -#: ../../library/typing.rst:1762 +#: ../../library/typing.rst:1761 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:1764 +#: ../../library/typing.rst:1763 msgid "" ":class:`collections.abc.Reversible` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1770 +#: ../../library/typing.rst:1769 msgid "An alias to :class:`collections.abc.Sized`" msgstr "" -#: ../../library/typing.rst:1773 +#: ../../library/typing.rst:1772 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:1777 +#: ../../library/typing.rst:1776 msgid "" "A generic version of :class:`collections.abc.Coroutine`. The variance and " "order of type variables correspond to those of :class:`Generator`, for " "example::" msgstr "" -#: ../../library/typing.rst:1790 +#: ../../library/typing.rst:1789 msgid "" ":class:`collections.abc.Coroutine` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1796 +#: ../../library/typing.rst:1795 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:1805 +#: ../../library/typing.rst:1804 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:1809 +#: ../../library/typing.rst:1808 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:1817 +#: ../../library/typing.rst:1816 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:1827 +#: ../../library/typing.rst:1826 msgid "" ":class:`collections.abc.AsyncGenerator` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1833 +#: ../../library/typing.rst:1832 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:1837 +#: ../../library/typing.rst:1836 msgid "" ":class:`collections.abc.AsyncIterable` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1843 +#: ../../library/typing.rst:1842 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:1847 +#: ../../library/typing.rst:1846 msgid "" ":class:`collections.abc.AsyncIterator` now supports ``[]``. See :pep:`585` " "and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1853 +#: ../../library/typing.rst:1852 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:1857 +#: ../../library/typing.rst:1856 msgid "" ":class:`collections.abc.Awaitable` now supports ``[]``. See :pep:`585` and :" "ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1863 +#: ../../library/typing.rst:1862 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:1867 +#: ../../library/typing.rst:1866 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:1872 +#: ../../library/typing.rst:1871 msgid "" ":class:`contextlib.AbstractContextManager` now supports ``[]``. See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1878 +#: ../../library/typing.rst:1877 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:1883 +#: ../../library/typing.rst:1882 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1888 +#: ../../library/typing.rst:1887 msgid "Protocols" msgstr "" -#: ../../library/typing.rst:1890 +#: ../../library/typing.rst:1889 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:1894 +#: ../../library/typing.rst:1893 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:1899 +#: ../../library/typing.rst:1898 msgid "An ABC with one abstract method ``__bytes__``." msgstr "" -#: ../../library/typing.rst:1903 +#: ../../library/typing.rst:1902 msgid "An ABC with one abstract method ``__complex__``." msgstr "" -#: ../../library/typing.rst:1907 +#: ../../library/typing.rst:1906 msgid "An ABC with one abstract method ``__float__``." msgstr "" -#: ../../library/typing.rst:1911 +#: ../../library/typing.rst:1910 msgid "An ABC with one abstract method ``__index__``." msgstr "" -#: ../../library/typing.rst:1917 +#: ../../library/typing.rst:1916 msgid "An ABC with one abstract method ``__int__``." msgstr "" -#: ../../library/typing.rst:1921 +#: ../../library/typing.rst:1920 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:1925 +#: ../../library/typing.rst:1924 msgid "Functions and decorators" msgstr "" -#: ../../library/typing.rst:1929 +#: ../../library/typing.rst:1928 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:1931 +#: ../../library/typing.rst:1930 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:1938 +#: ../../library/typing.rst:1937 msgid "" "The ``@overload`` decorator allows describing functions and methods that " "support multiple different combinations of argument types. A series of " @@ -1929,69 +1928,69 @@ msgid "" "variable::" msgstr "" -#: ../../library/typing.rst:1962 +#: ../../library/typing.rst:1961 msgid "See :pep:`484` for details and comparison with other typing semantics." msgstr "" -#: ../../library/typing.rst:1966 +#: ../../library/typing.rst:1965 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:1991 +#: ../../library/typing.rst:1990 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:1993 +#: ../../library/typing.rst:1992 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods defined in that class (but not to methods defined " "in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:1997 +#: ../../library/typing.rst:1996 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2001 +#: ../../library/typing.rst:2000 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2003 +#: ../../library/typing.rst:2002 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2008 +#: ../../library/typing.rst:2007 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2010 +#: ../../library/typing.rst:2009 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2021 +#: ../../library/typing.rst:2020 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2025 +#: ../../library/typing.rst:2024 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2029 +#: ../../library/typing.rst:2028 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2032 +#: ../../library/typing.rst:2031 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2001,29 +2000,29 @@ msgid "" "merging all the ``__annotations__`` along ``C.__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2040 +#: ../../library/typing.rst:2039 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2055 +#: ../../library/typing.rst:2054 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2060 +#: ../../library/typing.rst:2059 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "" -#: ../../library/typing.rst:2066 +#: ../../library/typing.rst:2065 msgid "Provide basic introspection for generic types and special typing forms." msgstr "" -#: ../../library/typing.rst:2068 +#: ../../library/typing.rst:2067 msgid "" "For a typing object of the form ``X[Y, Z, ...]`` these functions return " "``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or :mod:" @@ -2034,11 +2033,11 @@ msgid "" "and ``()`` correspondingly. Examples::" msgstr "" -#: ../../library/typing.rst:2087 +#: ../../library/typing.rst:2086 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2102 +#: ../../library/typing.rst:2101 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2046,24 +2045,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2108 +#: ../../library/typing.rst:2107 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2115 +#: ../../library/typing.rst:2114 msgid "Constant" msgstr "" -#: ../../library/typing.rst:2119 +#: ../../library/typing.rst:2118 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2128 +#: ../../library/typing.rst:2127 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2071,7 +2070,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2135 +#: ../../library/typing.rst:2134 msgid "" "If ``from __future__ import annotations`` is used in Python 3.7 or later, " "annotations are not evaluated at function definition time. Instead, they are " From 1f085f49416ed30844d0ecfe79036c29655a95e4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 6 Nov 2021 00:10:04 +0000 Subject: [PATCH 2/7] sync with cpython 279a7a0c --- library/functools.po | 101 +++++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 48 deletions(-) diff --git a/library/functools.po b/library/functools.po index 1afc5a92ac..99f1798802 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-11-06 00:08+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -375,16 +375,16 @@ msgstr "" #: ../../library/functools.rst:404 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " -"decorator. Note that the dispatch happens on the type of the first argument, " -"create your function accordingly::" +"decorator. When defining a function using ``@singledispatch``, note that the " +"dispatch happens on the type of the first argument::" msgstr "" #: ../../library/functools.rst:415 msgid "" "To add overloaded implementations to the function, use the :func:`register` " -"attribute of the generic function. It is a decorator. For functions " -"annotated with types, the decorator will infer the type of the first " -"argument automatically::" +"attribute of the generic function, which can be used as a decorator. For " +"functions annotated with types, the decorator will infer the type of the " +"first argument automatically::" msgstr "" #: ../../library/functools.rst:433 @@ -395,15 +395,15 @@ msgstr "" #: ../../library/functools.rst:444 msgid "" -"To enable registering lambdas and pre-existing functions, the :func:" -"`register` attribute can be used in a functional form::" +"To enable registering :term:`lambdas` and pre-existing functions, " +"the :func:`register` attribute can also be used in a functional form::" msgstr "" #: ../../library/functools.rst:452 msgid "" -"The :func:`register` attribute returns the undecorated function which " -"enables decorator stacking, pickling, as well as creating unit tests for " -"each variant independently::" +"The :func:`register` attribute returns the undecorated function. This " +"enables decorator stacking, :mod:`pickling`, and the creation of " +"unit tests for each variant independently::" msgstr "" #: ../../library/functools.rst:466 @@ -416,60 +416,65 @@ msgstr "" msgid "" "Where there is no registered implementation for a specific type, its method " "resolution order is used to find a more generic implementation. The original " -"function decorated with ``@singledispatch`` is registered for the base " -"``object`` type, which means it is used if no better implementation is found." +"function decorated with ``@singledispatch`` is registered for the base :" +"class:`object` type, which means it is used if no better implementation is " +"found." msgstr "" #: ../../library/functools.rst:492 msgid "" -"If an implementation registered to :term:`abstract base class`, virtual " -"subclasses will be dispatched to that implementation::" +"If an implementation is registered to an :term:`abstract base class`, " +"virtual subclasses of the base class will be dispatched to that " +"implementation::" msgstr "" -#: ../../library/functools.rst:506 +#: ../../library/functools.rst:507 msgid "" -"To check which implementation will the generic function choose for a given " +"To check which implementation the generic function will choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" -#: ../../library/functools.rst:514 +#: ../../library/functools.rst:515 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "" -#: ../../library/functools.rst:528 -msgid "The :func:`register` attribute supports using type annotations." +#: ../../library/functools.rst:529 +msgid "The :func:`register` attribute now supports using type annotations." msgstr "" -#: ../../library/functools.rst:534 +#: ../../library/functools.rst:535 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: ../../library/functools.rst:537 +#: ../../library/functools.rst:538 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " -"decorator. Note that the dispatch happens on the type of the first non-self " -"or non-cls argument, create your function accordingly::" +"decorator. When defining a function using ``@singledispatchmethod``, note " +"that the dispatch happens on the type of the first non-*self* or non-*cls* " +"argument::" msgstr "" -#: ../../library/functools.rst:554 +#: ../../library/functools.rst:556 msgid "" -"``@singledispatchmethod`` supports nesting with other decorators such as " -"``@classmethod``. Note that to allow for ``dispatcher.register``, " -"``singledispatchmethod`` must be the *outer most* decorator. Here is the " -"``Negator`` class with the ``neg`` methods being class bound::" +"``@singledispatchmethod`` supports nesting with other decorators such as :" +"func:`@classmethod`. Note that to allow for ``dispatcher." +"register``, ``singledispatchmethod`` must be the *outer most* decorator. " +"Here is the ``Negator`` class with the ``neg`` methods bound to the class, " +"rather than an instance of the class::" msgstr "" -#: ../../library/functools.rst:575 +#: ../../library/functools.rst:578 msgid "" -"The same pattern can be used for other similar decorators: ``staticmethod``, " -"``abstractmethod``, and others." +"The same pattern can be used for other similar decorators: :func:" +"`@staticmethod`, :func:`@abstractmethod`, " +"and others." msgstr "" -#: ../../library/functools.rst:583 +#: ../../library/functools.rst:587 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -483,7 +488,7 @@ msgid "" "``__dict__``, i.e. the instance dictionary)." msgstr "" -#: ../../library/functools.rst:593 +#: ../../library/functools.rst:597 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -491,7 +496,7 @@ msgid "" "that refers to the function being wrapped." msgstr "" -#: ../../library/functools.rst:598 +#: ../../library/functools.rst:602 msgid "" "The main intended use for this function is in :term:`decorator` functions " "which wrap the decorated function and return the wrapper. If the wrapper " @@ -500,7 +505,7 @@ msgid "" "is typically less than helpful." msgstr "" -#: ../../library/functools.rst:604 +#: ../../library/functools.rst:608 msgid "" ":func:`update_wrapper` may be used with callables other than functions. Any " "attributes named in *assigned* or *updated* that are missing from the object " @@ -509,26 +514,26 @@ msgid "" "wrapper function itself is missing any attributes named in *updated*." msgstr "" -#: ../../library/functools.rst:610 +#: ../../library/functools.rst:614 msgid "Automatic addition of the ``__wrapped__`` attribute." msgstr "" -#: ../../library/functools.rst:613 +#: ../../library/functools.rst:617 msgid "Copying of the ``__annotations__`` attribute by default." msgstr "" -#: ../../library/functools.rst:616 +#: ../../library/functools.rst:620 msgid "Missing attributes no longer trigger an :exc:`AttributeError`." msgstr "" -#: ../../library/functools.rst:619 +#: ../../library/functools.rst:623 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" "`17482`)" msgstr "" -#: ../../library/functools.rst:627 +#: ../../library/functools.rst:631 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -536,42 +541,42 @@ msgid "" "updated=updated)``. For example::" msgstr "" -#: ../../library/functools.rst:653 +#: ../../library/functools.rst:657 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:" "`example` would have been lost." msgstr "" -#: ../../library/functools.rst:661 +#: ../../library/functools.rst:665 msgid ":class:`partial` Objects" msgstr "" -#: ../../library/functools.rst:663 +#: ../../library/functools.rst:667 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" msgstr "" -#: ../../library/functools.rst:669 +#: ../../library/functools.rst:673 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." msgstr "" -#: ../../library/functools.rst:675 +#: ../../library/functools.rst:679 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." msgstr "" -#: ../../library/functools.rst:681 +#: ../../library/functools.rst:685 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "" -#: ../../library/functools.rst:684 +#: ../../library/functools.rst:688 msgid "" ":class:`partial` objects are like :class:`function` objects in that they are " "callable, weak referencable, and can have attributes. There are some " From 2604020fbec59a48f32bc41bac722a61d84d6fe2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 7 Nov 2021 00:11:25 +0000 Subject: [PATCH 3/7] sync with cpython 045f205b --- glossary.po | 423 ++++++++++++++++++++++---------------------- library/__main__.po | 4 +- 2 files changed, 217 insertions(+), 210 deletions(-) diff --git a/glossary.po b/glossary.po index 9d47cefd2a..323cd32b88 100644 --- a/glossary.po +++ b/glossary.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-11-07 00:09+0000\n" "PO-Revision-Date: 2021-10-27 00:04+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1019,8 +1019,8 @@ msgid "" "functionality. Also see :ref:`annotations-howto` for best practices on " "working with annotations." msgstr "" -"請參閱 :term:`variable annotation` 和 :pep:`484`\\ ,皆有此功能的描述。" -"關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`\\ 。" +"請參閱 :term:`variable annotation` 和 :pep:`484`\\ ,皆有此功能的描述。關於註" +"釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`\\ 。" #: ../../glossary.rst:462 msgid "__future__" @@ -1146,36 +1146,35 @@ msgid "generic type" msgstr "generic type(泛型型別)" #: ../../glossary.rst:523 +#, fuzzy msgid "" -"A :term:`type` that can be parameterized; typically a container like :class:" -"`list`. Used for :term:`type hints ` and :term:`annotations " -"`." +"A :term:`type` that can be parameterized; typically a :ref:`container " +"class` such as :class:`list` or :class:`dict`. Used for :" +"term:`type hints ` and :term:`annotations `." msgstr "" "一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一個容器," "像是 :class:`list`\\ (串列)。它被用於\\ :term:`型別提示 `\\ 和" "\\ :term:`註釋 `\\ 。" -#: ../../glossary.rst:527 +#: ../../glossary.rst:528 msgid "" -"See :pep:`483` for more details, and :mod:`typing` or :ref:`generic alias " -"type ` for its uses." +"For more details, see :ref:`generic alias types`, :pep:" +"`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." msgstr "" -"請參閱 :pep:`483` 了解更多細節,以及 :mod:`typing` 或 :ref:`泛型別名型別 " -"(generic alias type) ` 了解其用途。" -#: ../../glossary.rst:529 +#: ../../glossary.rst:530 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:531 +#: ../../glossary.rst:532 msgid "See :term:`global interpreter lock`." msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" -#: ../../glossary.rst:532 +#: ../../glossary.rst:533 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../glossary.rst:534 +#: ../../glossary.rst:535 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1192,7 +1191,7 @@ msgstr "" "(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " "(parallelism)。" -#: ../../glossary.rst:543 +#: ../../glossary.rst:544 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally-intensive tasks " @@ -1203,7 +1202,7 @@ msgstr "" "計算密集 (computationally-intensive) 的任務時,可以解除 GIL。另外,在執行 I/" "O 時,GIL 總是會被解除。" -#: ../../glossary.rst:548 +#: ../../glossary.rst:549 msgid "" "Past efforts to create a \"free-threaded\" interpreter (one which locks " "shared data at a much finer granularity) have not been successful because " @@ -1215,11 +1214,11 @@ msgstr "" "力並未成功,因為在一般的單一處理器情況下,效能會有所損失。一般認為,若要克服" "這個效能問題,會使實作變得複雜許多,進而付出更高的維護成本。" -#: ../../glossary.rst:554 +#: ../../glossary.rst:555 msgid "hash-based pyc" msgstr "hash-based pyc(雜湊架構的 pyc)" -#: ../../glossary.rst:556 +#: ../../glossary.rst:557 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" @@ -1228,11 +1227,11 @@ msgstr "" "一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" "間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`\\ 。" -#: ../../glossary.rst:559 +#: ../../glossary.rst:560 msgid "hashable" msgstr "hashable(可雜湊的)" -#: ../../glossary.rst:561 +#: ../../glossary.rst:562 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`__hash__` method), and can be compared to " @@ -1244,7 +1243,7 @@ msgstr "" "method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的多個可雜湊物件," "它們必須擁有相同的雜湊值。" -#: ../../glossary.rst:566 +#: ../../glossary.rst:567 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1252,7 +1251,7 @@ msgstr "" "可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" "的成員,因為這些資料結構都在其內部使用了雜湊值。" -#: ../../glossary.rst:569 +#: ../../glossary.rst:570 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1267,11 +1266,11 @@ msgstr "" "則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" "較),而它們的雜湊值則是衍生自它們的 :func:`id`\\ 。" -#: ../../glossary.rst:576 +#: ../../glossary.rst:577 msgid "IDLE" msgstr "IDLE" -#: ../../glossary.rst:578 +#: ../../glossary.rst:579 msgid "" "An Integrated Development Environment for Python. IDLE is a basic editor " "and interpreter environment which ships with the standard distribution of " @@ -1280,11 +1279,11 @@ msgstr "" "Python 的 Integrated Development Environment(整合開發環境)。IDLE 是一個基本" "的編輯器和直譯器環境,它和 Python 的標準發行版本一起被提供。" -#: ../../glossary.rst:581 +#: ../../glossary.rst:582 msgid "immutable" msgstr "immutable(不可變物件)" -#: ../../glossary.rst:583 +#: ../../glossary.rst:584 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1296,11 +1295,11 @@ msgstr "" "能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" "定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" -#: ../../glossary.rst:588 +#: ../../glossary.rst:589 msgid "import path" msgstr "import path(匯入路徑)" -#: ../../glossary.rst:590 +#: ../../glossary.rst:591 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -1312,11 +1311,11 @@ msgstr "" "的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`\\ ,但對於子套" "件 (subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" -#: ../../glossary.rst:595 +#: ../../glossary.rst:596 msgid "importing" msgstr "importing(匯入)" -#: ../../glossary.rst:597 +#: ../../glossary.rst:598 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1324,11 +1323,11 @@ msgstr "" "一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " "程式碼使用。" -#: ../../glossary.rst:599 +#: ../../glossary.rst:600 msgid "importer" msgstr "importer(匯入器)" -#: ../../glossary.rst:601 +#: ../../glossary.rst:602 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." @@ -1336,11 +1335,11 @@ msgstr "" "一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" "`loader`\\ (載入器)物件。" -#: ../../glossary.rst:603 +#: ../../glossary.rst:604 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:605 +#: ../../glossary.rst:606 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1353,11 +1352,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模塊和包的非常強大的方法(請" "記住help(x))。" -#: ../../glossary.rst:611 +#: ../../glossary.rst:612 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:613 +#: ../../glossary.rst:614 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1371,11 +1370,11 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:620 +#: ../../glossary.rst:621 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:622 +#: ../../glossary.rst:623 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1393,18 +1392,18 @@ msgstr "" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:631 +#: ../../glossary.rst:632 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:633 +#: ../../glossary.rst:634 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:635 +#: ../../glossary.rst:636 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " @@ -1420,7 +1419,7 @@ msgstr "" "`Sequence `\\ (序列)語意的 :meth:`__getitem__` method,該物件就是" "可疊代物件。" -#: ../../glossary.rst:642 +#: ../../glossary.rst:643 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1440,11 +1439,11 @@ msgstr "" "於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、\\ :term:" "`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" -#: ../../glossary.rst:652 +#: ../../glossary.rst:653 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:654 +#: ../../glossary.rst:655 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1473,15 +1472,15 @@ msgstr "" "事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" "件,使其看起來就像一個空的容器。" -#: ../../glossary.rst:669 +#: ../../glossary.rst:670 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:670 +#: ../../glossary.rst:671 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:672 +#: ../../glossary.rst:673 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1491,7 +1490,7 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,\\ :func:`locale." "strxfrm` 被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:677 +#: ../../glossary.rst:678 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1503,7 +1502,7 @@ msgstr "" "\\ 、\\ :func:`heapq.merge`\\ 、\\ :func:`heapq.nsmallest`\\ 、\\ :func:" "`heapq.nlargest` 和 :func:`itertools.groupby`\\ 。" -#: ../../glossary.rst:683 +#: ../../glossary.rst:684 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.lower` method can serve as a key function for case insensitive sorts. " @@ -1521,19 +1520,19 @@ msgstr "" "`~operator.itemgetter` 和 :func:`~operator.methodcaller`\\ 。關於如何建立和使" "用鍵函式的範例,請參閱\\ :ref:`如何排序 `\\ 。" -#: ../../glossary.rst:691 +#: ../../glossary.rst:692 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:693 ../../glossary.rst:982 +#: ../../glossary.rst:694 ../../glossary.rst:983 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:694 +#: ../../glossary.rst:695 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:696 +#: ../../glossary.rst:697 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1543,11 +1542,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``\\ 。" -#: ../../glossary.rst:699 +#: ../../glossary.rst:700 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:701 +#: ../../glossary.rst:702 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1558,7 +1557,7 @@ msgstr "" "地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" "keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:706 +#: ../../glossary.rst:707 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1572,37 +1571,37 @@ msgstr "" "了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" "解決。" -#: ../../glossary.rst:711 +#: ../../glossary.rst:712 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:713 +#: ../../glossary.rst:714 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with " "``locale.setlocale(locale.LC_CTYPE, new_locale)``." msgstr "" -#: ../../glossary.rst:716 +#: ../../glossary.rst:717 msgid "On Windows, it is the ANSI code page (ex: ``cp1252``)." msgstr "" -#: ../../glossary.rst:718 +#: ../../glossary.rst:719 msgid "" "``locale.getpreferredencoding(False)`` can be used to get the locale " "encoding." msgstr "" -#: ../../glossary.rst:721 +#: ../../glossary.rst:722 msgid "" "Python uses the :term:`filesystem encoding and error handler` to convert " "between Unicode filenames and bytes filenames." msgstr "" -#: ../../glossary.rst:723 +#: ../../glossary.rst:724 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:725 +#: ../../glossary.rst:726 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " @@ -1612,11 +1611,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 O(1)。" -#: ../../glossary.rst:728 +#: ../../glossary.rst:729 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:730 +#: ../../glossary.rst:731 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1630,11 +1629,11 @@ msgstr "" "keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" "處理。" -#: ../../glossary.rst:736 +#: ../../glossary.rst:737 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:738 +#: ../../glossary.rst:739 msgid "" "An object that loads a module. It must define a method named :meth:" "`load_module`. A loader is typically returned by a :term:`finder`. See :pep:" @@ -1646,19 +1645,19 @@ msgstr "" "`302`,關於 :term:`abstract base class`\\ (抽象基底類別),請參閱 :class:" "`importlib.abc.Loader`\\ 。" -#: ../../glossary.rst:742 +#: ../../glossary.rst:743 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:746 +#: ../../glossary.rst:747 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:747 +#: ../../glossary.rst:748 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:749 +#: ../../glossary.rst:750 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`~collections.abc.Mapping` or :class:" @@ -1673,11 +1672,11 @@ msgstr "" "的 method。範例包括 :class:`dict`\\ 、\\ :class:`collections.defaultdict`" "\\ 、\\ :class:`collections.OrderedDict` 和 :class:`collections.Counter`\\ 。" -#: ../../glossary.rst:755 +#: ../../glossary.rst:756 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:757 +#: ../../glossary.rst:758 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` " "相關但是不同。" -#: ../../glossary.rst:761 +#: ../../glossary.rst:762 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." @@ -1695,11 +1694,11 @@ msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`" "\\ 。" -#: ../../glossary.rst:763 +#: ../../glossary.rst:764 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:765 +#: ../../glossary.rst:766 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -1719,15 +1718,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:775 +#: ../../glossary.rst:776 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:776 +#: ../../glossary.rst:777 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:778 +#: ../../glossary.rst:779 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -1739,11 +1738,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:782 +#: ../../glossary.rst:783 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:784 +#: ../../glossary.rst:785 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See `The Python 2.3 Method Resolution Order `_\\ 。" -#: ../../glossary.rst:788 +#: ../../glossary.rst:789 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:790 +#: ../../glossary.rst:791 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -1768,15 +1767,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:794 +#: ../../glossary.rst:795 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:795 +#: ../../glossary.rst:796 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:797 +#: ../../glossary.rst:798 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -1784,19 +1783,19 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:799 +#: ../../glossary.rst:800 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:801 +#: ../../glossary.rst:802 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:802 +#: ../../glossary.rst:803 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:804 +#: ../../glossary.rst:805 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." @@ -1804,11 +1803,11 @@ msgstr "" "可變物件可以改變它們的值,但維持它們的 :func:`id`\\ 。另請參閱 :term:" "`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:806 +#: ../../glossary.rst:807 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:808 +#: ../../glossary.rst:809 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -1818,7 +1817,7 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:812 +#: ../../glossary.rst:813 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." @@ -1829,7 +1828,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:823 +#: ../../glossary.rst:824 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -1845,11 +1844,11 @@ msgstr "" "些額外的 method,這些 method 可能是在手寫或內建的 named tuple 中,無法找到" "的。" -#: ../../glossary.rst:830 +#: ../../glossary.rst:831 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:832 +#: ../../glossary.rst:833 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -1869,11 +1868,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:842 +#: ../../glossary.rst:843 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:844 +#: ../../glossary.rst:845 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " @@ -1884,15 +1883,15 @@ msgstr "" "一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" "`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:849 +#: ../../glossary.rst:850 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:850 +#: ../../glossary.rst:851 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:852 +#: ../../glossary.rst:853 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -1907,11 +1906,11 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。\\ :keyword:`nonlocal` 容" "許對外層作用域進行寫入。" -#: ../../glossary.rst:859 +#: ../../glossary.rst:860 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:861 +#: ../../glossary.rst:862 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -1923,11 +1922,11 @@ msgstr "" "__slots__`\\ 、描述器 (descriptor)、屬性 (property)、\\ :meth:" "`__getattribute__`\\ 、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:865 +#: ../../glossary.rst:866 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:867 +#: ../../glossary.rst:868 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -1935,11 +1934,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:870 +#: ../../glossary.rst:871 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:872 +#: ../../glossary.rst:873 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with an ``__path__`` " @@ -1949,17 +1948,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:876 +#: ../../glossary.rst:877 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace package`" "\\ (命名空間套件)。" -#: ../../glossary.rst:877 +#: ../../glossary.rst:878 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:879 +#: ../../glossary.rst:880 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -1969,7 +1968,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:883 +#: ../../glossary.rst:884 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -1982,7 +1981,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:892 +#: ../../glossary.rst:893 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -1995,7 +1994,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:901 +#: ../../glossary.rst:902 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2010,7 +2009,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:909 +#: ../../glossary.rst:910 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2024,7 +2023,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:917 +#: ../../glossary.rst:918 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2035,14 +2034,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:923 +#: ../../glossary.rst:924 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:926 +#: ../../glossary.rst:927 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2053,11 +2052,11 @@ msgstr "" "參數之間的差異 `\\ 、\\ :class:`inspect." "Parameter` class、\\ :ref:`function`\\ 章節,以及 :pep:`362`\\ 。" -#: ../../glossary.rst:930 +#: ../../glossary.rst:931 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:932 +#: ../../glossary.rst:933 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2065,11 +2064,11 @@ msgstr "" "在 :term:`import path`\\ (匯入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:934 +#: ../../glossary.rst:935 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:936 +#: ../../glossary.rst:937 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -2079,7 +2078,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`\\ ,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:940 +#: ../../glossary.rst:941 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2087,11 +2086,11 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`\\ 。" -#: ../../glossary.rst:942 +#: ../../glossary.rst:943 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:944 +#: ../../glossary.rst:945 msgid "" "A callable on the :data:`sys.path_hook` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2101,11 +2100,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:947 +#: ../../glossary.rst:948 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:949 +#: ../../glossary.rst:950 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2113,11 +2112,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:951 +#: ../../glossary.rst:952 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:953 +#: ../../glossary.rst:954 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2135,11 +2134,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:961 +#: ../../glossary.rst:962 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:963 +#: ../../glossary.rst:964 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2150,7 +2149,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:969 +#: ../../glossary.rst:970 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2162,15 +2161,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:975 +#: ../../glossary.rst:976 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`\\ 。" -#: ../../glossary.rst:976 +#: ../../glossary.rst:977 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:978 +#: ../../glossary.rst:979 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2178,15 +2177,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:980 +#: ../../glossary.rst:981 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:983 +#: ../../glossary.rst:984 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:985 +#: ../../glossary.rst:986 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2202,7 +2201,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:994 +#: ../../glossary.rst:995 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2211,7 +2210,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:998 +#: ../../glossary.rst:999 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2220,19 +2219,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1001 +#: ../../glossary.rst:1002 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1003 +#: ../../glossary.rst:1004 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1004 +#: ../../glossary.rst:1005 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1006 +#: ../../glossary.rst:1007 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2241,11 +2240,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1009 +#: ../../glossary.rst:1010 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1011 +#: ../../glossary.rst:1012 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2261,18 +2260,18 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1021 +#: ../../glossary.rst:1022 msgid "As opposed to the cleaner, Pythonic method::" msgstr "" "相較之下,以下方法更簡潔、更具有 Python 風格:\n" "\n" "::" -#: ../../glossary.rst:1025 +#: ../../glossary.rst:1026 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1027 +#: ../../glossary.rst:1028 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2285,7 +2284,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1044 +#: ../../glossary.rst:1045 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2296,11 +2295,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1051 +#: ../../glossary.rst:1052 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1053 +#: ../../glossary.rst:1054 msgid "" "The number of references to an object. When the reference count of an " "object drops to zero, it is deallocated. Reference counting is generally " @@ -2314,11 +2313,11 @@ msgstr "" "`CPython` 實作的一個關鍵元素。\\ :mod:`sys` 模組定義了一個 :func:`~sys." "getrefcount` 函式,程序設計師可以呼叫該函式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1059 +#: ../../glossary.rst:1060 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1061 +#: ../../glossary.rst:1062 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2326,15 +2325,15 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1064 +#: ../../glossary.rst:1065 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1065 +#: ../../glossary.rst:1066 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1067 +#: ../../glossary.rst:1068 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2347,11 +2346,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1072 +#: ../../glossary.rst:1073 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1074 +#: ../../glossary.rst:1075 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`__getitem__` special method and defines a :meth:" @@ -2369,7 +2368,7 @@ msgstr "" "對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` 鍵," "而不是整數。" -#: ../../glossary.rst:1083 +#: ../../glossary.rst:1084 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`__getitem__` and :meth:" @@ -2383,11 +2382,11 @@ msgstr "" "`__reversed__`\\ 。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta." "register` 被明確地註冊。" -#: ../../glossary.rst:1090 +#: ../../glossary.rst:1091 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1092 +#: ../../glossary.rst:1093 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2398,11 +2397,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`\\ 。" -#: ../../glossary.rst:1096 +#: ../../glossary.rst:1097 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1098 +#: ../../glossary.rst:1099 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2410,11 +2409,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1100 +#: ../../glossary.rst:1101 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1102 +#: ../../glossary.rst:1103 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2426,11 +2425,11 @@ msgstr "" "之間使用冒號,例如 ``in variable_name[1:3:5]``。在括號(下標)符號的內部,會" "使用 :class:`slice` 物件。" -#: ../../glossary.rst:1106 +#: ../../glossary.rst:1107 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1110 +#: ../../glossary.rst:1111 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2441,11 +2440,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1114 +#: ../../glossary.rst:1115 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1116 +#: ../../glossary.rst:1117 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -2455,18 +2454,18 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`\\ 、\\ :" "keyword:`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1119 +#: ../../glossary.rst:1120 msgid "strong reference" msgstr "" -#: ../../glossary.rst:1121 +#: ../../glossary.rst:1122 msgid "" "In Python's C API, a strong reference is a reference to an object which " "increments the object's reference count when it is created and decrements " "the object's reference count when it is deleted." msgstr "" -#: ../../glossary.rst:1125 +#: ../../glossary.rst:1126 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2474,23 +2473,23 @@ msgid "" "leaking one reference." msgstr "" -#: ../../glossary.rst:1130 +#: ../../glossary.rst:1131 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ 。" -#: ../../glossary.rst:1131 +#: ../../glossary.rst:1132 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1133 +#: ../../glossary.rst:1134 msgid "A codec which encodes Unicode strings to bytes." msgstr "將 Unicode 字串編碼為位元組的一個編解碼器 (codec)。" -#: ../../glossary.rst:1134 +#: ../../glossary.rst:1135 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1136 +#: ../../glossary.rst:1137 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -2504,7 +2503,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、\\ :data:`sys.stdin`\\ 、\\ :" "data:`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1143 +#: ../../glossary.rst:1144 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -2512,11 +2511,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進制檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1145 +#: ../../glossary.rst:1146 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1147 +#: ../../glossary.rst:1148 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2531,11 +2530,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1154 +#: ../../glossary.rst:1155 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1156 +#: ../../glossary.rst:1157 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~instance." @@ -2545,15 +2544,15 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1160 +#: ../../glossary.rst:1161 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1162 +#: ../../glossary.rst:1163 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1164 +#: ../../glossary.rst:1165 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" @@ -2562,22 +2561,22 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1171 +#: ../../glossary.rst:1172 msgid "could be made more readable like this::" msgstr "" "可以寫成這樣,更具有可讀性:\n" "\n" "::" -#: ../../glossary.rst:1178 ../../glossary.rst:1192 +#: ../../glossary.rst:1179 ../../glossary.rst:1193 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`\\ ,有此功能的描述。" -#: ../../glossary.rst:1179 +#: ../../glossary.rst:1180 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1181 +#: ../../glossary.rst:1182 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2585,7 +2584,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1184 +#: ../../glossary.rst:1185 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to static type analysis tools, and aid IDEs with code completion and " @@ -2594,7 +2593,7 @@ msgstr "" "型別提示是選擇性的,而不是被 Python 強制的,但它們對靜態型別分析工具很有用," "並能協助 IDE 完成程式碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1188 +#: ../../glossary.rst:1189 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2602,11 +2601,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1193 +#: ../../glossary.rst:1194 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1195 +#: ../../glossary.rst:1196 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -2619,15 +2618,15 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`\\ ,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1200 +#: ../../glossary.rst:1201 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1202 +#: ../../glossary.rst:1203 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1204 +#: ../../glossary.rst:1205 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "" @@ -2635,7 +2634,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1209 +#: ../../glossary.rst:1210 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -2645,24 +2644,25 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1215 +#: ../../glossary.rst:1216 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1217 +#: ../../glossary.rst:1218 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " "working with annotations." msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、\\ :pep:`484` 和 :pep:" -"`526`\\ ,皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`\\ 。" +"`526`\\ ,皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:" +"`annotations-howto`\\ 。" -#: ../../glossary.rst:1221 +#: ../../glossary.rst:1222 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1223 +#: ../../glossary.rst:1224 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -2673,15 +2673,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1228 +#: ../../glossary.rst:1229 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`\\ 。" -#: ../../glossary.rst:1229 +#: ../../glossary.rst:1230 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1231 +#: ../../glossary.rst:1232 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -2689,11 +2689,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1233 +#: ../../glossary.rst:1234 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1235 +#: ../../glossary.rst:1236 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -2701,3 +2701,10 @@ msgid "" msgstr "" "Python 設計原則與哲學的列表,其內容有助於理解和使用此語言。此列表可以透過在互" "動式提式字元後輸入「``import this``」來找到它。" + +#~ msgid "" +#~ "See :pep:`483` for more details, and :mod:`typing` or :ref:`generic alias " +#~ "type ` for its uses." +#~ msgstr "" +#~ "請參閱 :pep:`483` 了解更多細節,以及 :mod:`typing` 或 :ref:`泛型別名型別 " +#~ "(generic alias type) ` 了解其用途。" diff --git a/library/__main__.po b/library/__main__.po index edb17b43e2..19fc7041f5 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-11-07 00:09+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -247,7 +247,7 @@ msgstr "" #: ../../library/__main__.rst:233 msgid "" "Note that ``from .student import search_students`` is an example of a " -"relative import. This import style must be used when referencing modules " +"relative import. This import style can be used when referencing modules " "within a package. For more details, see :ref:`intra-package-references` in " "the :ref:`tut-modules` section of the tutorial." msgstr "" From 843e121139d708e53c35e136004fcc79d66a5aef Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 9 Nov 2021 00:14:17 +0000 Subject: [PATCH 4/7] sync with cpython 2c479226 --- tutorial/controlflow.po | 4 +- whatsnew/3.10.po | 4 +- whatsnew/3.9.po | 127 +++++++++++++++++++--------------------- 3 files changed, 64 insertions(+), 71 deletions(-) diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index a22993c8fb..4e974328ca 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-11-09 00:12+0000\n" "PO-Revision-Date: 2021-06-01 22:43+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -391,7 +391,7 @@ msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the ``" "\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " "sequence patterns, extra keys are ignored. An unpacking like ``**rest`` is " -"also supported. (But ``**_`` would be redundant, so it not allowed.)" +"also supported. (But ``**_`` would be redundant, so it is not allowed.)" msgstr "" #: ../../tutorial/controlflow.rst:383 diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index aba5e0d2d1..5d41558de5 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-11-09 00:12+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1355,7 +1355,7 @@ msgstr "" #: ../../whatsnew/3.10.rst:1173 msgid "" -":ref:`importlib.metadata entry points ` now provides a nicer " +":ref:`importlib.metadata entry points ` now provide a nicer " "experience for selecting entry points by group and name through a new :class:" "`importlib.metadata.EntryPoints` class. See the Compatibility Note in the " "docs for more info on the deprecation and usage." diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 4d918c3910..a3ffedc232 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-11-09 00:12+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1041,7 +1041,7 @@ msgid "" "(Contributed by Huon Wilson in :issue:`40630`.)" msgstr "" -#: ../../whatsnew/3.9.rst:698 ../../whatsnew/3.9.rst:1485 +#: ../../whatsnew/3.9.rst:698 ../../whatsnew/3.9.rst:1481 msgid "typing" msgstr "typing" @@ -1346,7 +1346,7 @@ msgid "" "(Contributed by Raymond Hettinger in :issue:`40465`)" msgstr "" -#: ../../whatsnew/3.9.rst:940 ../../whatsnew/3.9.rst:1399 +#: ../../whatsnew/3.9.rst:940 ../../whatsnew/3.9.rst:1395 msgid "Removed" msgstr "" @@ -1838,7 +1838,7 @@ msgid "" "(Contributed by Victor Stinner in :issue:`37194`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1288 ../../whatsnew/3.9.rst:1410 +#: ../../whatsnew/3.9.rst:1288 ../../whatsnew/3.9.rst:1406 msgid "Changes in the limited C API (if ``Py_LIMITED_API`` macro is defined):" msgstr "" @@ -1857,7 +1857,7 @@ msgid "" "function to hide implementation details." msgstr "" -#: ../../whatsnew/3.9.rst:1299 ../../whatsnew/3.9.rst:1437 +#: ../../whatsnew/3.9.rst:1299 ../../whatsnew/3.9.rst:1433 msgid "(Contributed by Victor Stinner in :issue:`38644` and :issue:`39542`.)" msgstr "" @@ -1985,43 +1985,36 @@ msgstr "" #: ../../whatsnew/3.9.rst:1381 msgid "" -":c:func:`PyType_HasFeature` now always calls :c:func:`PyType_GetFlags`. " -"Previously, it accessed directly the :c:member:`PyTypeObject.tp_flags` " -"member when the limited C API was not used." -msgstr "" - -#: ../../whatsnew/3.9.rst:1385 -msgid "" ":c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro was converted to a function: " "the macro accessed directly the :c:member:`PyTypeObject.tp_weaklistoffset` " "member." msgstr "" -#: ../../whatsnew/3.9.rst:1389 +#: ../../whatsnew/3.9.rst:1385 msgid "" ":c:func:`PyObject_CheckBuffer` macro was converted to a function: the macro " "accessed directly the :c:member:`PyTypeObject.tp_as_buffer` member." msgstr "" -#: ../../whatsnew/3.9.rst:1392 +#: ../../whatsnew/3.9.rst:1388 msgid "" ":c:func:`PyIndex_Check` is now always declared as an opaque function to hide " "implementation details: removed the ``PyIndex_Check()`` macro. The macro " "accessed directly the :c:member:`PyTypeObject.tp_as_number` member." msgstr "" -#: ../../whatsnew/3.9.rst:1396 +#: ../../whatsnew/3.9.rst:1392 msgid "(See :issue:`40170` for more details.)" msgstr "" -#: ../../whatsnew/3.9.rst:1401 +#: ../../whatsnew/3.9.rst:1397 msgid "" "Excluded ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` macros of " "``pyfpe.h`` from the limited C API. (Contributed by Victor Stinner in :issue:" "`38835`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1405 +#: ../../whatsnew/3.9.rst:1401 msgid "" "The ``tp_print`` slot of :ref:`PyTypeObject ` has been " "removed. It was used for printing objects to files in Python 2.7 and before. " @@ -2029,89 +2022,89 @@ msgid "" "Demeyer in :issue:`36974`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1412 +#: ../../whatsnew/3.9.rst:1408 msgid "Excluded the following functions from the limited C API:" msgstr "" -#: ../../whatsnew/3.9.rst:1414 +#: ../../whatsnew/3.9.rst:1410 msgid "" "``PyThreadState_DeleteCurrent()`` (Contributed by Joannah Nanjekye in :issue:" "`37878`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1416 +#: ../../whatsnew/3.9.rst:1412 msgid "``_Py_CheckRecursionLimit``" msgstr "``_Py_CheckRecursionLimit``" -#: ../../whatsnew/3.9.rst:1417 +#: ../../whatsnew/3.9.rst:1413 msgid "``_Py_NewReference()``" msgstr "``_Py_NewReference()``" -#: ../../whatsnew/3.9.rst:1418 +#: ../../whatsnew/3.9.rst:1414 msgid "``_Py_ForgetReference()``" msgstr "``_Py_ForgetReference()``" -#: ../../whatsnew/3.9.rst:1419 +#: ../../whatsnew/3.9.rst:1415 msgid "``_PyTraceMalloc_NewReference()``" msgstr "``_PyTraceMalloc_NewReference()``" -#: ../../whatsnew/3.9.rst:1420 +#: ../../whatsnew/3.9.rst:1416 msgid "``_Py_GetRefTotal()``" msgstr "``_Py_GetRefTotal()``" -#: ../../whatsnew/3.9.rst:1421 +#: ../../whatsnew/3.9.rst:1417 msgid "The trashcan mechanism which never worked in the limited C API." msgstr "" -#: ../../whatsnew/3.9.rst:1422 +#: ../../whatsnew/3.9.rst:1418 msgid "``PyTrash_UNWIND_LEVEL``" msgstr "``PyTrash_UNWIND_LEVEL``" -#: ../../whatsnew/3.9.rst:1423 +#: ../../whatsnew/3.9.rst:1419 msgid "``Py_TRASHCAN_BEGIN_CONDITION``" msgstr "``Py_TRASHCAN_BEGIN_CONDITION``" -#: ../../whatsnew/3.9.rst:1424 +#: ../../whatsnew/3.9.rst:1420 msgid "``Py_TRASHCAN_BEGIN``" msgstr "``Py_TRASHCAN_BEGIN``" -#: ../../whatsnew/3.9.rst:1425 +#: ../../whatsnew/3.9.rst:1421 msgid "``Py_TRASHCAN_END``" msgstr "``Py_TRASHCAN_END``" -#: ../../whatsnew/3.9.rst:1426 +#: ../../whatsnew/3.9.rst:1422 msgid "``Py_TRASHCAN_SAFE_BEGIN``" msgstr "``Py_TRASHCAN_SAFE_BEGIN``" -#: ../../whatsnew/3.9.rst:1427 +#: ../../whatsnew/3.9.rst:1423 msgid "``Py_TRASHCAN_SAFE_END``" msgstr "``Py_TRASHCAN_SAFE_END``" -#: ../../whatsnew/3.9.rst:1429 +#: ../../whatsnew/3.9.rst:1425 msgid "Moved following functions and definitions to the internal C API:" msgstr "" -#: ../../whatsnew/3.9.rst:1431 +#: ../../whatsnew/3.9.rst:1427 msgid "``_PyDebug_PrintTotalRefs()``" msgstr "``_PyDebug_PrintTotalRefs()``" -#: ../../whatsnew/3.9.rst:1432 +#: ../../whatsnew/3.9.rst:1428 msgid "``_Py_PrintReferences()``" msgstr "``_Py_PrintReferences()``" -#: ../../whatsnew/3.9.rst:1433 +#: ../../whatsnew/3.9.rst:1429 msgid "``_Py_PrintReferenceAddresses()``" msgstr "``_Py_PrintReferenceAddresses()``" -#: ../../whatsnew/3.9.rst:1434 +#: ../../whatsnew/3.9.rst:1430 msgid "``_Py_tracemalloc_config``" msgstr "``_Py_tracemalloc_config``" -#: ../../whatsnew/3.9.rst:1435 +#: ../../whatsnew/3.9.rst:1431 msgid "``_Py_AddToAllObjects()`` (specific to ``Py_TRACE_REFS`` build)" msgstr "" -#: ../../whatsnew/3.9.rst:1439 +#: ../../whatsnew/3.9.rst:1435 msgid "" "Removed ``_PyRuntime.getframe`` hook and removed ``_PyThreadState_GetFrame`` " "macro which was an alias to ``_PyRuntime.getframe``. They were only exposed " @@ -2119,72 +2112,72 @@ msgid "" "(Contributed by Victor Stinner in :issue:`39946`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1444 +#: ../../whatsnew/3.9.rst:1440 msgid "" "Removed the following functions from the C API. Call :c:func:`PyGC_Collect` " "explicitly to clear all free lists. (Contributed by Inada Naoki and Victor " "Stinner in :issue:`37340`, :issue:`38896` and :issue:`40428`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1449 +#: ../../whatsnew/3.9.rst:1445 msgid "``PyAsyncGen_ClearFreeLists()``" msgstr "``PyAsyncGen_ClearFreeLists()``" -#: ../../whatsnew/3.9.rst:1450 +#: ../../whatsnew/3.9.rst:1446 msgid "``PyContext_ClearFreeList()``" msgstr "``PyContext_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1451 +#: ../../whatsnew/3.9.rst:1447 msgid "``PyDict_ClearFreeList()``" msgstr "``PyDict_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1452 +#: ../../whatsnew/3.9.rst:1448 msgid "``PyFloat_ClearFreeList()``" msgstr "``PyFloat_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1453 +#: ../../whatsnew/3.9.rst:1449 msgid "``PyFrame_ClearFreeList()``" msgstr "``PyFrame_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1454 +#: ../../whatsnew/3.9.rst:1450 msgid "``PyList_ClearFreeList()``" msgstr "``PyList_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1455 +#: ../../whatsnew/3.9.rst:1451 msgid "" "``PyMethod_ClearFreeList()`` and ``PyCFunction_ClearFreeList()``: the free " "lists of bound method objects have been removed." msgstr "" -#: ../../whatsnew/3.9.rst:1457 +#: ../../whatsnew/3.9.rst:1453 msgid "" "``PySet_ClearFreeList()``: the set free list has been removed in Python 3.4." msgstr "" -#: ../../whatsnew/3.9.rst:1459 +#: ../../whatsnew/3.9.rst:1455 msgid "``PyTuple_ClearFreeList()``" msgstr "``PyTuple_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1460 +#: ../../whatsnew/3.9.rst:1456 msgid "" "``PyUnicode_ClearFreeList()``: the Unicode free list has been removed in " "Python 3.3." msgstr "" -#: ../../whatsnew/3.9.rst:1463 +#: ../../whatsnew/3.9.rst:1459 msgid "" "Removed ``_PyUnicode_ClearStaticStrings()`` function. (Contributed by Victor " "Stinner in :issue:`39465`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1466 +#: ../../whatsnew/3.9.rst:1462 msgid "" "Removed ``Py_UNICODE_MATCH``. It has been deprecated by :pep:`393`, and " "broken since Python 3.3. The :c:func:`PyUnicode_Tailmatch` function can be " "used instead. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1471 +#: ../../whatsnew/3.9.rst:1467 msgid "" "Cleaned header files of interfaces defined but with no implementation. The " "public API symbols being removed are: " @@ -2197,26 +2190,26 @@ msgid "" "`39372`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1482 +#: ../../whatsnew/3.9.rst:1478 msgid "Notable changes in Python 3.9.1" msgstr "" -#: ../../whatsnew/3.9.rst:1487 +#: ../../whatsnew/3.9.rst:1483 msgid "" "The behavior of :class:`typing.Literal` was changed to conform with :pep:" "`586` and to match the behavior of static type checkers specified in the PEP." msgstr "" -#: ../../whatsnew/3.9.rst:1490 +#: ../../whatsnew/3.9.rst:1486 msgid "``Literal`` now de-duplicates parameters." msgstr "" -#: ../../whatsnew/3.9.rst:1491 +#: ../../whatsnew/3.9.rst:1487 msgid "" "Equality comparisons between ``Literal`` objects are now order independent." msgstr "" -#: ../../whatsnew/3.9.rst:1492 +#: ../../whatsnew/3.9.rst:1488 msgid "" "``Literal`` comparisons now respect types. For example, ``Literal[0] == " "Literal[False]`` previously evaluated to ``True``. It is now ``False``. To " @@ -2224,7 +2217,7 @@ msgid "" "differentiating types." msgstr "" -#: ../../whatsnew/3.9.rst:1496 +#: ../../whatsnew/3.9.rst:1492 msgid "" "``Literal`` objects will now raise a :exc:`TypeError` exception during " "equality comparisons if any of their parameters are not :term:`hashable`. " @@ -2232,15 +2225,15 @@ msgid "" "error::" msgstr "" -#: ../../whatsnew/3.9.rst:1508 +#: ../../whatsnew/3.9.rst:1504 msgid "(Contributed by Yurii Karabas in :issue:`42345`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1511 +#: ../../whatsnew/3.9.rst:1507 msgid "macOS 11.0 (Big Sur) and Apple Silicon Mac support" msgstr "" -#: ../../whatsnew/3.9.rst:1513 +#: ../../whatsnew/3.9.rst:1509 msgid "" "As of 3.9.1, Python now fully supports building and running on macOS 11.0 " "(Big Sur) and on Apple Silicon Macs (based on the ``ARM64`` architecture). A " @@ -2252,19 +2245,19 @@ msgid "" "version in use at runtime (\"weaklinking\")." msgstr "" -#: ../../whatsnew/3.9.rst:1522 +#: ../../whatsnew/3.9.rst:1518 msgid "(Contributed by Ronald Oussoren and Lawrence D'Anna in :issue:`41100`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1525 +#: ../../whatsnew/3.9.rst:1521 msgid "Notable changes in Python 3.9.2" msgstr "" -#: ../../whatsnew/3.9.rst:1528 +#: ../../whatsnew/3.9.rst:1524 msgid "collections.abc" msgstr "collections.abc" -#: ../../whatsnew/3.9.rst:1530 +#: ../../whatsnew/3.9.rst:1526 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -2280,11 +2273,11 @@ msgid "" "Python 3.10. (Contributed by Ken Jin in :issue:`42195`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1544 +#: ../../whatsnew/3.9.rst:1540 msgid "urllib.parse" msgstr "" -#: ../../whatsnew/3.9.rst:1546 +#: ../../whatsnew/3.9.rst:1542 msgid "" "Earlier Python versions allowed using both ``;`` and ``&`` as query " "parameter separators in :func:`urllib.parse.parse_qs` and :func:`urllib." From ac13d75a08fafbb6181baea9d94cb46346920c28 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 14 Nov 2021 00:11:25 +0000 Subject: [PATCH 5/7] sync with cpython 28326ac5 --- library/__main__.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/__main__.po b/library/__main__.po index 19fc7041f5..b340543f17 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-07 00:09+0000\n" +"POT-Creation-Date: 2021-11-14 00:09+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -136,9 +136,9 @@ msgstr "" #: ../../library/__main__.rst:118 msgid "" "Some modules contain code that is intended for script use only, like parsing " -"command-line arguments or fetching data from standard input. When a module " -"like this were to be imported from a different module, for example to unit " -"test it, the script code would unintentionally execute as well." +"command-line arguments or fetching data from standard input. If a module " +"like this was imported from a different module, for example to unit test it, " +"the script code would unintentionally execute as well." msgstr "" #: ../../library/__main__.rst:123 From 9c73ee49b208b9c871587ef87e28df08a400d447 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 15 Nov 2021 00:11:07 +0000 Subject: [PATCH 6/7] sync with cpython 55d24eda --- library/copy.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/copy.po b/library/copy.po index 60dc97eb0f..e7d3dbd557 100644 --- a/library/copy.po +++ b/library/copy.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2021-11-15 00:09+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -107,7 +107,7 @@ msgstr "" #: ../../library/copy.rst:62 msgid "" "This module does not copy types like module, method, stack trace, stack " -"frame, file, socket, window, array, or any similar types. It does \"copy\" " +"frame, file, socket, window, or any similar types. It does \"copy\" " "functions and classes (shallow and deeply), by returning the original object " "unchanged; this is compatible with the way these are treated by the :mod:" "`pickle` module." From bc4b133262be038efc5a82c868d0ffbd06ae06d9 Mon Sep 17 00:00:00 2001 From: "Matt.Wang" Date: Mon, 15 Nov 2021 11:06:12 +0800 Subject: [PATCH 7/7] fix(glossary): correct fuzzy entry --- glossary.po | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/glossary.po b/glossary.po index 323cd32b88..b4fe0df39e 100644 --- a/glossary.po +++ b/glossary.po @@ -3,13 +3,14 @@ # This file is distributed under the same license as the Python package. # Translators: # Steven Hsu , 2021 +# Matt Wang , 2021 msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-07 00:09+0000\n" -"PO-Revision-Date: 2021-10-27 00:04+0800\n" -"Last-Translator: Steven Hsu \n" +"PO-Revision-Date: 2021-11-15 11:05+0800\n" +"Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -17,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 2.4.3\n" +"X-Generator: Poedit 3.0\n" #: ../../glossary.rst:5 msgid "Glossary" @@ -138,7 +139,7 @@ msgid "" msgstr "" "請參閱 :term:`variable annotation`\\ 、\\ :term:`function annotation`" "\\ 、\\ :pep:`484` 和 :pep:`526`,這些章節皆有此功能的說明。關於註釋的最佳實" -"踐方法也請參閱 :ref:`annotations-howto`" +"踐方法也請參閱 :ref:`annotations-howto`\\ 。" #: ../../glossary.rst:62 msgid "argument" @@ -1146,21 +1147,22 @@ msgid "generic type" msgstr "generic type(泛型型別)" #: ../../glossary.rst:523 -#, fuzzy msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " "class` such as :class:`list` or :class:`dict`. Used for :" "term:`type hints ` and :term:`annotations `." msgstr "" -"一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一個容器," -"像是 :class:`list`\\ (串列)。它被用於\\ :term:`型別提示 `\\ 和" -"\\ :term:`註釋 `\\ 。" +"一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一個 :ref:" +"`容器型別 `\\ ,像是 :class:`list` 和 :class:`dict`。它被用於" +"\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `\\ 。" #: ../../glossary.rst:528 msgid "" "For more details, see :ref:`generic alias types`, :pep:" "`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." msgstr "" +"詳情請參閱\\ :ref:`泛型別名型別 `\\ 、\\ :pep:`483`" +"\\ 、\\ :pep:`484`\\ 、\\ :pep:`585` 和 :mod:`typing` 模組。" #: ../../glossary.rst:530 msgid "GIL" @@ -2701,10 +2703,3 @@ msgid "" msgstr "" "Python 設計原則與哲學的列表,其內容有助於理解和使用此語言。此列表可以透過在互" "動式提式字元後輸入「``import this``」來找到它。" - -#~ msgid "" -#~ "See :pep:`483` for more details, and :mod:`typing` or :ref:`generic alias " -#~ "type ` for its uses." -#~ msgstr "" -#~ "請參閱 :pep:`483` 了解更多細節,以及 :mod:`typing` 或 :ref:`泛型別名型別 " -#~ "(generic alias type) ` 了解其用途。"