diff --git a/howto/clinic.po b/howto/clinic.po index 7239faccba..a9b49c94fd 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-18 15:00+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -54,11 +54,11 @@ msgid "" "totally incompatible and break all your code." msgstr "" -#: ../../howto/clinic.rst:31 -msgid "The Goals Of Argument Clinic" +#: ../../howto/clinic.rst:32 +msgid "The goals of Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:33 +#: ../../howto/clinic.rst:34 msgid "" "Argument Clinic's primary goal is to take over responsibility for all " "argument parsing code inside CPython. This means that, when you convert a " @@ -69,7 +69,7 @@ msgid "" "*kwargs``) magically converted into the C variables and types you need." msgstr "" -#: ../../howto/clinic.rst:43 +#: ../../howto/clinic.rst:44 msgid "" "In order for Argument Clinic to accomplish its primary goal, it must be easy " "to use. Currently, working with CPython's argument parsing library is a " @@ -77,7 +77,7 @@ msgid "" "places. When you use Argument Clinic, you don't have to repeat yourself." msgstr "" -#: ../../howto/clinic.rst:49 +#: ../../howto/clinic.rst:50 msgid "" "Obviously, no one would want to use Argument Clinic unless it's solving " "their problem—and without creating new problems of its own. So it's " @@ -89,14 +89,14 @@ msgid "" "parsing library. That would make for the fastest argument parsing possible!)" msgstr "" -#: ../../howto/clinic.rst:61 +#: ../../howto/clinic.rst:62 msgid "" "Additionally, Argument Clinic must be flexible enough to work with any " "approach to argument parsing. Python has some functions with some very " "strange parsing behaviors; Argument Clinic's goal is to support all of them." msgstr "" -#: ../../howto/clinic.rst:66 +#: ../../howto/clinic.rst:67 msgid "" "Finally, the original motivation for Argument Clinic was to provide " "introspection \"signatures\" for CPython builtins. It used to be, the " @@ -104,7 +104,7 @@ msgid "" "builtin. With Argument Clinic, that's a thing of the past!" msgstr "" -#: ../../howto/clinic.rst:72 +#: ../../howto/clinic.rst:73 msgid "" "One idea you should keep in mind, as you work with Argument Clinic: the more " "information you give it, the better job it'll be able to do. Argument Clinic " @@ -113,36 +113,36 @@ msgid "" "things with all the information you give it." msgstr "" -#: ../../howto/clinic.rst:82 -msgid "Basic Concepts And Usage" +#: ../../howto/clinic.rst:83 +msgid "Basic concepts and usage" msgstr "" -#: ../../howto/clinic.rst:84 +#: ../../howto/clinic.rst:85 msgid "" "Argument Clinic ships with CPython; you'll find it in ``Tools/clinic/clinic." "py``. If you run that script, specifying a C file as an argument:" msgstr "" -#: ../../howto/clinic.rst:91 +#: ../../howto/clinic.rst:92 msgid "" "Argument Clinic will scan over the file looking for lines that look exactly " "like this:" msgstr "" -#: ../../howto/clinic.rst:98 +#: ../../howto/clinic.rst:99 msgid "" "When it finds one, it reads everything up to a line that looks exactly like " "this:" msgstr "" -#: ../../howto/clinic.rst:105 +#: ../../howto/clinic.rst:106 msgid "" "Everything in between these two lines is input for Argument Clinic. All of " "these lines, including the beginning and ending comment lines, are " "collectively called an Argument Clinic \"block\"." msgstr "" -#: ../../howto/clinic.rst:109 +#: ../../howto/clinic.rst:110 msgid "" "When Argument Clinic parses one of these blocks, it generates output. This " "output is rewritten into the C file immediately after the block, followed by " @@ -150,7 +150,7 @@ msgid "" "this:" msgstr "" -#: ../../howto/clinic.rst:122 +#: ../../howto/clinic.rst:123 msgid "" "If you run Argument Clinic on the same file a second time, Argument Clinic " "will discard the old output and write out the new output with a fresh " @@ -158,7 +158,7 @@ msgid "" "change either." msgstr "" -#: ../../howto/clinic.rst:126 +#: ../../howto/clinic.rst:127 msgid "" "You should never modify the output portion of an Argument Clinic block. " "Instead, change the input until it produces the output you want. (That's " @@ -167,38 +167,38 @@ msgid "" "output.)" msgstr "" -#: ../../howto/clinic.rst:131 +#: ../../howto/clinic.rst:132 msgid "" "For the sake of clarity, here's the terminology we'll use with Argument " "Clinic:" msgstr "" -#: ../../howto/clinic.rst:133 +#: ../../howto/clinic.rst:134 msgid "" "The first line of the comment (``/*[clinic input]``) is the *start line*." msgstr "" -#: ../../howto/clinic.rst:134 +#: ../../howto/clinic.rst:135 msgid "" "The last line of the initial comment (``[clinic start generated code]*/``) " "is the *end line*." msgstr "" -#: ../../howto/clinic.rst:135 +#: ../../howto/clinic.rst:136 msgid "" "The last line (``/*[clinic end generated code: checksum=...]*/``) is the " "*checksum line*." msgstr "" -#: ../../howto/clinic.rst:136 +#: ../../howto/clinic.rst:137 msgid "In between the start line and the end line is the *input*." msgstr "" -#: ../../howto/clinic.rst:137 +#: ../../howto/clinic.rst:138 msgid "In between the end line and the checksum line is the *output*." msgstr "" -#: ../../howto/clinic.rst:138 +#: ../../howto/clinic.rst:139 msgid "" "All the text collectively, from the start line to the checksum line " "inclusively, is the *block*. (A block that hasn't been successfully " @@ -206,11 +206,11 @@ msgid "" "it's still considered a block.)" msgstr "" -#: ../../howto/clinic.rst:145 -msgid "Converting Your First Function" +#: ../../howto/clinic.rst:146 +msgid "Converting your first function" msgstr "" -#: ../../howto/clinic.rst:147 +#: ../../howto/clinic.rst:148 msgid "" "The best way to get a sense of how Argument Clinic works is to convert a " "function to work with it. Here, then, are the bare minimum steps you'd need " @@ -221,30 +221,30 @@ msgid "" "keep it simple for this walkthrough so you can learn." msgstr "" -#: ../../howto/clinic.rst:156 +#: ../../howto/clinic.rst:157 msgid "Let's dive in!" msgstr "" -#: ../../howto/clinic.rst:158 +#: ../../howto/clinic.rst:159 msgid "" "Make sure you're working with a freshly updated checkout of the CPython " "trunk." msgstr "" -#: ../../howto/clinic.rst:161 +#: ../../howto/clinic.rst:162 msgid "" "Find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :c:" "func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " "Argument Clinic yet. For my example I'm using ``_pickle.Pickler.dump()``." msgstr "" -#: ../../howto/clinic.rst:166 +#: ../../howto/clinic.rst:167 msgid "" "If the call to the ``PyArg_Parse`` function uses any of the following format " "units:" msgstr "" -#: ../../howto/clinic.rst:178 +#: ../../howto/clinic.rst:179 msgid "" "or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should choose " "a different function. Argument Clinic *does* support all of these " @@ -252,7 +252,7 @@ msgid "" "your first function." msgstr "" -#: ../../howto/clinic.rst:183 +#: ../../howto/clinic.rst:184 msgid "" "Also, if the function has multiple calls to :c:func:`PyArg_ParseTuple` or :c:" "func:`PyArg_ParseTupleAndKeywords` where it supports different types for the " @@ -262,11 +262,11 @@ msgid "" "polymorphic parameters." msgstr "" -#: ../../howto/clinic.rst:190 +#: ../../howto/clinic.rst:191 msgid "Add the following boilerplate above the function, creating our block::" msgstr "" -#: ../../howto/clinic.rst:195 +#: ../../howto/clinic.rst:196 msgid "" "Cut the docstring and paste it in between the ``[clinic]`` lines, removing " "all the junk that makes it a properly quoted C string. When you're done you " @@ -274,7 +274,7 @@ msgid "" "80 characters. (Argument Clinic will preserve indents inside the docstring.)" msgstr "" -#: ../../howto/clinic.rst:201 +#: ../../howto/clinic.rst:202 msgid "" "If the old docstring had a first line that looked like a function signature, " "throw that line away. (The docstring doesn't need it anymore—when you use " @@ -282,14 +282,14 @@ msgid "" "automatically based on the function's signature.)" msgstr "" -#: ../../howto/clinic.rst:207 ../../howto/clinic.rst:228 -#: ../../howto/clinic.rst:252 ../../howto/clinic.rst:310 -#: ../../howto/clinic.rst:350 ../../howto/clinic.rst:377 -#: ../../howto/clinic.rst:483 ../../howto/clinic.rst:535 +#: ../../howto/clinic.rst:208 ../../howto/clinic.rst:229 +#: ../../howto/clinic.rst:253 ../../howto/clinic.rst:311 +#: ../../howto/clinic.rst:351 ../../howto/clinic.rst:378 +#: ../../howto/clinic.rst:484 ../../howto/clinic.rst:536 msgid "Sample::" msgstr "" -#: ../../howto/clinic.rst:213 +#: ../../howto/clinic.rst:214 msgid "" "If your docstring doesn't have a \"summary\" line, Argument Clinic will " "complain. So let's make sure it has one. The \"summary\" line should be a " @@ -297,13 +297,13 @@ msgid "" "docstring." msgstr "" -#: ../../howto/clinic.rst:218 +#: ../../howto/clinic.rst:219 msgid "" "(Our example docstring consists solely of a summary line, so the sample code " "doesn't have to change for this step.)" msgstr "" -#: ../../howto/clinic.rst:221 +#: ../../howto/clinic.rst:222 msgid "" "Above the docstring, enter the name of the function, followed by a blank " "line. This should be the Python name of the function, and should be the " @@ -312,7 +312,7 @@ msgid "" "it should include the class name too." msgstr "" -#: ../../howto/clinic.rst:236 +#: ../../howto/clinic.rst:237 msgid "" "If this is the first time that module or class has been used with Argument " "Clinic in this C file, you must declare the module and/or class. Proper " @@ -322,47 +322,47 @@ msgid "" "next to each other.)" msgstr "" -#: ../../howto/clinic.rst:244 +#: ../../howto/clinic.rst:245 msgid "" "The name of the class and module should be the same as the one seen by " "Python. Check the name defined in the :c:type:`PyModuleDef` or :c:type:" "`PyTypeObject` as appropriate." msgstr "" -#: ../../howto/clinic.rst:248 +#: ../../howto/clinic.rst:249 msgid "" "When you declare a class, you must also specify two aspects of its type in " "C: the type declaration you'd use for a pointer to an instance of this " "class, and a pointer to the :c:type:`PyTypeObject` for this class." msgstr "" -#: ../../howto/clinic.rst:268 +#: ../../howto/clinic.rst:269 msgid "" "Declare each of the parameters to the function. Each parameter should get " "its own line. All the parameter lines should be indented from the function " "name and the docstring." msgstr "" -#: ../../howto/clinic.rst:272 +#: ../../howto/clinic.rst:273 msgid "The general form of these parameter lines is as follows:" msgstr "" -#: ../../howto/clinic.rst:278 +#: ../../howto/clinic.rst:279 msgid "If the parameter has a default value, add that after the converter:" msgstr "" -#: ../../howto/clinic.rst:285 +#: ../../howto/clinic.rst:286 msgid "" "Argument Clinic's support for \"default values\" is quite sophisticated; " "please see :ref:`the section below on default values ` for " "more information." msgstr "" -#: ../../howto/clinic.rst:289 +#: ../../howto/clinic.rst:290 msgid "Add a blank line below the parameters." msgstr "" -#: ../../howto/clinic.rst:291 +#: ../../howto/clinic.rst:292 msgid "" "What's a \"converter\"? It establishes both the type of the variable used " "in C, and the method to convert the Python value into a C value at runtime. " @@ -371,7 +371,7 @@ msgid "" "easier." msgstr "" -#: ../../howto/clinic.rst:298 +#: ../../howto/clinic.rst:299 msgid "" "For each parameter, copy the \"format unit\" for that parameter from the " "``PyArg_Parse()`` format argument and specify *that* as its converter, as a " @@ -381,58 +381,58 @@ msgid "" "For more on format units please see :ref:`arg-parsing`.)" msgstr "" -#: ../../howto/clinic.rst:307 +#: ../../howto/clinic.rst:308 msgid "" "For multicharacter format units like ``z#``, use the entire two-or-three " "character string." msgstr "" -#: ../../howto/clinic.rst:325 +#: ../../howto/clinic.rst:326 msgid "" "If your function has ``|`` in the format string, meaning some parameters " "have default values, you can ignore it. Argument Clinic infers which " "parameters are optional based on whether or not they have default values." msgstr "" -#: ../../howto/clinic.rst:330 +#: ../../howto/clinic.rst:331 msgid "" "If your function has ``$`` in the format string, meaning it takes keyword-" "only arguments, specify ``*`` on a line by itself before the first keyword-" "only argument, indented the same as the parameter lines." msgstr "" -#: ../../howto/clinic.rst:335 +#: ../../howto/clinic.rst:336 msgid "(``_pickle.Pickler.dump`` has neither, so our sample is unchanged.)" msgstr "" -#: ../../howto/clinic.rst:338 +#: ../../howto/clinic.rst:339 msgid "" "If the existing C function calls :c:func:`PyArg_ParseTuple` (as opposed to :" "c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments are positional-" "only." msgstr "" -#: ../../howto/clinic.rst:342 +#: ../../howto/clinic.rst:343 msgid "" "To mark all parameters as positional-only in Argument Clinic, add a ``/`` on " "a line by itself after the last parameter, indented the same as the " "parameter lines." msgstr "" -#: ../../howto/clinic.rst:346 +#: ../../howto/clinic.rst:347 msgid "" "Currently this is all-or-nothing; either all parameters are positional-only, " "or none of them are. (In the future Argument Clinic may relax this " "restriction.)" msgstr "" -#: ../../howto/clinic.rst:366 +#: ../../howto/clinic.rst:367 msgid "" "It's helpful to write a per-parameter docstring for each parameter. But per-" "parameter docstrings are optional; you can skip this step if you prefer." msgstr "" -#: ../../howto/clinic.rst:370 +#: ../../howto/clinic.rst:371 msgid "" "Here's how to add a per-parameter docstring. The first line of the per-" "parameter docstring must be indented further than the parameter definition. " @@ -442,34 +442,34 @@ msgid "" "you wish." msgstr "" -#: ../../howto/clinic.rst:394 +#: ../../howto/clinic.rst:395 msgid "" "Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " "luck everything worked---your block now has output, and a ``.c.h`` file has " "been generated! Reopen the file in your text editor to see::" msgstr "" -#: ../../howto/clinic.rst:413 +#: ../../howto/clinic.rst:414 msgid "" "Obviously, if Argument Clinic didn't produce any output, it's because it " "found an error in your input. Keep fixing your errors and retrying until " "Argument Clinic processes your file without complaint." msgstr "" -#: ../../howto/clinic.rst:417 +#: ../../howto/clinic.rst:418 msgid "" "For readability, most of the glue code has been generated to a ``.c.h`` " "file. You'll need to include that in your original ``.c`` file, typically " "right after the clinic module block::" msgstr "" -#: ../../howto/clinic.rst:423 +#: ../../howto/clinic.rst:424 msgid "" "Double-check that the argument-parsing code Argument Clinic generated looks " "basically the same as the existing code." msgstr "" -#: ../../howto/clinic.rst:426 +#: ../../howto/clinic.rst:427 msgid "" "First, ensure both places use the same argument-parsing function. The " "existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" @@ -477,21 +477,21 @@ msgid "" "Clinic calls the *exact* same function." msgstr "" -#: ../../howto/clinic.rst:432 +#: ../../howto/clinic.rst:433 msgid "" "Second, the format string passed in to :c:func:`PyArg_ParseTuple` or :c:func:" "`PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" "written one in the existing function, up to the colon or semi-colon." msgstr "" -#: ../../howto/clinic.rst:437 +#: ../../howto/clinic.rst:438 msgid "" "(Argument Clinic always generates its format strings with a ``:`` followed " "by the name of the function. If the existing code's format string ends with " "``;``, to provide usage help, this change is harmless—don't worry about it.)" msgstr "" -#: ../../howto/clinic.rst:442 +#: ../../howto/clinic.rst:443 msgid "" "Third, for parameters whose format units require two arguments (like a " "length variable, or an encoding string, or a pointer to a conversion " @@ -499,27 +499,27 @@ msgid "" "two invocations." msgstr "" -#: ../../howto/clinic.rst:447 +#: ../../howto/clinic.rst:448 msgid "" "Fourth, inside the output portion of the block you'll find a preprocessor " "macro defining the appropriate static :c:type:`PyMethodDef` structure for " "this builtin::" msgstr "" -#: ../../howto/clinic.rst:454 +#: ../../howto/clinic.rst:455 msgid "" "This static structure should be *exactly* the same as the existing static :c:" "type:`PyMethodDef` structure for this builtin." msgstr "" -#: ../../howto/clinic.rst:457 +#: ../../howto/clinic.rst:458 msgid "" "If any of these items differ in *any way*, adjust your Argument Clinic " "function specification and rerun ``Tools/clinic/clinic.py`` until they *are* " "the same." msgstr "" -#: ../../howto/clinic.rst:462 +#: ../../howto/clinic.rst:463 msgid "" "Notice that the last line of its output is the declaration of your \"impl\" " "function. This is where the builtin's implementation goes. Delete the " @@ -530,20 +530,20 @@ msgid "" "used different names for these variables, fix it." msgstr "" -#: ../../howto/clinic.rst:470 +#: ../../howto/clinic.rst:471 msgid "" "Let's reiterate, just because it's kind of weird. Your code should now look " "like this::" msgstr "" -#: ../../howto/clinic.rst:479 +#: ../../howto/clinic.rst:480 msgid "" "Argument Clinic generated the checksum line and the function prototype just " "above it. You should write the opening (and closing) curly braces for the " "function, and the implementation inside." msgstr "" -#: ../../howto/clinic.rst:524 +#: ../../howto/clinic.rst:525 msgid "" "Remember the macro with the :c:type:`PyMethodDef` structure for this " "function? Find the existing :c:type:`PyMethodDef` structure for this " @@ -553,81 +553,75 @@ msgid "" "to the implementation.)" msgstr "" -#: ../../howto/clinic.rst:531 +#: ../../howto/clinic.rst:532 msgid "" "Note that the body of the macro contains a trailing comma. So when you " "replace the existing static :c:type:`PyMethodDef` structure with the macro, " "*don't* add a comma to the end." msgstr "" -#: ../../howto/clinic.rst:544 +#: ../../howto/clinic.rst:545 msgid "" "Compile, then run the relevant portions of the regression-test suite. This " "change should not introduce any new compile-time warnings or errors, and " "there should be no externally visible change to Python's behavior." msgstr "" -#: ../../howto/clinic.rst:548 +#: ../../howto/clinic.rst:549 msgid "" "Well, except for one difference: ``inspect.signature()`` run on your " "function should now provide a valid signature!" msgstr "" -#: ../../howto/clinic.rst:551 +#: ../../howto/clinic.rst:552 msgid "" "Congratulations, you've ported your first function to work with Argument " "Clinic!" msgstr "" -#: ../../howto/clinic.rst:554 -msgid "Advanced Topics" -msgstr "" - #: ../../howto/clinic.rst:556 -msgid "" -"Now that you've had some experience working with Argument Clinic, it's time " -"for some advanced topics." +msgid "How-to guides" msgstr "" -#: ../../howto/clinic.rst:561 -msgid "Symbolic default values" +#: ../../howto/clinic.rst:560 +msgid "How to use symbolic default values" msgstr "" -#: ../../howto/clinic.rst:563 +#: ../../howto/clinic.rst:562 msgid "" "The default value you provide for a parameter can't be any arbitrary " "expression. Currently the following are explicitly supported:" msgstr "" -#: ../../howto/clinic.rst:566 +#: ../../howto/clinic.rst:565 msgid "Numeric constants (integer and float)" msgstr "" -#: ../../howto/clinic.rst:567 +#: ../../howto/clinic.rst:566 msgid "String constants" msgstr "" -#: ../../howto/clinic.rst:568 +#: ../../howto/clinic.rst:567 msgid "``True``, ``False``, and ``None``" msgstr "" -#: ../../howto/clinic.rst:569 +#: ../../howto/clinic.rst:568 msgid "" "Simple symbolic constants like ``sys.maxsize``, which must start with the " "name of the module" msgstr "" -#: ../../howto/clinic.rst:572 +#: ../../howto/clinic.rst:571 msgid "" "(In the future, this may need to get even more elaborate, to allow full " "expressions like ``CONSTANT - 1``.)" msgstr "" -#: ../../howto/clinic.rst:577 -msgid "Renaming the C functions and variables generated by Argument Clinic" +#: ../../howto/clinic.rst:576 +msgid "How to to rename C functions and variables generated by Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:579 +#: ../../howto/clinic.rst:578 msgid "" "Argument Clinic automatically names the functions it generates for you. " "Occasionally this may cause a problem, if the generated name collides with " @@ -639,19 +633,19 @@ msgid "" "impl function." msgstr "" -#: ../../howto/clinic.rst:587 +#: ../../howto/clinic.rst:586 msgid "" "For example, if we wanted to rename the C function names generated for " "``pickle.Pickler.dump``, it'd look like this::" msgstr "" -#: ../../howto/clinic.rst:595 +#: ../../howto/clinic.rst:594 msgid "" "The base function would now be named ``pickler_dumper()``, and the impl " "function would now be named ``pickler_dumper_impl()``." msgstr "" -#: ../../howto/clinic.rst:599 +#: ../../howto/clinic.rst:598 msgid "" "Similarly, you may have a problem where you want to give a parameter a " "specific Python name, but that name may be inconvenient in C. Argument " @@ -659,21 +653,21 @@ msgid "" "using the same ``\"as\"`` syntax::" msgstr "" -#: ../../howto/clinic.rst:613 +#: ../../howto/clinic.rst:612 msgid "" "Here, the name used in Python (in the signature and the ``keywords`` array) " "would be ``file``, but the C variable would be named ``file_obj``." msgstr "" -#: ../../howto/clinic.rst:616 +#: ../../howto/clinic.rst:615 msgid "You can use this to rename the ``self`` parameter too!" msgstr "" -#: ../../howto/clinic.rst:620 -msgid "Converting functions using PyArg_UnpackTuple" +#: ../../howto/clinic.rst:619 +msgid "How to convert functions using ``PyArg_UnpackTuple``" msgstr "" -#: ../../howto/clinic.rst:622 +#: ../../howto/clinic.rst:621 msgid "" "To convert a function parsing its arguments with :c:func:" "`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " @@ -682,14 +676,14 @@ msgid "" "a line by itself after the last argument)." msgstr "" -#: ../../howto/clinic.rst:628 +#: ../../howto/clinic.rst:627 msgid "" "Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " "will change soon." msgstr "" #: ../../howto/clinic.rst:632 -msgid "Optional Groups" +msgid "How to use optional groups" msgstr "" #: ../../howto/clinic.rst:634 @@ -787,7 +781,8 @@ msgid "" msgstr "" #: ../../howto/clinic.rst:725 -msgid "Using real Argument Clinic converters, instead of \"legacy converters\"" +msgid "" +"How to use real Argument Clinic converters, instead of \"legacy converters\"" msgstr "" #: ../../howto/clinic.rst:727 @@ -844,7 +839,7 @@ msgid "" "Clinic converters accept the following arguments:" msgstr "" -#: ../../howto/clinic.rst:763 ../../howto/clinic.rst:1328 +#: ../../howto/clinic.rst:763 ../../howto/clinic.rst:1329 msgid "``c_default``" msgstr "``c_default``" @@ -899,7 +894,7 @@ msgid "" "even for negative values." msgstr "" -#: ../../howto/clinic.rst:789 ../../howto/clinic.rst:1342 +#: ../../howto/clinic.rst:789 ../../howto/clinic.rst:1343 msgid "``converter``" msgstr "``converter``" @@ -930,7 +925,7 @@ msgid "" "be a subclass of a Python type, as expressed in C." msgstr "" -#: ../../howto/clinic.rst:803 ../../howto/clinic.rst:1314 +#: ../../howto/clinic.rst:803 ../../howto/clinic.rst:1315 msgid "``type``" msgstr "``type``" @@ -1324,11 +1319,11 @@ msgid "" "converters`` to see the full list." msgstr "" -#: ../../howto/clinic.rst:892 -msgid "Py_buffer" -msgstr "Py_buffer" +#: ../../howto/clinic.rst:893 +msgid "How to use the ``Py_buffer`` converter" +msgstr "" -#: ../../howto/clinic.rst:894 +#: ../../howto/clinic.rst:895 msgid "" "When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " "or ``'z*'`` legacy converters), you *must* not call :c:func:" @@ -1337,7 +1332,7 @@ msgid "" msgstr "" #: ../../howto/clinic.rst:902 -msgid "Advanced converters" +msgid "How to use advanced converters" msgstr "" #: ../../howto/clinic.rst:904 @@ -1380,7 +1375,7 @@ msgid "" msgstr "" #: ../../howto/clinic.rst:934 -msgid "Parameter default values" +msgid "How to assign default values to parameter" msgstr "" #: ../../howto/clinic.rst:936 @@ -1400,7 +1395,7 @@ msgid "" msgstr "" #: ../../howto/clinic.rst:958 -msgid "The ``NULL`` default value" +msgid "How to use the ``NULL`` default value" msgstr "" #: ../../howto/clinic.rst:960 @@ -1413,11 +1408,11 @@ msgid "" "with ``NULL``." msgstr "" -#: ../../howto/clinic.rst:968 -msgid "Expressions specified as default values" +#: ../../howto/clinic.rst:969 +msgid "How to use expressions as default values" msgstr "" -#: ../../howto/clinic.rst:970 +#: ../../howto/clinic.rst:971 msgid "" "The default value for a parameter can be more than just a literal value. It " "can be an entire expression, using math operators and looking up attributes " @@ -1425,11 +1420,11 @@ msgid "" "obvious semantics." msgstr "" -#: ../../howto/clinic.rst:975 +#: ../../howto/clinic.rst:976 msgid "Consider the following example:" msgstr "" -#: ../../howto/clinic.rst:981 +#: ../../howto/clinic.rst:982 msgid "" "``sys.maxsize`` can have different values on different platforms. Therefore " "Argument Clinic can't simply evaluate that expression locally and hard-code " @@ -1437,14 +1432,14 @@ msgid "" "at runtime, when the user asks for the function's signature." msgstr "" -#: ../../howto/clinic.rst:986 +#: ../../howto/clinic.rst:987 msgid "" "What namespace is available when the expression is evaluated? It's " "evaluated in the context of the module the builtin came from. So, if your " "module has an attribute called \"``max_widgets``\", you may simply use it:" msgstr "" -#: ../../howto/clinic.rst:994 +#: ../../howto/clinic.rst:995 msgid "" "If the symbol isn't found in the current module, it fails over to looking in " "``sys.modules``. That's how it can find ``sys.maxsize`` for example. " @@ -1453,7 +1448,7 @@ msgid "" "Python itself.)" msgstr "" -#: ../../howto/clinic.rst:999 +#: ../../howto/clinic.rst:1000 msgid "" "Evaluating default values only at runtime means Argument Clinic can't " "compute the correct equivalent C default value. So you need to tell it " @@ -1461,7 +1456,7 @@ msgid "" "expression in C, using the ``c_default`` parameter to the converter:" msgstr "" -#: ../../howto/clinic.rst:1008 +#: ../../howto/clinic.rst:1009 msgid "" "Another complication: Argument Clinic can't know in advance whether or not " "the expression you supply is valid. It parses it to make sure it looks " @@ -1469,35 +1464,35 @@ msgid "" "expressions to specify values that are guaranteed to be valid at runtime!" msgstr "" -#: ../../howto/clinic.rst:1013 +#: ../../howto/clinic.rst:1014 msgid "" "Finally, because expressions must be representable as static C values, there " "are many restrictions on legal expressions. Here's a list of Python " "features you're not permitted to use:" msgstr "" -#: ../../howto/clinic.rst:1017 +#: ../../howto/clinic.rst:1018 msgid "Function calls." msgstr "" -#: ../../howto/clinic.rst:1018 +#: ../../howto/clinic.rst:1019 msgid "Inline if statements (``3 if foo else 5``)." msgstr "" -#: ../../howto/clinic.rst:1019 +#: ../../howto/clinic.rst:1020 msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." msgstr "" -#: ../../howto/clinic.rst:1020 +#: ../../howto/clinic.rst:1021 msgid "List/set/dict comprehensions and generator expressions." msgstr "" -#: ../../howto/clinic.rst:1021 +#: ../../howto/clinic.rst:1022 msgid "Tuple/list/set/dict literals." msgstr "" #: ../../howto/clinic.rst:1026 -msgid "Using a return converter" +msgid "How to use return converters" msgstr "" #: ../../howto/clinic.rst:1028 @@ -1580,7 +1575,7 @@ msgid "" msgstr "" #: ../../howto/clinic.rst:1101 -msgid "Cloning existing functions" +msgid "How to clone existing functions" msgstr "" #: ../../howto/clinic.rst:1103 @@ -1648,41 +1643,41 @@ msgid "" "the current file." msgstr "" -#: ../../howto/clinic.rst:1144 -msgid "Calling Python code" +#: ../../howto/clinic.rst:1145 +msgid "How to call Python code" msgstr "" -#: ../../howto/clinic.rst:1146 +#: ../../howto/clinic.rst:1147 msgid "" "The rest of the advanced topics require you to write Python code which lives " "inside your C file and modifies Argument Clinic's runtime state. This is " "simple: you simply define a Python block." msgstr "" -#: ../../howto/clinic.rst:1150 +#: ../../howto/clinic.rst:1151 msgid "" "A Python block uses different delimiter lines than an Argument Clinic " "function block. It looks like this::" msgstr "" -#: ../../howto/clinic.rst:1157 +#: ../../howto/clinic.rst:1158 msgid "" "All the code inside the Python block is executed at the time it's parsed. " "All text written to stdout inside the block is redirected into the " "\"output\" after the block." msgstr "" -#: ../../howto/clinic.rst:1161 +#: ../../howto/clinic.rst:1162 msgid "" "As an example, here's a Python block that adds a static integer variable to " "the C code::" msgstr "" -#: ../../howto/clinic.rst:1172 -msgid "Using a \"self converter\"" +#: ../../howto/clinic.rst:1173 +msgid "How to use the \"self converter\"" msgstr "" -#: ../../howto/clinic.rst:1174 +#: ../../howto/clinic.rst:1175 msgid "" "Argument Clinic automatically adds a \"self\" parameter for you using a " "default converter. It automatically sets the ``type`` of this parameter to " @@ -1693,13 +1688,13 @@ msgid "" "a subclass thereof." msgstr "" -#: ../../howto/clinic.rst:1183 +#: ../../howto/clinic.rst:1184 msgid "" "What's the point? This lets you override the type of ``self``, or give it a " "different default name." msgstr "" -#: ../../howto/clinic.rst:1186 +#: ../../howto/clinic.rst:1187 msgid "" "How do you specify the custom type you want to cast ``self`` to? If you only " "have one or two functions with the same type for ``self``, you can directly " @@ -1707,18 +1702,18 @@ msgid "" "want to use as the ``type`` parameter::" msgstr "" -#: ../../howto/clinic.rst:1202 +#: ../../howto/clinic.rst:1203 msgid "" "On the other hand, if you have a lot of functions that will use the same " "type for ``self``, it's best to create your own converter, subclassing " "``self_converter`` but overwriting the ``type`` member::" msgstr "" -#: ../../howto/clinic.rst:1224 -msgid "Using a \"defining class\" converter" +#: ../../howto/clinic.rst:1225 +msgid "How to use the \"defining class\" converter" msgstr "" -#: ../../howto/clinic.rst:1226 +#: ../../howto/clinic.rst:1227 msgid "" "Argument Clinic facilitates gaining access to the defining class of a " "method. This is useful for :ref:`heap type ` methods that need " @@ -1728,25 +1723,25 @@ msgid "" "example from a module method." msgstr "" -#: ../../howto/clinic.rst:1232 +#: ../../howto/clinic.rst:1233 msgid "" "Example from ``Modules/zlibmodule.c``. First, ``defining_class`` is added " "to the clinic input::" msgstr "" -#: ../../howto/clinic.rst:1244 +#: ../../howto/clinic.rst:1245 msgid "" "After running the Argument Clinic tool, the following function signature is " "generated::" msgstr "" -#: ../../howto/clinic.rst:1254 +#: ../../howto/clinic.rst:1255 msgid "" "The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " "module state::" msgstr "" -#: ../../howto/clinic.rst:1260 +#: ../../howto/clinic.rst:1261 msgid "" "Each method may only have one argument using this converter, and it must " "appear after ``self``, or, if ``self`` is not used, as the first argument. " @@ -1754,13 +1749,13 @@ msgid "" "appear in the ``__text_signature__``." msgstr "" -#: ../../howto/clinic.rst:1265 +#: ../../howto/clinic.rst:1266 msgid "" "The ``defining_class`` converter is not compatible with ``__init__`` and " "``__new__`` methods, which cannot use the ``METH_METHOD`` convention." msgstr "" -#: ../../howto/clinic.rst:1268 +#: ../../howto/clinic.rst:1269 msgid "" "It is not possible to use ``defining_class`` with slot methods. In order to " "fetch the module state from such methods, use :c:func:" @@ -1769,15 +1764,15 @@ msgid "" "``setattro`` slot method in ``Modules/_threadmodule.c``::" msgstr "" -#: ../../howto/clinic.rst:1283 +#: ../../howto/clinic.rst:1284 msgid "See also :pep:`573`." msgstr "也請見 :pep:`573`\\ 。" -#: ../../howto/clinic.rst:1287 -msgid "Writing a custom converter" +#: ../../howto/clinic.rst:1288 +msgid "How to write a custom converter" msgstr "" -#: ../../howto/clinic.rst:1289 +#: ../../howto/clinic.rst:1290 msgid "" "As we hinted at in the previous section... you can write your own " "converters! A converter is simply a Python class that inherits from " @@ -1786,7 +1781,7 @@ msgid "" "a :c:func:`PyArg_ParseTuple` \"converter function\"." msgstr "" -#: ../../howto/clinic.rst:1295 +#: ../../howto/clinic.rst:1296 msgid "" "Your converter class should be named ``*something*_converter``. If the name " "follows this convention, then your converter class will be automatically " @@ -1795,7 +1790,7 @@ msgid "" "metaclass.)" msgstr "" -#: ../../howto/clinic.rst:1301 +#: ../../howto/clinic.rst:1302 msgid "" "You shouldn't subclass ``CConverter.__init__``. Instead, you should write a " "``converter_init()`` function. ``converter_init()`` always accepts a " @@ -1804,50 +1799,50 @@ msgid "" "passed along to your ``converter_init()``." msgstr "" -#: ../../howto/clinic.rst:1308 +#: ../../howto/clinic.rst:1309 msgid "" "There are some additional members of ``CConverter`` you may wish to specify " "in your subclass. Here's the current list:" msgstr "" -#: ../../howto/clinic.rst:1312 +#: ../../howto/clinic.rst:1313 msgid "" "The C type to use for this variable. ``type`` should be a Python string " "specifying the type, e.g. ``int``. If this is a pointer type, the type " "string should end with ``' *'``." msgstr "" -#: ../../howto/clinic.rst:1318 +#: ../../howto/clinic.rst:1319 msgid "``default``" msgstr "``default``" -#: ../../howto/clinic.rst:1317 +#: ../../howto/clinic.rst:1318 msgid "" "The Python default value for this parameter, as a Python value. Or the magic " "value ``unspecified`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1323 +#: ../../howto/clinic.rst:1324 msgid "``py_default``" msgstr "``py_default``" -#: ../../howto/clinic.rst:1321 +#: ../../howto/clinic.rst:1322 msgid "" "``default`` as it should appear in Python code, as a string. Or ``None`` if " "there is no default." msgstr "" -#: ../../howto/clinic.rst:1326 +#: ../../howto/clinic.rst:1327 msgid "" "``default`` as it should appear in C code, as a string. Or ``None`` if there " "is no default." msgstr "" -#: ../../howto/clinic.rst:1339 +#: ../../howto/clinic.rst:1340 msgid "``c_ignored_default``" msgstr "``c_ignored_default``" -#: ../../howto/clinic.rst:1331 +#: ../../howto/clinic.rst:1332 msgid "" "The default value used to initialize the C variable when there is no " "default, but not specifying a default may result in an \"uninitialized " @@ -1858,37 +1853,37 @@ msgid "" "non-empty string." msgstr "" -#: ../../howto/clinic.rst:1342 +#: ../../howto/clinic.rst:1343 msgid "The name of the C converter function, as a string." msgstr "" -#: ../../howto/clinic.rst:1347 +#: ../../howto/clinic.rst:1348 msgid "``impl_by_reference``" msgstr "``impl_by_reference``" -#: ../../howto/clinic.rst:1345 +#: ../../howto/clinic.rst:1346 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into the impl function." msgstr "" -#: ../../howto/clinic.rst:1353 +#: ../../howto/clinic.rst:1354 msgid "``parse_by_reference``" msgstr "``parse_by_reference``" -#: ../../howto/clinic.rst:1350 +#: ../../howto/clinic.rst:1351 msgid "" "A boolean value. If true, Argument Clinic will add a ``&`` in front of the " "name of the variable when passing it into :c:func:`PyArg_ParseTuple`." msgstr "" -#: ../../howto/clinic.rst:1355 +#: ../../howto/clinic.rst:1356 msgid "" "Here's the simplest example of a custom converter, from ``Modules/zlibmodule." "c``::" msgstr "" -#: ../../howto/clinic.rst:1366 +#: ../../howto/clinic.rst:1367 msgid "" "This block adds a converter to Argument Clinic named ``ssize_t``. " "Parameters declared as ``ssize_t`` will be declared as type :c:type:" @@ -1897,25 +1892,25 @@ msgid "" "automatically support default values." msgstr "" -#: ../../howto/clinic.rst:1372 +#: ../../howto/clinic.rst:1373 msgid "" "More sophisticated custom converters can insert custom C code to handle " "initialization and cleanup. You can see more examples of custom converters " "in the CPython source tree; grep the C files for the string ``CConverter``." msgstr "" -#: ../../howto/clinic.rst:1378 -msgid "Writing a custom return converter" +#: ../../howto/clinic.rst:1380 +msgid "How to write a custom return converter" msgstr "" -#: ../../howto/clinic.rst:1380 +#: ../../howto/clinic.rst:1382 msgid "" "Writing a custom return converter is much like writing a custom converter. " "Except it's somewhat simpler, because return converters are themselves much " "simpler." msgstr "" -#: ../../howto/clinic.rst:1384 +#: ../../howto/clinic.rst:1386 msgid "" "Return converters must subclass ``CReturnConverter``. There are no examples " "yet of custom return converters, because they are not widely used yet. If " @@ -1924,59 +1919,59 @@ msgid "" "its subclasses." msgstr "" -#: ../../howto/clinic.rst:1392 -msgid "METH_O and METH_NOARGS" +#: ../../howto/clinic.rst:1395 +msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" msgstr "" -#: ../../howto/clinic.rst:1394 +#: ../../howto/clinic.rst:1397 msgid "" "To convert a function using ``METH_O``, make sure the function's single " "argument is using the ``object`` converter, and mark the arguments as " "positional-only::" msgstr "" -#: ../../howto/clinic.rst:1406 +#: ../../howto/clinic.rst:1409 msgid "" "To convert a function using ``METH_NOARGS``, just don't specify any " "arguments." msgstr "" -#: ../../howto/clinic.rst:1409 +#: ../../howto/clinic.rst:1412 msgid "" "You can still use a self converter, a return converter, and specify a " "``type`` argument to the object converter for ``METH_O``." msgstr "" -#: ../../howto/clinic.rst:1413 -msgid "tp_new and tp_init functions" +#: ../../howto/clinic.rst:1417 +msgid "How to convert ``tp_new`` and ``tp_init`` functions" msgstr "" -#: ../../howto/clinic.rst:1415 +#: ../../howto/clinic.rst:1419 msgid "" "You can convert ``tp_new`` and ``tp_init`` functions. Just name them " "``__new__`` or ``__init__`` as appropriate. Notes:" msgstr "" -#: ../../howto/clinic.rst:1418 +#: ../../howto/clinic.rst:1422 msgid "" "The function name generated for ``__new__`` doesn't end in ``__new__`` like " "it would by default. It's just the name of the class, converted into a " "valid C identifier." msgstr "" -#: ../../howto/clinic.rst:1422 +#: ../../howto/clinic.rst:1426 msgid "No ``PyMethodDef`` ``#define`` is generated for these functions." msgstr "" -#: ../../howto/clinic.rst:1424 +#: ../../howto/clinic.rst:1428 msgid "``__init__`` functions return ``int``, not ``PyObject *``." msgstr "" -#: ../../howto/clinic.rst:1426 +#: ../../howto/clinic.rst:1430 msgid "Use the docstring as the class docstring." msgstr "" -#: ../../howto/clinic.rst:1428 +#: ../../howto/clinic.rst:1432 msgid "" "Although ``__new__`` and ``__init__`` functions must always accept both the " "``args`` and ``kwargs`` objects, when converting you may specify any " @@ -1985,11 +1980,11 @@ msgid "" "it receives any.)" msgstr "" -#: ../../howto/clinic.rst:1435 -msgid "Changing and redirecting Clinic's output" +#: ../../howto/clinic.rst:1440 +msgid "How to change and redirect Clinic's output" msgstr "" -#: ../../howto/clinic.rst:1437 +#: ../../howto/clinic.rst:1442 msgid "" "It can be inconvenient to have Clinic's output interspersed with your " "conventional hand-edited C code. Luckily, Clinic is configurable: you can " @@ -1998,7 +1993,7 @@ msgid "" "Clinic's generated output." msgstr "" -#: ../../howto/clinic.rst:1443 +#: ../../howto/clinic.rst:1448 msgid "" "While changing Clinic's output in this manner can be a boon to readability, " "it may result in Clinic code using types before they are defined, or your " @@ -2010,15 +2005,15 @@ msgid "" "rearranging your code to fix definition-before-use problems.)" msgstr "" -#: ../../howto/clinic.rst:1452 +#: ../../howto/clinic.rst:1457 msgid "Let's start with defining some terminology:" msgstr "" -#: ../../howto/clinic.rst:1479 +#: ../../howto/clinic.rst:1484 msgid "*field*" msgstr "" -#: ../../howto/clinic.rst:1455 +#: ../../howto/clinic.rst:1460 msgid "" "A field, in this context, is a subsection of Clinic's output. For example, " "the ``#define`` for the ``PyMethodDef`` structure is a field, called " @@ -2026,7 +2021,7 @@ msgid "" "function definition:" msgstr "" -#: ../../howto/clinic.rst:1470 +#: ../../howto/clinic.rst:1475 msgid "" "All the names are of the form ``\"_\"``, where ``\"\"`` is the " "semantic object represented (the parsing function, the impl function, the " @@ -2039,45 +2034,45 @@ msgid "" "``\"_define\"``, representing that it's a preprocessor #define.)" msgstr "" -#: ../../howto/clinic.rst:1513 +#: ../../howto/clinic.rst:1518 msgid "*destination*" msgstr "" -#: ../../howto/clinic.rst:1482 +#: ../../howto/clinic.rst:1487 msgid "" "A destination is a place Clinic can write output to. There are five built-" "in destinations:" msgstr "" -#: ../../howto/clinic.rst:1487 ../../howto/clinic.rst:1562 -#: ../../howto/clinic.rst:1640 +#: ../../howto/clinic.rst:1492 ../../howto/clinic.rst:1567 +#: ../../howto/clinic.rst:1645 msgid "``block``" msgstr "``block``" -#: ../../howto/clinic.rst:1486 +#: ../../howto/clinic.rst:1491 msgid "" "The default destination: printed in the output section of the current Clinic " "block." msgstr "" -#: ../../howto/clinic.rst:1493 ../../howto/clinic.rst:1589 -#: ../../howto/clinic.rst:1643 +#: ../../howto/clinic.rst:1498 ../../howto/clinic.rst:1594 +#: ../../howto/clinic.rst:1648 msgid "``buffer``" msgstr "``buffer``" -#: ../../howto/clinic.rst:1490 +#: ../../howto/clinic.rst:1495 msgid "" "A text buffer where you can save text for later. Text sent here is appended " "to the end of any existing text. It's an error to have any text left in the " "buffer when Clinic finishes processing a file." msgstr "" -#: ../../howto/clinic.rst:1504 ../../howto/clinic.rst:1575 -#: ../../howto/clinic.rst:1669 +#: ../../howto/clinic.rst:1509 ../../howto/clinic.rst:1580 +#: ../../howto/clinic.rst:1674 msgid "``file``" msgstr "``file``" -#: ../../howto/clinic.rst:1496 +#: ../../howto/clinic.rst:1501 msgid "" "A separate \"clinic file\" that will be created automatically by Clinic. The " "filename chosen for the file is ``{basename}.clinic{extension}``, where " @@ -2086,65 +2081,65 @@ msgid "" "for ``_pickle.c`` would be written to ``_pickle.clinic.c``.)" msgstr "" -#: ../../howto/clinic.rst:1503 +#: ../../howto/clinic.rst:1508 msgid "" "**Important: When using a** ``file`` **destination, you** *must check in* " "**the generated file!**" msgstr "" -#: ../../howto/clinic.rst:1509 ../../howto/clinic.rst:1602 -#: ../../howto/clinic.rst:1673 +#: ../../howto/clinic.rst:1514 ../../howto/clinic.rst:1607 +#: ../../howto/clinic.rst:1678 msgid "``two-pass``" msgstr "``two-pass``" -#: ../../howto/clinic.rst:1507 +#: ../../howto/clinic.rst:1512 msgid "" "A buffer like ``buffer``. However, a two-pass buffer can only be dumped " "once, and it prints out all text sent to it during all processing, even from " "Clinic blocks *after* the dumping point." msgstr "" -#: ../../howto/clinic.rst:1513 ../../howto/clinic.rst:1636 +#: ../../howto/clinic.rst:1518 ../../howto/clinic.rst:1641 msgid "``suppress``" msgstr "``suppress``" -#: ../../howto/clinic.rst:1512 +#: ../../howto/clinic.rst:1517 msgid "The text is suppressed—thrown away." msgstr "" -#: ../../howto/clinic.rst:1515 +#: ../../howto/clinic.rst:1520 msgid "Clinic defines five new directives that let you reconfigure its output." msgstr "" -#: ../../howto/clinic.rst:1517 +#: ../../howto/clinic.rst:1522 msgid "The first new directive is ``dump``:" msgstr "" -#: ../../howto/clinic.rst:1523 +#: ../../howto/clinic.rst:1528 msgid "" "This dumps the current contents of the named destination into the output of " "the current block, and empties it. This only works with ``buffer`` and " "``two-pass`` destinations." msgstr "" -#: ../../howto/clinic.rst:1527 +#: ../../howto/clinic.rst:1532 msgid "" "The second new directive is ``output``. The most basic form of ``output`` " "is like this:" msgstr "" -#: ../../howto/clinic.rst:1534 +#: ../../howto/clinic.rst:1539 msgid "" "This tells Clinic to output *field* to *destination*. ``output`` also " "supports a special meta-destination, called ``everything``, which tells " "Clinic to output *all* fields to that *destination*." msgstr "" -#: ../../howto/clinic.rst:1538 +#: ../../howto/clinic.rst:1543 msgid "``output`` has a number of other functions:" msgstr "" -#: ../../howto/clinic.rst:1547 +#: ../../howto/clinic.rst:1552 msgid "" "``output push`` and ``output pop`` allow you to push and pop configurations " "on an internal configuration stack, so that you can temporarily modify the " @@ -2153,25 +2148,25 @@ msgid "" "when you wish to restore the previous configuration." msgstr "" -#: ../../howto/clinic.rst:1554 +#: ../../howto/clinic.rst:1559 msgid "" "``output preset`` sets Clinic's output to one of several built-in preset " "configurations, as follows:" msgstr "" -#: ../../howto/clinic.rst:1558 +#: ../../howto/clinic.rst:1563 msgid "" "Clinic's original starting configuration. Writes everything immediately " "after the input block." msgstr "" -#: ../../howto/clinic.rst:1561 +#: ../../howto/clinic.rst:1566 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write " "everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1565 +#: ../../howto/clinic.rst:1570 msgid "" "Designed to write everything to the \"clinic file\" that it can. You then " "``#include`` this file near the top of your file. You may need to rearrange " @@ -2179,17 +2174,17 @@ msgid "" "declarations for various ``typedef`` and ``PyTypeObject`` definitions." msgstr "" -#: ../../howto/clinic.rst:1571 +#: ../../howto/clinic.rst:1576 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " "``impl_definition`` to ``block``, and write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1575 +#: ../../howto/clinic.rst:1580 msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." msgstr "" -#: ../../howto/clinic.rst:1578 +#: ../../howto/clinic.rst:1583 msgid "" "Save up most of the output from Clinic, to be written into your file near " "the end. For Python files implementing modules or builtin types, it's " @@ -2199,14 +2194,14 @@ msgid "" "static ``PyMethodDef`` arrays defined in the middle of the file." msgstr "" -#: ../../howto/clinic.rst:1587 +#: ../../howto/clinic.rst:1592 msgid "" "Suppress the ``parser_prototype``, ``impl_prototype``, and " "``docstring_prototype``, write the ``impl_definition`` to ``block``, and " "write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1592 +#: ../../howto/clinic.rst:1597 msgid "" "Similar to the ``buffer`` preset, but writes forward declarations to the " "``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " @@ -2215,18 +2210,18 @@ msgid "" "near the end just like you would when using the ``buffer`` preset." msgstr "" -#: ../../howto/clinic.rst:1599 +#: ../../howto/clinic.rst:1604 msgid "" "Suppresses the ``impl_prototype``, write the ``impl_definition`` to " "``block``, write ``docstring_prototype``, ``methoddef_define``, and " "``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." msgstr "" -#: ../../howto/clinic.rst:1613 +#: ../../howto/clinic.rst:1618 msgid "``partial-buffer``" msgstr "``partial-buffer``" -#: ../../howto/clinic.rst:1605 +#: ../../howto/clinic.rst:1610 msgid "" "Similar to the ``buffer`` preset, but writes more things to ``block``, only " "writing the really big chunks of generated code to ``buffer``. This avoids " @@ -2236,137 +2231,137 @@ msgid "" "preset." msgstr "" -#: ../../howto/clinic.rst:1612 +#: ../../howto/clinic.rst:1617 msgid "" "Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " "``parser_definition`` to ``buffer``, write everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1615 +#: ../../howto/clinic.rst:1620 msgid "The third new directive is ``destination``:" msgstr "" -#: ../../howto/clinic.rst:1621 +#: ../../howto/clinic.rst:1626 msgid "This performs an operation on the destination named ``name``." msgstr "" -#: ../../howto/clinic.rst:1623 +#: ../../howto/clinic.rst:1628 msgid "There are two defined subcommands: ``new`` and ``clear``." msgstr "" -#: ../../howto/clinic.rst:1625 +#: ../../howto/clinic.rst:1630 msgid "The ``new`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1631 +#: ../../howto/clinic.rst:1636 msgid "" "This creates a new destination with name ```` and type ````." msgstr "" -#: ../../howto/clinic.rst:1633 +#: ../../howto/clinic.rst:1638 msgid "There are five destination types:" msgstr "" -#: ../../howto/clinic.rst:1636 +#: ../../howto/clinic.rst:1641 msgid "Throws the text away." msgstr "" -#: ../../howto/clinic.rst:1639 +#: ../../howto/clinic.rst:1644 msgid "" "Writes the text to the current block. This is what Clinic originally did." msgstr "" -#: ../../howto/clinic.rst:1643 +#: ../../howto/clinic.rst:1648 msgid "A simple text buffer, like the \"buffer\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1646 +#: ../../howto/clinic.rst:1651 msgid "" "A text file. The file destination takes an extra argument, a template to " "use for building the filename, like so:" msgstr "" -#: ../../howto/clinic.rst:1649 +#: ../../howto/clinic.rst:1654 msgid "destination new " msgstr "" -#: ../../howto/clinic.rst:1651 +#: ../../howto/clinic.rst:1656 msgid "" "The template can use three strings internally that will be replaced by bits " "of the filename:" msgstr "" -#: ../../howto/clinic.rst:1654 +#: ../../howto/clinic.rst:1659 msgid "{path}" msgstr "{path}" -#: ../../howto/clinic.rst:1655 +#: ../../howto/clinic.rst:1660 msgid "The full path to the file, including directory and full filename." msgstr "" -#: ../../howto/clinic.rst:1656 +#: ../../howto/clinic.rst:1661 msgid "{dirname}" msgstr "{dirname}" -#: ../../howto/clinic.rst:1657 +#: ../../howto/clinic.rst:1662 msgid "The name of the directory the file is in." msgstr "" -#: ../../howto/clinic.rst:1658 +#: ../../howto/clinic.rst:1663 msgid "{basename}" msgstr "{basename}" -#: ../../howto/clinic.rst:1659 +#: ../../howto/clinic.rst:1664 msgid "Just the name of the file, not including the directory." msgstr "" -#: ../../howto/clinic.rst:1661 +#: ../../howto/clinic.rst:1666 msgid "{basename_root}" msgstr "{basename_root}" -#: ../../howto/clinic.rst:1661 +#: ../../howto/clinic.rst:1666 msgid "" "Basename with the extension clipped off (everything up to but not including " "the last '.')." msgstr "" -#: ../../howto/clinic.rst:1665 +#: ../../howto/clinic.rst:1670 msgid "{basename_extension}" msgstr "{basename_extension}" -#: ../../howto/clinic.rst:1664 +#: ../../howto/clinic.rst:1669 msgid "" "The last '.' and everything after it. If the basename does not contain a " "period, this will be the empty string." msgstr "" -#: ../../howto/clinic.rst:1667 +#: ../../howto/clinic.rst:1672 msgid "" "If there are no periods in the filename, {basename} and {filename} are the " "same, and {extension} is empty. \"{basename}{extension}\" is always exactly " "the same as \"{filename}\".\"" msgstr "" -#: ../../howto/clinic.rst:1672 +#: ../../howto/clinic.rst:1677 msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1675 +#: ../../howto/clinic.rst:1680 msgid "The ``clear`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1681 +#: ../../howto/clinic.rst:1686 msgid "" "It removes all the accumulated text up to this point in the destination. (I " "don't know what you'd need this for, but I thought maybe it'd be useful " "while someone's experimenting.)" msgstr "" -#: ../../howto/clinic.rst:1685 +#: ../../howto/clinic.rst:1690 msgid "The fourth new directive is ``set``:" msgstr "" -#: ../../howto/clinic.rst:1692 +#: ../../howto/clinic.rst:1697 msgid "" "``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " "string that will be prepended to every line of Clinic's output; " @@ -2374,35 +2369,35 @@ msgid "" "output." msgstr "" -#: ../../howto/clinic.rst:1696 +#: ../../howto/clinic.rst:1701 msgid "Both of these support two format strings:" msgstr "" -#: ../../howto/clinic.rst:1699 +#: ../../howto/clinic.rst:1704 msgid "``{block comment start}``" msgstr "``{block comment start}``" -#: ../../howto/clinic.rst:1699 +#: ../../howto/clinic.rst:1704 msgid "" "Turns into the string ``/*``, the start-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1702 +#: ../../howto/clinic.rst:1707 msgid "``{block comment end}``" msgstr "``{block comment end}``" -#: ../../howto/clinic.rst:1702 +#: ../../howto/clinic.rst:1707 msgid "" "Turns into the string ``*/``, the end-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1704 +#: ../../howto/clinic.rst:1709 msgid "" "The final new directive is one you shouldn't need to use directly, called " "``preserve``:" msgstr "" -#: ../../howto/clinic.rst:1711 +#: ../../howto/clinic.rst:1716 msgid "" "This tells Clinic that the current contents of the output should be kept, " "unmodified. This is used internally by Clinic when dumping output into " @@ -2411,36 +2406,36 @@ msgid "" "gets overwritten." msgstr "" -#: ../../howto/clinic.rst:1718 -msgid "The #ifdef trick" +#: ../../howto/clinic.rst:1723 +msgid "How to use the ``#ifdef`` trick" msgstr "" -#: ../../howto/clinic.rst:1720 +#: ../../howto/clinic.rst:1725 msgid "" "If you're converting a function that isn't available on all platforms, " "there's a trick you can use to make life a little easier. The existing code " "probably looks like this::" msgstr "" -#: ../../howto/clinic.rst:1731 +#: ../../howto/clinic.rst:1736 msgid "" "And then in the ``PyMethodDef`` structure at the bottom the existing code " "will have:" msgstr "" -#: ../../howto/clinic.rst:1740 +#: ../../howto/clinic.rst:1745 msgid "" "In this scenario, you should enclose the body of your impl function inside " "the ``#ifdef``, like so::" msgstr "" -#: ../../howto/clinic.rst:1754 +#: ../../howto/clinic.rst:1759 msgid "" "Then, remove those three lines from the ``PyMethodDef`` structure, replacing " "them with the macro Argument Clinic generated:" msgstr "" -#: ../../howto/clinic.rst:1761 +#: ../../howto/clinic.rst:1766 msgid "" "(You can find the real name for this macro inside the generated code. Or you " "can calculate it yourself: it's the name of your function as defined on the " @@ -2448,27 +2443,27 @@ msgid "" "uppercased, and ``\"_METHODDEF\"`` added to the end.)" msgstr "" -#: ../../howto/clinic.rst:1766 +#: ../../howto/clinic.rst:1771 msgid "" "Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " "``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" msgstr "" -#: ../../howto/clinic.rst:1769 +#: ../../howto/clinic.rst:1774 msgid "" "Here's where Argument Clinic gets very clever. It actually detects that the " "Argument Clinic block might be deactivated by the ``#ifdef``. When that " "happens, it generates a little extra code that looks like this::" msgstr "" -#: ../../howto/clinic.rst:1777 +#: ../../howto/clinic.rst:1782 msgid "" "That means the macro always works. If the function is defined, this turns " "into the correct structure, including the trailing comma. If the function " "is undefined, this turns into nothing." msgstr "" -#: ../../howto/clinic.rst:1781 +#: ../../howto/clinic.rst:1786 msgid "" "However, this causes one ticklish problem: where should Argument Clinic put " "this extra code when using the \"block\" output preset? It can't go in the " @@ -2476,24 +2471,24 @@ msgid "" "the whole point!)" msgstr "" -#: ../../howto/clinic.rst:1785 +#: ../../howto/clinic.rst:1790 msgid "" "In this situation, Argument Clinic writes the extra code to the \"buffer\" " "destination. This may mean that you get a complaint from Argument Clinic:" msgstr "" -#: ../../howto/clinic.rst:1793 +#: ../../howto/clinic.rst:1798 msgid "" "When this happens, just open your file, find the ``dump buffer`` block that " "Argument Clinic added to your file (it'll be at the very bottom), then move " "it above the ``PyMethodDef`` structure where that macro is used." msgstr "" -#: ../../howto/clinic.rst:1800 -msgid "Using Argument Clinic in Python files" +#: ../../howto/clinic.rst:1804 +msgid "How to use Argument Clinic in Python files" msgstr "" -#: ../../howto/clinic.rst:1802 +#: ../../howto/clinic.rst:1806 msgid "" "It's actually possible to use Argument Clinic to preprocess Python files. " "There's no point to using Argument Clinic blocks, of course, as the output " @@ -2501,8 +2496,11 @@ msgid "" "Clinic to run Python blocks lets you use Python as a Python preprocessor!" msgstr "" -#: ../../howto/clinic.rst:1807 +#: ../../howto/clinic.rst:1811 msgid "" "Since Python comments are different from C comments, Argument Clinic blocks " "embedded in Python files look slightly different. They look like this:" msgstr "" + +#~ msgid "Py_buffer" +#~ msgstr "Py_buffer" diff --git a/library/asyncio-exceptions.po b/library/asyncio-exceptions.po index 075e7bc684..c432a4901b 100644 --- a/library/asyncio-exceptions.po +++ b/library/asyncio-exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-07-06 00:19+0000\n" "PO-Revision-Date: 2022-01-31 21:41+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,9 @@ msgstr "**原始碼:**\\ :source:`Lib/asyncio/exceptions.py`" msgid "" "A deprecated alias of :exc:`TimeoutError`, raised when the operation has " "exceeded the given deadline." -msgstr ":exc:`TimeoutError` 的一個已被棄用的別名,當操作已超過規定的截止時間時被引發。" +msgstr "" +":exc:`TimeoutError` 的一個已被棄用的別名,當操作已超過規定的截止時間時被引" +"發。" #: ../../library/asyncio-exceptions.rst:21 msgid "This class was made an alias of :exc:`TimeoutError`." @@ -51,8 +53,10 @@ msgstr "" "該例外必須重新被引發。" #: ../../library/asyncio-exceptions.rst:34 -msgid ":exc:`CancelledError` is now a subclass of :class:`BaseException`." -msgstr ":exc:`CancelledError` 現在是 :class:`BaseException` 的子類別。" +msgid "" +":exc:`CancelledError` is now a subclass of :class:`BaseException` rather " +"than :class:`Exception`." +msgstr ":exc:`CancelledError` 現在是 :class:`BaseException` 而非 :class:`Exception` 的子類別。" #: ../../library/asyncio-exceptions.rst:39 msgid "Invalid internal state of :class:`Task` or :class:`Future`." diff --git a/library/crypt.po b/library/crypt.po index bfbac1aaa5..8871578e57 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-13 00:19+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,14 +26,15 @@ msgstr ":mod:`crypt` --- 用於檢查 Unix 密碼的函式" msgid "**Source code:** :source:`Lib/crypt.py`" msgstr "**原始碼:**\\ :source:`Lib/crypt.py`" -#: ../../library/crypt.rst:23 +#: ../../library/crypt.rst:24 msgid "" "The :mod:`crypt` module is deprecated (see :pep:`PEP 594 <594#crypt>` for " "details and alternatives). The :mod:`hashlib` module is a potential " -"replacement for certain use cases." +"replacement for certain use cases. The `passlib `_ package can replace all use cases of this module." msgstr "" -#: ../../library/crypt.rst:26 +#: ../../library/crypt.rst:27 msgid "" "This module implements an interface to the :manpage:`crypt(3)` routine, " "which is a one-way hash function based upon a modified DES algorithm; see " @@ -42,7 +43,7 @@ msgid "" "attempting to crack Unix passwords with a dictionary." msgstr "" -#: ../../library/crypt.rst:34 +#: ../../library/crypt.rst:35 msgid "" "Notice that the behavior of this module depends on the actual " "implementation of the :manpage:`crypt(3)` routine in the running system. " @@ -50,7 +51,7 @@ msgid "" "be available on this module." msgstr "" -#: ../../library/crypt.rst:39 +#: ../../library/crypt.rst:40 msgid ":ref:`Availability `: Unix, not VxWorks." msgstr ":ref:`適用 `:Unix,非 VxWorks。" @@ -65,65 +66,65 @@ msgid "" "more information." msgstr "" -#: ../../library/crypt.rst:44 +#: ../../library/crypt.rst:45 msgid "Hashing Methods" msgstr "" -#: ../../library/crypt.rst:48 +#: ../../library/crypt.rst:49 msgid "" "The :mod:`crypt` module defines the list of hashing methods (not all methods " "are available on all platforms):" msgstr "" -#: ../../library/crypt.rst:53 +#: ../../library/crypt.rst:54 msgid "" "A Modular Crypt Format method with 16 character salt and 86 character hash " "based on the SHA-512 hash function. This is the strongest method." msgstr "" -#: ../../library/crypt.rst:58 +#: ../../library/crypt.rst:59 msgid "" "Another Modular Crypt Format method with 16 character salt and 43 character " "hash based on the SHA-256 hash function." msgstr "" -#: ../../library/crypt.rst:63 +#: ../../library/crypt.rst:64 msgid "" "Another Modular Crypt Format method with 22 character salt and 31 character " "hash based on the Blowfish cipher." msgstr "" -#: ../../library/crypt.rst:70 +#: ../../library/crypt.rst:71 msgid "" "Another Modular Crypt Format method with 8 character salt and 22 character " "hash based on the MD5 hash function." msgstr "" -#: ../../library/crypt.rst:75 +#: ../../library/crypt.rst:76 msgid "" "The traditional method with a 2 character salt and 13 characters of hash. " "This is the weakest method." msgstr "" -#: ../../library/crypt.rst:80 +#: ../../library/crypt.rst:81 msgid "Module Attributes" msgstr "模組屬性" -#: ../../library/crypt.rst:86 +#: ../../library/crypt.rst:87 msgid "" "A list of available password hashing algorithms, as ``crypt.METHOD_*`` " "objects. This list is sorted from strongest to weakest." msgstr "" -#: ../../library/crypt.rst:92 +#: ../../library/crypt.rst:93 msgid "Module Functions" msgstr "模組函式" -#: ../../library/crypt.rst:94 +#: ../../library/crypt.rst:95 msgid "The :mod:`crypt` module defines the following functions:" msgstr ":mod:`crypt` 模組定義了以下函式:" -#: ../../library/crypt.rst:98 +#: ../../library/crypt.rst:99 msgid "" "*word* will usually be a user's password as typed at a prompt or in a " "graphical interface. The optional *salt* is either a string as returned " @@ -133,14 +134,14 @@ msgid "" "strongest method available in :attr:`methods` will be used." msgstr "" -#: ../../library/crypt.rst:105 +#: ../../library/crypt.rst:106 msgid "" "Checking a password is usually done by passing the plain-text password as " "*word* and the full results of a previous :func:`crypt` call, which should " "be the same as the results of this call." msgstr "" -#: ../../library/crypt.rst:109 +#: ../../library/crypt.rst:110 msgid "" "*salt* (either a random 2 or 16 character string, possibly prefixed with " "``$digit$`` to indicate the method) which will be used to perturb the " @@ -149,36 +150,36 @@ msgid "" "``$digit$``." msgstr "" -#: ../../library/crypt.rst:115 +#: ../../library/crypt.rst:116 msgid "" "Returns the hashed password as a string, which will be composed of " "characters from the same alphabet as the salt." msgstr "" -#: ../../library/crypt.rst:120 +#: ../../library/crypt.rst:121 msgid "" "Since a few :manpage:`crypt(3)` extensions allow different values, with " "different sizes in the *salt*, it is recommended to use the full crypted " "password as salt when checking for a password." msgstr "" -#: ../../library/crypt.rst:124 +#: ../../library/crypt.rst:125 msgid "Accept ``crypt.METHOD_*`` values in addition to strings for *salt*." msgstr "" -#: ../../library/crypt.rst:130 +#: ../../library/crypt.rst:131 msgid "" "Return a randomly generated salt of the specified method. If no *method* is " "given, the strongest method available in :attr:`methods` is used." msgstr "" -#: ../../library/crypt.rst:134 +#: ../../library/crypt.rst:135 msgid "" "The return value is a string suitable for passing as the *salt* argument to :" "func:`crypt`." msgstr "" -#: ../../library/crypt.rst:137 +#: ../../library/crypt.rst:138 msgid "" "*rounds* specifies the number of rounds for ``METHOD_SHA256``, " "``METHOD_SHA512`` and ``METHOD_BLOWFISH``. For ``METHOD_SHA256`` and " @@ -188,29 +189,29 @@ msgid "" "sup:`31`), the default is ``4096`` (2\\ :sup:`12`)." msgstr "" -#: ../../library/crypt.rst:147 +#: ../../library/crypt.rst:148 msgid "Added the *rounds* parameter." msgstr "新增 *rounds* 參數。" -#: ../../library/crypt.rst:152 +#: ../../library/crypt.rst:153 msgid "Examples" msgstr "範例" -#: ../../library/crypt.rst:154 +#: ../../library/crypt.rst:155 msgid "" "A simple example illustrating typical use (a constant-time comparison " "operation is needed to limit exposure to timing attacks. :func:`hmac." "compare_digest` is suitable for this purpose)::" msgstr "" -#: ../../library/crypt.rst:174 +#: ../../library/crypt.rst:175 msgid "" "To generate a hash of a password using the strongest available method and " "check it against the original::" msgstr "" -#: ../../library/crypt.rst:15 ../../library/crypt.rst:32 -#: ../../library/crypt.rst:118 +#: ../../library/crypt.rst:15 ../../library/crypt.rst:33 +#: ../../library/crypt.rst:119 msgid "crypt(3)" msgstr "crypt(3)" diff --git a/library/exceptions.po b/library/exceptions.po index b0828b4fd3..ba9bec1d90 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-29 00:19+0000\n" +"POT-Creation-Date: 2023-07-06 16:53+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -990,11 +990,11 @@ msgstr "" msgid "Base class for warnings related to resource usage." msgstr "" -#: ../../library/exceptions.rst:875 +#: ../../library/exceptions.rst:877 msgid "Exception groups" msgstr "" -#: ../../library/exceptions.rst:877 +#: ../../library/exceptions.rst:879 msgid "" "The following are used when it is necessary to raise multiple unrelated " "exceptions. They are part of the exception hierarchy so they can be handled " @@ -1003,7 +1003,7 @@ msgid "" "based on the types of the contained exceptions." msgstr "" -#: ../../library/exceptions.rst:886 +#: ../../library/exceptions.rst:888 msgid "" "Both of these exception types wrap the exceptions in the sequence ``excs``. " "The ``msg`` parameter must be a string. The difference between the two " @@ -1014,7 +1014,7 @@ msgid "" "exc:`BaseExceptionGroup`." msgstr "" -#: ../../library/exceptions.rst:894 +#: ../../library/exceptions.rst:896 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1023,23 +1023,23 @@ msgid "" "`TypeError` if any contained exception is not an :exc:`Exception` subclass." msgstr "" -#: ../../library/exceptions.rst:903 +#: ../../library/exceptions.rst:905 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "" -#: ../../library/exceptions.rst:907 +#: ../../library/exceptions.rst:909 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "" -#: ../../library/exceptions.rst:912 +#: ../../library/exceptions.rst:914 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." msgstr "" -#: ../../library/exceptions.rst:915 +#: ../../library/exceptions.rst:917 msgid "" "The condition can be either a function that accepts an exception and returns " "true for those that should be in the subgroup, or it can be an exception " @@ -1047,7 +1047,7 @@ msgid "" "the same check that is used in an ``except`` clause." msgstr "" -#: ../../library/exceptions.rst:920 +#: ../../library/exceptions.rst:922 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`__traceback__`, :attr:" @@ -1055,34 +1055,34 @@ msgid "" "groups are omitted from the result." msgstr "" -#: ../../library/exceptions.rst:925 +#: ../../library/exceptions.rst:927 msgid "" "The condition is checked for all exceptions in the nested exception group, " "including the top-level and any nested exception groups. If the condition is " "true for such an exception group, it is included in the result in full." msgstr "" -#: ../../library/exceptions.rst:931 +#: ../../library/exceptions.rst:933 msgid "" "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " "``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" "matching part." msgstr "" -#: ../../library/exceptions.rst:937 +#: ../../library/exceptions.rst:939 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." msgstr "" -#: ../../library/exceptions.rst:940 +#: ../../library/exceptions.rst:942 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`. A subclass needs " "to override it in order to make :meth:`subgroup` and :meth:`split` return " "instances of the subclass rather than :exc:`ExceptionGroup`." msgstr "" -#: ../../library/exceptions.rst:945 +#: ../../library/exceptions.rst:947 msgid "" ":meth:`subgroup` and :meth:`split` copy the :attr:`__traceback__`, :attr:" "`__cause__`, :attr:`__context__` and :attr:`__notes__` fields from the " @@ -1090,7 +1090,7 @@ msgid "" "fields do not need to be updated by :meth:`derive`. ::" msgstr "" -#: ../../library/exceptions.rst:974 +#: ../../library/exceptions.rst:976 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`__new__`, so subclasses " "that need a different constructor signature need to override that rather " @@ -1099,18 +1099,18 @@ msgid "" "from it. ::" msgstr "" -#: ../../library/exceptions.rst:989 +#: ../../library/exceptions.rst:991 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" "`Exception`." msgstr "" -#: ../../library/exceptions.rst:997 +#: ../../library/exceptions.rst:999 msgid "Exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:999 +#: ../../library/exceptions.rst:1001 msgid "The class hierarchy for built-in exceptions is:" msgstr "" diff --git a/library/functions.po b/library/functions.po index 9455147f6e..616d69ddfd 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-30 15:31+0000\n" +"POT-Creation-Date: 2023-07-09 00:21+0000\n" "PO-Revision-Date: 2023-07-02 22:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1467,10 +1467,10 @@ msgstr "" msgid "" "For objects with custom :meth:`__hash__` methods, note that :func:`hash` " "truncates the return value based on the bit width of the host machine. See :" -"meth:`__hash__` for details." +"meth:`__hash__ ` for details." msgstr "" "請注意,如果物件實現了自己的 :meth:`__hash__` method,:func:`hash` 根據執行機" -"器的位元長度來擷取回傳值。另請參閱 :meth:`__hash__`。" +"器的位元長度來擷取回傳值。另請參閱 :meth:`__hash__ `。" #: ../../library/functions.rst:801 msgid "" diff --git a/library/sqlite3.po b/library/sqlite3.po index f58e35fd8c..507125b3ae 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-25 19:30+0000\n" +"POT-Creation-Date: 2023-07-12 00:20+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -236,7 +236,7 @@ msgstr ":ref:`sqlite3-adapters`" msgid ":ref:`sqlite3-converters`" msgstr ":ref:`sqlite3-converters`" -#: ../../library/sqlite3.rst:241 ../../library/sqlite3.rst:557 +#: ../../library/sqlite3.rst:241 ../../library/sqlite3.rst:558 msgid ":ref:`sqlite3-connection-context-manager`" msgstr ":ref:`sqlite3-connection-context-manager`" @@ -267,11 +267,12 @@ msgstr "參數" #: ../../library/sqlite3.rst:266 msgid "" -"The path to the database file to be opened. Pass ``\":memory:\"`` to open a " -"connection to a database that is in RAM instead of on disk." +"The path to the database file to be opened. You can pass ``\":memory:\"`` to " +"create an `SQLite database existing only in memory `_, and open a connection to it." msgstr "" -#: ../../library/sqlite3.rst:272 +#: ../../library/sqlite3.rst:273 msgid "" "How many seconds the connection should wait before raising an :exc:" "`OperationalError` when a table is locked. If another connection opens a " @@ -279,7 +280,7 @@ msgid "" "transaction is committed. Default five seconds." msgstr "" -#: ../../library/sqlite3.rst:279 +#: ../../library/sqlite3.rst:280 msgid "" "Control whether and how data types not :ref:`natively supported by SQLite " "` are looked up to be converted to Python types, using the " @@ -292,7 +293,7 @@ msgid "" "disabled." msgstr "" -#: ../../library/sqlite3.rst:293 +#: ../../library/sqlite3.rst:294 msgid "" "The :attr:`~Connection.isolation_level` of the connection, controlling " "whether and how transactions are implicitly opened. Can be ``\"DEFERRED\"`` " @@ -301,7 +302,7 @@ msgid "" "for more." msgstr "" -#: ../../library/sqlite3.rst:301 +#: ../../library/sqlite3.rst:302 msgid "" "If ``True`` (default), :exc:`ProgrammingError` will be raised if the " "database connection is used by a thread other than the one that created it. " @@ -310,19 +311,19 @@ msgid "" "See :attr:`threadsafety` for more information." msgstr "" -#: ../../library/sqlite3.rst:310 +#: ../../library/sqlite3.rst:311 msgid "" "A custom subclass of :class:`Connection` to create the connection with, if " "not the default :class:`Connection` class." msgstr "" -#: ../../library/sqlite3.rst:314 +#: ../../library/sqlite3.rst:315 msgid "" "The number of statements that :mod:`!sqlite3` should internally cache for " "this connection, to avoid parsing overhead. By default, 128 statements." msgstr "" -#: ../../library/sqlite3.rst:319 +#: ../../library/sqlite3.rst:320 msgid "" "If set to ``True``, *database* is interpreted as a :abbr:`URI (Uniform " "Resource Identifier)` with a file path and an optional query string. The " @@ -335,7 +336,7 @@ msgstr "" msgid "Return type" msgstr "" -#: ../../library/sqlite3.rst:330 +#: ../../library/sqlite3.rst:331 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." @@ -343,7 +344,7 @@ msgstr "" "引發一個附帶引數 ``database`` 的\\ :ref:`稽核事件 ` ``sqlite3." "connect``。" -#: ../../library/sqlite3.rst:331 +#: ../../library/sqlite3.rst:332 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." @@ -351,20 +352,20 @@ msgstr "" "引發一個附帶引數 ``connection_handle`` 的\\ :ref:`稽核事件 ` " "``sqlite3.connect/handle``。" -#: ../../library/sqlite3.rst:333 +#: ../../library/sqlite3.rst:334 msgid "The *uri* parameter." msgstr "*uri* 參數。" -#: ../../library/sqlite3.rst:336 +#: ../../library/sqlite3.rst:337 msgid "" "*database* can now also be a :term:`path-like object`, not only a string." msgstr "" -#: ../../library/sqlite3.rst:339 +#: ../../library/sqlite3.rst:340 msgid "The ``sqlite3.connect/handle`` auditing event." msgstr "``sqlite3.connect/handle`` 稽核事件。" -#: ../../library/sqlite3.rst:344 +#: ../../library/sqlite3.rst:345 msgid "" "Return ``True`` if the string *statement* appears to contain one or more " "complete SQL statements. No syntactic verification or parsing of any kind is " @@ -372,18 +373,18 @@ msgid "" "and the statement is terminated by a semicolon." msgstr "" -#: ../../library/sqlite3.rst:350 +#: ../../library/sqlite3.rst:351 msgid "For example:" msgstr "範例:" -#: ../../library/sqlite3.rst:359 +#: ../../library/sqlite3.rst:360 msgid "" "This function may be useful during command-line input to determine if the " "entered text seems to form a complete SQL statement, or if additional input " "is needed before calling :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:365 +#: ../../library/sqlite3.rst:366 msgid "" "Enable or disable callback tracebacks. By default you will not get any " "tracebacks in user-defined functions, aggregates, converters, authorizer " @@ -392,13 +393,13 @@ msgid "" "on :data:`sys.stderr`. Use ``False`` to disable the feature again." msgstr "" -#: ../../library/sqlite3.rst:372 +#: ../../library/sqlite3.rst:373 msgid "" "Register an :func:`unraisable hook handler ` for an " "improved debug experience:" msgstr "" -#: ../../library/sqlite3.rst:397 +#: ../../library/sqlite3.rst:398 msgid "" "Register an *adapter* :term:`callable` to adapt the Python type *type* into " "an SQLite type. The adapter is called with a Python object of type *type* as " @@ -406,7 +407,7 @@ msgid "" "natively understands `." msgstr "" -#: ../../library/sqlite3.rst:405 +#: ../../library/sqlite3.rst:406 msgid "" "Register the *converter* :term:`callable` to convert SQLite objects of type " "*typename* into a Python object of a specific type. The converter is invoked " @@ -416,17 +417,17 @@ msgid "" "type detection works." msgstr "" -#: ../../library/sqlite3.rst:413 +#: ../../library/sqlite3.rst:414 msgid "" "Note: *typename* and the name of the type in your query are matched case-" "insensitively." msgstr "" -#: ../../library/sqlite3.rst:420 +#: ../../library/sqlite3.rst:421 msgid "Module constants" msgstr "" -#: ../../library/sqlite3.rst:424 +#: ../../library/sqlite3.rst:425 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function by using the type name, parsed from the query " @@ -434,13 +435,13 @@ msgid "" "in square brackets (``[]``)." msgstr "" -#: ../../library/sqlite3.rst:434 +#: ../../library/sqlite3.rst:435 msgid "" "This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:439 +#: ../../library/sqlite3.rst:440 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function using the declared types for each column. The " @@ -449,61 +450,61 @@ msgid "" "the converter dictionary key. For example:" msgstr "" -#: ../../library/sqlite3.rst:455 +#: ../../library/sqlite3.rst:456 msgid "" "This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: ../../library/sqlite3.rst:462 +#: ../../library/sqlite3.rst:463 msgid "" "Flags that should be returned by the *authorizer_callback* :term:`callable` " "passed to :meth:`Connection.set_authorizer`, to indicate whether:" msgstr "" -#: ../../library/sqlite3.rst:465 +#: ../../library/sqlite3.rst:466 msgid "Access is allowed (:const:`!SQLITE_OK`)," msgstr "" -#: ../../library/sqlite3.rst:466 +#: ../../library/sqlite3.rst:467 msgid "" "The SQL statement should be aborted with an error (:const:`!SQLITE_DENY`)" msgstr "" -#: ../../library/sqlite3.rst:467 +#: ../../library/sqlite3.rst:468 msgid "" "The column should be treated as a ``NULL`` value (:const:`!SQLITE_IGNORE`)" msgstr "" -#: ../../library/sqlite3.rst:471 +#: ../../library/sqlite3.rst:472 msgid "" "String constant stating the supported DB-API level. Required by the DB-API. " "Hard-coded to ``\"2.0\"``." msgstr "" -#: ../../library/sqlite3.rst:476 +#: ../../library/sqlite3.rst:477 msgid "" "String constant stating the type of parameter marker formatting expected by " "the :mod:`!sqlite3` module. Required by the DB-API. Hard-coded to " "``\"qmark\"``." msgstr "" -#: ../../library/sqlite3.rst:482 +#: ../../library/sqlite3.rst:483 msgid "The ``named`` DB-API parameter style is also supported." msgstr "" -#: ../../library/sqlite3.rst:486 +#: ../../library/sqlite3.rst:487 msgid "" "Version number of the runtime SQLite library as a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:490 +#: ../../library/sqlite3.rst:491 msgid "" "Version number of the runtime SQLite library as a :class:`tuple` of :class:" "`integers `." msgstr "" -#: ../../library/sqlite3.rst:495 +#: ../../library/sqlite3.rst:496 msgid "" "Integer constant required by the DB-API 2.0, stating the level of thread " "safety the :mod:`!sqlite3` module supports. This attribute is set based on " @@ -511,154 +512,154 @@ msgid "" "underlying SQLite library is compiled with. The SQLite threading modes are:" msgstr "" -#: ../../library/sqlite3.rst:500 +#: ../../library/sqlite3.rst:501 msgid "" "**Single-thread**: In this mode, all mutexes are disabled and SQLite is " "unsafe to use in more than a single thread at once." msgstr "" -#: ../../library/sqlite3.rst:502 +#: ../../library/sqlite3.rst:503 msgid "" "**Multi-thread**: In this mode, SQLite can be safely used by multiple " "threads provided that no single database connection is used simultaneously " "in two or more threads." msgstr "" -#: ../../library/sqlite3.rst:505 +#: ../../library/sqlite3.rst:506 msgid "" "**Serialized**: In serialized mode, SQLite can be safely used by multiple " "threads with no restriction." msgstr "" -#: ../../library/sqlite3.rst:508 +#: ../../library/sqlite3.rst:509 msgid "" "The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels " "are as follows:" msgstr "" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:513 msgid "SQLite threading mode" msgstr "" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:513 msgid "`threadsafety`_" msgstr "`threadsafety`_" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:513 msgid "`SQLITE_THREADSAFE`_" msgstr "`SQLITE_THREADSAFE`_" -#: ../../library/sqlite3.rst:512 +#: ../../library/sqlite3.rst:513 msgid "DB-API 2.0 meaning" msgstr "" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:516 msgid "single-thread" msgstr "" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:516 msgid "0" msgstr "0" -#: ../../library/sqlite3.rst:515 +#: ../../library/sqlite3.rst:516 msgid "Threads may not share the module" msgstr "" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:519 msgid "multi-thread" msgstr "" -#: ../../library/sqlite3.rst:518 ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:519 ../../library/sqlite3.rst:522 msgid "1" msgstr "1" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:519 msgid "2" msgstr "2" -#: ../../library/sqlite3.rst:518 +#: ../../library/sqlite3.rst:519 msgid "Threads may share the module, but not connections" msgstr "" -#: ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:522 msgid "serialized" msgstr "" -#: ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:522 msgid "3" msgstr "3" -#: ../../library/sqlite3.rst:521 +#: ../../library/sqlite3.rst:522 msgid "Threads may share the module, connections and cursors" msgstr "" -#: ../../library/sqlite3.rst:528 +#: ../../library/sqlite3.rst:529 msgid "Set *threadsafety* dynamically instead of hard-coding it to ``1``." msgstr "" -#: ../../library/sqlite3.rst:533 +#: ../../library/sqlite3.rst:534 msgid "" "Version number of this module as a :class:`string `. This is not the " "version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:538 +#: ../../library/sqlite3.rst:539 msgid "" "Version number of this module as a :class:`tuple` of :class:`integers " "`. This is not the version of the SQLite library." msgstr "" -#: ../../library/sqlite3.rst:545 +#: ../../library/sqlite3.rst:546 msgid "Connection objects" msgstr "" -#: ../../library/sqlite3.rst:549 +#: ../../library/sqlite3.rst:550 msgid "" "Each open SQLite database is represented by a ``Connection`` object, which " "is created using :func:`sqlite3.connect`. Their main purpose is creating :" "class:`Cursor` objects, and :ref:`sqlite3-controlling-transactions`." msgstr "" -#: ../../library/sqlite3.rst:556 +#: ../../library/sqlite3.rst:557 msgid ":ref:`sqlite3-connection-shortcuts`" msgstr ":ref:`sqlite3-connection-shortcuts`" -#: ../../library/sqlite3.rst:559 +#: ../../library/sqlite3.rst:560 msgid "An SQLite database connection has the following attributes and methods:" msgstr "" -#: ../../library/sqlite3.rst:563 +#: ../../library/sqlite3.rst:564 msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " "single optional parameter *factory*. If supplied, this must be a :term:" "`callable` returning an instance of :class:`Cursor` or its subclasses." msgstr "" -#: ../../library/sqlite3.rst:570 +#: ../../library/sqlite3.rst:571 msgid "" "Open a :class:`Blob` handle to an existing :abbr:`BLOB (Binary Large " "OBject)`." msgstr "" -#: ../../library/sqlite3.rst:573 +#: ../../library/sqlite3.rst:574 msgid "The name of the table where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:576 +#: ../../library/sqlite3.rst:577 msgid "The name of the column where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:579 +#: ../../library/sqlite3.rst:580 msgid "The name of the row where the blob is located." msgstr "" -#: ../../library/sqlite3.rst:582 +#: ../../library/sqlite3.rst:583 msgid "" "Set to ``True`` if the blob should be opened without write permissions. " "Defaults to ``False``." msgstr "" -#: ../../library/sqlite3.rst:587 +#: ../../library/sqlite3.rst:588 msgid "" "The name of the database where the blob is located. Defaults to ``\"main\"``." msgstr "" @@ -667,111 +668,111 @@ msgstr "" msgid "Raises" msgstr "" -#: ../../library/sqlite3.rst:591 +#: ../../library/sqlite3.rst:592 msgid "When trying to open a blob in a ``WITHOUT ROWID`` table." msgstr "" -#: ../../library/sqlite3.rst:598 +#: ../../library/sqlite3.rst:599 msgid "" "The blob size cannot be changed using the :class:`Blob` class. Use the SQL " "function ``zeroblob`` to create a blob with a fixed size." msgstr "" -#: ../../library/sqlite3.rst:605 +#: ../../library/sqlite3.rst:606 msgid "" "Commit any pending transaction to the database. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:610 +#: ../../library/sqlite3.rst:611 msgid "" "Roll back to the start of any pending transaction. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:615 +#: ../../library/sqlite3.rst:616 msgid "" "Close the database connection. Any pending transaction is not committed " "implicitly; make sure to :meth:`commit` before closing to avoid losing " "pending changes." msgstr "" -#: ../../library/sqlite3.rst:622 +#: ../../library/sqlite3.rst:623 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it " "with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:628 +#: ../../library/sqlite3.rst:629 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on " "it with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:634 +#: ../../library/sqlite3.rst:635 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executescript` " "on it with the given *sql_script*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:640 +#: ../../library/sqlite3.rst:641 msgid "Create or remove a user-defined SQL function." msgstr "" -#: ../../library/sqlite3.rst:642 +#: ../../library/sqlite3.rst:643 msgid "The name of the SQL function." msgstr "" -#: ../../library/sqlite3.rst:645 +#: ../../library/sqlite3.rst:646 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:649 +#: ../../library/sqlite3.rst:650 msgid "" "A :term:`callable` that is called when the SQL function is invoked. The " "callable must return :ref:`a type natively supported by SQLite `. Set to ``None`` to remove an existing SQL function." msgstr "" -#: ../../library/sqlite3.rst:656 +#: ../../library/sqlite3.rst:657 msgid "" "If ``True``, the created SQL function is marked as `deterministic `_, which allows SQLite to perform additional " "optimizations." msgstr "" -#: ../../library/sqlite3.rst:661 +#: ../../library/sqlite3.rst:662 msgid "If *deterministic* is used with SQLite versions older than 3.8.3." msgstr "" -#: ../../library/sqlite3.rst:664 +#: ../../library/sqlite3.rst:665 msgid "The *deterministic* parameter." msgstr "新增 *deterministic* 參數。" -#: ../../library/sqlite3.rst:667 ../../library/sqlite3.rst:705 -#: ../../library/sqlite3.rst:768 ../../library/sqlite3.rst:1020 -#: ../../library/sqlite3.rst:1257 ../../library/sqlite3.rst:1384 -#: ../../library/sqlite3.rst:1412 +#: ../../library/sqlite3.rst:668 ../../library/sqlite3.rst:706 +#: ../../library/sqlite3.rst:769 ../../library/sqlite3.rst:1021 +#: ../../library/sqlite3.rst:1258 ../../library/sqlite3.rst:1385 +#: ../../library/sqlite3.rst:1413 msgid "Example:" msgstr "範例:" -#: ../../library/sqlite3.rst:683 +#: ../../library/sqlite3.rst:684 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:685 +#: ../../library/sqlite3.rst:686 msgid "The name of the SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:688 +#: ../../library/sqlite3.rst:689 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:692 +#: ../../library/sqlite3.rst:693 msgid "" "A class must implement the following methods: * ``step()``: Add a row to " "the aggregate. * ``finalize()``: Return the final result of the aggregate " @@ -780,45 +781,45 @@ msgid "" "*n_arg*. Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:693 +#: ../../library/sqlite3.rst:694 msgid "A class must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:695 +#: ../../library/sqlite3.rst:696 msgid "``step()``: Add a row to the aggregate." msgstr "" -#: ../../library/sqlite3.rst:696 ../../library/sqlite3.rst:752 +#: ../../library/sqlite3.rst:697 ../../library/sqlite3.rst:753 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" -#: ../../library/sqlite3.rst:699 +#: ../../library/sqlite3.rst:700 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" -#: ../../library/sqlite3.rst:702 +#: ../../library/sqlite3.rst:703 msgid "Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:737 +#: ../../library/sqlite3.rst:738 msgid "Create or remove a user-defined aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:739 +#: ../../library/sqlite3.rst:740 msgid "The name of the SQL aggregate window function to create or remove." msgstr "" -#: ../../library/sqlite3.rst:742 +#: ../../library/sqlite3.rst:743 msgid "" "The number of arguments the SQL aggregate window function can accept. If " "``-1``, it may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:746 +#: ../../library/sqlite3.rst:747 msgid "" "A class that must implement the following methods: * ``step()``: Add a row " "to the current window. * ``value()``: Return the current value of the " @@ -830,79 +831,79 @@ msgid "" "function." msgstr "" -#: ../../library/sqlite3.rst:747 +#: ../../library/sqlite3.rst:748 msgid "A class that must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:749 +#: ../../library/sqlite3.rst:750 msgid "``step()``: Add a row to the current window." msgstr "" -#: ../../library/sqlite3.rst:750 +#: ../../library/sqlite3.rst:751 msgid "``value()``: Return the current value of the aggregate." msgstr "" -#: ../../library/sqlite3.rst:751 +#: ../../library/sqlite3.rst:752 msgid "``inverse()``: Remove a row from the current window." msgstr "" -#: ../../library/sqlite3.rst:755 +#: ../../library/sqlite3.rst:756 msgid "" "The number of arguments that the ``step()`` and ``value()`` methods must " "accept is controlled by *num_params*." msgstr "" -#: ../../library/sqlite3.rst:758 +#: ../../library/sqlite3.rst:759 msgid "Set to ``None`` to remove an existing SQL aggregate window function." msgstr "" -#: ../../library/sqlite3.rst:760 +#: ../../library/sqlite3.rst:761 msgid "" "If used with a version of SQLite older than 3.25.0, which does not support " "aggregate window functions." msgstr "" -#: ../../library/sqlite3.rst:823 +#: ../../library/sqlite3.rst:824 msgid "" "Create a collation named *name* using the collating function *callable*. " "*callable* is passed two :class:`string ` arguments, and it should " "return an :class:`integer `:" msgstr "" -#: ../../library/sqlite3.rst:827 +#: ../../library/sqlite3.rst:828 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: ../../library/sqlite3.rst:828 +#: ../../library/sqlite3.rst:829 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: ../../library/sqlite3.rst:829 +#: ../../library/sqlite3.rst:830 msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:831 +#: ../../library/sqlite3.rst:832 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:859 +#: ../../library/sqlite3.rst:860 msgid "Remove a collation function by setting *callable* to ``None``." msgstr "" -#: ../../library/sqlite3.rst:861 +#: ../../library/sqlite3.rst:862 msgid "" "The collation name can contain any Unicode character. Earlier, only ASCII " "characters were allowed." msgstr "" -#: ../../library/sqlite3.rst:868 +#: ../../library/sqlite3.rst:869 msgid "" "Call this method from a different thread to abort any queries that might be " "executing on the connection. Aborted queries will raise an :exc:" "`OperationalError`." msgstr "" -#: ../../library/sqlite3.rst:875 +#: ../../library/sqlite3.rst:876 msgid "" "Register :term:`callable` *authorizer_callback* to be invoked for each " "attempt to access a column of a table in the database. The callback should " @@ -911,7 +912,7 @@ msgid "" "underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:882 +#: ../../library/sqlite3.rst:883 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or ``None`` " @@ -921,7 +922,7 @@ msgid "" "attempt or ``None`` if this access attempt is directly from input SQL code." msgstr "" -#: ../../library/sqlite3.rst:889 +#: ../../library/sqlite3.rst:890 msgid "" "Please consult the SQLite documentation about the possible values for the " "first argument and the meaning of the second and third argument depending on " @@ -929,15 +930,15 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:893 +#: ../../library/sqlite3.rst:894 msgid "Passing ``None`` as *authorizer_callback* will disable the authorizer." msgstr "" -#: ../../library/sqlite3.rst:895 +#: ../../library/sqlite3.rst:896 msgid "Added support for disabling the authorizer using ``None``." msgstr "" -#: ../../library/sqlite3.rst:901 +#: ../../library/sqlite3.rst:902 msgid "" "Register :term:`callable` *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -945,26 +946,26 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:906 +#: ../../library/sqlite3.rst:907 msgid "" "If you want to clear any previously installed progress handler, call the " "method with ``None`` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:909 +#: ../../library/sqlite3.rst:910 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise an :exc:`OperationalError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:916 +#: ../../library/sqlite3.rst:917 msgid "" "Register :term:`callable` *trace_callback* to be invoked for each SQL " "statement that is actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:919 +#: ../../library/sqlite3.rst:920 msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " @@ -974,18 +975,18 @@ msgid "" "execution of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:927 +#: ../../library/sqlite3.rst:928 msgid "Passing ``None`` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:930 +#: ../../library/sqlite3.rst:931 msgid "" "Exceptions raised in the trace callback are not propagated. As a development " "and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable " "printing tracebacks from exceptions raised in the trace callback." msgstr "" -#: ../../library/sqlite3.rst:940 +#: ../../library/sqlite3.rst:941 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is ``True``; else, disallow loading SQLite extensions. SQLite " @@ -994,7 +995,7 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:949 +#: ../../library/sqlite3.rst:950 msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " @@ -1003,7 +1004,7 @@ msgid "" "program:`configure`." msgstr "" -#: ../../library/sqlite3.rst:956 +#: ../../library/sqlite3.rst:957 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." @@ -1011,18 +1012,18 @@ msgstr "" "引發一個附帶引數 ``connection``、``enabled`` 的\\ :ref:`稽核事件 ` " "``sqlite3.enable_load_extension``。" -#: ../../library/sqlite3.rst:960 +#: ../../library/sqlite3.rst:961 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "加入 ``sqlite3.enable_load_extension`` 稽核事件。" -#: ../../library/sqlite3.rst:1003 +#: ../../library/sqlite3.rst:1004 msgid "" "Load an SQLite extension from a shared library located at *path*. Enable " "extension loading with :meth:`enable_load_extension` before calling this " "method." msgstr "" -#: ../../library/sqlite3.rst:1007 +#: ../../library/sqlite3.rst:1008 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." @@ -1030,38 +1031,38 @@ msgstr "" "引發一個附帶引數 ``connection``、``path`` 的\\ :ref:`稽核事件 ` " "``sqlite3.load_extension``。" -#: ../../library/sqlite3.rst:1011 +#: ../../library/sqlite3.rst:1012 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "加入 ``sqlite3.load_extension`` 稽核事件。" -#: ../../library/sqlite3.rst:1016 +#: ../../library/sqlite3.rst:1017 msgid "" "Return an :term:`iterator` to dump the database as SQL source code. Useful " "when saving an in-memory database for later restoration. Similar to the ``." "dump`` command in the :program:`sqlite3` shell." msgstr "" -#: ../../library/sqlite3.rst:1034 +#: ../../library/sqlite3.rst:1035 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1036 +#: ../../library/sqlite3.rst:1037 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:1039 +#: ../../library/sqlite3.rst:1040 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:1042 +#: ../../library/sqlite3.rst:1043 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:1048 +#: ../../library/sqlite3.rst:1049 msgid "" "If set to a :term:`callable`, it is invoked with three integer arguments for " "every backup iteration: the *status* of the last iteration, the *remaining* " @@ -1069,46 +1070,46 @@ msgid "" "Defaults to ``None``." msgstr "" -#: ../../library/sqlite3.rst:1057 +#: ../../library/sqlite3.rst:1058 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1064 +#: ../../library/sqlite3.rst:1065 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:1068 +#: ../../library/sqlite3.rst:1069 msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:1087 +#: ../../library/sqlite3.rst:1088 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:1099 +#: ../../library/sqlite3.rst:1100 msgid "Get a connection runtime limit." msgstr "" -#: ../../library/sqlite3.rst:1101 +#: ../../library/sqlite3.rst:1102 msgid "The `SQLite limit category`_ to be queried." msgstr "" -#: ../../library/sqlite3.rst:1106 ../../library/sqlite3.rst:1143 +#: ../../library/sqlite3.rst:1107 ../../library/sqlite3.rst:1144 msgid "If *category* is not recognised by the underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:1109 +#: ../../library/sqlite3.rst:1110 msgid "" "Example, query the maximum length of an SQL statement for :class:" "`Connection` ``con`` (the default is 1000000000):" msgstr "" -#: ../../library/sqlite3.rst:1129 +#: ../../library/sqlite3.rst:1130 msgid "" "Set a connection runtime limit. Attempts to increase a limit above its hard " "upper bound are silently truncated to the hard upper bound. Regardless of " @@ -1116,22 +1117,22 @@ msgid "" "returned." msgstr "" -#: ../../library/sqlite3.rst:1134 +#: ../../library/sqlite3.rst:1135 msgid "The `SQLite limit category`_ to be set." msgstr "" -#: ../../library/sqlite3.rst:1137 +#: ../../library/sqlite3.rst:1138 msgid "" "The value of the new limit. If negative, the current limit is unchanged." msgstr "" -#: ../../library/sqlite3.rst:1146 +#: ../../library/sqlite3.rst:1147 msgid "" "Example, limit the number of attached databases to 1 for :class:`Connection` " "``con`` (the default limit is 10):" msgstr "" -#: ../../library/sqlite3.rst:1163 +#: ../../library/sqlite3.rst:1164 msgid "" "Serialize a database into a :class:`bytes` object. For an ordinary on-disk " "database file, the serialization is just a copy of the disk file. For an in-" @@ -1140,17 +1141,17 @@ msgid "" "backed up to disk." msgstr "" -#: ../../library/sqlite3.rst:1169 +#: ../../library/sqlite3.rst:1170 msgid "The database name to be serialized. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1177 +#: ../../library/sqlite3.rst:1178 msgid "" "This method is only available if the underlying SQLite library has the " "serialize API." msgstr "" -#: ../../library/sqlite3.rst:1185 +#: ../../library/sqlite3.rst:1186 msgid "" "Deserialize a :meth:`serialized ` database into a :class:" "`Connection`. This method causes the database connection to disconnect from " @@ -1158,47 +1159,47 @@ msgid "" "serialization contained in *data*." msgstr "" -#: ../../library/sqlite3.rst:1191 +#: ../../library/sqlite3.rst:1192 msgid "A serialized database." msgstr "" -#: ../../library/sqlite3.rst:1194 +#: ../../library/sqlite3.rst:1195 msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1198 +#: ../../library/sqlite3.rst:1199 msgid "" "If the database connection is currently involved in a read transaction or a " "backup operation." msgstr "" -#: ../../library/sqlite3.rst:1202 +#: ../../library/sqlite3.rst:1203 msgid "If *data* does not contain a valid SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1205 +#: ../../library/sqlite3.rst:1206 msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." msgstr "" -#: ../../library/sqlite3.rst:1210 +#: ../../library/sqlite3.rst:1211 msgid "" "This method is only available if the underlying SQLite library has the " "deserialize API." msgstr "" -#: ../../library/sqlite3.rst:1217 +#: ../../library/sqlite3.rst:1218 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:1220 +#: ../../library/sqlite3.rst:1221 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" -#: ../../library/sqlite3.rst:1227 +#: ../../library/sqlite3.rst:1228 msgid "" "This attribute controls the :ref:`transaction handling ` performed by :mod:`!sqlite3`. If set to ``None``, " @@ -1208,13 +1209,13 @@ msgid "" "` is performed." msgstr "" -#: ../../library/sqlite3.rst:1235 +#: ../../library/sqlite3.rst:1236 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: ../../library/sqlite3.rst:1240 +#: ../../library/sqlite3.rst:1241 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " "from this connection. Assigning to this attribute does not affect the :attr:" @@ -1223,12 +1224,12 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1247 ../../library/sqlite3.rst:1539 -#: ../../library/sqlite3.rst:1562 +#: ../../library/sqlite3.rst:1248 ../../library/sqlite3.rst:1540 +#: ../../library/sqlite3.rst:1563 msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "" -#: ../../library/sqlite3.rst:1251 +#: ../../library/sqlite3.rst:1252 msgid "" "A :term:`callable` that accepts a :class:`bytes` parameter and returns a " "text representation of it. The callable is invoked for SQLite values with " @@ -1236,17 +1237,17 @@ msgid "" "If you want to return ``bytes`` instead, set *text_factory* to ``bytes``." msgstr "" -#: ../../library/sqlite3.rst:1291 +#: ../../library/sqlite3.rst:1292 msgid "" "Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:1298 +#: ../../library/sqlite3.rst:1299 msgid "Cursor objects" msgstr "" -#: ../../library/sqlite3.rst:1300 +#: ../../library/sqlite3.rst:1301 msgid "" "A ``Cursor`` object represents a `database cursor`_ which is used to execute " "SQL statements, and manage the context of a fetch operation. Cursors are " @@ -1254,39 +1255,39 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:1307 +#: ../../library/sqlite3.rst:1308 msgid "" "Cursor objects are :term:`iterators `, meaning that if you :meth:" "`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " "to fetch the resulting rows:" msgstr "" -#: ../../library/sqlite3.rst:1332 +#: ../../library/sqlite3.rst:1333 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:1339 +#: ../../library/sqlite3.rst:1340 msgid "" "Execute SQL a single SQL statement, optionally binding Python values using :" "ref:`placeholders `." msgstr "" -#: ../../library/sqlite3.rst:1343 +#: ../../library/sqlite3.rst:1344 msgid "A single SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1346 +#: ../../library/sqlite3.rst:1347 msgid "" "Python values to bind to placeholders in *sql*. A :class:`!dict` if named " "placeholders are used. A :term:`!sequence` if unnamed placeholders are used. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1353 +#: ../../library/sqlite3.rst:1354 msgid "If *sql* contains more than one SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1356 +#: ../../library/sqlite3.rst:1357 msgid "" "If :attr:`~Connection.isolation_level` is not ``None``, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " @@ -1294,43 +1295,43 @@ msgid "" "*sql*." msgstr "" -#: ../../library/sqlite3.rst:1361 +#: ../../library/sqlite3.rst:1362 msgid "Use :meth:`executescript` to execute multiple SQL statements." msgstr "" -#: ../../library/sqlite3.rst:1365 +#: ../../library/sqlite3.rst:1366 msgid "" "For every item in *parameters*, repeatedly execute the :ref:`parameterized " "` :abbr:`DML (Data Manipulation Language)` SQL " "statement *sql*." msgstr "" -#: ../../library/sqlite3.rst:1369 +#: ../../library/sqlite3.rst:1370 msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:1371 +#: ../../library/sqlite3.rst:1372 msgid "A single SQL DML statement." msgstr "" -#: ../../library/sqlite3.rst:1374 +#: ../../library/sqlite3.rst:1375 msgid "" "An :term:`!iterable` of parameters to bind with the placeholders in *sql*. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1380 +#: ../../library/sqlite3.rst:1381 msgid "" "If *sql* contains more than one SQL statement, or is not a DML statment." msgstr "" -#: ../../library/sqlite3.rst:1397 +#: ../../library/sqlite3.rst:1398 msgid "" "Any resulting rows are discarded, including DML statements with `RETURNING " "clauses`_." msgstr "" -#: ../../library/sqlite3.rst:1404 +#: ../../library/sqlite3.rst:1405 msgid "" "Execute the SQL statements in *sql_script*. If there is a pending " "transaction, an implicit ``COMMIT`` statement is executed first. No other " @@ -1338,24 +1339,24 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1410 +#: ../../library/sqlite3.rst:1411 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1428 +#: ../../library/sqlite3.rst:1429 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1436 +#: ../../library/sqlite3.rst:1437 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1439 +#: ../../library/sqlite3.rst:1440 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1363,7 +1364,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1445 +#: ../../library/sqlite3.rst:1446 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1371,36 +1372,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1452 +#: ../../library/sqlite3.rst:1453 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1459 +#: ../../library/sqlite3.rst:1460 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1461 +#: ../../library/sqlite3.rst:1462 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: ../../library/sqlite3.rst:1466 ../../library/sqlite3.rst:1470 +#: ../../library/sqlite3.rst:1467 ../../library/sqlite3.rst:1471 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1474 +#: ../../library/sqlite3.rst:1475 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: ../../library/sqlite3.rst:1479 +#: ../../library/sqlite3.rst:1480 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1408,18 +1409,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1493 +#: ../../library/sqlite3.rst:1494 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1497 +#: ../../library/sqlite3.rst:1498 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1501 +#: ../../library/sqlite3.rst:1502 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1429,15 +1430,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1509 +#: ../../library/sqlite3.rst:1510 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1511 +#: ../../library/sqlite3.rst:1512 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1516 +#: ../../library/sqlite3.rst:1517 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1447,7 +1448,7 @@ msgid "" "resulting rows must be fetched in order for :attr:`!rowcount` to be updated." msgstr "" -#: ../../library/sqlite3.rst:1527 +#: ../../library/sqlite3.rst:1528 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -1456,18 +1457,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1534 +#: ../../library/sqlite3.rst:1535 msgid "" "Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" "Cursor` was created. Assigning to this attribute does not affect :attr:" "`Connection.row_factory` of the parent connection." msgstr "" -#: ../../library/sqlite3.rst:1550 +#: ../../library/sqlite3.rst:1551 msgid "Row objects" msgstr "" -#: ../../library/sqlite3.rst:1554 +#: ../../library/sqlite3.rst:1555 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1475,28 +1476,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1559 +#: ../../library/sqlite3.rst:1560 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1566 +#: ../../library/sqlite3.rst:1567 msgid "" "Return a :class:`list` of column names as :class:`strings `. " "Immediately after a query, it is the first member of each tuple in :attr:" "`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:1570 +#: ../../library/sqlite3.rst:1571 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:1577 +#: ../../library/sqlite3.rst:1578 msgid "Blob objects" msgstr "" -#: ../../library/sqlite3.rst:1583 +#: ../../library/sqlite3.rst:1584 msgid "" "A :class:`Blob` instance is a :term:`file-like object` that can read and " "write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:" @@ -1504,24 +1505,24 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1588 +#: ../../library/sqlite3.rst:1589 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1618 +#: ../../library/sqlite3.rst:1619 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1620 +#: ../../library/sqlite3.rst:1621 msgid "" "The blob will be unusable from this point onward. An :class:`~sqlite3." "Error` (or subclass) exception will be raised if any further operation is " "attempted with the blob." msgstr "" -#: ../../library/sqlite3.rst:1626 +#: ../../library/sqlite3.rst:1627 msgid "" "Read *length* bytes of data from the blob at the current offset position. If " "the end of the blob is reached, the data up to :abbr:`EOF (End of File)` " @@ -1529,18 +1530,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1634 +#: ../../library/sqlite3.rst:1635 msgid "" "Write *data* to the blob at the current offset. This function cannot change " "the blob length. Writing beyond the end of the blob will raise :exc:" "`ValueError`." msgstr "" -#: ../../library/sqlite3.rst:1640 +#: ../../library/sqlite3.rst:1641 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1644 +#: ../../library/sqlite3.rst:1645 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :data:`os.SEEK_SET` (absolute blob positioning). Other " @@ -1548,26 +1549,26 @@ msgid "" "position) and :data:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1652 +#: ../../library/sqlite3.rst:1653 msgid "PrepareProtocol objects" msgstr "" -#: ../../library/sqlite3.rst:1656 +#: ../../library/sqlite3.rst:1657 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1664 +#: ../../library/sqlite3.rst:1665 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1666 +#: ../../library/sqlite3.rst:1667 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1670 +#: ../../library/sqlite3.rst:1671 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -1575,39 +1576,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1677 +#: ../../library/sqlite3.rst:1678 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1681 +#: ../../library/sqlite3.rst:1682 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1686 +#: ../../library/sqlite3.rst:1687 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1693 +#: ../../library/sqlite3.rst:1694 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1700 +#: ../../library/sqlite3.rst:1701 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1707 +#: ../../library/sqlite3.rst:1708 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1615,14 +1616,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1714 +#: ../../library/sqlite3.rst:1715 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1720 +#: ../../library/sqlite3.rst:1721 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1630,20 +1631,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1728 +#: ../../library/sqlite3.rst:1729 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1733 +#: ../../library/sqlite3.rst:1734 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1740 +#: ../../library/sqlite3.rst:1741 msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "supplying the wrong number of bindings to a query, or trying to operate on a " @@ -1651,7 +1652,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1747 +#: ../../library/sqlite3.rst:1748 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1660,78 +1661,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1757 +#: ../../library/sqlite3.rst:1758 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1759 +#: ../../library/sqlite3.rst:1760 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1762 +#: ../../library/sqlite3.rst:1763 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1765 ../../library/sqlite3.rst:1782 +#: ../../library/sqlite3.rst:1766 ../../library/sqlite3.rst:1783 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1765 ../../library/sqlite3.rst:1782 +#: ../../library/sqlite3.rst:1766 ../../library/sqlite3.rst:1783 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1767 ../../library/sqlite3.rst:1784 +#: ../../library/sqlite3.rst:1768 ../../library/sqlite3.rst:1785 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1767 ../../library/sqlite3.rst:1784 +#: ../../library/sqlite3.rst:1768 ../../library/sqlite3.rst:1785 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1769 ../../library/sqlite3.rst:1786 +#: ../../library/sqlite3.rst:1770 ../../library/sqlite3.rst:1787 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1769 ../../library/sqlite3.rst:1786 +#: ../../library/sqlite3.rst:1770 ../../library/sqlite3.rst:1787 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1771 ../../library/sqlite3.rst:1788 +#: ../../library/sqlite3.rst:1772 ../../library/sqlite3.rst:1789 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1771 ../../library/sqlite3.rst:1788 +#: ../../library/sqlite3.rst:1772 ../../library/sqlite3.rst:1789 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1773 +#: ../../library/sqlite3.rst:1774 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1773 ../../library/sqlite3.rst:1790 +#: ../../library/sqlite3.rst:1774 ../../library/sqlite3.rst:1791 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1775 ../../library/sqlite3.rst:1793 +#: ../../library/sqlite3.rst:1776 ../../library/sqlite3.rst:1794 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1775 ../../library/sqlite3.rst:1793 +#: ../../library/sqlite3.rst:1776 ../../library/sqlite3.rst:1794 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1779 +#: ../../library/sqlite3.rst:1780 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1790 +#: ../../library/sqlite3.rst:1791 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1796 +#: ../../library/sqlite3.rst:1797 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1740,42 +1741,42 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1806 +#: ../../library/sqlite3.rst:1807 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1808 +#: ../../library/sqlite3.rst:1809 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1811 +#: ../../library/sqlite3.rst:1812 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1815 +#: ../../library/sqlite3.rst:1816 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1819 +#: ../../library/sqlite3.rst:1820 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1823 +#: ../../library/sqlite3.rst:1824 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1829 +#: ../../library/sqlite3.rst:1830 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1783,15 +1784,15 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1838 +#: ../../library/sqlite3.rst:1839 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:1843 +#: ../../library/sqlite3.rst:1844 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:1845 +#: ../../library/sqlite3.rst:1846 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1799,7 +1800,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:1858 +#: ../../library/sqlite3.rst:1859 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -1807,7 +1808,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:1863 +#: ../../library/sqlite3.rst:1864 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -1818,24 +1819,24 @@ msgid "" "are ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1900 +#: ../../library/sqlite3.rst:1901 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:1907 +#: ../../library/sqlite3.rst:1908 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1909 +#: ../../library/sqlite3.rst:1910 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1913 +#: ../../library/sqlite3.rst:1914 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1845,11 +1846,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1925 +#: ../../library/sqlite3.rst:1926 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1927 +#: ../../library/sqlite3.rst:1928 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1859,84 +1860,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1958 +#: ../../library/sqlite3.rst:1959 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1960 +#: ../../library/sqlite3.rst:1961 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1990 +#: ../../library/sqlite3.rst:1991 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1992 +#: ../../library/sqlite3.rst:1993 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1997 +#: ../../library/sqlite3.rst:1998 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:2000 +#: ../../library/sqlite3.rst:2001 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:2005 +#: ../../library/sqlite3.rst:2006 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:2014 +#: ../../library/sqlite3.rst:2015 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:2018 +#: ../../library/sqlite3.rst:2019 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:2019 +#: ../../library/sqlite3.rst:2020 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:2020 +#: ../../library/sqlite3.rst:2021 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:2024 +#: ../../library/sqlite3.rst:2025 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2075 +#: ../../library/sqlite3.rst:2076 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2077 +#: ../../library/sqlite3.rst:2078 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2139 +#: ../../library/sqlite3.rst:2140 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2141 +#: ../../library/sqlite3.rst:2142 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1948,11 +1949,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2182 +#: ../../library/sqlite3.rst:2183 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2184 +#: ../../library/sqlite3.rst:2185 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1962,58 +1963,58 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:2193 +#: ../../library/sqlite3.rst:2194 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:2198 +#: ../../library/sqlite3.rst:2199 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2231 +#: ../../library/sqlite3.rst:2232 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2233 +#: ../../library/sqlite3.rst:2234 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2235 +#: ../../library/sqlite3.rst:2236 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2244 +#: ../../library/sqlite3.rst:2245 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2254 +#: ../../library/sqlite3.rst:2255 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2268 +#: ../../library/sqlite3.rst:2269 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2277 +#: ../../library/sqlite3.rst:2278 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2279 +#: ../../library/sqlite3.rst:2280 msgid "" "By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" "class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." "Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" -#: ../../library/sqlite3.rst:2284 +#: ../../library/sqlite3.rst:2285 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -2021,7 +2022,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2289 +#: ../../library/sqlite3.rst:2290 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -2029,51 +2030,59 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2299 +#: ../../library/sqlite3.rst:2300 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2314 +#: ../../library/sqlite3.rst:2317 +msgid "" +"The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the " +"above example. In such cases, SQLite returns a single row with columns " +"defined by expressions, e.g. literals, with the given aliases ``expr AS " +"alias``." +msgstr "" + +#: ../../library/sqlite3.rst:2322 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2323 +#: ../../library/sqlite3.rst:2331 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2333 +#: ../../library/sqlite3.rst:2341 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2344 +#: ../../library/sqlite3.rst:2352 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2359 +#: ../../library/sqlite3.rst:2367 msgid "" "With some adjustments, the above recipe can be adapted to use a :class:" "`~dataclasses.dataclass`, or any other custom class, instead of a :class:" "`~collections.namedtuple`." msgstr "" -#: ../../library/sqlite3.rst:2367 +#: ../../library/sqlite3.rst:2375 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2372 +#: ../../library/sqlite3.rst:2380 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2374 +#: ../../library/sqlite3.rst:2382 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:2377 +#: ../../library/sqlite3.rst:2385 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2087,7 +2096,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2390 +#: ../../library/sqlite3.rst:2398 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2097,27 +2106,27 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2398 +#: ../../library/sqlite3.rst:2406 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2402 +#: ../../library/sqlite3.rst:2410 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:1334 +#: ../../library/sqlite3.rst:1335 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/sqlite3.rst:1334 ../../library/sqlite3.rst:1335 +#: ../../library/sqlite3.rst:1335 ../../library/sqlite3.rst:1336 msgid "in SQL statements" msgstr "於 SQL 陳述式中" -#: ../../library/sqlite3.rst:1335 +#: ../../library/sqlite3.rst:1336 msgid ": (colon)" msgstr ": (冒號)" diff --git a/library/stdtypes.po b/library/stdtypes.po index 46c97e854d..e24d0398d3 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-23 16:50+0800\n" +"POT-Creation-Date: 2023-07-15 00:19+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -4238,53 +4238,54 @@ msgstr "" msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " -"'c'). The byte length of the result must be the same as the original length." +"'c'). The byte length of the result must be the same as the original length. " +"Note that all byte lengths may depend on the operating system." msgstr "" -#: ../../library/stdtypes.rst:3963 +#: ../../library/stdtypes.rst:3964 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:3986 +#: ../../library/stdtypes.rst:3987 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:3999 +#: ../../library/stdtypes.rst:4000 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4025 +#: ../../library/stdtypes.rst:4026 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4039 +#: ../../library/stdtypes.rst:4040 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4042 +#: ../../library/stdtypes.rst:4043 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4046 +#: ../../library/stdtypes.rst:4047 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4057 +#: ../../library/stdtypes.rst:4058 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " "representation. It is not necessarily equal to ``len(m)``::" msgstr "" -#: ../../library/stdtypes.rst:4076 +#: ../../library/stdtypes.rst:4077 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4093 +#: ../../library/stdtypes.rst:4094 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4097 +#: ../../library/stdtypes.rst:4098 msgid "" "A string containing the format (in :mod:`struct` module style) for each " "element in the view. A memoryview can be created from exporters with " @@ -4292,59 +4293,59 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4102 +#: ../../library/stdtypes.rst:4103 msgid "" "format ``'B'`` is now handled according to the struct module syntax. This " "means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." msgstr "" -#: ../../library/stdtypes.rst:4108 +#: ../../library/stdtypes.rst:4109 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4121 +#: ../../library/stdtypes.rst:4122 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4126 +#: ../../library/stdtypes.rst:4127 msgid "" "A tuple of integers the length of :attr:`ndim` giving the shape of the " "memory as an N-dimensional array." msgstr "" -#: ../../library/stdtypes.rst:4129 ../../library/stdtypes.rst:4137 +#: ../../library/stdtypes.rst:4130 ../../library/stdtypes.rst:4138 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4134 +#: ../../library/stdtypes.rst:4135 msgid "" "A tuple of integers the length of :attr:`ndim` giving the size in bytes to " "access each element for each dimension of the array." msgstr "" -#: ../../library/stdtypes.rst:4142 +#: ../../library/stdtypes.rst:4143 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4146 +#: ../../library/stdtypes.rst:4147 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4152 +#: ../../library/stdtypes.rst:4153 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4158 +#: ../../library/stdtypes.rst:4159 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4166 +#: ../../library/stdtypes.rst:4167 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4170 +#: ../../library/stdtypes.rst:4171 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -4354,7 +4355,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4177 +#: ../../library/stdtypes.rst:4178 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " @@ -4362,7 +4363,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4182 +#: ../../library/stdtypes.rst:4183 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -4374,18 +4375,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4190 +#: ../../library/stdtypes.rst:4191 msgid "" "Non-empty sets (not frozensets) can be created by placing a comma-separated " "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " "addition to the :class:`set` constructor." msgstr "" -#: ../../library/stdtypes.rst:4194 +#: ../../library/stdtypes.rst:4195 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4199 +#: ../../library/stdtypes.rst:4200 msgid "" "Return a new set or frozenset object whose elements are taken from " "*iterable*. The elements of a set must be :term:`hashable`. To represent " @@ -4393,92 +4394,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4205 +#: ../../library/stdtypes.rst:4206 msgid "Sets can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4207 +#: ../../library/stdtypes.rst:4208 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4208 +#: ../../library/stdtypes.rst:4209 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4209 +#: ../../library/stdtypes.rst:4210 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4211 +#: ../../library/stdtypes.rst:4212 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4216 +#: ../../library/stdtypes.rst:4217 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4220 +#: ../../library/stdtypes.rst:4221 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4224 +#: ../../library/stdtypes.rst:4225 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4228 +#: ../../library/stdtypes.rst:4229 msgid "" "Return ``True`` if the set has no elements in common with *other*. Sets are " "disjoint if and only if their intersection is the empty set." msgstr "" -#: ../../library/stdtypes.rst:4234 +#: ../../library/stdtypes.rst:4235 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4238 +#: ../../library/stdtypes.rst:4239 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4244 +#: ../../library/stdtypes.rst:4245 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4248 +#: ../../library/stdtypes.rst:4249 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4254 +#: ../../library/stdtypes.rst:4255 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4259 +#: ../../library/stdtypes.rst:4260 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4264 +#: ../../library/stdtypes.rst:4265 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4269 +#: ../../library/stdtypes.rst:4270 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4273 +#: ../../library/stdtypes.rst:4274 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4276 +#: ../../library/stdtypes.rst:4277 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -4488,7 +4489,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4283 +#: ../../library/stdtypes.rst:4284 msgid "" "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two " "sets are equal if and only if every element of each set is contained in the " @@ -4498,14 +4499,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4290 +#: ../../library/stdtypes.rst:4291 msgid "" "Instances of :class:`set` are compared to instances of :class:`frozenset` " "based on their members. For example, ``set('abc') == frozenset('abc')`` " "returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." msgstr "" -#: ../../library/stdtypes.rst:4294 +#: ../../library/stdtypes.rst:4295 msgid "" "The subset and equality comparisons do not generalize to a total ordering " "function. For example, any two nonempty disjoint sets are not equal and are " @@ -4513,71 +4514,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4299 +#: ../../library/stdtypes.rst:4300 msgid "" "Since sets only define partial ordering (subset relationships), the output " "of the :meth:`list.sort` method is undefined for lists of sets." msgstr "" -#: ../../library/stdtypes.rst:4302 +#: ../../library/stdtypes.rst:4303 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4304 +#: ../../library/stdtypes.rst:4305 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -#: ../../library/stdtypes.rst:4308 +#: ../../library/stdtypes.rst:4309 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4314 +#: ../../library/stdtypes.rst:4315 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4319 +#: ../../library/stdtypes.rst:4320 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4324 +#: ../../library/stdtypes.rst:4325 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4329 +#: ../../library/stdtypes.rst:4330 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4333 +#: ../../library/stdtypes.rst:4334 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4337 +#: ../../library/stdtypes.rst:4338 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4342 +#: ../../library/stdtypes.rst:4343 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4346 +#: ../../library/stdtypes.rst:4347 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4351 +#: ../../library/stdtypes.rst:4352 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4354 +#: ../../library/stdtypes.rst:4355 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -4585,18 +4586,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4359 +#: ../../library/stdtypes.rst:4360 msgid "" "Note, the *elem* argument to the :meth:`__contains__`, :meth:`remove`, and :" "meth:`discard` methods may be a set. To support searching for an equivalent " "frozenset, a temporary one is created from *elem*." msgstr "" -#: ../../library/stdtypes.rst:4367 +#: ../../library/stdtypes.rst:4368 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4377 +#: ../../library/stdtypes.rst:4378 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -4605,7 +4606,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4383 +#: ../../library/stdtypes.rst:4384 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -4614,33 +4615,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4394 +#: ../../library/stdtypes.rst:4395 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4397 +#: ../../library/stdtypes.rst:4398 msgid "Dictionaries can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4399 +#: ../../library/stdtypes.rst:4400 msgid "" "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': " "4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4401 +#: ../../library/stdtypes.rst:4402 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4402 +#: ../../library/stdtypes.rst:4403 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4405 +#: ../../library/stdtypes.rst:4406 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it is a mapping object, a dictionary is " @@ -4652,7 +4653,7 @@ msgid "" "value for that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4415 +#: ../../library/stdtypes.rst:4416 msgid "" "If keyword arguments are given, the keyword arguments and their values are " "added to the dictionary created from the positional argument. If a key " @@ -4660,39 +4661,39 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4420 +#: ../../library/stdtypes.rst:4421 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4432 +#: ../../library/stdtypes.rst:4433 msgid "" "Providing keyword arguments as in the first example only works for keys that " "are valid Python identifiers. Otherwise, any valid keys can be used." msgstr "" -#: ../../library/stdtypes.rst:4436 +#: ../../library/stdtypes.rst:4437 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4441 +#: ../../library/stdtypes.rst:4442 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4445 +#: ../../library/stdtypes.rst:4446 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4449 +#: ../../library/stdtypes.rst:4450 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4454 +#: ../../library/stdtypes.rst:4455 msgid "" "If a subclass of dict defines a method :meth:`__missing__` and *key* is not " "present, the ``d[key]`` operation calls that method with the key *key* as " @@ -4703,51 +4704,51 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4472 +#: ../../library/stdtypes.rst:4473 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different ``__missing__`` method is used by :class:`collections." "defaultdict`." msgstr "" -#: ../../library/stdtypes.rst:4478 +#: ../../library/stdtypes.rst:4479 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4482 +#: ../../library/stdtypes.rst:4483 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4487 +#: ../../library/stdtypes.rst:4488 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4491 +#: ../../library/stdtypes.rst:4492 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4495 +#: ../../library/stdtypes.rst:4496 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4500 +#: ../../library/stdtypes.rst:4501 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4504 +#: ../../library/stdtypes.rst:4505 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4508 +#: ../../library/stdtypes.rst:4509 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4510 +#: ../../library/stdtypes.rst:4511 msgid "" ":meth:`fromkeys` is a class method that returns a new dictionary. *value* " "defaults to ``None``. All of the values refer to just a single instance, so " @@ -4756,70 +4757,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4518 +#: ../../library/stdtypes.rst:4519 msgid "" "Return the value for *key* if *key* is in the dictionary, else *default*. If " "*default* is not given, it defaults to ``None``, so that this method never " "raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4524 +#: ../../library/stdtypes.rst:4525 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4529 +#: ../../library/stdtypes.rst:4530 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4534 +#: ../../library/stdtypes.rst:4535 msgid "" "If *key* is in the dictionary, remove it and return its value, else return " "*default*. If *default* is not given and *key* is not in the dictionary, a :" "exc:`KeyError` is raised." msgstr "" -#: ../../library/stdtypes.rst:4540 +#: ../../library/stdtypes.rst:4541 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" -#: ../../library/stdtypes.rst:4543 +#: ../../library/stdtypes.rst:4544 msgid "" ":meth:`popitem` is useful to destructively iterate over a dictionary, as " "often used in set algorithms. If the dictionary is empty, calling :meth:" "`popitem` raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4547 +#: ../../library/stdtypes.rst:4548 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4553 +#: ../../library/stdtypes.rst:4554 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4560 +#: ../../library/stdtypes.rst:4561 msgid "" "If *key* is in the dictionary, return its value. If not, insert *key* with " "a value of *default* and return *default*. *default* defaults to ``None``." msgstr "" -#: ../../library/stdtypes.rst:4566 +#: ../../library/stdtypes.rst:4567 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4569 +#: ../../library/stdtypes.rst:4570 msgid "" ":meth:`update` accepts either another dictionary object or an iterable of " "key/value pairs (as tuples or other iterables of length two). If keyword " @@ -4827,71 +4828,71 @@ msgid "" "pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4576 +#: ../../library/stdtypes.rst:4577 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4579 +#: ../../library/stdtypes.rst:4580 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " "to itself::" msgstr "" -#: ../../library/stdtypes.rst:4589 +#: ../../library/stdtypes.rst:4590 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4597 +#: ../../library/stdtypes.rst:4598 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " "values of *other* take priority when *d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4603 +#: ../../library/stdtypes.rst:4604 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " "'>') raise :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:4607 +#: ../../library/stdtypes.rst:4608 msgid "" "Dictionaries preserve insertion order. Note that updating a key does not " "affect the order. Keys added after deletion are inserted at the end. ::" msgstr "" -#: ../../library/stdtypes.rst:4625 +#: ../../library/stdtypes.rst:4626 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4629 +#: ../../library/stdtypes.rst:4630 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4641 +#: ../../library/stdtypes.rst:4642 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4646 +#: ../../library/stdtypes.rst:4647 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4653 +#: ../../library/stdtypes.rst:4654 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4655 +#: ../../library/stdtypes.rst:4656 msgid "" "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" "`dict.items` are *view objects*. They provide a dynamic view on the " @@ -4899,23 +4900,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4660 +#: ../../library/stdtypes.rst:4661 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4665 +#: ../../library/stdtypes.rst:4666 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4669 +#: ../../library/stdtypes.rst:4670 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4672 +#: ../../library/stdtypes.rst:4673 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -4923,39 +4924,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4677 +#: ../../library/stdtypes.rst:4678 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" -#: ../../library/stdtypes.rst:4680 +#: ../../library/stdtypes.rst:4681 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4685 +#: ../../library/stdtypes.rst:4686 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" -#: ../../library/stdtypes.rst:4690 +#: ../../library/stdtypes.rst:4691 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -#: ../../library/stdtypes.rst:4693 +#: ../../library/stdtypes.rst:4694 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4698 +#: ../../library/stdtypes.rst:4699 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4703 +#: ../../library/stdtypes.rst:4704 msgid "" "Keys views are set-like since their entries are unique and :term:" "`hashable`. If all values are hashable, so that ``(key, value)`` pairs are " @@ -4966,15 +4967,15 @@ msgid "" "``<``, or ``^``)." msgstr "" -#: ../../library/stdtypes.rst:4710 +#: ../../library/stdtypes.rst:4711 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4751 +#: ../../library/stdtypes.rst:4754 msgid "Context Manager Types" msgstr "" -#: ../../library/stdtypes.rst:4758 +#: ../../library/stdtypes.rst:4761 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -4982,7 +4983,7 @@ msgid "" "before the statement body is executed and exited when the statement ends:" msgstr "" -#: ../../library/stdtypes.rst:4766 +#: ../../library/stdtypes.rst:4769 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -4990,14 +4991,14 @@ msgid "" "using this context manager." msgstr "" -#: ../../library/stdtypes.rst:4771 +#: ../../library/stdtypes.rst:4774 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" "`open` to be used as the context expression in a :keyword:`with` statement." msgstr "" -#: ../../library/stdtypes.rst:4775 +#: ../../library/stdtypes.rst:4778 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -5007,7 +5008,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/stdtypes.rst:4785 +#: ../../library/stdtypes.rst:4788 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -5016,7 +5017,7 @@ msgid "" "arguments are ``None``." msgstr "" -#: ../../library/stdtypes.rst:4790 +#: ../../library/stdtypes.rst:4793 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -5027,7 +5028,7 @@ msgid "" "statement." msgstr "" -#: ../../library/stdtypes.rst:4797 +#: ../../library/stdtypes.rst:4800 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -5036,7 +5037,7 @@ msgid "" "method has actually failed." msgstr "" -#: ../../library/stdtypes.rst:4803 +#: ../../library/stdtypes.rst:4806 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -5045,7 +5046,7 @@ msgid "" "management protocol. See the :mod:`contextlib` module for some examples." msgstr "" -#: ../../library/stdtypes.rst:4809 +#: ../../library/stdtypes.rst:4812 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -5055,7 +5056,7 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" -#: ../../library/stdtypes.rst:4816 +#: ../../library/stdtypes.rst:4819 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -5064,23 +5065,23 @@ msgid "" "a single class dictionary lookup is negligible." msgstr "" -#: ../../library/stdtypes.rst:4824 +#: ../../library/stdtypes.rst:4827 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" msgstr "" -#: ../../library/stdtypes.rst:4829 +#: ../../library/stdtypes.rst:4832 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." msgstr "" -#: ../../library/stdtypes.rst:4836 +#: ../../library/stdtypes.rst:4839 msgid "Generic Alias Type" msgstr "" -#: ../../library/stdtypes.rst:4842 +#: ../../library/stdtypes.rst:4845 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -5090,19 +5091,19 @@ msgid "" "are intended primarily for use with :term:`type annotations `." msgstr "" -#: ../../library/stdtypes.rst:4852 +#: ../../library/stdtypes.rst:4855 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:4855 +#: ../../library/stdtypes.rst:4858 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." msgstr "" -#: ../../library/stdtypes.rst:4858 +#: ../../library/stdtypes.rst:4861 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " @@ -5111,7 +5112,7 @@ msgid "" "`bytes`." msgstr "" -#: ../../library/stdtypes.rst:4864 +#: ../../library/stdtypes.rst:4867 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -5120,7 +5121,7 @@ msgid "" "the :class:`str` data type and the :class:`bytes` data type:" msgstr "" -#: ../../library/stdtypes.rst:4870 +#: ../../library/stdtypes.rst:4873 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -5128,7 +5129,7 @@ msgid "" "annotations with the ``GenericAlias`` ``re.Match[str]``." msgstr "" -#: ../../library/stdtypes.rst:4876 +#: ../../library/stdtypes.rst:4879 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " "``y`` will also be an instance of ``re.Match``, but the return values of ``y." @@ -5137,21 +5138,21 @@ msgid "" "objects>` objects with ``re.Match[bytes]``." msgstr "" -#: ../../library/stdtypes.rst:4882 +#: ../../library/stdtypes.rst:4885 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " "directly." msgstr "" -#: ../../library/stdtypes.rst:4888 +#: ../../library/stdtypes.rst:4891 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " "expecting a :class:`list` containing :class:`float` elements::" msgstr "" -#: ../../library/stdtypes.rst:4896 +#: ../../library/stdtypes.rst:4899 msgid "" "Another example for :term:`mapping` objects, using a :class:`dict`, which is " "a generic type expecting two type parameters representing the key type and " @@ -5159,13 +5160,13 @@ msgid "" "of type :class:`str` and values of type :class:`int`::" msgstr "" -#: ../../library/stdtypes.rst:4904 +#: ../../library/stdtypes.rst:4907 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" msgstr "" -#: ../../library/stdtypes.rst:4912 +#: ../../library/stdtypes.rst:4915 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -5174,331 +5175,331 @@ msgid "" "discouraged, but will run without errors::" msgstr "" -#: ../../library/stdtypes.rst:4922 +#: ../../library/stdtypes.rst:4925 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "" -#: ../../library/stdtypes.rst:4933 +#: ../../library/stdtypes.rst:4936 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -#: ../../library/stdtypes.rst:4941 +#: ../../library/stdtypes.rst:4944 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" msgstr "" -#: ../../library/stdtypes.rst:4949 +#: ../../library/stdtypes.rst:4952 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " "items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" msgstr "" -#: ../../library/stdtypes.rst:4960 +#: ../../library/stdtypes.rst:4963 msgid "Standard Generic Classes" msgstr "" -#: ../../library/stdtypes.rst:4962 +#: ../../library/stdtypes.rst:4965 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -#: ../../library/stdtypes.rst:4965 +#: ../../library/stdtypes.rst:4968 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4969 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:4967 +#: ../../library/stdtypes.rst:4970 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:4968 +#: ../../library/stdtypes.rst:4971 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:4969 +#: ../../library/stdtypes.rst:4972 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:4970 +#: ../../library/stdtypes.rst:4973 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4974 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:4972 +#: ../../library/stdtypes.rst:4975 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:4973 +#: ../../library/stdtypes.rst:4976 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4977 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:4975 +#: ../../library/stdtypes.rst:4978 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:4979 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:4977 +#: ../../library/stdtypes.rst:4980 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:4978 +#: ../../library/stdtypes.rst:4981 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:4982 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:4980 +#: ../../library/stdtypes.rst:4983 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:4984 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:4982 +#: ../../library/stdtypes.rst:4985 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:4983 +#: ../../library/stdtypes.rst:4986 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:4984 +#: ../../library/stdtypes.rst:4987 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:4985 +#: ../../library/stdtypes.rst:4988 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:4986 +#: ../../library/stdtypes.rst:4989 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4990 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:4988 +#: ../../library/stdtypes.rst:4991 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:4989 +#: ../../library/stdtypes.rst:4992 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:4990 +#: ../../library/stdtypes.rst:4993 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:4991 +#: ../../library/stdtypes.rst:4994 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:4992 +#: ../../library/stdtypes.rst:4995 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:4996 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:4994 +#: ../../library/stdtypes.rst:4997 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:4998 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:4996 +#: ../../library/stdtypes.rst:4999 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:5000 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:4998 +#: ../../library/stdtypes.rst:5001 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:4999 +#: ../../library/stdtypes.rst:5002 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5000 +#: ../../library/stdtypes.rst:5003 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5001 +#: ../../library/stdtypes.rst:5004 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5002 +#: ../../library/stdtypes.rst:5005 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5003 +#: ../../library/stdtypes.rst:5006 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5004 +#: ../../library/stdtypes.rst:5007 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5005 +#: ../../library/stdtypes.rst:5008 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5006 +#: ../../library/stdtypes.rst:5009 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5007 +#: ../../library/stdtypes.rst:5010 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5008 +#: ../../library/stdtypes.rst:5011 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5009 +#: ../../library/stdtypes.rst:5012 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5010 +#: ../../library/stdtypes.rst:5013 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5014 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5012 +#: ../../library/stdtypes.rst:5015 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5013 +#: ../../library/stdtypes.rst:5016 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5014 +#: ../../library/stdtypes.rst:5017 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5015 +#: ../../library/stdtypes.rst:5018 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5019 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5017 +#: ../../library/stdtypes.rst:5020 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5018 +#: ../../library/stdtypes.rst:5021 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5023 +#: ../../library/stdtypes.rst:5026 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "" -#: ../../library/stdtypes.rst:5025 +#: ../../library/stdtypes.rst:5028 msgid "All parameterized generics implement special read-only attributes." msgstr "" -#: ../../library/stdtypes.rst:5029 +#: ../../library/stdtypes.rst:5032 msgid "This attribute points at the non-parameterized generic class::" msgstr "" -#: ../../library/stdtypes.rst:5037 +#: ../../library/stdtypes.rst:5040 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " "class::" msgstr "" -#: ../../library/stdtypes.rst:5047 +#: ../../library/stdtypes.rst:5050 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -#: ../../library/stdtypes.rst:5058 +#: ../../library/stdtypes.rst:5061 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." "ParamSpec` is intended primarily for static type checking." msgstr "" -#: ../../library/stdtypes.rst:5065 +#: ../../library/stdtypes.rst:5068 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." msgstr "" -#: ../../library/stdtypes.rst:5074 +#: ../../library/stdtypes.rst:5077 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../library/stdtypes.rst:5074 +#: ../../library/stdtypes.rst:5077 msgid "Introducing Python's framework for type annotations." msgstr "" -#: ../../library/stdtypes.rst:5079 +#: ../../library/stdtypes.rst:5082 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/stdtypes.rst:5077 +#: ../../library/stdtypes.rst:5080 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." "__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:5082 +#: ../../library/stdtypes.rst:5085 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" msgstr "" -#: ../../library/stdtypes.rst:5082 +#: ../../library/stdtypes.rst:5085 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../library/stdtypes.rst:5091 +#: ../../library/stdtypes.rst:5094 msgid "Union Type" msgstr "" -#: ../../library/stdtypes.rst:5097 +#: ../../library/stdtypes.rst:5100 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -5507,7 +5508,7 @@ msgid "" "Union`." msgstr "" -#: ../../library/stdtypes.rst:5104 +#: ../../library/stdtypes.rst:5107 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " @@ -5515,7 +5516,7 @@ msgid "" "class:`float`::" msgstr "" -#: ../../library/stdtypes.rst:5114 +#: ../../library/stdtypes.rst:5117 msgid "" "The ``|`` operand cannot be used at runtime to define unions where one or " "more members is a forward reference. For example, ``int | \"Foo\"``, where " @@ -5524,76 +5525,76 @@ msgid "" "a string, e.g. ``\"int | Foo\"``." msgstr "" -#: ../../library/stdtypes.rst:5122 +#: ../../library/stdtypes.rst:5125 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" -#: ../../library/stdtypes.rst:5124 +#: ../../library/stdtypes.rst:5127 msgid "Unions of unions are flattened::" msgstr "" -#: ../../library/stdtypes.rst:5128 +#: ../../library/stdtypes.rst:5131 msgid "Redundant types are removed::" msgstr "" -#: ../../library/stdtypes.rst:5132 +#: ../../library/stdtypes.rst:5135 msgid "When comparing unions, the order is ignored::" msgstr "" -#: ../../library/stdtypes.rst:5136 +#: ../../library/stdtypes.rst:5139 msgid "It is compatible with :data:`typing.Union`::" msgstr "" -#: ../../library/stdtypes.rst:5140 +#: ../../library/stdtypes.rst:5143 msgid "Optional types can be spelled as a union with ``None``::" msgstr "" -#: ../../library/stdtypes.rst:5147 +#: ../../library/stdtypes.rst:5150 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -#: ../../library/stdtypes.rst:5153 +#: ../../library/stdtypes.rst:5156 msgid "" -"However, union objects containing :ref:`parameterized generics ` cannot be used::" +"However, :ref:`parameterized generics ` in union objects " +"cannot be checked::" msgstr "" -#: ../../library/stdtypes.rst:5161 +#: ../../library/stdtypes.rst:5166 msgid "" "The user-exposed type for the union object can be accessed from :data:`types." "UnionType` and used for :func:`isinstance` checks. An object cannot be " "instantiated from the type::" msgstr "" -#: ../../library/stdtypes.rst:5174 +#: ../../library/stdtypes.rst:5179 msgid "" "The :meth:`__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`__or__`, the Union may override " "it::" msgstr "" -#: ../../library/stdtypes.rst:5192 +#: ../../library/stdtypes.rst:5197 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" -#: ../../library/stdtypes.rst:5200 +#: ../../library/stdtypes.rst:5205 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5202 +#: ../../library/stdtypes.rst:5207 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5209 +#: ../../library/stdtypes.rst:5214 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5211 +#: ../../library/stdtypes.rst:5216 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -5604,7 +5605,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5218 +#: ../../library/stdtypes.rst:5223 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5615,32 +5616,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5226 +#: ../../library/stdtypes.rst:5231 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5234 +#: ../../library/stdtypes.rst:5239 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5236 +#: ../../library/stdtypes.rst:5241 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5242 +#: ../../library/stdtypes.rst:5247 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5244 +#: ../../library/stdtypes.rst:5249 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." msgstr "" -#: ../../library/stdtypes.rst:5247 +#: ../../library/stdtypes.rst:5252 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5648,15 +5649,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:5256 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`\\ 。" -#: ../../library/stdtypes.rst:5257 +#: ../../library/stdtypes.rst:5262 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5261 +#: ../../library/stdtypes.rst:5266 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: built-in methods (such as :meth:`append` on lists) and " @@ -5664,7 +5665,7 @@ msgid "" "support them." msgstr "" -#: ../../library/stdtypes.rst:5266 +#: ../../library/stdtypes.rst:5271 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :dfn:" @@ -5676,7 +5677,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5275 +#: ../../library/stdtypes.rst:5280 msgid "" "Like function objects, bound method objects support getting arbitrary " "attributes. However, since method attributes are actually stored on the " @@ -5686,15 +5687,15 @@ msgid "" "attribute, you need to explicitly set it on the underlying function object::" msgstr "" -#: ../../library/stdtypes.rst:5295 ../../library/stdtypes.rst:5326 +#: ../../library/stdtypes.rst:5300 ../../library/stdtypes.rst:5331 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`\\ 。" -#: ../../library/stdtypes.rst:5303 +#: ../../library/stdtypes.rst:5308 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5309 +#: ../../library/stdtypes.rst:5314 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -5704,7 +5705,7 @@ msgid "" "`__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5316 +#: ../../library/stdtypes.rst:5321 msgid "" "Accessing ``__code__`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"__code__\"``." @@ -5712,17 +5713,17 @@ msgstr "" "存取 ``__code__`` 會引發一個附帶引數 ``obj`` 與 ``\"__code__\"`` 的\\ :ref:`" "稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:5323 +#: ../../library/stdtypes.rst:5328 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" -#: ../../library/stdtypes.rst:5332 +#: ../../library/stdtypes.rst:5337 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5338 +#: ../../library/stdtypes.rst:5343 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -5730,30 +5731,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5343 +#: ../../library/stdtypes.rst:5348 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5349 +#: ../../library/stdtypes.rst:5354 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5351 +#: ../../library/stdtypes.rst:5356 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " "``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" -#: ../../library/stdtypes.rst:5355 +#: ../../library/stdtypes.rst:5360 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5362 +#: ../../library/stdtypes.rst:5367 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5364 +#: ../../library/stdtypes.rst:5369 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5761,15 +5762,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5369 +#: ../../library/stdtypes.rst:5374 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5375 +#: ../../library/stdtypes.rst:5380 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5377 +#: ../../library/stdtypes.rst:5382 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -5777,15 +5778,15 @@ msgid "" "``type(NotImplemented)()`` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:5387 msgid "It is written as ``NotImplemented``." msgstr "" -#: ../../library/stdtypes.rst:5388 +#: ../../library/stdtypes.rst:5393 msgid "Boolean Values" msgstr "" -#: ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:5395 msgid "" "Boolean values are the two constant objects ``False`` and ``True``. They " "are used to represent truth values (although other values can also be " @@ -5796,81 +5797,81 @@ msgid "" "(see section :ref:`truth` above)." msgstr "" -#: ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:5408 msgid "They are written as ``False`` and ``True``, respectively." msgstr "" -#: ../../library/stdtypes.rst:5409 +#: ../../library/stdtypes.rst:5414 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5411 +#: ../../library/stdtypes.rst:5416 msgid "" "See :ref:`types` for this information. It describes stack frame objects, " "traceback objects, and slice objects." msgstr "" -#: ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:5423 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5420 +#: ../../library/stdtypes.rst:5425 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" "`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:5427 +#: ../../library/stdtypes.rst:5432 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5433 +#: ../../library/stdtypes.rst:5438 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5438 +#: ../../library/stdtypes.rst:5443 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5443 +#: ../../library/stdtypes.rst:5448 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5449 +#: ../../library/stdtypes.rst:5454 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5457 +#: ../../library/stdtypes.rst:5462 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5463 +#: ../../library/stdtypes.rst:5468 msgid "" "This method can be overridden by a metaclass to customize the method " "resolution order for its instances. It is called at class instantiation, " "and its result is stored in :attr:`~class.__mro__`." msgstr "" -#: ../../library/stdtypes.rst:5470 +#: ../../library/stdtypes.rst:5475 msgid "" "Each class keeps a list of weak references to its immediate subclasses. " "This method returns a list of all those references still alive. The list is " "in definition order. Example::" msgstr "" -#: ../../library/stdtypes.rst:5481 +#: ../../library/stdtypes.rst:5486 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5483 +#: ../../library/stdtypes.rst:5488 msgid "" "CPython has a global limit for converting between :class:`int` and :class:" "`str` to mitigate denial of service attacks. This limit *only* applies to " @@ -5878,7 +5879,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5488 +#: ../../library/stdtypes.rst:5493 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -5888,25 +5889,25 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5495 +#: ../../library/stdtypes.rst:5500 msgid "" "Limiting conversion size offers a practical way to avoid `CVE-2020-10735 " "`_." msgstr "" -#: ../../library/stdtypes.rst:5498 +#: ../../library/stdtypes.rst:5503 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " "Underscores and the sign are not counted towards the limit." msgstr "" -#: ../../library/stdtypes.rst:5502 +#: ../../library/stdtypes.rst:5507 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5524 +#: ../../library/stdtypes.rst:5529 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -5914,94 +5915,94 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5529 +#: ../../library/stdtypes.rst:5534 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5544 +#: ../../library/stdtypes.rst:5549 msgid "Affected APIs" msgstr "" -#: ../../library/stdtypes.rst:5546 +#: ../../library/stdtypes.rst:5551 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5549 +#: ../../library/stdtypes.rst:5554 msgid "``int(string)`` with default base 10." msgstr "" -#: ../../library/stdtypes.rst:5550 +#: ../../library/stdtypes.rst:5555 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5556 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5552 +#: ../../library/stdtypes.rst:5557 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5553 +#: ../../library/stdtypes.rst:5558 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5556 +#: ../../library/stdtypes.rst:5561 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5558 +#: ../../library/stdtypes.rst:5563 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5559 +#: ../../library/stdtypes.rst:5564 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr "" -#: ../../library/stdtypes.rst:5560 +#: ../../library/stdtypes.rst:5565 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr "" -#: ../../library/stdtypes.rst:5561 +#: ../../library/stdtypes.rst:5566 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5562 +#: ../../library/stdtypes.rst:5567 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5563 +#: ../../library/stdtypes.rst:5568 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5566 +#: ../../library/stdtypes.rst:5571 msgid "Configuring the limit" msgstr "" -#: ../../library/stdtypes.rst:5568 +#: ../../library/stdtypes.rst:5573 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" msgstr "" -#: ../../library/stdtypes.rst:5571 +#: ../../library/stdtypes.rst:5576 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " "the limitation." msgstr "" -#: ../../library/stdtypes.rst:5574 +#: ../../library/stdtypes.rst:5579 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" msgstr "" -#: ../../library/stdtypes.rst:5576 +#: ../../library/stdtypes.rst:5581 msgid "" ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" "`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " @@ -6010,38 +6011,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5582 +#: ../../library/stdtypes.rst:5587 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5585 +#: ../../library/stdtypes.rst:5590 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " "their own limit." msgstr "" -#: ../../library/stdtypes.rst:5589 +#: ../../library/stdtypes.rst:5594 msgid "" "Information about the default and minimum can be found in :attr:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5591 +#: ../../library/stdtypes.rst:5596 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5598 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." msgstr "" -#: ../../library/stdtypes.rst:5600 +#: ../../library/stdtypes.rst:5605 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -6053,7 +6054,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5609 +#: ../../library/stdtypes.rst:5614 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -6061,11 +6062,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5615 +#: ../../library/stdtypes.rst:5620 msgid "Recommended configuration" msgstr "" -#: ../../library/stdtypes.rst:5617 +#: ../../library/stdtypes.rst:5622 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " @@ -6073,45 +6074,45 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.11." msgstr "" -#: ../../library/stdtypes.rst:5622 +#: ../../library/stdtypes.rst:5627 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:5634 +#: ../../library/stdtypes.rst:5639 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5638 +#: ../../library/stdtypes.rst:5643 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5639 +#: ../../library/stdtypes.rst:5644 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5642 +#: ../../library/stdtypes.rst:5647 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5645 +#: ../../library/stdtypes.rst:5650 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5647 +#: ../../library/stdtypes.rst:5652 msgid "" "Cased characters are those with general category property being one of " "\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:5650 +#: ../../library/stdtypes.rst:5655 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -6124,13 +6125,13 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:315 #: ../../library/stdtypes.rst:390 ../../library/stdtypes.rst:907 #: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:1096 -#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 -#: ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:5339 msgid "types" msgstr "type(型別)" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1111 -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:4370 msgid "statement" msgstr "statement(陳述式)" @@ -6151,7 +6152,7 @@ msgid "value" msgstr "value" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:80 -#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:207 ../../library/stdtypes.rst:5403 msgid "Boolean" msgstr "Boolean(布林)" @@ -6191,11 +6192,11 @@ msgstr "or" msgid "and" msgstr "and" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5403 msgid "False" msgstr "False" -#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:63 ../../library/stdtypes.rst:5403 msgid "True" msgstr "True" @@ -6253,10 +6254,10 @@ msgstr "is not" #: ../../library/stdtypes.rst:1295 ../../library/stdtypes.rst:1339 #: ../../library/stdtypes.rst:1461 ../../library/stdtypes.rst:1497 #: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:2485 -#: ../../library/stdtypes.rst:2592 ../../library/stdtypes.rst:4168 -#: ../../library/stdtypes.rst:4369 ../../library/stdtypes.rst:4838 -#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5259 -#: ../../library/stdtypes.rst:5298 +#: ../../library/stdtypes.rst:2592 ../../library/stdtypes.rst:4169 +#: ../../library/stdtypes.rst:4370 ../../library/stdtypes.rst:4841 +#: ../../library/stdtypes.rst:5096 ../../library/stdtypes.rst:5264 +#: ../../library/stdtypes.rst:5303 msgid "object" msgstr "object(物件)" @@ -6348,9 +6349,9 @@ msgid "arithmetic" msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:245 ../../library/stdtypes.rst:907 -#: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:4369 -#: ../../library/stdtypes.rst:5305 ../../library/stdtypes.rst:5319 -#: ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:1074 ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:5310 ../../library/stdtypes.rst:5324 +#: ../../library/stdtypes.rst:5339 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -6408,7 +6409,7 @@ msgstr "**" #: ../../library/stdtypes.rst:315 ../../library/stdtypes.rst:390 #: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:1111 -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:4370 msgid "operations on" msgstr "operations on(操作於)" @@ -6417,7 +6418,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:332 ../../library/stdtypes.rst:1563 -#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:2466 ../../library/stdtypes.rst:5339 msgid "module" msgstr "模組" @@ -6481,7 +6482,7 @@ msgstr "~ (波浪號)" msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:804 ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:804 ../../library/stdtypes.rst:4756 msgid "protocol" msgstr "protocol(協定)" @@ -6507,7 +6508,7 @@ msgstr "container(容器)" msgid "iteration over" msgstr "iteration over(疊代於)" -#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:907 ../../library/stdtypes.rst:4370 msgid "len" msgstr "len" @@ -6590,8 +6591,8 @@ msgstr "list(串列)" msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 -#: ../../library/stdtypes.rst:5093 ../../library/stdtypes.rst:5334 +#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4370 +#: ../../library/stdtypes.rst:5096 ../../library/stdtypes.rst:5339 msgid "type" msgstr "type(型別)" @@ -6599,7 +6600,7 @@ msgstr "type(型別)" msgid "assignment" msgstr "assignment(賦值)" -#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:1111 ../../library/stdtypes.rst:4370 msgid "del" msgstr "del" @@ -6768,98 +6769,98 @@ msgstr "bytearray (%)" msgid "interpolation" msgstr "interpolation(插值)" -#: ../../library/stdtypes.rst:4168 +#: ../../library/stdtypes.rst:4169 msgid "set" msgstr "set(集合)" -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:4370 msgid "mapping" msgstr "mapping(對映)" -#: ../../library/stdtypes.rst:4369 +#: ../../library/stdtypes.rst:4370 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../library/stdtypes.rst:4452 +#: ../../library/stdtypes.rst:4453 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4756 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4756 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:4753 +#: ../../library/stdtypes.rst:4756 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:4826 +#: ../../library/stdtypes.rst:4829 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:4826 +#: ../../library/stdtypes.rst:4829 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:4838 +#: ../../library/stdtypes.rst:4841 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:4838 +#: ../../library/stdtypes.rst:4841 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:4838 +#: ../../library/stdtypes.rst:4841 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5093 +#: ../../library/stdtypes.rst:5096 msgid "Union" msgstr "Union(聯集)" -#: ../../library/stdtypes.rst:5093 +#: ../../library/stdtypes.rst:5096 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:5259 +#: ../../library/stdtypes.rst:5264 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:5298 +#: ../../library/stdtypes.rst:5303 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:5298 +#: ../../library/stdtypes.rst:5303 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:5305 +#: ../../library/stdtypes.rst:5310 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:5305 +#: ../../library/stdtypes.rst:5310 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5324 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5324 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:5358 +#: ../../library/stdtypes.rst:5363 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:5358 +#: ../../library/stdtypes.rst:5363 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" -#: ../../library/stdtypes.rst:5398 +#: ../../library/stdtypes.rst:5403 msgid "values" msgstr "values" diff --git a/library/typing.po b/library/typing.po index 24d98a9ab7..33219e2836 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-27 00:19+0000\n" +"POT-Creation-Date: 2023-07-16 00:22+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-" @@ -358,28 +358,46 @@ msgid "" "Python 3.9." msgstr "" -#: ../../library/typing.rst:249 -msgid "Callable" +#: ../../library/typing.rst:250 +msgid "Annotating callable objects" msgstr "" -#: ../../library/typing.rst:251 +#: ../../library/typing.rst:252 msgid "" -"Frameworks expecting callback functions of specific signatures might be type " -"hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." +"Functions -- or other :term:`callable` objects -- can be annotated using :" +"class:`collections.abc.Callable` or :data:`typing.Callable`. " +"``Callable[[int], str]`` signifies a function that takes a single parameter " +"of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:254 ../../library/typing.rst:2679 +#: ../../library/typing.rst:257 ../../library/typing.rst:2684 msgid "For example:" msgstr "舉例來說" -#: ../../library/typing.rst:272 +#: ../../library/typing.rst:275 +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, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return " +"type must be a single type." +msgstr "" + +#: ../../library/typing.rst:280 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]``." +"If a literal ellipsis ``...`` is given as the argument list, it indicates " +"that a callable with any arbitrary parameter list would be acceptable:" msgstr "" -#: ../../library/typing.rst:276 ../../library/typing.rst:1008 +#: ../../library/typing.rst:292 +msgid "" +"``Callable`` cannot express complex signatures such as functions that take a " +"variadic number of arguments, :func:`overloaded functions `, or " +"functions that have keyword-only parameters. However, these signatures can " +"be expressed by defining a :class:`Protocol` class with a :meth:`~object." +"__call__` method:" +msgstr "" + +#: ../../library/typing.rst:319 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -390,46 +408,46 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:284 ../../library/typing.rst:1020 +#: ../../library/typing.rst:327 ../../library/typing.rst:3211 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:289 +#: ../../library/typing.rst:332 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:295 +#: ../../library/typing.rst:338 msgid "Generics" msgstr "" -#: ../../library/typing.rst:297 +#: ../../library/typing.rst:340 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, many container classes in the standard library " "support subscription to denote the expected types of container elements." msgstr "" -#: ../../library/typing.rst:314 +#: ../../library/typing.rst:357 msgid "" "Generics can be parameterized by using a factory available in typing called :" "class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:330 +#: ../../library/typing.rst:373 msgid "Annotating tuples" msgstr "" -#: ../../library/typing.rst:332 +#: ../../library/typing.rst:375 msgid "" "For most containers in Python, the typing system assumes that all elements " "in the container will be of the same type. For example::" msgstr "" -#: ../../library/typing.rst:347 +#: ../../library/typing.rst:390 msgid "" ":class:`list` only accepts one type argument, so a type checker would emit " "an error on the ``y`` assignment above. Similarly, :class:`~collections.abc." @@ -437,7 +455,7 @@ msgid "" "the keys, and the second indicates the type of the values." msgstr "" -#: ../../library/typing.rst:353 +#: ../../library/typing.rst:396 msgid "" "Unlike most other Python containers, however, it is common in idiomatic " "Python code for tuples to have elements which are not all of the same type. " @@ -445,7 +463,7 @@ msgid "" "`tuple` accepts *any number* of type arguments::" msgstr "" -#: ../../library/typing.rst:369 +#: ../../library/typing.rst:412 msgid "" "To denote a tuple which could be of *any* length, and in which all elements " "are of the same type ``T``, use ``tuple[T, ...]``. To denote an empty tuple, " @@ -453,11 +471,11 @@ msgid "" "using ``tuple[Any, ...]``::" msgstr "" -#: ../../library/typing.rst:392 +#: ../../library/typing.rst:435 msgid "The type of class objects" msgstr "" -#: ../../library/typing.rst:394 +#: ../../library/typing.rst:437 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``type[C]`` (or :class:`typing.Type[C] " @@ -465,84 +483,84 @@ msgid "" "will accept the *class object* of ``C``. For example::" msgstr "" -#: ../../library/typing.rst:404 +#: ../../library/typing.rst:447 msgid "Note that ``type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:420 +#: ../../library/typing.rst:463 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:432 +#: ../../library/typing.rst:475 msgid "" "``type[Any]`` is equivalent to :class:`type`, which is the root of Python's :" "ref:`metaclass hierarchy `." msgstr "" -#: ../../library/typing.rst:438 +#: ../../library/typing.rst:481 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:440 +#: ../../library/typing.rst:483 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:466 +#: ../../library/typing.rst:509 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:470 +#: ../../library/typing.rst:513 msgid "" "The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " "that ``LoggedVar[T]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:479 +#: ../../library/typing.rst:522 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:491 +#: ../../library/typing.rst:534 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:502 +#: ../../library/typing.rst:545 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:512 +#: ../../library/typing.rst:555 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: ../../library/typing.rst:522 +#: ../../library/typing.rst:565 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:524 +#: ../../library/typing.rst:567 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:535 +#: ../../library/typing.rst:578 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:552 +#: ../../library/typing.rst:595 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:555 +#: ../../library/typing.rst:598 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -552,7 +570,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:571 +#: ../../library/typing.rst:614 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -560,20 +578,20 @@ msgid "" "converted to the former, so the following are equivalent::" msgstr "" -#: ../../library/typing.rst:583 +#: ../../library/typing.rst:626 msgid "" "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:587 +#: ../../library/typing.rst:630 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:591 +#: ../../library/typing.rst:634 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -581,24 +599,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:598 +#: ../../library/typing.rst:641 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:600 +#: ../../library/typing.rst:643 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:604 +#: ../../library/typing.rst:647 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:622 +#: ../../library/typing.rst:665 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -607,19 +625,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:628 +#: ../../library/typing.rst:671 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:641 +#: ../../library/typing.rst:684 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:644 +#: ../../library/typing.rst:687 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, " @@ -627,7 +645,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:649 +#: ../../library/typing.rst:692 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 " @@ -635,24 +653,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:671 +#: ../../library/typing.rst:714 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:676 +#: ../../library/typing.rst:719 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:678 +#: ../../library/typing.rst:721 msgid "" "Initially :pep:`484` defined the 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:682 +#: ../../library/typing.rst:725 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -661,7 +679,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:695 +#: ../../library/typing.rst:738 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 " @@ -670,85 +688,85 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:711 +#: ../../library/typing.rst:754 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:716 +#: ../../library/typing.rst:759 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:718 +#: ../../library/typing.rst:761 msgid "" "The ``typing`` module defines the following classes, functions and " "decorators." msgstr "" -#: ../../library/typing.rst:721 +#: ../../library/typing.rst:764 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:724 +#: ../../library/typing.rst:767 msgid "Special types" msgstr "" -#: ../../library/typing.rst:726 +#: ../../library/typing.rst:769 msgid "" "These can be used as types in annotations. They do not support subscription " "using ``[]``." msgstr "" -#: ../../library/typing.rst:731 +#: ../../library/typing.rst:774 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:733 +#: ../../library/typing.rst:776 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:734 +#: ../../library/typing.rst:777 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:736 +#: ../../library/typing.rst:779 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:743 +#: ../../library/typing.rst:786 msgid "A :ref:`constrained type variable `." msgstr "" -#: ../../library/typing.rst:745 +#: ../../library/typing.rst:788 msgid "Definition::" msgstr "" -#: ../../library/typing.rst:749 +#: ../../library/typing.rst:792 msgid "" "``AnyStr`` is meant to be used for functions that may accept :class:`str` " "or :class:`bytes` arguments but cannot allow the two to mix." msgstr "" -#: ../../library/typing.rst:752 ../../library/typing.rst:828 -#: ../../library/typing.rst:848 ../../library/typing.rst:894 -#: ../../library/typing.rst:1092 ../../library/typing.rst:1149 -#: ../../library/typing.rst:1357 ../../library/typing.rst:2519 +#: ../../library/typing.rst:795 ../../library/typing.rst:871 +#: ../../library/typing.rst:891 ../../library/typing.rst:937 +#: ../../library/typing.rst:1096 ../../library/typing.rst:1153 +#: ../../library/typing.rst:1361 ../../library/typing.rst:2524 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:763 +#: ../../library/typing.rst:806 msgid "Special type that includes only literal strings." msgstr "" -#: ../../library/typing.rst:765 +#: ../../library/typing.rst:808 msgid "" "Any string literal is compatible with ``LiteralString``, as is another " "``LiteralString``. However, an object typed as just ``str`` is not. A string " @@ -756,14 +774,14 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:771 +#: ../../library/typing.rst:814 msgid "Example:" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:787 +#: ../../library/typing.rst:830 msgid "" "``LiteralString`` is useful for sensitive APIs where arbitrary user-" "generated strings could generate problems. For example, the two cases above " @@ -771,33 +789,33 @@ msgid "" "attack." msgstr "" -#: ../../library/typing.rst:792 +#: ../../library/typing.rst:835 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:798 +#: ../../library/typing.rst:841 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:801 +#: ../../library/typing.rst:844 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:821 +#: ../../library/typing.rst:864 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:826 +#: ../../library/typing.rst:869 msgid "Special type indicating that a function never returns." msgstr "" -#: ../../library/typing.rst:835 +#: ../../library/typing.rst:878 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -805,126 +823,126 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:846 +#: ../../library/typing.rst:889 msgid "Special type to represent the current enclosed class." msgstr "" -#: ../../library/typing.rst:858 +#: ../../library/typing.rst:901 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:870 +#: ../../library/typing.rst:913 msgid "In general if something currently follows the pattern of::" msgstr "" -#: ../../library/typing.rst:877 +#: ../../library/typing.rst:920 msgid "" "You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " "have ``Foo`` as the return type and not ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:880 +#: ../../library/typing.rst:923 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:882 +#: ../../library/typing.rst:925 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:884 +#: ../../library/typing.rst:927 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:886 +#: ../../library/typing.rst:929 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:892 +#: ../../library/typing.rst:935 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "" -#: ../../library/typing.rst:900 +#: ../../library/typing.rst:943 msgid "" "``TypeAlias`` is particularly useful for annotating aliases that make use of " "forward references, as it can be hard for type checkers to distinguish these " "from normal variable assignments:" msgstr "" -#: ../../library/typing.rst:920 +#: ../../library/typing.rst:963 msgid "See :pep:`613` for more details." msgstr "更多細節請見 :pep:`613`。" -#: ../../library/typing.rst:925 +#: ../../library/typing.rst:968 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:927 +#: ../../library/typing.rst:970 msgid "" "These can be used as types in annotations. They all support subscription " "using ``[]``, but each has a unique syntax." msgstr "" -#: ../../library/typing.rst:932 +#: ../../library/typing.rst:975 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:934 +#: ../../library/typing.rst:977 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:936 +#: ../../library/typing.rst:979 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:938 +#: ../../library/typing.rst:981 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:942 +#: ../../library/typing.rst:985 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:946 +#: ../../library/typing.rst:989 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:950 +#: ../../library/typing.rst:993 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:954 +#: ../../library/typing.rst:997 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:956 +#: ../../library/typing.rst:999 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:958 +#: ../../library/typing.rst:1001 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:961 +#: ../../library/typing.rst:1004 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:967 +#: ../../library/typing.rst:1010 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:969 +#: ../../library/typing.rst:1012 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 " @@ -932,75 +950,35 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:977 +#: ../../library/typing.rst:1020 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:984 +#: ../../library/typing.rst:1027 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:990 -msgid "Deprecated alias to :class:`collections.abc.Callable`." -msgstr "" - -#: ../../library/typing.rst:992 -msgid "" -"``Callable[[int], str]`` signifies a function that takes a single parameter " -"of type :class:`int` and returns a :class:`str`." -msgstr "" - -#: ../../library/typing.rst:995 -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, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return " -"type must be a single type." -msgstr "" - -#: ../../library/typing.rst:1000 -msgid "" -"There is no syntax to indicate optional or keyword arguments; such function " -"types are rarely used as callback types. ``Callable[..., ReturnType]`` " -"(literal ellipsis) can be used to type hint a callable taking any number of " -"arguments and returning ``ReturnType``. A plain :data:`Callable` is " -"equivalent to ``Callable[..., Any]``, and in turn to :class:`collections.abc." -"Callable`." -msgstr "" - -#: ../../library/typing.rst:1016 -msgid "" -":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1025 -msgid "" -"The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " -"examples of usage with ``Callable``." -msgstr "" - -#: ../../library/typing.rst:1030 +#: ../../library/typing.rst:1033 msgid "Special form for annotating higher-order functions." msgstr "" -#: ../../library/typing.rst:1032 +#: ../../library/typing.rst:1035 msgid "" -"``Concatenate`` can be used in conjunction with :data:`Callable` and :class:" -"`ParamSpec` to annotate a higher-order callable which adds, removes, or " -"transforms parameters of another callable. Usage is in the form " -"``Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable]``. ``Concatenate`` " -"is currently only valid when used as the first argument to a :data:" -"`Callable`. The last parameter to ``Concatenate`` must be a :class:" -"`ParamSpec` or ellipsis (``...``)." +"``Concatenate`` can be used in conjunction with :ref:`Callable ` and :class:`ParamSpec` to annotate a higher-order callable which " +"adds, removes, or transforms parameters of another callable. Usage is in " +"the form ``Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable]``. " +"``Concatenate`` is currently only valid when used as the first argument to " +"a :ref:`Callable `. The last parameter to " +"``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:1041 +#: ../../library/typing.rst:1044 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -1011,34 +989,38 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1080 ../../library/typing.rst:1736 +#: ../../library/typing.rst:1083 ../../library/typing.rst:1740 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " -"``ParamSpec`` and ``Concatenate``)." +"``ParamSpec`` and ``Concatenate``)" msgstr "" -#: ../../library/typing.rst:1082 -msgid ":class:`ParamSpec` and :class:`Callable`." -msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" +#: ../../library/typing.rst:1085 +msgid ":class:`ParamSpec`" +msgstr ":class:`ParamSpec`" + +#: ../../library/typing.rst:1086 ../../library/typing.rst:1743 +msgid ":ref:`annotating-callables`" +msgstr "" -#: ../../library/typing.rst:1086 +#: ../../library/typing.rst:1090 msgid "Special typing form to define \"literal types\"." msgstr "" -#: ../../library/typing.rst:1088 +#: ../../library/typing.rst:1092 msgid "" "``Literal`` can be used to indicate to type checkers that the annotated " "object has a value equivalent to one of the provided literals." msgstr "" -#: ../../library/typing.rst:1104 +#: ../../library/typing.rst:1108 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:1110 +#: ../../library/typing.rst:1114 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1046,22 +1028,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1118 +#: ../../library/typing.rst:1122 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1120 +#: ../../library/typing.rst:1124 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:1128 +#: ../../library/typing.rst:1132 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1130 +#: ../../library/typing.rst:1134 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 " @@ -1069,27 +1051,27 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1144 +#: ../../library/typing.rst:1148 msgid "Special typing construct to indicate final names to type checkers." msgstr "" -#: ../../library/typing.rst:1146 +#: ../../library/typing.rst:1150 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1160 ../../library/typing.rst:2535 +#: ../../library/typing.rst:1164 ../../library/typing.rst:2540 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1167 +#: ../../library/typing.rst:1171 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "" -#: ../../library/typing.rst:1169 +#: ../../library/typing.rst:1173 msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." @@ -1097,21 +1079,21 @@ msgstr "" "主要用於 ``total=False`` 的 TypedDict。更多細節請見 :class:`TypedDict` 與 :" "pep:`655`。" -#: ../../library/typing.rst:1176 +#: ../../library/typing.rst:1180 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "" -#: ../../library/typing.rst:1179 +#: ../../library/typing.rst:1183 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1185 +#: ../../library/typing.rst:1189 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1187 +#: ../../library/typing.rst:1191 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1119,7 +1101,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1192 +#: ../../library/typing.rst:1196 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -1128,7 +1110,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1198 +#: ../../library/typing.rst:1202 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1138,7 +1120,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1205 +#: ../../library/typing.rst:1209 msgid "" "The responsibility of how to interpret the metadata lies with the the tool " "or library encountering an ``Annotated`` annotation. A tool or library " @@ -1146,108 +1128,108 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1213 +#: ../../library/typing.rst:1217 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1226 +#: ../../library/typing.rst:1230 msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1228 +#: ../../library/typing.rst:1232 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1230 +#: ../../library/typing.rst:1234 msgid "" "Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1239 +#: ../../library/typing.rst:1243 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: ../../library/typing.rst:1243 +#: ../../library/typing.rst:1247 msgid "" "``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1246 +#: ../../library/typing.rst:1250 msgid "" "The order of the metadata elements is preserved and matters for equality " "checks::" msgstr "" -#: ../../library/typing.rst:1253 +#: ../../library/typing.rst:1257 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1260 +#: ../../library/typing.rst:1264 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1266 +#: ../../library/typing.rst:1270 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1279 +#: ../../library/typing.rst:1283 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1283 +#: ../../library/typing.rst:1287 msgid "This would be equivalent to::" msgstr "" "這會等價於:\n" "\n" "::" -#: ../../library/typing.rst:1287 +#: ../../library/typing.rst:1291 msgid "" "where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " "invalid: only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1290 +#: ../../library/typing.rst:1294 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: ../../library/typing.rst:1303 +#: ../../library/typing.rst:1307 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1317 +#: ../../library/typing.rst:1321 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1318 +#: ../../library/typing.rst:1322 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1325 +#: ../../library/typing.rst:1329 msgid "Special typing construct for marking user-defined type guard functions." msgstr "" -#: ../../library/typing.rst:1327 +#: ../../library/typing.rst:1331 msgid "" "``TypeGuard`` can be 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:1331 +#: ../../library/typing.rst:1335 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 " @@ -1256,44 +1238,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1346 +#: ../../library/typing.rst:1350 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:1350 +#: ../../library/typing.rst:1354 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1353 +#: ../../library/typing.rst:1357 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1354 +#: ../../library/typing.rst:1358 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1371 +#: ../../library/typing.rst:1375 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:1375 +#: ../../library/typing.rst:1379 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:1381 +#: ../../library/typing.rst:1385 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]`` " @@ -1302,24 +1284,24 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1387 +#: ../../library/typing.rst:1391 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1394 +#: ../../library/typing.rst:1398 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1396 +#: ../../library/typing.rst:1400 msgid "" "For example, using the unpack operator ``*`` on a :class:`type variable " "tuple ` is equivalent to using ``Unpack`` to mark the type " "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1405 +#: ../../library/typing.rst:1409 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1327,45 +1309,45 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1422 +#: ../../library/typing.rst:1426 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1424 +#: ../../library/typing.rst:1428 msgid "" "The following classes should not be used directly as annotations. Their " "intended purpose is to be building blocks for creating generic types." msgstr "" -#: ../../library/typing.rst:1430 +#: ../../library/typing.rst:1434 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1432 +#: ../../library/typing.rst:1436 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:1441 +#: ../../library/typing.rst:1445 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1454 +#: ../../library/typing.rst:1458 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1456 ../../library/typing.rst:1551 -#: ../../library/typing.rst:1661 ../../library/typing.rst:1774 -#: ../../library/typing.rst:1845 ../../library/typing.rst:2719 +#: ../../library/typing.rst:1460 ../../library/typing.rst:1555 +#: ../../library/typing.rst:1665 ../../library/typing.rst:1779 +#: ../../library/typing.rst:1850 ../../library/typing.rst:2724 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1462 +#: ../../library/typing.rst:1466 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 " @@ -1373,69 +1355,69 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1483 +#: ../../library/typing.rst:1487 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1486 +#: ../../library/typing.rst:1490 msgid "" "Type variables may be marked covariant or contravariant by passing " "``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " "details. By default, type variables are invariant." msgstr "" -#: ../../library/typing.rst:1490 +#: ../../library/typing.rst:1494 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1505 +#: ../../library/typing.rst:1509 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1513 +#: ../../library/typing.rst:1517 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1524 +#: ../../library/typing.rst:1528 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1528 +#: ../../library/typing.rst:1532 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1532 +#: ../../library/typing.rst:1536 msgid "Whether the type var has been marked as covariant." msgstr "" -#: ../../library/typing.rst:1536 +#: ../../library/typing.rst:1540 msgid "Whether the type var has been marked as contravariant." msgstr "" -#: ../../library/typing.rst:1540 +#: ../../library/typing.rst:1544 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1544 +#: ../../library/typing.rst:1548 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1548 +#: ../../library/typing.rst:1552 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1559 +#: ../../library/typing.rst:1563 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1443,7 +1425,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1585 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1453,36 +1435,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1589 +#: ../../library/typing.rst:1593 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1596 +#: ../../library/typing.rst:1600 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1605 +#: ../../library/typing.rst:1609 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1624 +#: ../../library/typing.rst:1628 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1631 +#: ../../library/typing.rst:1635 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1641 +#: ../../library/typing.rst:1645 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1491,21 +1473,21 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1648 +#: ../../library/typing.rst:1652 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1652 +#: ../../library/typing.rst:1656 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1658 +#: ../../library/typing.rst:1662 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1665 +#: ../../library/typing.rst:1669 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1515,7 +1497,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1676 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 " @@ -1523,27 +1505,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1696 +#: ../../library/typing.rst:1700 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:1700 +#: ../../library/typing.rst:1704 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:1702 +#: ../../library/typing.rst:1706 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:1709 +#: ../../library/typing.rst:1713 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1556,11 +1538,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1721 +#: ../../library/typing.rst:1725 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1727 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1569,17 +1551,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1732 +#: ../../library/typing.rst:1736 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1738 -msgid ":class:`Callable` and :class:`Concatenate`." -msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" +#: ../../library/typing.rst:1742 +msgid ":data:`Concatenate`" +msgstr "" -#: ../../library/typing.rst:1743 +#: ../../library/typing.rst:1748 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1587,45 +1569,45 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1748 +#: ../../library/typing.rst:1753 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1764 +#: ../../library/typing.rst:1769 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1766 +#: ../../library/typing.rst:1771 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:1772 +#: ../../library/typing.rst:1777 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1780 +#: ../../library/typing.rst:1785 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1784 +#: ../../library/typing.rst:1789 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1793 +#: ../../library/typing.rst:1798 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1795 +#: ../../library/typing.rst:1800 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 " @@ -1634,83 +1616,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:1806 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1811 +#: ../../library/typing.rst:1816 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1817 +#: ../../library/typing.rst:1822 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1821 +#: ../../library/typing.rst:1826 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1824 +#: ../../library/typing.rst:1829 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1827 +#: ../../library/typing.rst:1832 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1831 +#: ../../library/typing.rst:1836 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1835 +#: ../../library/typing.rst:1840 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1840 +#: ../../library/typing.rst:1845 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:1842 +#: ../../library/typing.rst:1847 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:1852 +#: ../../library/typing.rst:1857 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1856 +#: ../../library/typing.rst:1861 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1860 +#: ../../library/typing.rst:1865 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1864 +#: ../../library/typing.rst:1869 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1869 +#: ../../library/typing.rst:1874 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:1871 +#: ../../library/typing.rst:1876 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1877 +#: ../../library/typing.rst:1882 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1889 +#: ../../library/typing.rst:1894 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1718,15 +1700,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1894 +#: ../../library/typing.rst:1899 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1906 +#: ../../library/typing.rst:1911 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1908 +#: ../../library/typing.rst:1913 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 " @@ -1735,18 +1717,18 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1928 +#: ../../library/typing.rst:1933 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" "class:`ssl.SSLObject` is a class, therefore it passes an :func:`issubclass` " -"check against :data:`Callable`. However, the ``ssl.SSLObject.__init__`` " -"method exists only to raise a :exc:`TypeError` with a more informative " -"message, therefore making it impossible to call (instantiate) :class:`ssl." -"SSLObject`." +"check against :ref:`Callable `. However, the ``ssl." +"SSLObject.__init__`` method exists only to raise a :exc:`TypeError` with a " +"more informative message, therefore making it impossible to call " +"(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:1939 +#: ../../library/typing.rst:1944 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1754,13 +1736,13 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1950 +#: ../../library/typing.rst:1955 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1953 +#: ../../library/typing.rst:1958 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 " @@ -1768,53 +1750,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:1974 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1973 +#: ../../library/typing.rst:1978 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1977 +#: ../../library/typing.rst:1982 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1984 +#: ../../library/typing.rst:1989 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1985 +#: ../../library/typing.rst:1990 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1997 +#: ../../library/typing.rst:2002 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:2008 +#: ../../library/typing.rst:2013 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2011 +#: ../../library/typing.rst:2016 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2021 +#: ../../library/typing.rst:2026 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 " @@ -1822,61 +1804,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2026 +#: ../../library/typing.rst:2031 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2041 +#: ../../library/typing.rst:2046 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:2048 +#: ../../library/typing.rst:2053 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2056 +#: ../../library/typing.rst:2061 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2074 +#: ../../library/typing.rst:2079 msgid "A ``TypedDict`` can be generic:" msgstr "" -#: ../../library/typing.rst:2084 +#: ../../library/typing.rst:2089 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:2090 +#: ../../library/typing.rst:2095 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2112 +#: ../../library/typing.rst:2117 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2115 +#: ../../library/typing.rst:2120 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2123 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1885,133 +1867,133 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2141 +#: ../../library/typing.rst:2146 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2145 +#: ../../library/typing.rst:2150 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2149 +#: ../../library/typing.rst:2154 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2153 +#: ../../library/typing.rst:2158 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2155 +#: ../../library/typing.rst:2160 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2160 +#: ../../library/typing.rst:2165 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2165 +#: ../../library/typing.rst:2170 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2169 +#: ../../library/typing.rst:2174 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2173 +#: ../../library/typing.rst:2178 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2177 +#: ../../library/typing.rst:2182 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2183 +#: ../../library/typing.rst:2188 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2187 +#: ../../library/typing.rst:2192 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2191 +#: ../../library/typing.rst:2196 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2197 +#: ../../library/typing.rst:2202 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:2203 +#: ../../library/typing.rst:2208 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2207 +#: ../../library/typing.rst:2212 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2209 +#: ../../library/typing.rst:2214 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:2216 +#: ../../library/typing.rst:2221 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2218 +#: ../../library/typing.rst:2223 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2221 +#: ../../library/typing.rst:2226 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2228 +#: ../../library/typing.rst:2233 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2242 +#: ../../library/typing.rst:2247 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2244 +#: ../../library/typing.rst:2249 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2255 +#: ../../library/typing.rst:2260 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2260 +#: ../../library/typing.rst:2265 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2021,59 +2003,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2268 +#: ../../library/typing.rst:2273 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2276 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2279 +#: ../../library/typing.rst:2284 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2281 +#: ../../library/typing.rst:2286 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2287 +#: ../../library/typing.rst:2292 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2290 +#: ../../library/typing.rst:2295 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2295 +#: ../../library/typing.rst:2300 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2300 +#: ../../library/typing.rst:2305 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2312 +#: ../../library/typing.rst:2317 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2315 +#: ../../library/typing.rst:2320 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2082,19 +2064,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2322 +#: ../../library/typing.rst:2327 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2338 +#: ../../library/typing.rst:2343 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2347 +#: ../../library/typing.rst:2352 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2358 +#: ../../library/typing.rst:2363 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2489 +#: ../../library/typing.rst:2494 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2299,32 +2281,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2496 +#: ../../library/typing.rst:2501 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2504 +#: ../../library/typing.rst:2509 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2506 +#: ../../library/typing.rst:2511 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2513 +#: ../../library/typing.rst:2518 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2515 +#: ../../library/typing.rst:2520 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2540 +#: ../../library/typing.rst:2545 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2334,11 +2316,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2551 +#: ../../library/typing.rst:2556 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2553 +#: ../../library/typing.rst:2558 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2346,48 +2328,48 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2559 +#: ../../library/typing.rst:2564 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2563 +#: ../../library/typing.rst:2568 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2565 +#: ../../library/typing.rst:2570 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2570 +#: ../../library/typing.rst:2575 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2572 +#: ../../library/typing.rst:2577 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:2583 +#: ../../library/typing.rst:2588 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2587 +#: ../../library/typing.rst:2592 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2591 +#: ../../library/typing.rst:2596 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2594 +#: ../../library/typing.rst:2599 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2396,21 +2378,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2600 +#: ../../library/typing.rst:2605 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:2617 +#: ../../library/typing.rst:2622 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:2622 +#: ../../library/typing.rst:2627 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2418,20 +2400,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2626 +#: ../../library/typing.rst:2631 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2633 +#: ../../library/typing.rst:2638 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2636 +#: ../../library/typing.rst:2641 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2439,17 +2421,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2642 ../../library/typing.rst:2665 +#: ../../library/typing.rst:2647 ../../library/typing.rst:2670 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:2657 +#: ../../library/typing.rst:2662 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2660 +#: ../../library/typing.rst:2665 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2457,40 +2439,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:2677 +#: ../../library/typing.rst:2682 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2698 +#: ../../library/typing.rst:2703 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:2700 +#: ../../library/typing.rst:2705 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2705 +#: ../../library/typing.rst:2710 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:2712 +#: ../../library/typing.rst:2717 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2716 +#: ../../library/typing.rst:2721 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:2727 +#: ../../library/typing.rst:2732 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2498,7 +2480,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2734 +#: ../../library/typing.rst:2739 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2506,205 +2488,211 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2745 +#: ../../library/typing.rst:2751 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:2747 +#: ../../library/typing.rst:2753 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " "order to support parameterizing these generic classes using ``[]``. However, " "the aliases became redundant in Python 3.9 when the corresponding pre-" -"existing classes were enhanced to support ``[]``." +"existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:2753 +#: ../../library/typing.rst:2760 msgid "" -"The redundant types are deprecated as of Python 3.9 but no deprecation " -"warnings are issued by the interpreter. It is expected that type checkers " -"will flag the deprecated types when the checked program targets Python 3.9 " -"or newer." +"The redundant types are deprecated as of Python 3.9. However, while the " +"aliases may be removed at some point, removal of these aliases is not " +"currently planned. As such, no deprecation warnings are currently issued by " +"the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:2758 +#: ../../library/typing.rst:2765 msgid "" -"The deprecated types will be removed from the :mod:`typing` module no sooner " -"than 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*." +"If at some point it is decided to remove these deprecated aliases, a " +"deprecation warning will be issued by the interpreter for at least two " +"releases prior to removal. The aliases are guaranteed to remain in the " +"typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:2765 +#: ../../library/typing.rst:2770 +msgid "" +"Type checkers are encouraged to flag uses of the deprecated types if the " +"program they are checking targets a minimum Python version of 3.9 or newer." +msgstr "" + +#: ../../library/typing.rst:2776 msgid "Aliases to built-in types" msgstr "" -#: ../../library/typing.rst:2769 +#: ../../library/typing.rst:2780 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: ../../library/typing.rst:2771 +#: ../../library/typing.rst:2782 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2775 ../../library/typing.rst:3015 +#: ../../library/typing.rst:2786 ../../library/typing.rst:3026 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2780 +#: ../../library/typing.rst:2791 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2786 +#: ../../library/typing.rst:2797 msgid "Deprecated alias to :class:`list`." msgstr "" -#: ../../library/typing.rst:2788 +#: ../../library/typing.rst:2799 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2792 +#: ../../library/typing.rst:2803 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2802 +#: ../../library/typing.rst:2813 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2808 +#: ../../library/typing.rst:2819 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: ../../library/typing.rst:2810 +#: ../../library/typing.rst:2821 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2814 +#: ../../library/typing.rst:2825 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2820 +#: ../../library/typing.rst:2831 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:2822 +#: ../../library/typing.rst:2833 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2829 +#: ../../library/typing.rst:2840 msgid "Deprecated alias for :class:`tuple`." msgstr "" -#: ../../library/typing.rst:2831 +#: ../../library/typing.rst:2842 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:2834 +#: ../../library/typing.rst:2845 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2840 +#: ../../library/typing.rst:2851 msgid "Deprecated alias to :class:`type`." msgstr "" -#: ../../library/typing.rst:2842 +#: ../../library/typing.rst:2853 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:2858 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2854 +#: ../../library/typing.rst:2865 msgid "Aliases to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:2869 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:2873 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2879 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:2872 +#: ../../library/typing.rst:2883 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2878 +#: ../../library/typing.rst:2889 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:2894 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:2900 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:2905 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2900 +#: ../../library/typing.rst:2911 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:2905 +#: ../../library/typing.rst:2916 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2912 +#: ../../library/typing.rst:2923 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:2917 +#: ../../library/typing.rst:2928 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2920 +#: ../../library/typing.rst:2931 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -2712,367 +2700,383 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2928 +#: ../../library/typing.rst:2939 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2929 +#: ../../library/typing.rst:2940 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2935 +#: ../../library/typing.rst:2946 msgid "Deprecated alias for :class:`str`." msgstr "" -#: ../../library/typing.rst:2937 +#: ../../library/typing.rst:2948 msgid "" "``Text`` 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:2941 +#: ../../library/typing.rst:2952 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:2949 +#: ../../library/typing.rst:2960 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2959 +#: ../../library/typing.rst:2970 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2963 +#: ../../library/typing.rst:2974 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2965 +#: ../../library/typing.rst:2976 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2971 +#: ../../library/typing.rst:2982 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2975 +#: ../../library/typing.rst:2986 msgid "" "Prefer ``typing_extensions.Buffer``, or a union like ``bytes | bytearray | " "memoryview``." msgstr "" -#: ../../library/typing.rst:2979 +#: ../../library/typing.rst:2990 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: ../../library/typing.rst:2983 +#: ../../library/typing.rst:2994 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2989 +#: ../../library/typing.rst:3000 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2991 +#: ../../library/typing.rst:3002 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2997 +#: ../../library/typing.rst:3008 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2999 +#: ../../library/typing.rst:3010 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3005 +#: ../../library/typing.rst:3016 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:3007 +#: ../../library/typing.rst:3018 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3013 +#: ../../library/typing.rst:3024 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: ../../library/typing.rst:3020 +#: ../../library/typing.rst:3031 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3026 +#: ../../library/typing.rst:3037 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:3028 +#: ../../library/typing.rst:3039 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3034 +#: ../../library/typing.rst:3045 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:3036 +#: ../../library/typing.rst:3047 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3043 +#: ../../library/typing.rst:3054 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:3045 +#: ../../library/typing.rst:3056 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3052 +#: ../../library/typing.rst:3063 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:3054 +#: ../../library/typing.rst:3065 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3060 +#: ../../library/typing.rst:3071 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:3062 +#: ../../library/typing.rst:3073 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3068 +#: ../../library/typing.rst:3079 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:3070 +#: ../../library/typing.rst:3081 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3077 +#: ../../library/typing.rst:3088 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3081 +#: ../../library/typing.rst:3092 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: ../../library/typing.rst:3083 +#: ../../library/typing.rst:3094 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3094 +#: ../../library/typing.rst:3105 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3100 +#: ../../library/typing.rst:3111 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: ../../library/typing.rst:3102 +#: ../../library/typing.rst:3113 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3122 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:3115 +#: ../../library/typing.rst:3126 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3123 +#: ../../library/typing.rst:3134 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3133 +#: ../../library/typing.rst:3144 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3140 +#: ../../library/typing.rst:3151 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:3144 +#: ../../library/typing.rst:3155 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3150 +#: ../../library/typing.rst:3161 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:3154 +#: ../../library/typing.rst:3165 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3160 +#: ../../library/typing.rst:3171 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:3164 +#: ../../library/typing.rst:3175 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3171 +#: ../../library/typing.rst:3182 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3186 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:3177 +#: ../../library/typing.rst:3188 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3183 +#: ../../library/typing.rst:3194 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:3185 +#: ../../library/typing.rst:3196 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3191 +#: ../../library/typing.rst:3202 +msgid "Deprecated alias to :class:`collections.abc.Callable`." +msgstr "" + +#: ../../library/typing.rst:3204 +msgid "" +"See :ref:`annotating-callables` for details on how to use :class:" +"`collections.abc.Callable` and ``typing.Callable`` in type annotations." +msgstr "" + +#: ../../library/typing.rst:3207 +msgid "" +":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." +msgstr "" + +#: ../../library/typing.rst:3217 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: ../../library/typing.rst:3193 +#: ../../library/typing.rst:3219 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3202 +#: ../../library/typing.rst:3228 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:3206 +#: ../../library/typing.rst:3232 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3214 +#: ../../library/typing.rst:3240 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3222 +#: ../../library/typing.rst:3248 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3228 +#: ../../library/typing.rst:3254 msgid "Alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:3232 +#: ../../library/typing.rst:3258 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:3234 +#: ../../library/typing.rst:3260 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3240 +#: ../../library/typing.rst:3266 msgid "Alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:3245 +#: ../../library/typing.rst:3271 msgid "Aliases to :mod:`contextlib` ABCs" msgstr "" -#: ../../library/typing.rst:3249 +#: ../../library/typing.rst:3275 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3254 +#: ../../library/typing.rst:3280 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3261 +#: ../../library/typing.rst:3287 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3266 +#: ../../library/typing.rst:3292 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3272 +#: ../../library/typing.rst:3298 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3274 +#: ../../library/typing.rst:3300 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3080,74 +3084,81 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3307 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3308 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3309 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3310 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3311 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3312 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3313 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3314 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3284 +#: ../../library/typing.rst:3315 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3284 ../../library/typing.rst:3287 +#: ../../library/typing.rst:3316 ../../library/typing.rst:3320 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3284 ../../library/typing.rst:3289 -msgid "Undecided" +#: ../../library/typing.rst:3317 +msgid "Undecided (see :ref:`deprecated-typing-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3284 +#: ../../library/typing.rst:3318 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3287 -msgid "``typing.ByteString``" -msgstr "``typing.Text``" +#: ../../library/typing.rst:3319 +msgid ":class:`typing.ByteString`" +msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3321 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3322 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3289 -msgid "``typing.Text``" -msgstr "``typing.Text``" +#: ../../library/typing.rst:3323 +msgid ":data:`typing.Text`" +msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3324 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3325 +msgid "Undecided" +msgstr "" + +#: ../../library/typing.rst:3326 msgid ":gh:`92332`" msgstr ":gh:`92332`" + +#~ msgid ":class:`Callable` and :class:`Concatenate`." +#~ msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" diff --git a/library/urllib.parse.po b/library/urllib.parse.po index 7b8129d44c..df342a0b66 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-18 00:15+0000\n" +"POT-Creation-Date: 2023-07-06 00:19+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-" @@ -39,9 +39,9 @@ msgid "" "The module has been designed to match the internet RFC on Relative Uniform " "Resource Locators. It supports the following URL schemes: ``file``, ``ftp``, " "``gopher``, ``hdl``, ``http``, ``https``, ``imap``, ``mailto``, ``mms``, " -"``news``, ``nntp``, ``prospero``, ``rsync``, ``rtsp``, ``rtspu``, ``sftp``, " -"``shttp``, ``sip``, ``sips``, ``snews``, ``svn``, ``svn+ssh``, ``telnet``, " -"``wais``, ``ws``, ``wss``." +"``news``, ``nntp``, ``prospero``, ``rsync``, ``rtsp``, ``rtsps``, ``rtspu``, " +"``sftp``, ``shttp``, ``sip``, ``sips``, ``snews``, ``svn``, ``svn+ssh``, " +"``telnet``, ``wais``, ``ws``, ``wss``." msgstr "" #: ../../library/urllib.parse.rst:30 @@ -929,7 +929,8 @@ msgstr "" #: ../../library/urllib.parse.rst:761 msgid ":rfc:`1808` - Relative Uniform Resource Locators" -msgstr ":rfc:`1808` - 相對的統一資源定位器 (Relative Uniform Resource Locators)" +msgstr "" +":rfc:`1808` - 相對的統一資源定位器 (Relative Uniform Resource Locators)" #: ../../library/urllib.parse.rst:759 msgid "" diff --git a/reference/expressions.po b/reference/expressions.po index 48989538e9..ebb1508065 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-08 00:17+0000\n" +"POT-Creation-Date: 2023-07-03 07:57+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -313,8 +313,8 @@ msgstr "" #: ../../reference/expressions.rst:307 msgid "" -"A dictionary display is a possibly empty series of key/datum pairs enclosed " -"in curly braces:" +"A dictionary display is a possibly empty series of dict items (key/value " +"pairs) enclosed in curly braces:" msgstr "" #: ../../reference/expressions.rst:316 @@ -323,20 +323,20 @@ msgstr "" #: ../../reference/expressions.rst:318 msgid "" -"If a comma-separated sequence of key/datum pairs is given, they are " -"evaluated from left to right to define the entries of the dictionary: each " -"key object is used as a key into the dictionary to store the corresponding " -"datum. This means that you can specify the same key multiple times in the " -"key/datum list, and the final dictionary's value for that key will be the " -"last one given." +"If a comma-separated sequence of dict items is given, they are evaluated " +"from left to right to define the entries of the dictionary: each key object " +"is used as a key into the dictionary to store the corresponding value. This " +"means that you can specify the same key multiple times in the dict item " +"list, and the final dictionary's value for that key will be the last one " +"given." msgstr "" #: ../../reference/expressions.rst:328 msgid "" "A double asterisk ``**`` denotes :dfn:`dictionary unpacking`. Its operand " "must be a :term:`mapping`. Each mapping item is added to the new " -"dictionary. Later values replace values already set by earlier key/datum " -"pairs and earlier dictionary unpackings." +"dictionary. Later values replace values already set by earlier dict items " +"and earlier dictionary unpackings." msgstr "" #: ../../reference/expressions.rst:333 @@ -356,7 +356,7 @@ msgid "" "Restrictions on the types of the key values are listed earlier in section :" "ref:`types`. (To summarize, the key type should be :term:`hashable`, which " "excludes all mutable objects.) Clashes between duplicate keys are not " -"detected; the last datum (textually rightmost in the display) stored for a " +"detected; the last value (textually rightmost in the display) stored for a " "given key value prevails." msgstr "" @@ -2420,12 +2420,12 @@ msgid "key" msgstr "key(鍵)" #: ../../reference/expressions.rst:298 -msgid "datum" -msgstr "datum(資料元)" +msgid "value" +msgstr "value(值)" #: ../../reference/expressions.rst:298 -msgid "key/datum pair" -msgstr "key/datum pair(鍵/資料元對)" +msgid "key/value pair" +msgstr "key/value pair(鍵/值對)" #: ../../reference/expressions.rst:298 msgid "dictionary expression" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index accbe67a34..2228049d6c 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-03 07:57+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -205,7 +205,7 @@ msgstr "" msgid "" "If the primary is a mapping object (such as a dictionary), the subscript " "must have a type compatible with the mapping's key type, and the mapping is " -"then asked to create a key/datum pair which maps the subscript to the " +"then asked to create a key/value pair which maps the subscript to the " "assigned object. This can either replace an existing key/value pair with " "the same key value, or insert a new key/value pair (if no key with the same " "value existed)." diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 6d80b0495e..7d28031c5c 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-18 00:46+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -362,7 +362,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:326 +#: ../../tutorial/controlflow.rst:327 msgid "" "You can use positional parameters with some builtin classes that provide an " "ordering for their attributes (e.g. dataclasses). You can also define a " @@ -378,7 +378,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:337 +#: ../../tutorial/controlflow.rst:338 msgid "" "A recommended way to read patterns is to look at them as an extended form of " "what you would put on the left of an assignment, to understand which " @@ -394,17 +394,17 @@ msgstr "" "的 ``x=`` 及 ``y=``)或 class 名稱(由它們後面的 \"(...)\" 被辨識,如上面的 " "``Point``)則永遠無法被賦值。" -#: ../../tutorial/controlflow.rst:344 +#: ../../tutorial/controlflow.rst:345 msgid "" "Patterns can be arbitrarily nested. For example, if we have a short list of " -"points, we could match it like this::" +"Points, with ``__match_args__`` added, we could match it like this::" msgstr "" "模式可以任意地被巢套 (nested)。例如,如果我們有一個由某些點所組成的簡短 " -"list,我們就可以像這樣來對它進行匹配:\n" +"list,我們就可以像這樣加入 ``__match_args__`` 來對它進行匹配:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:359 +#: ../../tutorial/controlflow.rst:366 msgid "" "We can add an ``if`` clause to a pattern, known as a \"guard\". If the " "guard is false, ``match`` goes on to try the next case block. Note that " @@ -416,11 +416,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:369 +#: ../../tutorial/controlflow.rst:376 msgid "Several other key features of this statement:" msgstr "此種陳述式的其他幾個重要特色:" -#: ../../tutorial/controlflow.rst:371 +#: ../../tutorial/controlflow.rst:378 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. An important exception is " @@ -429,7 +429,7 @@ msgstr "" "與拆解賦值的情況類似,tuple(元組)和 list 模式具有完全相同的意義,而且實際上" "可以匹配任意的序列。一個重要的例外,是它們不能匹配疊代器 (iterator) 或字串。" -#: ../../tutorial/controlflow.rst:375 +#: ../../tutorial/controlflow.rst:382 msgid "" "Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y, " "*rest)`` work similar to unpacking assignments. The name after ``*`` may " @@ -441,7 +441,7 @@ msgstr "" "是 ``_``,所以 ``(x, y, *_)`` 會匹配一個至少兩項的序列,且不會連結那兩項以外" "的其餘項。" -#: ../../tutorial/controlflow.rst:380 +#: ../../tutorial/controlflow.rst:387 msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " "``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " @@ -453,14 +453,14 @@ msgstr "" "模式不同,額外的鍵 (key) 會被忽略。一種像是 ``**rest`` 的拆解方式,也是可被支" "援的。(但 ``**_`` 則是多餘的做法,所以它並不被允許。)" -#: ../../tutorial/controlflow.rst:385 +#: ../../tutorial/controlflow.rst:392 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "" "使用關鍵字 ``as`` 可以擷取子模式 (subpattern):\n" "\n" "::" -#: ../../tutorial/controlflow.rst:389 +#: ../../tutorial/controlflow.rst:396 msgid "" "will capture the second element of the input as ``p2`` (as long as the input " "is a sequence of two points)" @@ -468,7 +468,7 @@ msgstr "" "將會擷取輸入的第二個元素作為 ``p2``\\ (只要該輸入是一個由兩個點所組成的序" "列)。" -#: ../../tutorial/controlflow.rst:392 +#: ../../tutorial/controlflow.rst:399 msgid "" "Most literals are compared by equality, however the singletons ``True``, " "``False`` and ``None`` are compared by identity." @@ -476,7 +476,7 @@ msgstr "" "大部分的字面值是藉由相等性 (equality) 來比較,但是單例物件 (singleton) " "``True``\\ 、\\ ``False`` 和 ``None`` 是藉由標識值 (identity) 來比較。" -#: ../../tutorial/controlflow.rst:395 +#: ../../tutorial/controlflow.rst:402 msgid "" "Patterns may use named constants. These must be dotted names to prevent " "them from being interpreted as capture variable::" @@ -486,18 +486,18 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:414 +#: ../../tutorial/controlflow.rst:421 msgid "" "For a more detailed explanation and additional examples, you can look into :" "pep:`636` which is written in a tutorial format." msgstr "" "關於更詳細的解釋和其他範例,你可以閱讀 :pep:`636`,它是以教學的格式編寫而成。" -#: ../../tutorial/controlflow.rst:420 +#: ../../tutorial/controlflow.rst:427 msgid "Defining Functions" msgstr "定義函式 (function)" -#: ../../tutorial/controlflow.rst:422 +#: ../../tutorial/controlflow.rst:429 msgid "" "We can create a function that writes the Fibonacci series to an arbitrary " "boundary::" @@ -506,7 +506,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:442 +#: ../../tutorial/controlflow.rst:449 msgid "" "The keyword :keyword:`def` introduces a function *definition*. It must be " "followed by the function name and the parenthesized list of formal " @@ -516,7 +516,7 @@ msgstr "" "關鍵字 :keyword:`def` 介紹一個函式的\\ *定義*\\ 。它之後必須連著該函式的名稱" "和置於括號之中的一串參數。自下一行起,所有縮排的陳述式成為該函式的主體。" -#: ../../tutorial/controlflow.rst:447 +#: ../../tutorial/controlflow.rst:454 msgid "" "The first statement of the function body can optionally be a string literal; " "this string literal is the function's documentation string, or :dfn:" @@ -532,7 +532,7 @@ msgstr "" "件,或讓使用者能以互動的方式在原始碼中瀏覽文件。在原始碼中加入 docstring 是個" "好慣例,應該養成這樣的習慣。" -#: ../../tutorial/controlflow.rst:454 +#: ../../tutorial/controlflow.rst:461 msgid "" "The *execution* of a function introduces a new symbol table used for the " "local variables of the function. More precisely, all variable assignments " @@ -553,7 +553,7 @@ msgstr "" "域變數是在 :keyword:`global` 陳述式中被定義,或外層函式變數在 :keyword:" "`nonlocal` 陳述式中被定義)。" -#: ../../tutorial/controlflow.rst:465 +#: ../../tutorial/controlflow.rst:472 msgid "" "The actual parameters (arguments) to a function call are introduced in the " "local symbol table of the called function when it is called; thus, arguments " @@ -568,7 +568,7 @@ msgstr "" "函式呼叫別的函式或遞迴呼叫它自己時,在被呼叫的函式中會建立一個新的區域符號" "表。" -#: ../../tutorial/controlflow.rst:472 +#: ../../tutorial/controlflow.rst:479 msgid "" "A function definition associates the function name with the function object " "in the current symbol table. The interpreter recognizes the object pointed " @@ -581,7 +581,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:483 +#: ../../tutorial/controlflow.rst:490 msgid "" "Coming from other languages, you might object that ``fib`` is not a function " "but a procedure since it doesn't return a value. In fact, even functions " @@ -598,7 +598,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:494 +#: ../../tutorial/controlflow.rst:501 msgid "" "It is simple to write a function that returns a list of the numbers of the " "Fibonacci series, instead of printing it::" @@ -607,11 +607,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:510 +#: ../../tutorial/controlflow.rst:517 msgid "This example, as usual, demonstrates some new Python features:" msgstr "這個例子一樣示範了一些新的 Python 特性:" -#: ../../tutorial/controlflow.rst:512 +#: ../../tutorial/controlflow.rst:519 msgid "" "The :keyword:`return` statement returns with a value from a function. :" "keyword:`!return` without an expression argument returns ``None``. Falling " @@ -621,7 +621,7 @@ msgstr "" "不外加一個運算式作為引數時會回傳 ``None``\\ 。一個函式執行到結束也會回傳 " "``None``\\ 。" -#: ../../tutorial/controlflow.rst:516 +#: ../../tutorial/controlflow.rst:523 msgid "" "The statement ``result.append(a)`` calls a *method* of the list object " "``result``. A method is a function that 'belongs' to an object and is named " @@ -643,22 +643,22 @@ msgstr "" "method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同" "於 ``result = result + [a]``\\ ,但更有效率。" -#: ../../tutorial/controlflow.rst:531 +#: ../../tutorial/controlflow.rst:538 msgid "More on Defining Functions" msgstr "深入了解函式定義" -#: ../../tutorial/controlflow.rst:533 +#: ../../tutorial/controlflow.rst:540 msgid "" "It is also possible to define functions with a variable number of arguments. " "There are three forms, which can be combined." msgstr "" "定義函式時使用的引數 (argument) 數量是可變的。總共有三種可以組合使用的形式。" -#: ../../tutorial/controlflow.rst:540 +#: ../../tutorial/controlflow.rst:547 msgid "Default Argument Values" msgstr "預設引數值" -#: ../../tutorial/controlflow.rst:542 +#: ../../tutorial/controlflow.rst:549 msgid "" "The most useful form is to specify a default value for one or more " "arguments. This creates a function that can be called with fewer arguments " @@ -669,22 +669,22 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:558 +#: ../../tutorial/controlflow.rst:565 msgid "This function can be called in several ways:" msgstr "該函式可以用以下幾種方式被呼叫:" -#: ../../tutorial/controlflow.rst:560 +#: ../../tutorial/controlflow.rst:567 msgid "" "giving only the mandatory argument: ``ask_ok('Do you really want to quit?')``" msgstr "只給必要引數:\\ ``ask_ok('Do you really want to quit?')``" -#: ../../tutorial/controlflow.rst:562 +#: ../../tutorial/controlflow.rst:569 msgid "" "giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', " "2)``" msgstr "給予一個選擇性引數:\\ ``ask_ok('OK to overwrite the file?', 2)``" -#: ../../tutorial/controlflow.rst:564 +#: ../../tutorial/controlflow.rst:571 msgid "" "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come " "on, only yes or no!')``" @@ -692,14 +692,14 @@ msgstr "" "給予所有引數:\\ ``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes " "or no!')``" -#: ../../tutorial/controlflow.rst:567 +#: ../../tutorial/controlflow.rst:574 msgid "" "This example also introduces the :keyword:`in` keyword. This tests whether " "or not a sequence contains a certain value." msgstr "" "此例也使用了關鍵字 :keyword:`in`\\ ,用於測試序列中是否包含某個特定值。" -#: ../../tutorial/controlflow.rst:570 +#: ../../tutorial/controlflow.rst:577 msgid "" "The default values are evaluated at the point of function definition in the " "*defining* scope, so that ::" @@ -708,11 +708,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:581 +#: ../../tutorial/controlflow.rst:588 msgid "will print ``5``." msgstr "將會輸出 ``5``\\ 。" -#: ../../tutorial/controlflow.rst:583 +#: ../../tutorial/controlflow.rst:590 msgid "" "**Important warning:** The default value is evaluated only once. This makes " "a difference when the default is a mutable object such as a list, " @@ -725,24 +725,24 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:596 +#: ../../tutorial/controlflow.rst:603 msgid "This will print ::" msgstr "" "將會輸出:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:602 +#: ../../tutorial/controlflow.rst:609 msgid "" "If you don't want the default to be shared between subsequent calls, you can " "write the function like this instead::" msgstr "如果不想在後續呼叫之間共用預設值,應以如下方式編寫函式:" -#: ../../tutorial/controlflow.rst:615 +#: ../../tutorial/controlflow.rst:622 msgid "Keyword Arguments" msgstr "關鍵字引數" -#: ../../tutorial/controlflow.rst:617 +#: ../../tutorial/controlflow.rst:624 msgid "" "Functions can also be called using :term:`keyword arguments ` of the form ``kwarg=value``. For instance, the following " @@ -753,7 +753,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:626 +#: ../../tutorial/controlflow.rst:633 msgid "" "accepts one required argument (``voltage``) and three optional arguments " "(``state``, ``action``, and ``type``). This function can be called in any " @@ -764,14 +764,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:637 +#: ../../tutorial/controlflow.rst:644 msgid "but all the following calls would be invalid::" msgstr "" "但以下呼叫方式都無效:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:644 +#: ../../tutorial/controlflow.rst:651 msgid "" "In a function call, keyword arguments must follow positional arguments. All " "the keyword arguments passed must match one of the arguments accepted by the " @@ -789,7 +789,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:660 +#: ../../tutorial/controlflow.rst:667 msgid "" "When a final formal parameter of the form ``**name`` is present, it receives " "a dictionary (see :ref:`typesmapping`) containing all keyword arguments " @@ -807,31 +807,31 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:677 +#: ../../tutorial/controlflow.rst:684 msgid "It could be called like this::" msgstr "" "它可以被如此呼叫:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:685 +#: ../../tutorial/controlflow.rst:692 msgid "and of course it would print:" msgstr "" "輸出結果如下:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:698 +#: ../../tutorial/controlflow.rst:705 msgid "" "Note that the order in which the keyword arguments are printed is guaranteed " "to match the order in which they were provided in the function call." msgstr "注意,關鍵字引數的輸出順序與呼叫函式時被提供的順序必定一致。" -#: ../../tutorial/controlflow.rst:702 +#: ../../tutorial/controlflow.rst:709 msgid "Special parameters" msgstr "特殊參數" -#: ../../tutorial/controlflow.rst:704 +#: ../../tutorial/controlflow.rst:711 msgid "" "By default, arguments may be passed to a Python function either by position " "or explicitly by keyword. For readability and performance, it makes sense to " @@ -843,11 +843,11 @@ msgstr "" "及效能,限制引數的傳遞方式是合理的,如此,開發者只需查看函式定義,即可確定各" "項目是按位置,按位置或關鍵字,還是按關鍵字傳遞。" -#: ../../tutorial/controlflow.rst:710 +#: ../../tutorial/controlflow.rst:717 msgid "A function definition may look like:" msgstr "函式定義可能如以下樣式:" -#: ../../tutorial/controlflow.rst:721 +#: ../../tutorial/controlflow.rst:728 msgid "" "where ``/`` and ``*`` are optional. If used, these symbols indicate the kind " "of parameter by how the arguments may be passed to the function: positional-" @@ -858,22 +858,22 @@ msgstr "" "類:僅限位置、位置或關鍵字、僅限關鍵字。關鍵字參數也稱為附名參數 (named " "parameters)。" -#: ../../tutorial/controlflow.rst:728 +#: ../../tutorial/controlflow.rst:735 msgid "Positional-or-Keyword Arguments" msgstr "位置或關鍵字引數 (Positional-or-Keyword Arguments)" -#: ../../tutorial/controlflow.rst:730 +#: ../../tutorial/controlflow.rst:737 msgid "" "If ``/`` and ``*`` are not present in the function definition, arguments may " "be passed to a function by position or by keyword." msgstr "" "若函式定義中未使用 ``/`` 和 ``*`` 時,引數可以按位置或關鍵字傳遞給函式。" -#: ../../tutorial/controlflow.rst:735 +#: ../../tutorial/controlflow.rst:742 msgid "Positional-Only Parameters" msgstr "僅限位置參數 (Positional-Only Parameters)" -#: ../../tutorial/controlflow.rst:737 +#: ../../tutorial/controlflow.rst:744 msgid "" "Looking at this in a bit more detail, it is possible to mark certain " "parameters as *positional-only*. If *positional-only*, the parameters' order " @@ -888,17 +888,17 @@ msgstr "" "``/``\\ (斜線)之前。\\ ``/`` 用於在邏輯上分開僅限位置參數與其餘參數。如果函" "式定義中沒有 ``/``\\ ,則表示沒有任何僅限位置參數。" -#: ../../tutorial/controlflow.rst:745 +#: ../../tutorial/controlflow.rst:752 msgid "" "Parameters following the ``/`` may be *positional-or-keyword* or *keyword-" "only*." msgstr "``/`` 後面的參數可以是\\ *位置或關鍵字*\\ 或\\ *僅限關鍵字*\\ 參數。" -#: ../../tutorial/controlflow.rst:749 +#: ../../tutorial/controlflow.rst:756 msgid "Keyword-Only Arguments" msgstr "僅限關鍵字引數 (Keyword-Only Arguments)" -#: ../../tutorial/controlflow.rst:751 +#: ../../tutorial/controlflow.rst:758 msgid "" "To mark parameters as *keyword-only*, indicating the parameters must be " "passed by keyword argument, place an ``*`` in the arguments list just before " @@ -907,11 +907,11 @@ msgstr "" "要把參數標記為\\ *僅限關鍵字*\\ ,表明參數必須以關鍵字引數傳遞,必須在引數列" "表中第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``\\ 。" -#: ../../tutorial/controlflow.rst:757 +#: ../../tutorial/controlflow.rst:764 msgid "Function Examples" msgstr "函式範例" -#: ../../tutorial/controlflow.rst:759 +#: ../../tutorial/controlflow.rst:766 msgid "" "Consider the following example function definitions paying close attention " "to the markers ``/`` and ``*``::" @@ -920,7 +920,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:775 +#: ../../tutorial/controlflow.rst:782 msgid "" "The first function definition, ``standard_arg``, the most familiar form, " "places no restrictions on the calling convention and arguments may be passed " @@ -931,7 +931,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:785 +#: ../../tutorial/controlflow.rst:792 msgid "" "The second function ``pos_only_arg`` is restricted to only use positional " "parameters as there is a ``/`` in the function definition::" @@ -940,7 +940,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:796 +#: ../../tutorial/controlflow.rst:803 msgid "" "The third function ``kwd_only_args`` only allows keyword arguments as " "indicated by a ``*`` in the function definition::" @@ -949,7 +949,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:807 +#: ../../tutorial/controlflow.rst:814 msgid "" "And the last uses all three calling conventions in the same function " "definition::" @@ -958,7 +958,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:827 +#: ../../tutorial/controlflow.rst:834 msgid "" "Finally, consider this function definition which has a potential collision " "between the positional argument ``name`` and ``**kwds`` which has ``name`` " @@ -969,7 +969,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:832 +#: ../../tutorial/controlflow.rst:839 msgid "" "There is no possible call that will make it return ``True`` as the keyword " "``'name'`` will always bind to the first parameter. For example::" @@ -979,7 +979,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:841 +#: ../../tutorial/controlflow.rst:848 msgid "" "But using ``/`` (positional only arguments), it is possible since it allows " "``name`` as a positional argument and ``'name'`` as a key in the keyword " @@ -990,17 +990,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:849 +#: ../../tutorial/controlflow.rst:856 msgid "" "In other words, the names of positional-only parameters can be used in " "``**kwds`` without ambiguity." msgstr "換句話說,僅限位置參數的名稱可以在 ``**kwds`` 中使用,而不產生歧義。" -#: ../../tutorial/controlflow.rst:854 +#: ../../tutorial/controlflow.rst:861 msgid "Recap" msgstr "回顧" -#: ../../tutorial/controlflow.rst:856 +#: ../../tutorial/controlflow.rst:863 msgid "" "The use case will determine which parameters to use in the function " "definition::" @@ -1009,11 +1009,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:860 +#: ../../tutorial/controlflow.rst:867 msgid "As guidance:" msgstr "說明:" -#: ../../tutorial/controlflow.rst:862 +#: ../../tutorial/controlflow.rst:869 msgid "" "Use positional-only if you want the name of the parameters to not be " "available to the user. This is useful when parameter names have no real " @@ -1025,7 +1025,7 @@ msgstr "" "想控制引數在函式呼叫的排列順序,或同時使用位置參數和任意關鍵字時,這種方式很" "有用。" -#: ../../tutorial/controlflow.rst:867 +#: ../../tutorial/controlflow.rst:874 msgid "" "Use keyword-only when names have meaning and the function definition is more " "understandable by being explicit with names or you want to prevent users " @@ -1034,7 +1034,7 @@ msgstr "" "當參數名稱有意義,且明確的名稱可讓函式定義更易理解,或是你不希望使用者依賴引" "數被傳遞時的位置時,請使用僅限關鍵字。" -#: ../../tutorial/controlflow.rst:870 +#: ../../tutorial/controlflow.rst:877 msgid "" "For an API, use positional-only to prevent breaking API changes if the " "parameter's name is modified in the future." @@ -1042,11 +1042,11 @@ msgstr "" "對於應用程式介面 (API),使用僅限位置,以防止未來參數名稱被修改時造成 API 的中" "斷性變更。" -#: ../../tutorial/controlflow.rst:876 +#: ../../tutorial/controlflow.rst:883 msgid "Arbitrary Argument Lists" msgstr "任意引數列表 (Arbitrary Argument Lists)" -#: ../../tutorial/controlflow.rst:881 +#: ../../tutorial/controlflow.rst:888 msgid "" "Finally, the least frequently used option is to specify that a function can " "be called with an arbitrary number of arguments. These arguments will be " @@ -1059,7 +1059,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:890 +#: ../../tutorial/controlflow.rst:897 msgid "" "Normally, these *variadic* arguments will be last in the list of formal " "parameters, because they scoop up all remaining input arguments that are " @@ -1073,11 +1073,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:907 +#: ../../tutorial/controlflow.rst:914 msgid "Unpacking Argument Lists" msgstr "拆解引數列表(Unpacking Argument Lists)" -#: ../../tutorial/controlflow.rst:909 +#: ../../tutorial/controlflow.rst:916 msgid "" "The reverse situation occurs when the arguments are already in a list or " "tuple but need to be unpacked for a function call requiring separate " @@ -1093,7 +1093,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:925 +#: ../../tutorial/controlflow.rst:932 msgid "" "In the same fashion, dictionaries can deliver keyword arguments with the " "``**``\\ -operator::" @@ -1102,11 +1102,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:941 +#: ../../tutorial/controlflow.rst:948 msgid "Lambda Expressions" msgstr "Lambda 運算式" -#: ../../tutorial/controlflow.rst:943 +#: ../../tutorial/controlflow.rst:950 msgid "" "Small anonymous functions can be created with the :keyword:`lambda` keyword. " "This function returns the sum of its two arguments: ``lambda a, b: a+b``. " @@ -1123,7 +1123,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:960 +#: ../../tutorial/controlflow.rst:967 msgid "" "The above example uses a lambda expression to return a function. Another " "use is to pass a small function as an argument::" @@ -1133,17 +1133,17 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:972 +#: ../../tutorial/controlflow.rst:979 msgid "Documentation Strings" msgstr "說明文件字串 (Documentation Strings)" -#: ../../tutorial/controlflow.rst:979 +#: ../../tutorial/controlflow.rst:986 msgid "" "Here are some conventions about the content and formatting of documentation " "strings." msgstr "以下是關於說明文件字串內容和格式的慣例。" -#: ../../tutorial/controlflow.rst:982 +#: ../../tutorial/controlflow.rst:989 msgid "" "The first line should always be a short, concise summary of the object's " "purpose. For brevity, it should not explicitly state the object's name or " @@ -1155,7 +1155,7 @@ msgstr "" "的名稱或型別,因為有其他方法可以達到相同目的(除非該名稱剛好是一個描述函式運" "算的動詞)。這一行應以大寫字母開頭,以句號結尾。" -#: ../../tutorial/controlflow.rst:988 +#: ../../tutorial/controlflow.rst:995 msgid "" "If there are more lines in the documentation string, the second line should " "be blank, visually separating the summary from the rest of the description. " @@ -1165,7 +1165,7 @@ msgstr "" "文件字串為多行時,第二行應為空白行,在視覺上將摘要與其餘描述分開。後面幾行可" "包含一或多個段落,描述此物件的呼叫慣例、副作用等。" -#: ../../tutorial/controlflow.rst:993 +#: ../../tutorial/controlflow.rst:1000 msgid "" "The Python parser does not strip indentation from multi-line string literals " "in Python, so tools that process documentation have to strip indentation if " @@ -1187,18 +1187,18 @@ msgstr "" "出現了,這些行的全部前導空白字元都應被去除。展開 tab 鍵後(通常為八個空格)," "應測試空白字元量是否等價。" -#: ../../tutorial/controlflow.rst:1005 +#: ../../tutorial/controlflow.rst:1012 msgid "Here is an example of a multi-line docstring::" msgstr "" "下面是多行說明字串的一個範例:\n" "\n" "::" -#: ../../tutorial/controlflow.rst:1023 +#: ../../tutorial/controlflow.rst:1030 msgid "Function Annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1031 +#: ../../tutorial/controlflow.rst:1038 msgid "" ":ref:`Function annotations ` are completely optional metadata " "information about the types used by user-defined functions (see :pep:`3107` " @@ -1207,7 +1207,7 @@ msgstr "" ":ref:`函式註釋 `\\ 是選擇性的元資料(metadata)資訊,描述使用者定義" "函式所使用的型別(更多資訊詳見 :pep:`3107` 和 :pep:`484`\\ )。" -#: ../../tutorial/controlflow.rst:1035 +#: ../../tutorial/controlflow.rst:1042 msgid "" ":term:`Annotations ` are stored in the :attr:" "`__annotations__` attribute of the function as a dictionary and have no " @@ -1227,11 +1227,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/controlflow.rst:1057 +#: ../../tutorial/controlflow.rst:1064 msgid "Intermezzo: Coding Style" msgstr "間奏曲:程式碼風格 (Coding Style)" -#: ../../tutorial/controlflow.rst:1062 +#: ../../tutorial/controlflow.rst:1069 msgid "" "Now that you are about to write longer, more complex pieces of Python, it is " "a good time to talk about *coding style*. Most languages can be written (or " @@ -1244,7 +1244,7 @@ msgstr "" "式比其他的更具可讀性。能讓其他人輕鬆閱讀你的程式碼永遠是一個好主意,而使用優" "良的編碼樣式對此有極大的幫助。" -#: ../../tutorial/controlflow.rst:1068 +#: ../../tutorial/controlflow.rst:1075 msgid "" "For Python, :pep:`8` has emerged as the style guide that most projects " "adhere to; it promotes a very readable and eye-pleasing coding style. Every " @@ -1254,11 +1254,11 @@ msgstr "" "對於 Python,大多數的專案都遵循 :pep:`8` 的樣式指南;它推行的編碼樣式相當可讀" "且賞心悅目。每個 Python 開發者都應該花點時間研讀;這裡是該指南的核心重點:" -#: ../../tutorial/controlflow.rst:1073 +#: ../../tutorial/controlflow.rst:1080 msgid "Use 4-space indentation, and no tabs." msgstr "用 4 個空格縮排,不要用 tab 鍵。" -#: ../../tutorial/controlflow.rst:1075 +#: ../../tutorial/controlflow.rst:1082 msgid "" "4 spaces are a good compromise between small indentation (allows greater " "nesting depth) and large indentation (easier to read). Tabs introduce " @@ -1267,11 +1267,11 @@ msgstr "" "4 個空格是小縮排(容許更大的巢套深度)和大縮排(較易閱讀)之間的折衷方案。" "Tab 鍵會造成混亂,最好別用。" -#: ../../tutorial/controlflow.rst:1079 +#: ../../tutorial/controlflow.rst:1086 msgid "Wrap lines so that they don't exceed 79 characters." msgstr "換行,使一行不超過 79 個字元。" -#: ../../tutorial/controlflow.rst:1081 +#: ../../tutorial/controlflow.rst:1088 msgid "" "This helps users with small displays and makes it possible to have several " "code files side-by-side on larger displays." @@ -1279,21 +1279,21 @@ msgstr "" "換行能讓使用小顯示器的使用者方便閱讀,也可以在較大顯示器上並排陳列多個程式碼" "檔案。" -#: ../../tutorial/controlflow.rst:1084 +#: ../../tutorial/controlflow.rst:1091 msgid "" "Use blank lines to separate functions and classes, and larger blocks of code " "inside functions." msgstr "用空行分隔函式和 class(類別),及函式內較大塊的程式碼。" -#: ../../tutorial/controlflow.rst:1087 +#: ../../tutorial/controlflow.rst:1094 msgid "When possible, put comments on a line of their own." msgstr "如果可以,把註解放在單獨一行。" -#: ../../tutorial/controlflow.rst:1089 +#: ../../tutorial/controlflow.rst:1096 msgid "Use docstrings." msgstr "使用說明字串。" -#: ../../tutorial/controlflow.rst:1091 +#: ../../tutorial/controlflow.rst:1098 msgid "" "Use spaces around operators and after commas, but not directly inside " "bracketing constructs: ``a = f(1, 2) + g(3, 4)``." @@ -1301,7 +1301,7 @@ msgstr "" "運算子前後、逗號後要加空格,但不要直接放在括號內側:\\ ``a = f(1, 2) + g(3, " "4)``\\ 。" -#: ../../tutorial/controlflow.rst:1094 +#: ../../tutorial/controlflow.rst:1101 msgid "" "Name your classes and functions consistently; the convention is to use " "``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for " @@ -1313,7 +1313,7 @@ msgstr "" "底線)。永遠用 ``self`` 作為 method 第一個引數的名稱(關於 class 和 method," "詳見 :ref:`tut-firstclasses`\\ )。" -#: ../../tutorial/controlflow.rst:1099 +#: ../../tutorial/controlflow.rst:1106 msgid "" "Don't use fancy encodings if your code is meant to be used in international " "environments. Python's default, UTF-8, or even plain ASCII work best in any " @@ -1322,7 +1322,7 @@ msgstr "" "若程式碼是為了用於國際環境時,不要用花俏的編碼。Python 預設的 UTF-8 或甚至普" "通的 ASCII,就可以勝任各種情況。" -#: ../../tutorial/controlflow.rst:1103 +#: ../../tutorial/controlflow.rst:1110 msgid "" "Likewise, don't use non-ASCII characters in identifiers if there is only the " "slightest chance people speaking a different language will read or maintain " @@ -1331,11 +1331,11 @@ msgstr "" "同樣地,若不同語言使用者閱讀或維護程式碼的可能性微乎其微,就不要在命名時使用" "非 ASCII 字元。" -#: ../../tutorial/controlflow.rst:1109 +#: ../../tutorial/controlflow.rst:1116 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/controlflow.rst:1110 +#: ../../tutorial/controlflow.rst:1117 msgid "" "Actually, *call by object reference* would be a better description, since if " "a mutable object is passed, the caller will see any changes the callee makes " @@ -1353,54 +1353,54 @@ msgstr "statement(陳述式)" msgid "for" msgstr "for" -#: ../../tutorial/controlflow.rst:437 ../../tutorial/controlflow.rst:974 +#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981 msgid "documentation strings" msgstr "ddocumentation strings(說明字串)" -#: ../../tutorial/controlflow.rst:437 ../../tutorial/controlflow.rst:974 +#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981 msgid "docstrings" msgstr "docstrings(說明字串)" -#: ../../tutorial/controlflow.rst:437 ../../tutorial/controlflow.rst:974 +#: ../../tutorial/controlflow.rst:444 ../../tutorial/controlflow.rst:981 msgid "strings, documentation" msgstr "strings(字串), documentation(說明文件)" -#: ../../tutorial/controlflow.rst:878 +#: ../../tutorial/controlflow.rst:885 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../tutorial/controlflow.rst:878 ../../tutorial/controlflow.rst:922 +#: ../../tutorial/controlflow.rst:885 ../../tutorial/controlflow.rst:929 msgid "in function calls" msgstr "於函式呼叫中" -#: ../../tutorial/controlflow.rst:922 +#: ../../tutorial/controlflow.rst:929 msgid "**" msgstr "**" -#: ../../tutorial/controlflow.rst:1026 +#: ../../tutorial/controlflow.rst:1033 msgid "function" msgstr "function(函式)" -#: ../../tutorial/controlflow.rst:1026 +#: ../../tutorial/controlflow.rst:1033 msgid "annotations" msgstr "annotations(註釋)" -#: ../../tutorial/controlflow.rst:1026 +#: ../../tutorial/controlflow.rst:1033 msgid "->" msgstr "->" -#: ../../tutorial/controlflow.rst:1026 +#: ../../tutorial/controlflow.rst:1033 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../tutorial/controlflow.rst:1026 +#: ../../tutorial/controlflow.rst:1033 msgid ": (colon)" msgstr ": (冒號)" -#: ../../tutorial/controlflow.rst:1060 +#: ../../tutorial/controlflow.rst:1067 msgid "coding" msgstr "coding(程式編寫)" -#: ../../tutorial/controlflow.rst:1060 +#: ../../tutorial/controlflow.rst:1067 msgid "style" msgstr "style(風格)" diff --git a/tutorial/errors.po b/tutorial/errors.po index d09bbd2026..819a972bf7 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-06 00:20+0000\n" +"POT-Creation-Date: 2023-07-06 16:53+0000\n" "PO-Revision-Date: 2022-10-24 14:54+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -197,8 +197,8 @@ msgid "" msgstr "" ":keyword:`try` 陳述式可以有不只一個 *except 子句*\\ ,為不同的例外指定處理" "者,而最多只有一個處理者會被執行。處理者只處理對應的 try 子句中發生的例外,而" -"不會處理同一 :keyword:`!try` 陳述式裡其他處理者內的例外。一個 *except 子句*" -"\\ 可以用一組括號內的 tuple 列舉多個例外,例如:\n" +"不會處理同一 :keyword:`!try` 陳述式裡其他處理者內的例外。一個 *except 子句" +"*\\ 可以用一組括號內的 tuple 列舉多個例外,例如:\n" "\n" "::" @@ -626,9 +626,9 @@ msgid "" "that they can be raised together. It is an exception itself, so it can be " "caught like any other exception. ::" msgstr "" -"內建的 :exc:`ExceptionGroup` 會包裝一個例外實例 (exception instance) 的 " -"list(串列),使得它們可以一起被引發。由於它本身就是一個例外,因此它也可以像" -"任何其他例外一樣被捕獲。\n" +"內建的 :exc:`ExceptionGroup` 會包裝一個例外實例 (exception instance) 的 list" +"(串列),使得它們可以一起被引發。由於它本身就是一個例外,因此它也可以像任何" +"其他例外一樣被捕獲。\n" "\n" "::" @@ -659,11 +659,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:582 +#: ../../tutorial/errors.rst:584 msgid "Enriching Exceptions with Notes" msgstr "用註解使例外更詳細" -#: ../../tutorial/errors.rst:584 +#: ../../tutorial/errors.rst:586 msgid "" "When an exception is created in order to be raised, it is usually " "initialized with information that describes the error that has occurred. " @@ -681,7 +681,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:605 +#: ../../tutorial/errors.rst:607 msgid "" "For example, when collecting exceptions into an exception group, we may want " "to add context information for the individual errors. In the following each "