Skip to content

Sync with CPython 3.10 #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
432 changes: 217 additions & 215 deletions glossary.po

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions library/__main__.po
Original file line number Diff line number Diff line change
Expand Up @@ -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-14 00:09+0000\n"
"PO-Revision-Date: 2015-12-09 17:51+0000\n"
"Last-Translator: Liang-Bo Wang <me@liang2.tw>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ""
Expand Down
4 changes: 2 additions & 2 deletions library/copy.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <adrianliaw2000@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -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."
Expand Down
101 changes: 53 additions & 48 deletions library/functools.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <adrianliaw2000@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -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
Expand All @@ -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<lambda>` 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<pickle>`, and the creation of "
"unit tests for each variant independently::"
msgstr ""

#: ../../library/functools.rst:466
Expand All @@ -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 <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<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<staticmethod>`, :func:`@abstractmethod<abc.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 "
Expand All @@ -483,15 +488,15 @@ 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`), "
"this function automatically adds a ``__wrapped__`` attribute to the wrapper "
"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 "
Expand All @@ -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 "
Expand All @@ -509,69 +514,69 @@ 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 "
"``partial(update_wrapper, wrapped=wrapped, assigned=assigned, "
"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 "
Expand Down
Loading