Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7983119

Browse filesBrowse files
sync with cpython 56d50dd9
1 parent 2142a2e commit 7983119
Copy full SHA for 7983119

File tree

Expand file treeCollapse file tree

8 files changed

+722
-611
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+722
-611
lines changed

‎howto/argparse.po

Copy file name to clipboardExpand all lines: howto/argparse.po
+106-102Lines changed: 106 additions & 102 deletions
Large diffs are not rendered by default.

‎howto/descriptor.po

Copy file name to clipboardExpand all lines: howto/descriptor.po
+40-23Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.11\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2022-10-15 20:43+0000\n"
11+
"POT-Creation-Date: 2023-04-25 00:20+0000\n"
1212
"PO-Revision-Date: 2018-05-23 14:36+0000\n"
1313
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -697,8 +697,8 @@ msgstr ""
697697
msgid ""
698698
"The descriptor protocol is simple and offers exciting possibilities. "
699699
"Several use cases are so common that they have been prepackaged into built-"
700-
"in tools. Properties, bound methods, static methods, class methods, and \\_"
701-
"\\_slots\\_\\_ are all based on the descriptor protocol."
700+
"in tools. Properties, bound methods, static methods, class methods, and "
701+
"\\_\\_slots\\_\\_ are all based on the descriptor protocol."
702702
msgstr ""
703703

704704
#: ../../howto/descriptor.rst:957
@@ -924,18 +924,26 @@ msgid ""
924924
"`staticmethod` would look like this:"
925925
msgstr ""
926926

927-
#: ../../howto/descriptor.rst:1310
927+
#: ../../howto/descriptor.rst:1291
928+
msgid ""
929+
"The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute "
930+
"that refers to the underlying function. Also it carries forward the "
931+
"attributes necessary to make the wrapper look like the wrapped function: "
932+
"``__name__``, ``__qualname__``, ``__doc__``, and ``__annotations__``."
933+
msgstr ""
934+
935+
#: ../../howto/descriptor.rst:1359
928936
msgid "Class methods"
929937
msgstr ""
930938

931-
#: ../../howto/descriptor.rst:1312
939+
#: ../../howto/descriptor.rst:1361
932940
msgid ""
933941
"Unlike static methods, class methods prepend the class reference to the "
934942
"argument list before calling the function. This format is the same for "
935943
"whether the caller is an object or a class:"
936944
msgstr ""
937945

938-
#: ../../howto/descriptor.rst:1330
946+
#: ../../howto/descriptor.rst:1379
939947
msgid ""
940948
"This behavior is useful whenever the method only needs to have a class "
941949
"reference and does not rely on data stored in a specific instance. One use "
@@ -944,68 +952,77 @@ msgid ""
944952
"of keys. The pure Python equivalent is:"
945953
msgstr ""
946954

947-
#: ../../howto/descriptor.rst:1347
955+
#: ../../howto/descriptor.rst:1396
948956
msgid "Now a new dictionary of unique keys can be constructed like this:"
949957
msgstr ""
950958

951-
#: ../../howto/descriptor.rst:1357
959+
#: ../../howto/descriptor.rst:1406
952960
msgid ""
953961
"Using the non-data descriptor protocol, a pure Python version of :func:"
954962
"`classmethod` would look like this:"
955963
msgstr ""
956964

957-
#: ../../howto/descriptor.rst:1408
965+
#: ../../howto/descriptor.rst:1484
958966
msgid ""
959967
"The code path for ``hasattr(type(self.f), '__get__')`` was added in Python "
960968
"3.9 and makes it possible for :func:`classmethod` to support chained "
961969
"decorators. For example, a classmethod and property could be chained "
962970
"together. In Python 3.11, this functionality was deprecated."
963971
msgstr ""
964972

965-
#: ../../howto/descriptor.rst:1428
973+
#: ../../howto/descriptor.rst:1502
974+
msgid ""
975+
"The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a "
976+
"``__wrapped__`` attribute that refers to the underlying function. Also it "
977+
"carries forward the attributes necessary to make the wrapper look like the "
978+
"wrapped function: ``__name__``, ``__qualname__``, ``__doc__``, and "
979+
"``__annotations__``."
980+
msgstr ""
981+
982+
#: ../../howto/descriptor.rst:1510
966983
msgid "Member objects and __slots__"
967984
msgstr ""
968985

969-
#: ../../howto/descriptor.rst:1430
986+
#: ../../howto/descriptor.rst:1512
970987
msgid ""
971988
"When a class defines ``__slots__``, it replaces instance dictionaries with a "
972989
"fixed-length array of slot values. From a user point of view that has "
973990
"several effects:"
974991
msgstr ""
975992

976-
#: ../../howto/descriptor.rst:1434
993+
#: ../../howto/descriptor.rst:1516
977994
msgid ""
978995
"1. Provides immediate detection of bugs due to misspelled attribute "
979996
"assignments. Only attribute names specified in ``__slots__`` are allowed:"
980997
msgstr ""
981998

982-
#: ../../howto/descriptor.rst:1450
999+
#: ../../howto/descriptor.rst:1532
9831000
msgid ""
9841001
"2. Helps create immutable objects where descriptors manage access to private "
9851002
"attributes stored in ``__slots__``:"
9861003
msgstr ""
9871004

988-
#: ../../howto/descriptor.rst:1485
1005+
#: ../../howto/descriptor.rst:1567
9891006
msgid ""
9901007
"3. Saves memory. On a 64-bit Linux build, an instance with two attributes "
9911008
"takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight "
9921009
"design pattern <https://en.wikipedia.org/wiki/Flyweight_pattern>`_ likely "
9931010
"only matters when a large number of instances are going to be created."
9941011
msgstr ""
9951012

996-
#: ../../howto/descriptor.rst:1490
1013+
#: ../../howto/descriptor.rst:1572
9971014
msgid ""
9981015
"4. Improves speed. Reading instance variables is 35% faster with "
9991016
"``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)."
10001017
msgstr ""
10011018

1002-
#: ../../howto/descriptor.rst:1493
1019+
#: ../../howto/descriptor.rst:1575
10031020
msgid ""
10041021
"5. Blocks tools like :func:`functools.cached_property` which require an "
10051022
"instance dictionary to function correctly:"
10061023
msgstr ""
10071024

1008-
#: ../../howto/descriptor.rst:1515
1025+
#: ../../howto/descriptor.rst:1597
10091026
msgid ""
10101027
"It is not possible to create an exact drop-in pure Python version of "
10111028
"``__slots__`` because it requires direct access to C structures and control "
@@ -1015,36 +1032,36 @@ msgid ""
10151032
"managed by member descriptors:"
10161033
msgstr ""
10171034

1018-
#: ../../howto/descriptor.rst:1560
1035+
#: ../../howto/descriptor.rst:1642
10191036
msgid ""
10201037
"The :meth:`type.__new__` method takes care of adding member objects to class "
10211038
"variables:"
10221039
msgstr ""
10231040

1024-
#: ../../howto/descriptor.rst:1576
1041+
#: ../../howto/descriptor.rst:1658
10251042
msgid ""
10261043
"The :meth:`object.__new__` method takes care of creating instances that have "
10271044
"slots instead of an instance dictionary. Here is a rough simulation in pure "
10281045
"Python:"
10291046
msgstr ""
10301047

1031-
#: ../../howto/descriptor.rst:1611
1048+
#: ../../howto/descriptor.rst:1693
10321049
msgid ""
10331050
"To use the simulation in a real class, just inherit from :class:`Object` and "
10341051
"set the :term:`metaclass` to :class:`Type`:"
10351052
msgstr ""
10361053

1037-
#: ../../howto/descriptor.rst:1625
1054+
#: ../../howto/descriptor.rst:1707
10381055
msgid ""
10391056
"At this point, the metaclass has loaded member objects for *x* and *y*::"
10401057
msgstr ""
10411058

1042-
#: ../../howto/descriptor.rst:1646
1059+
#: ../../howto/descriptor.rst:1728
10431060
msgid ""
10441061
"When instances are created, they have a ``slot_values`` list where the "
10451062
"attributes are stored:"
10461063
msgstr ""
10471064

1048-
#: ../../howto/descriptor.rst:1658
1065+
#: ../../howto/descriptor.rst:1740
10491066
msgid "Misspelled or unassigned attributes will raise an exception:"
10501067
msgstr ""

‎library/argparse.po

Copy file name to clipboardExpand all lines: library/argparse.po
+30-9Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.11\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2023-04-20 00:15+0000\n"
10+
"POT-Creation-Date: 2023-04-25 00:20+0000\n"
1111
"PO-Revision-Date: 2018-05-23 14:38+0000\n"
1212
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -199,7 +199,8 @@ msgstr ""
199199
msgid ""
200200
":class:`int`, :class:`float`, ``argparse.FileType('w')``, or callable "
201201
"function"
202-
msgstr ":class:`int`、:class:`float`、``argparse.FileType('w')`` 或可呼叫的函式"
202+
msgstr ""
203+
":class:`int`、:class:`float`、``argparse.FileType('w')`` 或可呼叫的函式"
203204

204205
#: ../../library/argparse.rst:77
205206
msgid "Example"
@@ -1110,7 +1111,7 @@ msgstr ""
11101111
msgid ""
11111112
"For example, JSON or YAML conversions have complex error cases that require "
11121113
"better reporting than can be given by the ``type`` keyword. A :exc:`~json."
1113-
"JSONDecodeError` would not be well formatted and a :exc:`FileNotFound` "
1114+
"JSONDecodeError` would not be well formatted and a :exc:`FileNotFoundError` "
11141115
"exception would not be handled at all."
11151116
msgstr ""
11161117

@@ -1299,7 +1300,8 @@ msgstr ""
12991300
msgid ""
13001301
"Action classes implement the Action API, a callable which returns a callable "
13011302
"which processes arguments from the command-line. Any object which follows "
1302-
"this API may be passed as the ``action`` parameter to :meth:`add_argument`."
1303+
"this API may be passed as the ``action`` parameter to :meth:`~ArgumentParser."
1304+
"add_argument`."
13031305
msgstr ""
13041306

13051307
#: ../../library/argparse.rst:1444
@@ -1529,7 +1531,7 @@ msgid ""
15291531
"arguments. :class:`ArgumentParser` supports the creation of such sub-"
15301532
"commands with the :meth:`add_subparsers` method. The :meth:`add_subparsers` "
15311533
"method is normally called with no arguments and returns a special action "
1532-
"object. This object has a single method, :meth:`~ArgumentParser."
1534+
"object. This object has a single method, :meth:`~_SubParsersAction."
15331535
"add_parser`, which takes a command name and any :class:`ArgumentParser` "
15341536
"constructor arguments, and returns an :class:`ArgumentParser` object that "
15351537
"can be modified as usual."
@@ -1616,7 +1618,7 @@ msgid ""
16161618
"for that particular parser will be printed. The help message will not "
16171619
"include parent parser or sibling parser messages. (A help message for each "
16181620
"subparser command, however, can be given by supplying the ``help=`` argument "
1619-
"to :meth:`add_parser` as above.)"
1621+
"to :meth:`~_SubParsersAction.add_parser` as above.)"
16201622
msgstr ""
16211623

16221624
#: ../../library/argparse.rst:1811
@@ -1842,9 +1844,9 @@ msgstr ""
18421844
#: ../../library/argparse.rst:2127
18431845
msgid ""
18441846
":ref:`Prefix matching <prefix-matching>` rules apply to :meth:"
1845-
"`parse_known_args`. The parser may consume an option even if it's just a "
1846-
"prefix of one of its known options, instead of leaving it in the remaining "
1847-
"arguments list."
1847+
"`~ArgumentParser.parse_known_args`. The parser may consume an option even if "
1848+
"it's just a prefix of one of its known options, instead of leaving it in the "
1849+
"remaining arguments list."
18481850
msgstr ""
18491851

18501852
#: ../../library/argparse.rst:2134
@@ -2026,3 +2028,22 @@ msgid ""
20262028
"``parser.add_argument('--version', action='version', version='<the "
20272029
"version>')``."
20282030
msgstr ""
2031+
2032+
#: ../../library/argparse.rst:2268
2033+
msgid "Exceptions"
2034+
msgstr ""
2035+
2036+
#: ../../library/argparse.rst:2272
2037+
msgid "An error from creating or using an argument (optional or positional)."
2038+
msgstr ""
2039+
2040+
#: ../../library/argparse.rst:2274
2041+
msgid ""
2042+
"The string value of this exception is the message, augmented with "
2043+
"information about the argument that caused it."
2044+
msgstr ""
2045+
2046+
#: ../../library/argparse.rst:2279
2047+
msgid ""
2048+
"Raised when something goes wrong converting a command line string to a type."
2049+
msgstr ""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.