diff --git a/howto/clinic.po b/howto/clinic.po index bd5548c581..eb225b5e6e 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-21 09:32+0000\n" +"POT-Creation-Date: 2023-07-25 00:04+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-" @@ -138,30 +138,30 @@ msgstr "" #: ../../howto/clinic.rst:99 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:" +"Argument Clinic ships with CPython; you'll find it in :source:`Tools/clinic/" +"clinic.py`. If you run that script, specifying a C file as an argument:" msgstr "" -#: ../../howto/clinic.rst:106 +#: ../../howto/clinic.rst:107 msgid "" "Argument Clinic will scan over the file looking for lines that look exactly " "like this:" msgstr "" -#: ../../howto/clinic.rst:113 +#: ../../howto/clinic.rst:114 msgid "" "When it finds one, it reads everything up to a line that looks exactly like " "this:" msgstr "" -#: ../../howto/clinic.rst:120 +#: ../../howto/clinic.rst:121 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:124 +#: ../../howto/clinic.rst:125 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 " @@ -169,7 +169,7 @@ msgid "" "this:" msgstr "" -#: ../../howto/clinic.rst:137 +#: ../../howto/clinic.rst:138 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 " @@ -177,7 +177,7 @@ msgid "" "change either." msgstr "" -#: ../../howto/clinic.rst:141 +#: ../../howto/clinic.rst:142 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 " @@ -186,38 +186,38 @@ msgid "" "output.)" msgstr "" -#: ../../howto/clinic.rst:146 +#: ../../howto/clinic.rst:147 msgid "" "For the sake of clarity, here's the terminology we'll use with Argument " "Clinic:" msgstr "" -#: ../../howto/clinic.rst:148 +#: ../../howto/clinic.rst:149 msgid "" "The first line of the comment (``/*[clinic input]``) is the *start line*." msgstr "" -#: ../../howto/clinic.rst:149 +#: ../../howto/clinic.rst:150 msgid "" "The last line of the initial comment (``[clinic start generated code]*/``) " "is the *end line*." msgstr "" -#: ../../howto/clinic.rst:150 +#: ../../howto/clinic.rst:151 msgid "" "The last line (``/*[clinic end generated code: checksum=...]*/``) is the " "*checksum line*." msgstr "" -#: ../../howto/clinic.rst:151 +#: ../../howto/clinic.rst:152 msgid "In between the start line and the end line is the *input*." msgstr "" -#: ../../howto/clinic.rst:152 +#: ../../howto/clinic.rst:153 msgid "In between the end line and the checksum line is the *output*." msgstr "" -#: ../../howto/clinic.rst:153 +#: ../../howto/clinic.rst:154 msgid "" "All the text collectively, from the start line to the checksum line " "inclusively, is the *block*. (A block that hasn't been successfully " @@ -225,11 +225,11 @@ msgid "" "it's still considered a block.)" msgstr "" -#: ../../howto/clinic.rst:162 +#: ../../howto/clinic.rst:163 msgid "Tutorial" msgstr "" -#: ../../howto/clinic.rst:164 +#: ../../howto/clinic.rst:165 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 " @@ -240,30 +240,31 @@ msgid "" "keep it simple for this walkthrough so you can learn." msgstr "" -#: ../../howto/clinic.rst:173 +#: ../../howto/clinic.rst:174 msgid "Let's dive in!" msgstr "" -#: ../../howto/clinic.rst:175 +#: ../../howto/clinic.rst:176 msgid "" "Make sure you're working with a freshly updated checkout of the CPython " "trunk." msgstr "" -#: ../../howto/clinic.rst:178 +#: ../../howto/clinic.rst:179 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()``." +"Argument Clinic yet. For my example I'm using :py:meth:`_pickle.Pickler.dump " +"`." msgstr "" -#: ../../howto/clinic.rst:183 +#: ../../howto/clinic.rst:185 msgid "" -"If the call to the ``PyArg_Parse`` function uses any of the following format " -"units:" +"If the call to the :c:func:`!PyArg_Parse*` function uses any of the " +"following format units:" msgstr "" -#: ../../howto/clinic.rst:195 +#: ../../howto/clinic.rst:197 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 " @@ -271,21 +272,21 @@ msgid "" "your first function." msgstr "" -#: ../../howto/clinic.rst:200 +#: ../../howto/clinic.rst:202 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 " -"same argument, or if the function uses something besides PyArg_Parse " -"functions to parse its arguments, it probably isn't suitable for conversion " -"to Argument Clinic. Argument Clinic doesn't support generic functions or " -"polymorphic parameters." +"Also, if the function has multiple calls to :c:func:`!PyArg_ParseTuple` or :" +"c:func:`PyArg_ParseTupleAndKeywords` where it supports different types for " +"the same argument, or if the function uses something besides :c:func:`!" +"PyArg_Parse*` functions to parse its arguments, it probably isn't suitable " +"for conversion to Argument Clinic. Argument Clinic doesn't support generic " +"functions or polymorphic parameters." msgstr "" -#: ../../howto/clinic.rst:207 +#: ../../howto/clinic.rst:209 msgid "Add the following boilerplate above the function, creating our block::" msgstr "" -#: ../../howto/clinic.rst:212 +#: ../../howto/clinic.rst:214 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 " @@ -293,22 +294,22 @@ msgid "" "80 characters. (Argument Clinic will preserve indents inside the docstring.)" msgstr "" -#: ../../howto/clinic.rst:218 +#: ../../howto/clinic.rst:220 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 " -"``help()`` on your builtin in the future, the first line will be built " +"throw that line away. (The docstring doesn't need it anymore—when you use :" +"py:func:`help` on your builtin in the future, the first line will be built " "automatically based on the function's signature.)" msgstr "" -#: ../../howto/clinic.rst:224 ../../howto/clinic.rst:245 -#: ../../howto/clinic.rst:269 ../../howto/clinic.rst:327 -#: ../../howto/clinic.rst:367 ../../howto/clinic.rst:394 -#: ../../howto/clinic.rst:500 ../../howto/clinic.rst:552 +#: ../../howto/clinic.rst:226 ../../howto/clinic.rst:247 +#: ../../howto/clinic.rst:271 ../../howto/clinic.rst:329 +#: ../../howto/clinic.rst:369 ../../howto/clinic.rst:396 +#: ../../howto/clinic.rst:502 ../../howto/clinic.rst:554 msgid "Sample::" msgstr "" -#: ../../howto/clinic.rst:230 +#: ../../howto/clinic.rst:232 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 " @@ -316,13 +317,13 @@ msgid "" "docstring." msgstr "" -#: ../../howto/clinic.rst:235 +#: ../../howto/clinic.rst:237 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:238 +#: ../../howto/clinic.rst:240 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 " @@ -331,7 +332,7 @@ msgid "" "it should include the class name too." msgstr "" -#: ../../howto/clinic.rst:253 +#: ../../howto/clinic.rst:255 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 " @@ -341,47 +342,47 @@ msgid "" "next to each other.)" msgstr "" -#: ../../howto/clinic.rst:261 +#: ../../howto/clinic.rst:263 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:265 +#: ../../howto/clinic.rst:267 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." +"class, and a pointer to the :c:type:`!PyTypeObject` for this class." msgstr "" -#: ../../howto/clinic.rst:285 +#: ../../howto/clinic.rst:287 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:289 +#: ../../howto/clinic.rst:291 msgid "The general form of these parameter lines is as follows:" msgstr "" -#: ../../howto/clinic.rst:295 +#: ../../howto/clinic.rst:297 msgid "If the parameter has a default value, add that after the converter:" msgstr "" -#: ../../howto/clinic.rst:302 +#: ../../howto/clinic.rst:304 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:306 +#: ../../howto/clinic.rst:308 msgid "Add a blank line below the parameters." msgstr "" -#: ../../howto/clinic.rst:308 +#: ../../howto/clinic.rst:310 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. " @@ -390,68 +391,69 @@ msgid "" "easier." msgstr "" -#: ../../howto/clinic.rst:315 +#: ../../howto/clinic.rst:317 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 " +"For each parameter, copy the \"format unit\" for that parameter from the :c:" +"func:`PyArg_Parse` format argument and specify *that* as its converter, as a " "quoted string. (\"format unit\" is the formal name for the one-to-three " -"character substring of the ``format`` parameter that tells the argument " +"character substring of the *format* parameter that tells the argument " "parsing function what the type of the variable is and how to convert it. " "For more on format units please see :ref:`arg-parsing`.)" msgstr "" -#: ../../howto/clinic.rst:324 +#: ../../howto/clinic.rst:326 msgid "" "For multicharacter format units like ``z#``, use the entire two-or-three " "character string." msgstr "" -#: ../../howto/clinic.rst:342 +#: ../../howto/clinic.rst:344 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:347 +#: ../../howto/clinic.rst:349 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:352 -msgid "(``_pickle.Pickler.dump`` has neither, so our sample is unchanged.)" +#: ../../howto/clinic.rst:354 +msgid "" +"(:py:meth:`!_pickle.Pickler.dump` has neither, so our sample is unchanged.)" msgstr "" -#: ../../howto/clinic.rst:355 +#: ../../howto/clinic.rst:357 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:359 +#: ../../howto/clinic.rst:361 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:363 +#: ../../howto/clinic.rst:365 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:383 +#: ../../howto/clinic.rst:385 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:387 +#: ../../howto/clinic.rst:389 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. " @@ -461,34 +463,34 @@ msgid "" "you wish." msgstr "" -#: ../../howto/clinic.rst:411 +#: ../../howto/clinic.rst:413 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::" +"luck everything worked---your block now has output, and a :file:`.c.h` file " +"has been generated! Reopen the file in your text editor to see::" msgstr "" -#: ../../howto/clinic.rst:430 +#: ../../howto/clinic.rst:432 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:434 +#: ../../howto/clinic.rst:436 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::" +"For readability, most of the glue code has been generated to a :file:`.c.h` " +"file. You'll need to include that in your original :file:`.c` file, " +"typically right after the clinic module block::" msgstr "" -#: ../../howto/clinic.rst:440 +#: ../../howto/clinic.rst:442 msgid "" "Double-check that the argument-parsing code Argument Clinic generated looks " "basically the same as the existing code." msgstr "" -#: ../../howto/clinic.rst:443 +#: ../../howto/clinic.rst:445 msgid "" "First, ensure both places use the same argument-parsing function. The " "existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" @@ -496,21 +498,21 @@ msgid "" "Clinic calls the *exact* same function." msgstr "" -#: ../../howto/clinic.rst:449 +#: ../../howto/clinic.rst:451 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-" +"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:454 +#: ../../howto/clinic.rst:456 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:459 +#: ../../howto/clinic.rst:461 msgid "" "Third, for parameters whose format units require two arguments (like a " "length variable, or an encoding string, or a pointer to a conversion " @@ -518,27 +520,27 @@ msgid "" "two invocations." msgstr "" -#: ../../howto/clinic.rst:464 +#: ../../howto/clinic.rst:466 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:471 +#: ../../howto/clinic.rst:473 msgid "" "This static structure should be *exactly* the same as the existing static :c:" -"type:`PyMethodDef` structure for this builtin." +"type:`!PyMethodDef` structure for this builtin." msgstr "" -#: ../../howto/clinic.rst:474 +#: ../../howto/clinic.rst:476 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:479 +#: ../../howto/clinic.rst:481 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 " @@ -549,74 +551,74 @@ msgid "" "used different names for these variables, fix it." msgstr "" -#: ../../howto/clinic.rst:487 +#: ../../howto/clinic.rst:489 msgid "" "Let's reiterate, just because it's kind of weird. Your code should now look " "like this::" msgstr "" -#: ../../howto/clinic.rst:496 +#: ../../howto/clinic.rst:498 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:541 +#: ../../howto/clinic.rst:543 msgid "" "Remember the macro with the :c:type:`PyMethodDef` structure for this " -"function? Find the existing :c:type:`PyMethodDef` structure for this " +"function? Find the existing :c:type:`!PyMethodDef` structure for this " "function and replace it with a reference to the macro. (If the builtin is " "at module scope, this will probably be very near the end of the file; if the " "builtin is a class method, this will probably be below but relatively near " "to the implementation.)" msgstr "" -#: ../../howto/clinic.rst:548 +#: ../../howto/clinic.rst:550 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, " +"replace the existing static :c:type:`!PyMethodDef` structure with the macro, " "*don't* add a comma to the end." msgstr "" -#: ../../howto/clinic.rst:561 +#: ../../howto/clinic.rst:563 msgid "Argument Clinic may generate new instances of ``_Py_ID``. For example::" msgstr "" -#: ../../howto/clinic.rst:565 +#: ../../howto/clinic.rst:567 msgid "" -"If it does, you'll have to run ``Tools/scripts/generate_global_objects.py`` " -"to regenerate the list of precompiled identifiers at this point." +"If it does, you'll have to run ``make regen-global-objects`` to regenerate " +"the list of precompiled identifiers at this point." msgstr "" -#: ../../howto/clinic.rst:569 +#: ../../howto/clinic.rst:571 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:573 +#: ../../howto/clinic.rst:575 msgid "" -"Well, except for one difference: ``inspect.signature()`` run on your " +"Well, except for one difference: :py:func:`inspect.signature` run on your " "function should now provide a valid signature!" msgstr "" -#: ../../howto/clinic.rst:576 +#: ../../howto/clinic.rst:578 msgid "" "Congratulations, you've ported your first function to work with Argument " "Clinic!" msgstr "" -#: ../../howto/clinic.rst:582 +#: ../../howto/clinic.rst:584 msgid "How-to guides" msgstr "" -#: ../../howto/clinic.rst:586 -msgid "How to to rename C functions and variables generated by Argument Clinic" +#: ../../howto/clinic.rst:588 +msgid "How to rename C functions and variables generated by Argument Clinic" msgstr "" -#: ../../howto/clinic.rst:588 +#: ../../howto/clinic.rst:590 msgid "" "Argument Clinic automatically names the functions it generates for you. " "Occasionally this may cause a problem, if the generated name collides with " @@ -628,19 +630,19 @@ msgid "" "impl function." msgstr "" -#: ../../howto/clinic.rst:596 +#: ../../howto/clinic.rst:598 msgid "" -"For example, if we wanted to rename the C function names generated for " -"``pickle.Pickler.dump``, it'd look like this::" +"For example, if we wanted to rename the C function names generated for :py:" +"meth:`pickle.Pickler.dump`, it'd look like this::" msgstr "" -#: ../../howto/clinic.rst:604 +#: ../../howto/clinic.rst:606 msgid "" -"The base function would now be named ``pickler_dumper()``, and the impl " -"function would now be named ``pickler_dumper_impl()``." +"The base function would now be named :c:func:`!pickler_dumper`, and the impl " +"function would now be named :c:func:`!pickler_dumper_impl`." msgstr "" -#: ../../howto/clinic.rst:608 +#: ../../howto/clinic.rst:610 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 " @@ -648,40 +650,40 @@ msgid "" "using the same ``\"as\"`` syntax::" msgstr "" -#: ../../howto/clinic.rst:622 +#: ../../howto/clinic.rst:624 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``." +"would be *file*, but the C variable would be named ``file_obj``." msgstr "" -#: ../../howto/clinic.rst:625 -msgid "You can use this to rename the ``self`` parameter too!" +#: ../../howto/clinic.rst:627 +msgid "You can use this to rename the *self* parameter too!" msgstr "" -#: ../../howto/clinic.rst:629 +#: ../../howto/clinic.rst:631 msgid "How to convert functions using ``PyArg_UnpackTuple``" msgstr "" -#: ../../howto/clinic.rst:631 +#: ../../howto/clinic.rst:633 msgid "" "To convert a function parsing its arguments with :c:func:" "`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " -"an ``object``. You may specify the ``type`` argument to cast the type as " +"an ``object``. You may specify the *type* argument to cast the type as " "appropriate. All arguments should be marked positional-only (add a ``/`` on " "a line by itself after the last argument)." msgstr "" -#: ../../howto/clinic.rst:637 +#: ../../howto/clinic.rst:639 msgid "" "Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " "will change soon." msgstr "" -#: ../../howto/clinic.rst:642 +#: ../../howto/clinic.rst:644 msgid "How to use optional groups" msgstr "" -#: ../../howto/clinic.rst:644 +#: ../../howto/clinic.rst:646 msgid "" "Some legacy functions have a tricky approach to parsing their arguments: " "they count the number of positional arguments, then use a ``switch`` " @@ -692,21 +694,21 @@ msgid "" "created." msgstr "" -#: ../../howto/clinic.rst:651 +#: ../../howto/clinic.rst:653 msgid "" -"While functions using this approach can often be converted to use :c:func:" -"`PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " +"While functions using this approach can often be converted to use :c:func:`!" +"PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " "not always possible. Some of these legacy functions have behaviors :c:func:" -"`PyArg_ParseTupleAndKeywords` doesn't directly support. The most obvious " -"example is the builtin function ``range()``, which has an optional argument " -"on the *left* side of its required argument! Another example is ``curses." -"window.addch()``, which has a group of two arguments that must always be " -"specified together. (The arguments are called ``x`` and ``y``; if you call " -"the function passing in ``x``, you must also pass in ``y``—and if you don't " -"pass in ``x`` you may not pass in ``y`` either.)" +"`!PyArg_ParseTupleAndKeywords` doesn't directly support. The most obvious " +"example is the builtin function :py:func:`range`, which has an optional " +"argument on the *left* side of its required argument! Another example is :py:" +"meth:`curses.window.addch`, which has a group of two arguments that must " +"always be specified together. (The arguments are called *x* and *y*; if you " +"call the function passing in *x*, you must also pass in *y* — and if you " +"don't pass in *x* you may not pass in *y* either.)" msgstr "" -#: ../../howto/clinic.rst:663 +#: ../../howto/clinic.rst:665 msgid "" "In any case, the goal of Argument Clinic is to support argument parsing for " "all existing CPython builtins without changing their semantics. Therefore " @@ -716,7 +718,7 @@ msgid "" "required arguments. They can *only* be used with positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:671 +#: ../../howto/clinic.rst:673 msgid "" "Optional groups are *only* intended for use when converting functions that " "make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " @@ -727,20 +729,20 @@ msgid "" "possible." msgstr "" -#: ../../howto/clinic.rst:680 +#: ../../howto/clinic.rst:682 msgid "" "To specify an optional group, add a ``[`` on a line by itself before the " "parameters you wish to group together, and a ``]`` on a line by itself after " -"these parameters. As an example, here's how ``curses.window.addch`` uses " -"optional groups to make the first two parameters and the last parameter " +"these parameters. As an example, here's how :py:meth:`curses.window.addch` " +"uses optional groups to make the first two parameters and the last parameter " "optional::" msgstr "" -#: ../../howto/clinic.rst:709 +#: ../../howto/clinic.rst:711 msgid "Notes:" msgstr "註解:" -#: ../../howto/clinic.rst:711 +#: ../../howto/clinic.rst:713 msgid "" "For every optional group, one additional parameter will be passed into the " "impl function representing the group. The parameter will be an int named " @@ -753,34 +755,34 @@ msgid "" "I mean whether or not the parameters received arguments in this invocation.)" msgstr "" -#: ../../howto/clinic.rst:722 +#: ../../howto/clinic.rst:724 msgid "" "If there are no required arguments, the optional groups will behave as if " "they're to the right of the required arguments." msgstr "" -#: ../../howto/clinic.rst:725 +#: ../../howto/clinic.rst:727 msgid "" "In the case of ambiguity, the argument parsing code favors parameters on the " "left (before the required parameters)." msgstr "" -#: ../../howto/clinic.rst:728 +#: ../../howto/clinic.rst:730 msgid "Optional groups can only contain positional-only parameters." msgstr "" -#: ../../howto/clinic.rst:730 +#: ../../howto/clinic.rst:732 msgid "" "Optional groups are *only* intended for legacy code. Please do not use " "optional groups for new code." msgstr "" -#: ../../howto/clinic.rst:735 +#: ../../howto/clinic.rst:737 msgid "" "How to use real Argument Clinic converters, instead of \"legacy converters\"" msgstr "" -#: ../../howto/clinic.rst:737 +#: ../../howto/clinic.rst:739 msgid "" "To save time, and to minimize how much you need to learn to achieve your " "first port to Argument Clinic, the walkthrough above tells you to use " @@ -789,38 +791,38 @@ msgid "" "be clear, their use is acceptable when porting code for Python 3.4." msgstr "" -#: ../../howto/clinic.rst:744 +#: ../../howto/clinic.rst:746 msgid "" "However, in the long term we probably want all our blocks to use Argument " "Clinic's real syntax for converters. Why? A couple reasons:" msgstr "" -#: ../../howto/clinic.rst:748 +#: ../../howto/clinic.rst:750 msgid "" "The proper converters are far easier to read and clearer in their intent." msgstr "" -#: ../../howto/clinic.rst:749 +#: ../../howto/clinic.rst:751 msgid "" "There are some format units that are unsupported as \"legacy converters\", " "because they require arguments, and the legacy converter syntax doesn't " "support specifying arguments." msgstr "" -#: ../../howto/clinic.rst:752 +#: ../../howto/clinic.rst:754 msgid "" "In the future we may have a new argument parsing library that isn't " "restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " "won't be available to parameters using legacy converters." msgstr "" -#: ../../howto/clinic.rst:756 +#: ../../howto/clinic.rst:758 msgid "" "Therefore, if you don't mind a little extra effort, please use the normal " "converters instead of legacy converters." msgstr "" -#: ../../howto/clinic.rst:759 +#: ../../howto/clinic.rst:761 msgid "" "In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " "like a Python function call. However, if there are no explicit arguments to " @@ -828,17 +830,17 @@ msgid "" "parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." msgstr "" -#: ../../howto/clinic.rst:765 +#: ../../howto/clinic.rst:767 msgid "" "All arguments to Argument Clinic converters are keyword-only. All Argument " "Clinic converters accept the following arguments:" msgstr "" -#: ../../howto/clinic.rst:773 ../../howto/clinic.rst:1353 -msgid "``c_default``" -msgstr "``c_default``" +#: ../../howto/clinic.rst:775 +msgid "*c_default*" +msgstr "*c_default*" -#: ../../howto/clinic.rst:769 +#: ../../howto/clinic.rst:771 msgid "" "The default value for this parameter when defined in C. Specifically, this " "will be the initializer for the variable declared in the \"parse " @@ -846,36 +848,36 @@ msgid "" "how to use this. Specified as a string." msgstr "" -#: ../../howto/clinic.rst:778 -msgid "``annotation``" -msgstr "``annotation``" +#: ../../howto/clinic.rst:780 +msgid "*annotation*" +msgstr "*annotation*" -#: ../../howto/clinic.rst:776 +#: ../../howto/clinic.rst:778 msgid "" "The annotation value for this parameter. Not currently supported, because :" "pep:`8` mandates that the Python library may not use annotations." msgstr "" -#: ../../howto/clinic.rst:781 -msgid "``unused``" -msgstr "``unused``" +#: ../../howto/clinic.rst:783 +msgid "*unused*" +msgstr "*unused*" -#: ../../howto/clinic.rst:781 +#: ../../howto/clinic.rst:783 msgid "" "Wrap the argument with :c:macro:`Py_UNUSED` in the impl function signature." msgstr "" -#: ../../howto/clinic.rst:783 +#: ../../howto/clinic.rst:785 msgid "" "In addition, some converters accept additional arguments. Here is a list of " "these arguments, along with their meanings:" msgstr "" -#: ../../howto/clinic.rst:792 -msgid "``accept``" -msgstr "``accept``" +#: ../../howto/clinic.rst:794 +msgid "*accept*" +msgstr "*accept*" -#: ../../howto/clinic.rst:787 +#: ../../howto/clinic.rst:789 msgid "" "A set of Python types (and possibly pseudo-types); this restricts the " "allowable Python argument to values of these types. (This is not a general-" @@ -883,68 +885,68 @@ msgid "" "shown in the legacy converter table.)" msgstr "" -#: ../../howto/clinic.rst:792 +#: ../../howto/clinic.rst:794 msgid "To accept ``None``, add ``NoneType`` to this set." msgstr "" -#: ../../howto/clinic.rst:797 -msgid "``bitwise``" -msgstr "``bitwise``" +#: ../../howto/clinic.rst:799 +msgid "*bitwise*" +msgstr "*bitwise*" -#: ../../howto/clinic.rst:795 +#: ../../howto/clinic.rst:797 msgid "" "Only supported for unsigned integers. The native integer value of this " "Python argument will be written to the parameter without any range checking, " "even for negative values." msgstr "" -#: ../../howto/clinic.rst:802 ../../howto/clinic.rst:1367 -msgid "``converter``" -msgstr "``converter``" +#: ../../howto/clinic.rst:804 +msgid "*converter*" +msgstr "*converter*" -#: ../../howto/clinic.rst:800 +#: ../../howto/clinic.rst:802 msgid "" "Only supported by the ``object`` converter. Specifies the name of a :ref:`C " "\"converter function\" ` to use to convert this object to a " "native type." msgstr "" -#: ../../howto/clinic.rst:807 -msgid "``encoding``" -msgstr "``encoding``" +#: ../../howto/clinic.rst:809 +msgid "*encoding*" +msgstr "*encoding*" -#: ../../howto/clinic.rst:805 +#: ../../howto/clinic.rst:807 msgid "" "Only supported for strings. Specifies the encoding to use when converting " "this string from a Python str (Unicode) value into a C ``char *`` value." msgstr "" -#: ../../howto/clinic.rst:811 -msgid "``subclass_of``" -msgstr "``subclass_of``" +#: ../../howto/clinic.rst:813 +msgid "*subclass_of*" +msgstr "*subclass_of*" -#: ../../howto/clinic.rst:810 +#: ../../howto/clinic.rst:812 msgid "" "Only supported for the ``object`` converter. Requires that the Python value " "be a subclass of a Python type, as expressed in C." msgstr "" -#: ../../howto/clinic.rst:816 ../../howto/clinic.rst:1339 -msgid "``type``" -msgstr "``type``" +#: ../../howto/clinic.rst:818 +msgid "*type*" +msgstr "" -#: ../../howto/clinic.rst:814 +#: ../../howto/clinic.rst:816 msgid "" "Only supported for the ``object`` and ``self`` converters. Specifies the C " "type that will be used to declare the variable. Default value is " "``\"PyObject *\"``." msgstr "" -#: ../../howto/clinic.rst:822 -msgid "``zeroes``" -msgstr "``zeroes``" +#: ../../howto/clinic.rst:824 +msgid "*zeroes*" +msgstr "*zeroes*" -#: ../../howto/clinic.rst:819 +#: ../../howto/clinic.rst:821 msgid "" "Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " "permitted inside the value. The length of the string will be passed in to " @@ -952,361 +954,361 @@ msgid "" "``_length``." msgstr "" -#: ../../howto/clinic.rst:824 +#: ../../howto/clinic.rst:826 msgid "" "Please note, not every possible combination of arguments will work. Usually " -"these arguments are implemented by specific ``PyArg_ParseTuple`` *format " -"units*, with specific behavior. For example, currently you cannot call " -"``unsigned_short`` without also specifying ``bitwise=True``. Although it's " -"perfectly reasonable to think this would work, these semantics don't map to " -"any existing format unit. So Argument Clinic doesn't support it. (Or, at " -"least, not yet.)" +"these arguments are implemented by specific :c:func:`PyArg_ParseTuple` " +"*format units*, with specific behavior. For example, currently you cannot " +"call ``unsigned_short`` without also specifying ``bitwise=True``. Although " +"it's perfectly reasonable to think this would work, these semantics don't " +"map to any existing format unit. So Argument Clinic doesn't support it. " +"(Or, at least, not yet.)" msgstr "" -#: ../../howto/clinic.rst:832 +#: ../../howto/clinic.rst:834 msgid "" "Below is a table showing the mapping of legacy converters into real Argument " "Clinic converters. On the left is the legacy converter, on the right is the " "text you'd replace it with." msgstr "" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:839 msgid "``'B'``" msgstr "``'B'``" -#: ../../howto/clinic.rst:837 +#: ../../howto/clinic.rst:839 msgid "``unsigned_char(bitwise=True)``" msgstr "``unsigned_char(bitwise=True)``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:840 msgid "``'b'``" msgstr "``'b'``" -#: ../../howto/clinic.rst:838 +#: ../../howto/clinic.rst:840 msgid "``unsigned_char``" msgstr "``unsigned_char``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:841 msgid "``'c'``" msgstr "``'c'``" -#: ../../howto/clinic.rst:839 +#: ../../howto/clinic.rst:841 msgid "``char``" msgstr "``char``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:842 msgid "``'C'``" msgstr "``'C'``" -#: ../../howto/clinic.rst:840 +#: ../../howto/clinic.rst:842 msgid "``int(accept={str})``" msgstr "``int(accept={str})``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:843 msgid "``'d'``" msgstr "``'d'``" -#: ../../howto/clinic.rst:841 +#: ../../howto/clinic.rst:843 msgid "``double``" msgstr "``double``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:844 msgid "``'D'``" msgstr "``'D'``" -#: ../../howto/clinic.rst:842 +#: ../../howto/clinic.rst:844 msgid "``Py_complex``" msgstr "``Py_complex``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:845 msgid "``'es'``" msgstr "``'es'``" -#: ../../howto/clinic.rst:843 +#: ../../howto/clinic.rst:845 msgid "``str(encoding='name_of_encoding')``" msgstr "``str(encoding='name_of_encoding')``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:846 msgid "``'es#'``" msgstr "``'es#'``" -#: ../../howto/clinic.rst:844 +#: ../../howto/clinic.rst:846 msgid "``str(encoding='name_of_encoding', zeroes=True)``" msgstr "``str(encoding='name_of_encoding', zeroes=True)``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:847 msgid "``'et'``" msgstr "``'et'``" -#: ../../howto/clinic.rst:845 +#: ../../howto/clinic.rst:847 msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:848 msgid "``'et#'``" msgstr "``'et#'``" -#: ../../howto/clinic.rst:846 +#: ../../howto/clinic.rst:848 msgid "" "``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " "zeroes=True)``" msgstr "" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:849 msgid "``'f'``" msgstr "``'f'``" -#: ../../howto/clinic.rst:847 +#: ../../howto/clinic.rst:849 msgid "``float``" msgstr "``float``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:850 msgid "``'h'``" msgstr "``'h'``" -#: ../../howto/clinic.rst:848 +#: ../../howto/clinic.rst:850 msgid "``short``" msgstr "``short``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:851 msgid "``'H'``" msgstr "``'H'``" -#: ../../howto/clinic.rst:849 +#: ../../howto/clinic.rst:851 msgid "``unsigned_short(bitwise=True)``" msgstr "``unsigned_short(bitwise=True)``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:852 msgid "``'i'``" msgstr "``'i'``" -#: ../../howto/clinic.rst:850 +#: ../../howto/clinic.rst:852 msgid "``int``" msgstr "``int``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:853 msgid "``'I'``" msgstr "``'I'``" -#: ../../howto/clinic.rst:851 +#: ../../howto/clinic.rst:853 msgid "``unsigned_int(bitwise=True)``" msgstr "``unsigned_int(bitwise=True)``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:854 msgid "``'k'``" msgstr "``'k'``" -#: ../../howto/clinic.rst:852 +#: ../../howto/clinic.rst:854 msgid "``unsigned_long(bitwise=True)``" msgstr "``unsigned_long(bitwise=True)``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:855 msgid "``'K'``" msgstr "``'K'``" -#: ../../howto/clinic.rst:853 +#: ../../howto/clinic.rst:855 msgid "``unsigned_long_long(bitwise=True)``" msgstr "``unsigned_long_long(bitwise=True)``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:856 msgid "``'l'``" msgstr "``'l'``" -#: ../../howto/clinic.rst:854 +#: ../../howto/clinic.rst:856 msgid "``long``" msgstr "``long``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:857 msgid "``'L'``" msgstr "``'L'``" -#: ../../howto/clinic.rst:855 +#: ../../howto/clinic.rst:857 msgid "``long long``" msgstr "``long long``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:858 msgid "``'n'``" msgstr "``'n'``" -#: ../../howto/clinic.rst:856 +#: ../../howto/clinic.rst:858 msgid "``Py_ssize_t``" msgstr "``Py_ssize_t``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:859 msgid "``'O'``" msgstr "``'O'``" -#: ../../howto/clinic.rst:857 +#: ../../howto/clinic.rst:859 msgid "``object``" msgstr "``object``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:860 msgid "``'O!'``" msgstr "``'O!'``" -#: ../../howto/clinic.rst:858 +#: ../../howto/clinic.rst:860 msgid "``object(subclass_of='&PySomething_Type')``" msgstr "``object(subclass_of='&PySomething_Type')``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:861 msgid "``'O&'``" msgstr "``'O&'``" -#: ../../howto/clinic.rst:859 +#: ../../howto/clinic.rst:861 msgid "``object(converter='name_of_c_function')``" msgstr "``object(converter='name_of_c_function')``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:862 msgid "``'p'``" msgstr "``'p'``" -#: ../../howto/clinic.rst:860 +#: ../../howto/clinic.rst:862 msgid "``bool``" msgstr "``bool``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:863 msgid "``'S'``" msgstr "``'S'``" -#: ../../howto/clinic.rst:861 +#: ../../howto/clinic.rst:863 msgid "``PyBytesObject``" msgstr "``PyBytesObject``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:864 msgid "``'s'``" msgstr "``'s'``" -#: ../../howto/clinic.rst:862 +#: ../../howto/clinic.rst:864 msgid "``str``" msgstr "``str``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:865 msgid "``'s#'``" msgstr "``'s#'``" -#: ../../howto/clinic.rst:863 +#: ../../howto/clinic.rst:865 msgid "``str(zeroes=True)``" msgstr "``str(zeroes=True)``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:866 msgid "``'s*'``" msgstr "``'s*'``" -#: ../../howto/clinic.rst:864 +#: ../../howto/clinic.rst:866 msgid "``Py_buffer(accept={buffer, str})``" msgstr "``Py_buffer(accept={buffer, str})``" -#: ../../howto/clinic.rst:865 +#: ../../howto/clinic.rst:867 msgid "``'U'``" msgstr "``'U'``" -#: ../../howto/clinic.rst:865 +#: ../../howto/clinic.rst:867 msgid "``unicode``" msgstr "``unicode``" -#: ../../howto/clinic.rst:866 +#: ../../howto/clinic.rst:868 msgid "``'u'``" msgstr "``'u'``" -#: ../../howto/clinic.rst:866 +#: ../../howto/clinic.rst:868 msgid "``wchar_t``" msgstr "``wchar_t``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:869 msgid "``'u#'``" msgstr "``'u#'``" -#: ../../howto/clinic.rst:867 +#: ../../howto/clinic.rst:869 msgid "``wchar_t(zeroes=True)``" msgstr "``wchar_t(zeroes=True)``" -#: ../../howto/clinic.rst:868 +#: ../../howto/clinic.rst:870 msgid "``'w*'``" msgstr "``'w*'``" -#: ../../howto/clinic.rst:868 +#: ../../howto/clinic.rst:870 msgid "``Py_buffer(accept={rwbuffer})``" msgstr "``Py_buffer(accept={rwbuffer})``" -#: ../../howto/clinic.rst:869 +#: ../../howto/clinic.rst:871 msgid "``'Y'``" msgstr "``'Y'``" -#: ../../howto/clinic.rst:869 +#: ../../howto/clinic.rst:871 msgid "``PyByteArrayObject``" msgstr "``PyByteArrayObject``" -#: ../../howto/clinic.rst:870 +#: ../../howto/clinic.rst:872 msgid "``'y'``" msgstr "``'y'``" -#: ../../howto/clinic.rst:870 +#: ../../howto/clinic.rst:872 msgid "``str(accept={bytes})``" msgstr "``str(accept={bytes})``" -#: ../../howto/clinic.rst:871 +#: ../../howto/clinic.rst:873 msgid "``'y#'``" msgstr "``'y#'``" -#: ../../howto/clinic.rst:871 +#: ../../howto/clinic.rst:873 msgid "``str(accept={robuffer}, zeroes=True)``" msgstr "``str(accept={robuffer}, zeroes=True)``" -#: ../../howto/clinic.rst:872 +#: ../../howto/clinic.rst:874 msgid "``'y*'``" msgstr "``'y*'``" -#: ../../howto/clinic.rst:872 +#: ../../howto/clinic.rst:874 msgid "``Py_buffer``" msgstr "``Py_buffer``" -#: ../../howto/clinic.rst:873 +#: ../../howto/clinic.rst:875 msgid "``'Z'``" msgstr "``'Z'``" -#: ../../howto/clinic.rst:873 +#: ../../howto/clinic.rst:875 msgid "``wchar_t(accept={str, NoneType})``" msgstr "``wchar_t(accept={str, NoneType})``" -#: ../../howto/clinic.rst:874 +#: ../../howto/clinic.rst:876 msgid "``'Z#'``" msgstr "``'Z#'``" -#: ../../howto/clinic.rst:874 +#: ../../howto/clinic.rst:876 msgid "``wchar_t(accept={str, NoneType}, zeroes=True)``" msgstr "``wchar_t(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:875 +#: ../../howto/clinic.rst:877 msgid "``'z'``" msgstr "``'z'``" -#: ../../howto/clinic.rst:875 +#: ../../howto/clinic.rst:877 msgid "``str(accept={str, NoneType})``" msgstr "``str(accept={str, NoneType})``" -#: ../../howto/clinic.rst:876 +#: ../../howto/clinic.rst:878 msgid "``'z#'``" msgstr "``'z#'``" -#: ../../howto/clinic.rst:876 +#: ../../howto/clinic.rst:878 msgid "``str(accept={str, NoneType}, zeroes=True)``" msgstr "``str(accept={str, NoneType}, zeroes=True)``" -#: ../../howto/clinic.rst:877 +#: ../../howto/clinic.rst:879 msgid "``'z*'``" msgstr "``'z*'``" -#: ../../howto/clinic.rst:877 +#: ../../howto/clinic.rst:879 msgid "``Py_buffer(accept={buffer, str, NoneType})``" msgstr "``Py_buffer(accept={buffer, str, NoneType})``" -#: ../../howto/clinic.rst:880 +#: ../../howto/clinic.rst:882 msgid "" "As an example, here's our sample ``pickle.Pickler.dump`` using the proper " "converter::" msgstr "" -#: ../../howto/clinic.rst:893 +#: ../../howto/clinic.rst:895 msgid "" "One advantage of real converters is that they're more flexible than legacy " "converters. For example, the ``unsigned_int`` converter (and all the " @@ -1315,7 +1317,7 @@ msgid "" "negative numbers. You just can't do that with a legacy converter!" msgstr "" -#: ../../howto/clinic.rst:899 +#: ../../howto/clinic.rst:901 msgid "" "Argument Clinic will show you all the converters it has available. For each " "converter it'll show you all the parameters it accepts, along with the " @@ -1323,11 +1325,11 @@ msgid "" "converters`` to see the full list." msgstr "" -#: ../../howto/clinic.rst:906 +#: ../../howto/clinic.rst:908 msgid "How to use the ``Py_buffer`` converter" msgstr "" -#: ../../howto/clinic.rst:908 +#: ../../howto/clinic.rst:910 msgid "" "When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " "or ``'z*'`` legacy converters), you *must* not call :c:func:" @@ -1335,74 +1337,74 @@ msgid "" "that does it for you (in the parsing function)." msgstr "" -#: ../../howto/clinic.rst:915 +#: ../../howto/clinic.rst:917 msgid "How to use advanced converters" msgstr "" -#: ../../howto/clinic.rst:917 +#: ../../howto/clinic.rst:919 msgid "" "Remember those format units you skipped for your first time because they " "were advanced? Here's how to handle those too." msgstr "" -#: ../../howto/clinic.rst:920 +#: ../../howto/clinic.rst:922 msgid "" "The trick is, all those format units take arguments—either conversion " "functions, or types, or strings specifying an encoding. (But \"legacy " "converters\" don't support arguments. That's why we skipped them for your " "first function.) The argument you specified to the format unit is now an " -"argument to the converter; this argument is either ``converter`` (for " -"``O&``), ``subclass_of`` (for ``O!``), or ``encoding`` (for all the format " -"units that start with ``e``)." +"argument to the converter; this argument is either *converter* (for ``O&``), " +"*subclass_of* (for ``O!``), or *encoding* (for all the format units that " +"start with ``e``)." msgstr "" -#: ../../howto/clinic.rst:928 +#: ../../howto/clinic.rst:930 msgid "" -"When using ``subclass_of``, you may also want to use the other custom " -"argument for ``object()``: ``type``, which lets you set the type actually " -"used for the parameter. For example, if you want to ensure that the object " -"is a subclass of ``PyUnicode_Type``, you probably want to use the converter " +"When using *subclass_of*, you may also want to use the other custom argument " +"for ``object()``: *type*, which lets you set the type actually used for the " +"parameter. For example, if you want to ensure that the object is a subclass " +"of :c:var:`PyUnicode_Type`, you probably want to use the converter " "``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." msgstr "" -#: ../../howto/clinic.rst:934 +#: ../../howto/clinic.rst:936 msgid "" "One possible problem with using Argument Clinic: it takes away some possible " -"flexibility for the format units starting with ``e``. When writing a " -"``PyArg_Parse`` call by hand, you could theoretically decide at runtime what " -"encoding string to pass in to :c:func:`PyArg_ParseTuple`. But now this " -"string must be hard-coded at Argument-Clinic-preprocessing-time. This " -"limitation is deliberate; it made supporting this format unit much easier, " -"and may allow for future optimizations. This restriction doesn't seem " -"unreasonable; CPython itself always passes in static hard-coded encoding " -"strings for parameters whose format units start with ``e``." +"flexibility for the format units starting with ``e``. When writing a :c:" +"func:`!PyArg_Parse*` call by hand, you could theoretically decide at runtime " +"what encoding string to pass to that call. But now this string must be " +"hard-coded at Argument-Clinic-preprocessing-time. This limitation is " +"deliberate; it made supporting this format unit much easier, and may allow " +"for future optimizations. This restriction doesn't seem unreasonable; " +"CPython itself always passes in static hard-coded encoding strings for " +"parameters whose format units start with ``e``." msgstr "" -#: ../../howto/clinic.rst:947 +#: ../../howto/clinic.rst:949 msgid "How to assign default values to parameter" msgstr "" -#: ../../howto/clinic.rst:949 +#: ../../howto/clinic.rst:951 msgid "" "Default values for parameters can be any of a number of values. At their " "simplest, they can be string, int, or float literals:" msgstr "" -#: ../../howto/clinic.rst:958 +#: ../../howto/clinic.rst:960 msgid "They can also use any of Python's built-in constants:" msgstr "" -#: ../../howto/clinic.rst:966 +#: ../../howto/clinic.rst:968 msgid "" "There's also special support for a default value of ``NULL``, and for simple " "expressions, documented in the following sections." msgstr "" -#: ../../howto/clinic.rst:971 +#: ../../howto/clinic.rst:973 msgid "The ``NULL`` default value" msgstr "" -#: ../../howto/clinic.rst:973 +#: ../../howto/clinic.rst:975 msgid "" "For string and object parameters, you can set them to ``None`` to indicate " "that there's no default. However, that means the C variable will be " @@ -1412,45 +1414,45 @@ msgid "" "with ``NULL``." msgstr "" -#: ../../howto/clinic.rst:982 +#: ../../howto/clinic.rst:984 msgid "Symbolic default values" msgstr "" -#: ../../howto/clinic.rst:984 +#: ../../howto/clinic.rst:986 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:987 +#: ../../howto/clinic.rst:989 msgid "Numeric constants (integer and float)" msgstr "" -#: ../../howto/clinic.rst:988 +#: ../../howto/clinic.rst:990 msgid "String constants" msgstr "" -#: ../../howto/clinic.rst:989 +#: ../../howto/clinic.rst:991 msgid "``True``, ``False``, and ``None``" msgstr "" -#: ../../howto/clinic.rst:990 +#: ../../howto/clinic.rst:992 msgid "" -"Simple symbolic constants like ``sys.maxsize``, which must start with the " -"name of the module" +"Simple symbolic constants like :py:data:`sys.maxsize`, which must start with " +"the name of the module" msgstr "" -#: ../../howto/clinic.rst:993 +#: ../../howto/clinic.rst:995 msgid "" "(In the future, this may need to get even more elaborate, to allow full " "expressions like ``CONSTANT - 1``.)" msgstr "" -#: ../../howto/clinic.rst:998 +#: ../../howto/clinic.rst:1000 msgid "Expressions as default values" msgstr "" -#: ../../howto/clinic.rst:1000 +#: ../../howto/clinic.rst:1002 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 " @@ -1458,43 +1460,44 @@ msgid "" "obvious semantics." msgstr "" -#: ../../howto/clinic.rst:1005 +#: ../../howto/clinic.rst:1007 msgid "Consider the following example:" msgstr "" -#: ../../howto/clinic.rst:1011 +#: ../../howto/clinic.rst:1013 msgid "" -"``sys.maxsize`` can have different values on different platforms. Therefore " -"Argument Clinic can't simply evaluate that expression locally and hard-code " -"it in C. So it stores the default in such a way that it will get evaluated " -"at runtime, when the user asks for the function's signature." +":py:data:`sys.maxsize` can have different values on different platforms. " +"Therefore Argument Clinic can't simply evaluate that expression locally and " +"hard-code it in C. So it stores the default in such a way that it will get " +"evaluated at runtime, when the user asks for the function's signature." msgstr "" -#: ../../howto/clinic.rst:1016 +#: ../../howto/clinic.rst:1018 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:" +"module has an attribute called :py:attr:`!max_widgets`, you may simply use " +"it:" msgstr "" -#: ../../howto/clinic.rst:1024 +#: ../../howto/clinic.rst:1026 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. " -"(Since you don't know in advance what modules the user will load into their " -"interpreter, it's best to restrict yourself to modules that are preloaded by " -"Python itself.)" +"If the symbol isn't found in the current module, it fails over to looking " +"in :py:data:`sys.modules`. That's how it can find :py:data:`sys.maxsize` " +"for example. (Since you don't know in advance what modules the user will " +"load into their interpreter, it's best to restrict yourself to modules that " +"are preloaded by Python itself.)" msgstr "" -#: ../../howto/clinic.rst:1029 +#: ../../howto/clinic.rst:1031 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 " "explicitly. When you use an expression, you must also specify the equivalent " -"expression in C, using the ``c_default`` parameter to the converter:" +"expression in C, using the *c_default* parameter to the converter:" msgstr "" -#: ../../howto/clinic.rst:1038 +#: ../../howto/clinic.rst:1040 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 " @@ -1502,38 +1505,38 @@ msgid "" "expressions to specify values that are guaranteed to be valid at runtime!" msgstr "" -#: ../../howto/clinic.rst:1043 +#: ../../howto/clinic.rst:1045 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:1047 +#: ../../howto/clinic.rst:1049 msgid "Function calls." msgstr "" -#: ../../howto/clinic.rst:1048 +#: ../../howto/clinic.rst:1050 msgid "Inline if statements (``3 if foo else 5``)." msgstr "" -#: ../../howto/clinic.rst:1049 +#: ../../howto/clinic.rst:1051 msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." msgstr "" -#: ../../howto/clinic.rst:1050 +#: ../../howto/clinic.rst:1052 msgid "List/set/dict comprehensions and generator expressions." msgstr "" -#: ../../howto/clinic.rst:1051 +#: ../../howto/clinic.rst:1053 msgid "Tuple/list/set/dict literals." msgstr "" -#: ../../howto/clinic.rst:1055 +#: ../../howto/clinic.rst:1057 msgid "How to use return converters" msgstr "" -#: ../../howto/clinic.rst:1057 +#: ../../howto/clinic.rst:1059 msgid "" "By default, the impl function Argument Clinic generates for you returns :c:" "type:`PyObject * `. But your C function often computes some C " @@ -1543,38 +1546,38 @@ msgid "" "a Python type too?" msgstr "" -#: ../../howto/clinic.rst:1065 +#: ../../howto/clinic.rst:1067 msgid "" "That's what a \"return converter\" does. It changes your impl function to " "return some C type, then adds code to the generated (non-impl) function to " "handle converting that value into the appropriate :c:type:`!PyObject *`." msgstr "" -#: ../../howto/clinic.rst:1069 +#: ../../howto/clinic.rst:1071 msgid "" "The syntax for return converters is similar to that of parameter converters. " "You specify the return converter like it was a return annotation on the " "function itself, using ``->`` notation." msgstr "" -#: ../../howto/clinic.rst:1073 +#: ../../howto/clinic.rst:1075 msgid "For example:" msgstr "" -#: ../../howto/clinic.rst:1086 +#: ../../howto/clinic.rst:1088 msgid "" "Return converters behave much the same as parameter converters; they take " "arguments, the arguments are all keyword-only, and if you're not changing " "any of the default arguments you can omit the parentheses." msgstr "" -#: ../../howto/clinic.rst:1090 +#: ../../howto/clinic.rst:1092 msgid "" "(If you use both ``\"as\"`` *and* a return converter for your function, the " "``\"as\"`` should come before the return converter.)" msgstr "" -#: ../../howto/clinic.rst:1093 +#: ../../howto/clinic.rst:1095 msgid "" "There's one additional complication when using return converters: how do you " "indicate an error has occurred? Normally, a function returns a valid (non-" @@ -1582,168 +1585,168 @@ msgid "" "integer return converter, all integers are valid. How can Argument Clinic " "detect an error? Its solution: each return converter implicitly looks for a " "special value that indicates an error. If you return that value, and an " -"error has been set (``PyErr_Occurred()`` returns a true value), then the " +"error has been set (c:func:`PyErr_Occurred` returns a true value), then the " "generated code will propagate the error. Otherwise it will encode the value " "you return like normal." msgstr "" -#: ../../howto/clinic.rst:1102 +#: ../../howto/clinic.rst:1104 msgid "Currently Argument Clinic supports only a few return converters:" msgstr "" -#: ../../howto/clinic.rst:1116 +#: ../../howto/clinic.rst:1118 msgid "" "None of these take parameters. For all of these, return ``-1`` to indicate " "error." msgstr "" -#: ../../howto/clinic.rst:1119 +#: ../../howto/clinic.rst:1121 msgid "" "To see all the return converters Argument Clinic supports, along with their " "parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " "the full list." msgstr "" -#: ../../howto/clinic.rst:1125 +#: ../../howto/clinic.rst:1127 msgid "How to clone existing functions" msgstr "" -#: ../../howto/clinic.rst:1127 +#: ../../howto/clinic.rst:1129 msgid "" "If you have a number of functions that look similar, you may be able to use " "Clinic's \"clone\" feature. When you clone an existing function, you reuse:" msgstr "" -#: ../../howto/clinic.rst:1131 +#: ../../howto/clinic.rst:1133 msgid "its parameters, including" msgstr "" -#: ../../howto/clinic.rst:1133 +#: ../../howto/clinic.rst:1135 msgid "their names," msgstr "" -#: ../../howto/clinic.rst:1135 +#: ../../howto/clinic.rst:1137 msgid "their converters, with all parameters," msgstr "" -#: ../../howto/clinic.rst:1137 +#: ../../howto/clinic.rst:1139 msgid "their default values," msgstr "" -#: ../../howto/clinic.rst:1139 +#: ../../howto/clinic.rst:1141 msgid "their per-parameter docstrings," msgstr "" -#: ../../howto/clinic.rst:1141 +#: ../../howto/clinic.rst:1143 msgid "" "their *kind* (whether they're positional only, positional or keyword, or " "keyword only), and" msgstr "" -#: ../../howto/clinic.rst:1144 +#: ../../howto/clinic.rst:1146 msgid "its return converter." msgstr "" -#: ../../howto/clinic.rst:1146 +#: ../../howto/clinic.rst:1148 msgid "" "The only thing not copied from the original function is its docstring; the " "syntax allows you to specify a new docstring." msgstr "" -#: ../../howto/clinic.rst:1149 +#: ../../howto/clinic.rst:1151 msgid "Here's the syntax for cloning a function::" msgstr "" -#: ../../howto/clinic.rst:1157 +#: ../../howto/clinic.rst:1159 msgid "" "(The functions can be in different modules or classes. I wrote ``module." "class`` in the sample just to illustrate that you must use the full path to " "*both* functions.)" msgstr "" -#: ../../howto/clinic.rst:1161 +#: ../../howto/clinic.rst:1163 msgid "" "Sorry, there's no syntax for partially cloning a function, or cloning a " "function then modifying it. Cloning is an all-or nothing proposition." msgstr "" -#: ../../howto/clinic.rst:1164 +#: ../../howto/clinic.rst:1166 msgid "" "Also, the function you are cloning from must have been previously defined in " "the current file." msgstr "" -#: ../../howto/clinic.rst:1169 +#: ../../howto/clinic.rst:1171 msgid "How to call Python code" msgstr "" -#: ../../howto/clinic.rst:1171 +#: ../../howto/clinic.rst:1173 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:1175 +#: ../../howto/clinic.rst:1177 msgid "" "A Python block uses different delimiter lines than an Argument Clinic " "function block. It looks like this::" msgstr "" -#: ../../howto/clinic.rst:1182 +#: ../../howto/clinic.rst:1184 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:1186 +#: ../../howto/clinic.rst:1188 msgid "" "As an example, here's a Python block that adds a static integer variable to " "the C code::" msgstr "" -#: ../../howto/clinic.rst:1197 +#: ../../howto/clinic.rst:1199 msgid "How to use the \"self converter\"" msgstr "" -#: ../../howto/clinic.rst:1199 +#: ../../howto/clinic.rst:1201 msgid "" "Argument Clinic automatically adds a \"self\" parameter for you using a " "default converter. It automatically sets the ``type`` of this parameter to " "the \"pointer to an instance\" you specified when you declared the type. " "However, you can override Argument Clinic's converter and specify one " -"yourself. Just add your own ``self`` parameter as the first parameter in a " -"block, and ensure that its converter is an instance of ``self_converter`` or " -"a subclass thereof." +"yourself. Just add your own *self* parameter as the first parameter in a " +"block, and ensure that its converter is an instance of :class:`!" +"self_converter` or a subclass thereof." msgstr "" -#: ../../howto/clinic.rst:1208 +#: ../../howto/clinic.rst:1210 msgid "" "What's the point? This lets you override the type of ``self``, or give it a " "different default name." msgstr "" -#: ../../howto/clinic.rst:1211 +#: ../../howto/clinic.rst:1213 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 " "use Argument Clinic's existing ``self`` converter, passing in the type you " -"want to use as the ``type`` parameter::" +"want to use as the *type* parameter::" msgstr "" -#: ../../howto/clinic.rst:1227 +#: ../../howto/clinic.rst:1229 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::" +"type for ``self``, it's best to create your own converter, subclassing :" +"class:`!self_converter` but overwriting the :py:attr:`!type` member::" msgstr "" -#: ../../howto/clinic.rst:1249 +#: ../../howto/clinic.rst:1251 msgid "How to use the \"defining class\" converter" msgstr "" -#: ../../howto/clinic.rst:1251 +#: ../../howto/clinic.rst:1253 msgid "" "Argument Clinic facilitates gaining access to the defining class of a " "method. This is useful for :ref:`heap type ` methods that need " @@ -1753,65 +1756,66 @@ msgid "" "example from a module method." msgstr "" -#: ../../howto/clinic.rst:1257 +#: ../../howto/clinic.rst:1259 msgid "" -"Example from ``Modules/zlibmodule.c``. First, ``defining_class`` is added " -"to the clinic input::" +"Example from :source:`Modules/zlibmodule.c`. First, ``defining_class`` is " +"added to the clinic input::" msgstr "" -#: ../../howto/clinic.rst:1269 +#: ../../howto/clinic.rst:1271 msgid "" "After running the Argument Clinic tool, the following function signature is " "generated::" msgstr "" -#: ../../howto/clinic.rst:1279 +#: ../../howto/clinic.rst:1281 msgid "" "The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " "module state::" msgstr "" -#: ../../howto/clinic.rst:1285 +#: ../../howto/clinic.rst:1287 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. " "The argument will be of type ``PyTypeObject *``. The argument will not " -"appear in the ``__text_signature__``." +"appear in the :py:attr:`!__text_signature__`." msgstr "" -#: ../../howto/clinic.rst:1290 +#: ../../howto/clinic.rst:1292 msgid "" -"The ``defining_class`` converter is not compatible with ``__init__`` and " -"``__new__`` methods, which cannot use the ``METH_METHOD`` convention." +"The ``defining_class`` converter is not compatible with :py:meth:`!__init__` " +"and :py:meth:`!__new__` methods, which cannot use the :c:macro:`METH_METHOD` " +"convention." msgstr "" -#: ../../howto/clinic.rst:1293 +#: ../../howto/clinic.rst:1296 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:" "`PyType_GetModuleByDef` to look up the module and then :c:func:" "`PyModule_GetState` to fetch the module state. Example from the " -"``setattro`` slot method in ``Modules/_threadmodule.c``::" +"``setattro`` slot method in :source:`Modules/_threadmodule.c`::" msgstr "" -#: ../../howto/clinic.rst:1308 +#: ../../howto/clinic.rst:1311 msgid "See also :pep:`573`." msgstr "也請見 :pep:`573`\\ 。" -#: ../../howto/clinic.rst:1312 +#: ../../howto/clinic.rst:1315 msgid "How to write a custom converter" msgstr "" -#: ../../howto/clinic.rst:1314 +#: ../../howto/clinic.rst:1317 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 " -"``CConverter``. The main purpose of a custom converter is if you have a " +"converters! A converter is simply a Python class that inherits from :py:" +"class:`!CConverter`. The main purpose of a custom converter is if you have a " "parameter using the ``O&`` format unit—parsing this parameter means calling " "a :c:func:`PyArg_ParseTuple` \"converter function\"." msgstr "" -#: ../../howto/clinic.rst:1320 +#: ../../howto/clinic.rst:1323 msgid "" "Your converter class should be named ``*something*_converter``. If the name " "follows this convention, then your converter class will be automatically " @@ -1820,59 +1824,47 @@ msgid "" "metaclass.)" msgstr "" -#: ../../howto/clinic.rst:1326 +#: ../../howto/clinic.rst:1329 msgid "" -"You shouldn't subclass ``CConverter.__init__``. Instead, you should write a " -"``converter_init()`` function. ``converter_init()`` always accepts a " -"``self`` parameter; after that, all additional parameters *must* be keyword-" -"only. Any arguments passed in to the converter in Argument Clinic will be " -"passed along to your ``converter_init()``." +"You shouldn't subclass :py:meth:`!CConverter.__init__`. Instead, you should " +"write a :py:meth:`!converter_init` function. :py:meth:`!converter_init` " +"always accepts a *self* parameter; after that, all additional parameters " +"*must* be keyword-only. Any arguments passed in to the converter in " +"Argument Clinic will be passed along to your :py:meth:`!converter_init`." msgstr "" -#: ../../howto/clinic.rst:1333 +#: ../../howto/clinic.rst:1336 msgid "" -"There are some additional members of ``CConverter`` you may wish to specify " -"in your subclass. Here's the current list:" +"There are some additional members of :py:class:`!CConverter` you may wish to " +"specify in your subclass. Here's the current list:" msgstr "" -#: ../../howto/clinic.rst:1337 +#: ../../howto/clinic.rst:1345 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 " +"The C type to use for this variable. :attr:`!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:1343 -msgid "``default``" -msgstr "``default``" - -#: ../../howto/clinic.rst:1342 +#: ../../howto/clinic.rst:1352 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:1348 -msgid "``py_default``" -msgstr "``py_default``" - -#: ../../howto/clinic.rst:1346 +#: ../../howto/clinic.rst:1357 msgid "" -"``default`` as it should appear in Python code, as a string. Or ``None`` if " -"there is no default." +":attr:`!default` as it should appear in Python code, as a string. Or " +"``None`` if there is no default." msgstr "" -#: ../../howto/clinic.rst:1351 +#: ../../howto/clinic.rst:1363 msgid "" -"``default`` as it should appear in C code, as a string. Or ``None`` if there " -"is no default." +":attr:`!default` as it should appear in C code, as a string. Or ``None`` if " +"there is no default." msgstr "" -#: ../../howto/clinic.rst:1364 -msgid "``c_ignored_default``" -msgstr "``c_ignored_default``" - -#: ../../howto/clinic.rst:1356 +#: ../../howto/clinic.rst:1369 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 " @@ -1883,37 +1875,29 @@ msgid "" "non-empty string." msgstr "" -#: ../../howto/clinic.rst:1367 +#: ../../howto/clinic.rst:1381 msgid "The name of the C converter function, as a string." msgstr "" -#: ../../howto/clinic.rst:1372 -msgid "``impl_by_reference``" -msgstr "``impl_by_reference``" - -#: ../../howto/clinic.rst:1370 +#: ../../howto/clinic.rst:1385 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:1378 -msgid "``parse_by_reference``" -msgstr "``parse_by_reference``" - -#: ../../howto/clinic.rst:1375 +#: ../../howto/clinic.rst:1391 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:1380 +#: ../../howto/clinic.rst:1396 msgid "" -"Here's the simplest example of a custom converter, from ``Modules/zlibmodule." -"c``::" +"Here's the simplest example of a custom converter, from :source:`Modules/" +"zlibmodule.c`::" msgstr "" -#: ../../howto/clinic.rst:1391 +#: ../../howto/clinic.rst:1407 msgid "" "This block adds a converter to Argument Clinic named ``ssize_t``. " "Parameters declared as ``ssize_t`` will be declared as type :c:type:" @@ -1922,86 +1906,88 @@ msgid "" "automatically support default values." msgstr "" -#: ../../howto/clinic.rst:1397 +#: ../../howto/clinic.rst:1413 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``." +"in the CPython source tree; grep the C files for the string :py:class:`!" +"CConverter`." msgstr "" -#: ../../howto/clinic.rst:1404 +#: ../../howto/clinic.rst:1420 msgid "How to write a custom return converter" msgstr "" -#: ../../howto/clinic.rst:1406 +#: ../../howto/clinic.rst:1422 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:1410 +#: ../../howto/clinic.rst:1426 msgid "" -"Return converters must subclass ``CReturnConverter``. There are no examples " -"yet of custom return converters, because they are not widely used yet. If " -"you wish to write your own return converter, please read ``Tools/clinic/" -"clinic.py``, specifically the implementation of ``CReturnConverter`` and all " -"its subclasses." +"Return converters must subclass :py:class:`!CReturnConverter`. There are no " +"examples yet of custom return converters, because they are not widely used " +"yet. If you wish to write your own return converter, please read :source:" +"`Tools/clinic/clinic.py`, specifically the implementation of :py:class:`!" +"CReturnConverter` and all its subclasses." msgstr "" -#: ../../howto/clinic.rst:1419 +#: ../../howto/clinic.rst:1435 msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" msgstr "" -#: ../../howto/clinic.rst:1421 +#: ../../howto/clinic.rst:1437 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 " +"To convert a function using :c:macro:`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:1433 +#: ../../howto/clinic.rst:1449 msgid "" -"To convert a function using ``METH_NOARGS``, just don't specify any " +"To convert a function using :c:macro:`METH_NOARGS`, just don't specify any " "arguments." msgstr "" -#: ../../howto/clinic.rst:1436 +#: ../../howto/clinic.rst:1452 msgid "" -"You can still use a self converter, a return converter, and specify a " -"``type`` argument to the object converter for ``METH_O``." +"You can still use a self converter, a return converter, and specify a *type* " +"argument to the object converter for :c:macro:`METH_O`." msgstr "" -#: ../../howto/clinic.rst:1441 +#: ../../howto/clinic.rst:1457 msgid "How to convert ``tp_new`` and ``tp_init`` functions" msgstr "" -#: ../../howto/clinic.rst:1443 +#: ../../howto/clinic.rst:1459 msgid "" -"You can convert ``tp_new`` and ``tp_init`` functions. Just name them " -"``__new__`` or ``__init__`` as appropriate. Notes:" +"You can convert :c:member:`~PyTypeObject.tp_new` and :c:member:" +"`~PyTypeObject.tp_init` functions. Just name them ``__new__`` or " +"``__init__`` as appropriate. Notes:" msgstr "" -#: ../../howto/clinic.rst:1446 +#: ../../howto/clinic.rst:1463 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:1450 -msgid "No ``PyMethodDef`` ``#define`` is generated for these functions." +#: ../../howto/clinic.rst:1467 +msgid "No :c:type:`PyMethodDef` ``#define`` is generated for these functions." msgstr "" -#: ../../howto/clinic.rst:1452 +#: ../../howto/clinic.rst:1469 msgid "``__init__`` functions return ``int``, not ``PyObject *``." msgstr "" -#: ../../howto/clinic.rst:1454 +#: ../../howto/clinic.rst:1471 msgid "Use the docstring as the class docstring." msgstr "" -#: ../../howto/clinic.rst:1456 +#: ../../howto/clinic.rst:1473 msgid "" "Although ``__new__`` and ``__init__`` functions must always accept both the " "``args`` and ``kwargs`` objects, when converting you may specify any " @@ -2010,11 +1996,11 @@ msgid "" "it receives any.)" msgstr "" -#: ../../howto/clinic.rst:1464 +#: ../../howto/clinic.rst:1481 msgid "How to change and redirect Clinic's output" msgstr "" -#: ../../howto/clinic.rst:1466 +#: ../../howto/clinic.rst:1483 msgid "" "It can be inconvenient to have Clinic's output interspersed with your " "conventional hand-edited C code. Luckily, Clinic is configurable: you can " @@ -2023,7 +2009,7 @@ msgid "" "Clinic's generated output." msgstr "" -#: ../../howto/clinic.rst:1472 +#: ../../howto/clinic.rst:1489 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 " @@ -2035,23 +2021,23 @@ msgid "" "rearranging your code to fix definition-before-use problems.)" msgstr "" -#: ../../howto/clinic.rst:1481 +#: ../../howto/clinic.rst:1498 msgid "Let's start with defining some terminology:" msgstr "" -#: ../../howto/clinic.rst:1508 +#: ../../howto/clinic.rst:1525 msgid "*field*" msgstr "" -#: ../../howto/clinic.rst:1484 +#: ../../howto/clinic.rst:1501 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 " +"the ``#define`` for the :c:type:`PyMethodDef` structure is a field, called " "``methoddef_define``. Clinic has seven different fields it can output per " "function definition:" msgstr "" -#: ../../howto/clinic.rst:1499 +#: ../../howto/clinic.rst:1516 msgid "" "All the names are of the form ``\"_\"``, where ``\"\"`` is the " "semantic object represented (the parsing function, the impl function, the " @@ -2064,112 +2050,112 @@ msgid "" "``\"_define\"``, representing that it's a preprocessor #define.)" msgstr "" -#: ../../howto/clinic.rst:1542 +#: ../../howto/clinic.rst:1559 msgid "*destination*" msgstr "" -#: ../../howto/clinic.rst:1511 +#: ../../howto/clinic.rst:1528 msgid "" "A destination is a place Clinic can write output to. There are five built-" "in destinations:" msgstr "" -#: ../../howto/clinic.rst:1516 ../../howto/clinic.rst:1591 -#: ../../howto/clinic.rst:1669 +#: ../../howto/clinic.rst:1533 ../../howto/clinic.rst:1608 +#: ../../howto/clinic.rst:1686 msgid "``block``" msgstr "``block``" -#: ../../howto/clinic.rst:1515 +#: ../../howto/clinic.rst:1532 msgid "" "The default destination: printed in the output section of the current Clinic " "block." msgstr "" -#: ../../howto/clinic.rst:1522 ../../howto/clinic.rst:1618 -#: ../../howto/clinic.rst:1672 +#: ../../howto/clinic.rst:1539 ../../howto/clinic.rst:1635 +#: ../../howto/clinic.rst:1689 msgid "``buffer``" msgstr "``buffer``" -#: ../../howto/clinic.rst:1519 +#: ../../howto/clinic.rst:1536 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:1533 ../../howto/clinic.rst:1604 -#: ../../howto/clinic.rst:1698 +#: ../../howto/clinic.rst:1550 ../../howto/clinic.rst:1621 +#: ../../howto/clinic.rst:1715 msgid "``file``" msgstr "``file``" -#: ../../howto/clinic.rst:1525 +#: ../../howto/clinic.rst:1542 msgid "" "A separate \"clinic file\" that will be created automatically by Clinic. The " "filename chosen for the file is ``{basename}.clinic{extension}``, where " "``basename`` and ``extension`` were assigned the output from ``os.path." "splitext()`` run on the current file. (Example: the ``file`` destination " -"for ``_pickle.c`` would be written to ``_pickle.clinic.c``.)" +"for :file:`_pickle.c` would be written to :file:`_pickle.clinic.c`.)" msgstr "" -#: ../../howto/clinic.rst:1532 +#: ../../howto/clinic.rst:1549 msgid "" "**Important: When using a** ``file`` **destination, you** *must check in* " "**the generated file!**" msgstr "" -#: ../../howto/clinic.rst:1538 ../../howto/clinic.rst:1631 -#: ../../howto/clinic.rst:1702 +#: ../../howto/clinic.rst:1555 ../../howto/clinic.rst:1648 +#: ../../howto/clinic.rst:1719 msgid "``two-pass``" msgstr "``two-pass``" -#: ../../howto/clinic.rst:1536 +#: ../../howto/clinic.rst:1553 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:1542 ../../howto/clinic.rst:1665 +#: ../../howto/clinic.rst:1559 ../../howto/clinic.rst:1682 msgid "``suppress``" msgstr "``suppress``" -#: ../../howto/clinic.rst:1541 +#: ../../howto/clinic.rst:1558 msgid "The text is suppressed—thrown away." msgstr "" -#: ../../howto/clinic.rst:1544 +#: ../../howto/clinic.rst:1561 msgid "Clinic defines five new directives that let you reconfigure its output." msgstr "" -#: ../../howto/clinic.rst:1546 +#: ../../howto/clinic.rst:1563 msgid "The first new directive is ``dump``:" msgstr "" -#: ../../howto/clinic.rst:1552 +#: ../../howto/clinic.rst:1569 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:1556 +#: ../../howto/clinic.rst:1573 msgid "" "The second new directive is ``output``. The most basic form of ``output`` " "is like this:" msgstr "" -#: ../../howto/clinic.rst:1563 +#: ../../howto/clinic.rst:1580 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:1567 +#: ../../howto/clinic.rst:1584 msgid "``output`` has a number of other functions:" msgstr "" -#: ../../howto/clinic.rst:1576 +#: ../../howto/clinic.rst:1593 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 " @@ -2178,25 +2164,25 @@ msgid "" "when you wish to restore the previous configuration." msgstr "" -#: ../../howto/clinic.rst:1583 +#: ../../howto/clinic.rst:1600 msgid "" "``output preset`` sets Clinic's output to one of several built-in preset " "configurations, as follows:" msgstr "" -#: ../../howto/clinic.rst:1587 +#: ../../howto/clinic.rst:1604 msgid "" "Clinic's original starting configuration. Writes everything immediately " "after the input block." msgstr "" -#: ../../howto/clinic.rst:1590 +#: ../../howto/clinic.rst:1607 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write " "everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1594 +#: ../../howto/clinic.rst:1611 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 " @@ -2204,17 +2190,17 @@ msgid "" "declarations for various ``typedef`` and ``PyTypeObject`` definitions." msgstr "" -#: ../../howto/clinic.rst:1600 +#: ../../howto/clinic.rst:1617 msgid "" "Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " "``impl_definition`` to ``block``, and write everything else to ``file``." msgstr "" -#: ../../howto/clinic.rst:1604 +#: ../../howto/clinic.rst:1621 msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." msgstr "" -#: ../../howto/clinic.rst:1607 +#: ../../howto/clinic.rst:1624 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 " @@ -2224,14 +2210,14 @@ msgid "" "static ``PyMethodDef`` arrays defined in the middle of the file." msgstr "" -#: ../../howto/clinic.rst:1616 +#: ../../howto/clinic.rst:1633 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:1621 +#: ../../howto/clinic.rst:1638 msgid "" "Similar to the ``buffer`` preset, but writes forward declarations to the " "``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " @@ -2240,18 +2226,18 @@ msgid "" "near the end just like you would when using the ``buffer`` preset." msgstr "" -#: ../../howto/clinic.rst:1628 +#: ../../howto/clinic.rst:1645 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:1642 +#: ../../howto/clinic.rst:1659 msgid "``partial-buffer``" msgstr "``partial-buffer``" -#: ../../howto/clinic.rst:1634 +#: ../../howto/clinic.rst:1651 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 " @@ -2261,137 +2247,137 @@ msgid "" "preset." msgstr "" -#: ../../howto/clinic.rst:1641 +#: ../../howto/clinic.rst:1658 msgid "" "Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " "``parser_definition`` to ``buffer``, write everything else to ``block``." msgstr "" -#: ../../howto/clinic.rst:1644 +#: ../../howto/clinic.rst:1661 msgid "The third new directive is ``destination``:" msgstr "" -#: ../../howto/clinic.rst:1650 +#: ../../howto/clinic.rst:1667 msgid "This performs an operation on the destination named ``name``." msgstr "" -#: ../../howto/clinic.rst:1652 +#: ../../howto/clinic.rst:1669 msgid "There are two defined subcommands: ``new`` and ``clear``." msgstr "" -#: ../../howto/clinic.rst:1654 +#: ../../howto/clinic.rst:1671 msgid "The ``new`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1660 +#: ../../howto/clinic.rst:1677 msgid "" "This creates a new destination with name ```` and type ````." msgstr "" -#: ../../howto/clinic.rst:1662 +#: ../../howto/clinic.rst:1679 msgid "There are five destination types:" msgstr "" -#: ../../howto/clinic.rst:1665 +#: ../../howto/clinic.rst:1682 msgid "Throws the text away." msgstr "" -#: ../../howto/clinic.rst:1668 +#: ../../howto/clinic.rst:1685 msgid "" "Writes the text to the current block. This is what Clinic originally did." msgstr "" -#: ../../howto/clinic.rst:1672 +#: ../../howto/clinic.rst:1689 msgid "A simple text buffer, like the \"buffer\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1675 +#: ../../howto/clinic.rst:1692 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:1678 +#: ../../howto/clinic.rst:1695 msgid "destination new " msgstr "" -#: ../../howto/clinic.rst:1680 +#: ../../howto/clinic.rst:1697 msgid "" "The template can use three strings internally that will be replaced by bits " "of the filename:" msgstr "" -#: ../../howto/clinic.rst:1683 +#: ../../howto/clinic.rst:1700 msgid "{path}" msgstr "{path}" -#: ../../howto/clinic.rst:1684 +#: ../../howto/clinic.rst:1701 msgid "The full path to the file, including directory and full filename." msgstr "" -#: ../../howto/clinic.rst:1685 +#: ../../howto/clinic.rst:1702 msgid "{dirname}" msgstr "{dirname}" -#: ../../howto/clinic.rst:1686 +#: ../../howto/clinic.rst:1703 msgid "The name of the directory the file is in." msgstr "" -#: ../../howto/clinic.rst:1687 +#: ../../howto/clinic.rst:1704 msgid "{basename}" msgstr "{basename}" -#: ../../howto/clinic.rst:1688 +#: ../../howto/clinic.rst:1705 msgid "Just the name of the file, not including the directory." msgstr "" -#: ../../howto/clinic.rst:1690 +#: ../../howto/clinic.rst:1707 msgid "{basename_root}" msgstr "{basename_root}" -#: ../../howto/clinic.rst:1690 +#: ../../howto/clinic.rst:1707 msgid "" "Basename with the extension clipped off (everything up to but not including " "the last '.')." msgstr "" -#: ../../howto/clinic.rst:1694 +#: ../../howto/clinic.rst:1711 msgid "{basename_extension}" msgstr "{basename_extension}" -#: ../../howto/clinic.rst:1693 +#: ../../howto/clinic.rst:1710 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:1696 +#: ../../howto/clinic.rst:1713 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:1701 +#: ../../howto/clinic.rst:1718 msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." msgstr "" -#: ../../howto/clinic.rst:1704 +#: ../../howto/clinic.rst:1721 msgid "The ``clear`` subcommand works like this:" msgstr "" -#: ../../howto/clinic.rst:1710 +#: ../../howto/clinic.rst:1727 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:1714 +#: ../../howto/clinic.rst:1731 msgid "The fourth new directive is ``set``:" msgstr "" -#: ../../howto/clinic.rst:1721 +#: ../../howto/clinic.rst:1738 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; " @@ -2399,35 +2385,35 @@ msgid "" "output." msgstr "" -#: ../../howto/clinic.rst:1725 +#: ../../howto/clinic.rst:1742 msgid "Both of these support two format strings:" msgstr "" -#: ../../howto/clinic.rst:1728 +#: ../../howto/clinic.rst:1745 msgid "``{block comment start}``" msgstr "``{block comment start}``" -#: ../../howto/clinic.rst:1728 +#: ../../howto/clinic.rst:1745 msgid "" "Turns into the string ``/*``, the start-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1731 +#: ../../howto/clinic.rst:1748 msgid "``{block comment end}``" msgstr "``{block comment end}``" -#: ../../howto/clinic.rst:1731 +#: ../../howto/clinic.rst:1748 msgid "" "Turns into the string ``*/``, the end-comment text sequence for C files." msgstr "" -#: ../../howto/clinic.rst:1733 +#: ../../howto/clinic.rst:1750 msgid "" "The final new directive is one you shouldn't need to use directly, called " "``preserve``:" msgstr "" -#: ../../howto/clinic.rst:1740 +#: ../../howto/clinic.rst:1757 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 " @@ -2436,36 +2422,36 @@ msgid "" "gets overwritten." msgstr "" -#: ../../howto/clinic.rst:1747 +#: ../../howto/clinic.rst:1764 msgid "How to use the ``#ifdef`` trick" msgstr "" -#: ../../howto/clinic.rst:1749 +#: ../../howto/clinic.rst:1766 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:1760 +#: ../../howto/clinic.rst:1777 msgid "" "And then in the ``PyMethodDef`` structure at the bottom the existing code " "will have:" msgstr "" -#: ../../howto/clinic.rst:1769 +#: ../../howto/clinic.rst:1786 msgid "" "In this scenario, you should enclose the body of your impl function inside " "the ``#ifdef``, like so::" msgstr "" -#: ../../howto/clinic.rst:1783 +#: ../../howto/clinic.rst:1800 msgid "" -"Then, remove those three lines from the ``PyMethodDef`` structure, replacing " -"them with the macro Argument Clinic generated:" +"Then, remove those three lines from the :c:type:`PyMethodDef` structure, " +"replacing them with the macro Argument Clinic generated:" msgstr "" -#: ../../howto/clinic.rst:1790 +#: ../../howto/clinic.rst:1807 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 " @@ -2473,27 +2459,27 @@ msgid "" "uppercased, and ``\"_METHODDEF\"`` added to the end.)" msgstr "" -#: ../../howto/clinic.rst:1795 +#: ../../howto/clinic.rst:1812 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:1798 +#: ../../howto/clinic.rst:1815 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:1806 +#: ../../howto/clinic.rst:1823 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:1810 +#: ../../howto/clinic.rst:1827 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 " @@ -2501,24 +2487,24 @@ msgid "" "the whole point!)" msgstr "" -#: ../../howto/clinic.rst:1814 +#: ../../howto/clinic.rst:1831 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:1822 +#: ../../howto/clinic.rst:1839 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." +"it above the :c:type:`PyMethodDef` structure where that macro is used." msgstr "" -#: ../../howto/clinic.rst:1828 +#: ../../howto/clinic.rst:1845 msgid "How to use Argument Clinic in Python files" msgstr "" -#: ../../howto/clinic.rst:1830 +#: ../../howto/clinic.rst:1847 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 " @@ -2526,11 +2512,29 @@ msgid "" "Clinic to run Python blocks lets you use Python as a Python preprocessor!" msgstr "" -#: ../../howto/clinic.rst:1835 +#: ../../howto/clinic.rst:1852 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 "``type``" +#~ msgstr "``type``" + +#~ msgid "``default``" +#~ msgstr "``default``" + +#~ msgid "``py_default``" +#~ msgstr "``py_default``" + +#~ msgid "``c_ignored_default``" +#~ msgstr "``c_ignored_default``" + +#~ msgid "``impl_by_reference``" +#~ msgstr "``impl_by_reference``" + +#~ msgid "``parse_by_reference``" +#~ msgstr "``parse_by_reference``" + #~ msgid "Py_buffer" #~ msgstr "Py_buffer" diff --git a/library/multiprocessing.shared_memory.po b/library/multiprocessing.shared_memory.po index 2b3107a5b8..da0cb02aac 100644 --- a/library/multiprocessing.shared_memory.po +++ b/library/multiprocessing.shared_memory.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-07-26 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -212,22 +212,22 @@ msgstr "" msgid "" "Provides a mutable list-like object where all values stored within are " "stored in a shared memory block. This constrains storable values to only " -"the ``int``, ``float``, ``bool``, ``str`` (less than 10M bytes each), " -"``bytes`` (less than 10M bytes each), and ``None`` built-in data types. It " -"also notably differs from the built-in ``list`` type in that these lists can " -"not change their overall length (i.e. no append, insert, etc.) and do not " -"support the dynamic creation of new :class:`ShareableList` instances via " -"slicing." +"the ``int`` (signed 64-bit), ``float``, ``bool``, ``str`` (less than 10M " +"bytes each when encoded as utf-8), ``bytes`` (less than 10M bytes each), and " +"``None`` built-in data types. It also notably differs from the built-in " +"``list`` type in that these lists can not change their overall length (i.e. " +"no append, insert, etc.) and do not support the dynamic creation of new :" +"class:`ShareableList` instances via slicing." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:269 +#: ../../library/multiprocessing.shared_memory.rst:270 msgid "" "*sequence* is used in populating a new ``ShareableList`` full of values. Set " "to ``None`` to instead attach to an already existing ``ShareableList`` by " "its unique shared memory name." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:273 +#: ../../library/multiprocessing.shared_memory.rst:274 msgid "" "*name* is the unique name for the requested shared memory, as described in " "the definition for :class:`SharedMemory`. When attaching to an existing " @@ -235,40 +235,56 @@ msgid "" "leaving ``sequence`` set to ``None``." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:280 +#: ../../library/multiprocessing.shared_memory.rst:281 +msgid "" +"A known issue exists for :class:`bytes` and :class:`str` values. If they end " +"with ``\\x00`` nul bytes or characters, those may be *silently stripped* " +"when fetching them by index from the :class:`ShareableList`. This ``." +"rstrip(b'\\x00')`` behavior is considered a bug and may go away in the " +"future. See :gh:`106939`." +msgstr "" + +#: ../../library/multiprocessing.shared_memory.rst:287 +msgid "" +"For applications where rstripping of trailing nulls is a problem, work " +"around it by always unconditionally appending an extra non-0 byte to the end " +"of such values when storing and unconditionally removing it when fetching:" +msgstr "" + +#: ../../library/multiprocessing.shared_memory.rst:310 msgid "Returns the number of occurrences of ``value``." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:284 +#: ../../library/multiprocessing.shared_memory.rst:314 msgid "" "Returns first index position of ``value``. Raises :exc:`ValueError` if " "``value`` is not present." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:289 +#: ../../library/multiprocessing.shared_memory.rst:319 msgid "" "Read-only attribute containing the :mod:`struct` packing format used by all " "currently stored values." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:294 +#: ../../library/multiprocessing.shared_memory.rst:324 msgid "The :class:`SharedMemory` instance where the values are stored." msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:297 +#: ../../library/multiprocessing.shared_memory.rst:327 msgid "" "The following example demonstrates basic use of a :class:`ShareableList` " "instance:" msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:330 +#: ../../library/multiprocessing.shared_memory.rst:360 msgid "" "The following example depicts how one, two, or many processes may access the " "same :class:`ShareableList` by supplying the name of the shared memory block " "behind it:" msgstr "" -#: ../../library/multiprocessing.shared_memory.rst:345 +#: ../../library/multiprocessing.shared_memory.rst:375 msgid "" "The following examples demonstrates that ``ShareableList`` (and underlying " "``SharedMemory``) objects can be pickled and unpickled if needed. Note, that " diff --git a/library/statistics.po b/library/statistics.po index c305f55fe0..6f8f10c91f 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -920,9 +920,9 @@ msgid "" "equal values receive the same rank. The resulting coefficient measures the " "strength of a monotonic relationship." msgstr "" -"如果 *method* 為 \"ranked\",則計算兩輸入的 ``Spearman 等級相關係數 " +"如果 *method* 為 \"ranked\",則計算兩輸入的 `Spearman 等級相關係數 " "(Spearman’s rank correlation coefficient) ``。資料將被取代為等級。平手的情況" +"Spearman%27s_rank_correlation_coefficient>`_。資料將被取代為等級。平手的情況" "則取平均,令相同的值排名也相同。所得係數衡量單調關係 (monotonic " "relationship) 的強度。" diff --git a/library/turtle.po b/library/turtle.po index 3b21472329..6d7d9d2c35 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-26 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,158 +68,283 @@ msgid "" "introducing more complex or external libraries into their work." msgstr "" -#: ../../library/turtle.rst:50 +#: ../../library/turtle.rst:52 msgid "Tutorial" msgstr "" -#: ../../library/turtle.rst:52 +#: ../../library/turtle.rst:54 msgid "" "New users should start here. In this tutorial we'll explore some of the " "basics of turtle drawing." msgstr "" -#: ../../library/turtle.rst:57 +#: ../../library/turtle.rst:59 msgid "Starting a turtle environment" msgstr "" -#: ../../library/turtle.rst:59 +#: ../../library/turtle.rst:61 msgid "In a Python shell, import all the objects of the ``turtle`` module::" msgstr "" -#: ../../library/turtle.rst:63 +#: ../../library/turtle.rst:65 msgid "" "If you run into a ``No module named '_tkinter'`` error, you'll have to " "install the :mod:`Tk interface package ` on your system." msgstr "" -#: ../../library/turtle.rst:68 +#: ../../library/turtle.rst:70 msgid "Basic drawing" msgstr "" -#: ../../library/turtle.rst:70 +#: ../../library/turtle.rst:72 msgid "Send the turtle forward 100 steps::" msgstr "" -#: ../../library/turtle.rst:74 +#: ../../library/turtle.rst:76 msgid "" "You should see (most likely, in a new window on your display) a line drawn " "by the turtle, heading East. Change the direction of the turtle, so that it " "turns 120 degrees left (anti-clockwise)::" msgstr "" -#: ../../library/turtle.rst:80 +#: ../../library/turtle.rst:82 msgid "Let's continue by drawing a triangle::" msgstr "" -#: ../../library/turtle.rst:86 +#: ../../library/turtle.rst:88 msgid "" "Notice how the turtle, represented by an arrow, points in different " "directions as you steer it." msgstr "" -#: ../../library/turtle.rst:89 +#: ../../library/turtle.rst:91 msgid "" "Experiment with those commands, and also with ``backward()`` and ``right()``." msgstr "" -#: ../../library/turtle.rst:94 ../../library/turtle.rst:283 -#: ../../library/turtle.rst:953 +#: ../../library/turtle.rst:96 ../../library/turtle.rst:397 +#: ../../library/turtle.rst:1067 msgid "Pen control" msgstr "" -#: ../../library/turtle.rst:96 +#: ../../library/turtle.rst:98 msgid "" "Try changing the color - for example, ``color('blue')`` - and width of the " "line - for example, ``width(3)`` - and then drawing again." msgstr "" -#: ../../library/turtle.rst:99 +#: ../../library/turtle.rst:101 msgid "" "You can also move the turtle around without drawing, by lifting up the pen: " "``up()`` before moving. To start drawing again, use ``down()``." msgstr "" -#: ../../library/turtle.rst:104 +#: ../../library/turtle.rst:106 msgid "The turtle's position" msgstr "" -#: ../../library/turtle.rst:106 +#: ../../library/turtle.rst:108 msgid "" "Send your turtle back to its starting-point (useful if it has disappeared " "off-screen)::" msgstr "" -#: ../../library/turtle.rst:111 +#: ../../library/turtle.rst:113 msgid "" "The home position is at the center of the turtle's screen. If you ever need " "to know them, get the turtle's x-y co-ordinates with::" msgstr "" -#: ../../library/turtle.rst:116 +#: ../../library/turtle.rst:118 msgid "Home is at ``(0, 0)``." msgstr "" -#: ../../library/turtle.rst:118 +#: ../../library/turtle.rst:120 msgid "" "And after a while, it will probably help to clear the window so we can start " "anew::" msgstr "" -#: ../../library/turtle.rst:125 +#: ../../library/turtle.rst:127 msgid "Making algorithmic patterns" msgstr "" -#: ../../library/turtle.rst:127 +#: ../../library/turtle.rst:129 msgid "Using loops, it's possible to build up geometric patterns::" msgstr "" -#: ../../library/turtle.rst:136 +#: ../../library/turtle.rst:138 msgid "\\ - which of course, are limited only by the imagination!" msgstr "" -#: ../../library/turtle.rst:138 +#: ../../library/turtle.rst:140 msgid "" "Let's draw the star shape at the top of this page. We want red lines, filled " "in with yellow::" msgstr "" -#: ../../library/turtle.rst:144 +#: ../../library/turtle.rst:146 msgid "" "Just as ``up()`` and ``down()`` determine whether lines will be drawn, " "filling can be turned on and off::" msgstr "" -#: ../../library/turtle.rst:149 +#: ../../library/turtle.rst:151 msgid "Next we'll create a loop::" msgstr "" -#: ../../library/turtle.rst:157 +#: ../../library/turtle.rst:159 msgid "" "``abs(pos()) < 1`` is a good way to know when the turtle is back at its home " "position." msgstr "" -#: ../../library/turtle.rst:160 +#: ../../library/turtle.rst:162 msgid "Finally, complete the filling::" msgstr "" -#: ../../library/turtle.rst:164 +#: ../../library/turtle.rst:166 msgid "" "(Note that filling only actually takes place when you give the " "``end_fill()`` command.)" msgstr "" -#: ../../library/turtle.rst:169 +#: ../../library/turtle.rst:173 +msgid "How to..." +msgstr "" + +#: ../../library/turtle.rst:175 +msgid "This section covers some typical turtle use-cases and approaches." +msgstr "" + +#: ../../library/turtle.rst:179 +msgid "Get started as quickly as possible" +msgstr "" + +#: ../../library/turtle.rst:181 +msgid "" +"One of the joys of turtle graphics is the immediate, visual feedback that's " +"available from simple commands - it's an excellent way to introduce children " +"to programming ideas, with a minimum of overhead (not just children, of " +"course)." +msgstr "" + +#: ../../library/turtle.rst:186 +msgid "" +"The turtle module makes this possible by exposing all its basic " +"functionality as functions, available with ``from turtle import *``. The :" +"ref:`turtle graphics tutorial ` covers this approach." +msgstr "" + +#: ../../library/turtle.rst:190 +msgid "" +"It's worth noting that many of the turtle commands also have even more terse " +"equivalents, such as ``fd()`` for :func:`forward`. These are especially " +"useful when working with learners for whom typing is not a skill." +msgstr "" + +#: ../../library/turtle.rst:196 +msgid "" +"You'll need to have the :mod:`Tk interface package ` installed on " +"your system for turtle graphics to work. Be warned that this is not always " +"straightforward, so check this in advance if you're planning to use turtle " +"graphics with a learner." +msgstr "" + +#: ../../library/turtle.rst:203 +msgid "Use the ``turtle`` module namespace" +msgstr "" + +#: ../../library/turtle.rst:205 +msgid "" +"Using ``from turtle import *`` is convenient - but be warned that it imports " +"a rather large collection of objects, and if you're doing anything but " +"turtle graphics you run the risk of a name conflict (this becomes even more " +"an issue if you're using turtle graphics in a script where other modules " +"might be imported)." +msgstr "" + +#: ../../library/turtle.rst:211 +msgid "" +"The solution is to use ``import turtle`` - ``fd()`` becomes ``turtle.fd()``, " +"``width()`` becomes ``turtle.width()`` and so on. (If typing \"turtle\" over " +"and over again becomes tedious, use for example ``import turtle as t`` " +"instead.)" +msgstr "" + +#: ../../library/turtle.rst:218 +msgid "Use turtle graphics in a script" +msgstr "" + +#: ../../library/turtle.rst:220 +msgid "" +"It's recommended to use the ``turtle`` module namespace as described " +"immediately above, for example::" +msgstr "" + +#: ../../library/turtle.rst:232 +msgid "" +"Another step is also required though - as soon as the script ends, Python " +"will also close the turtle's window. Add::" +msgstr "" + +#: ../../library/turtle.rst:237 +msgid "" +"to the end of the script. The script will now wait to be dismissed and will " +"not exit until it is terminated, for example by closing the turtle graphics " +"window." +msgstr "" + +#: ../../library/turtle.rst:243 +msgid "Use object-oriented turtle graphics" +msgstr "" + +#: ../../library/turtle.rst:245 +msgid "" +":ref:`Explanation of the object-oriented interface `" +msgstr "" + +#: ../../library/turtle.rst:247 +msgid "" +"Other than for very basic introductory purposes, or for trying things out as " +"quickly as possible, it's more usual and much more powerful to use the " +"object-oriented approach to turtle graphics. For example, this allows " +"multiple turtles on screen at once." +msgstr "" + +#: ../../library/turtle.rst:252 +msgid "" +"In this approach, the various turtle commands are methods of objects (mostly " +"of ``Turtle`` objects). You *can* use the object-oriented approach in the " +"shell, but it would be more typical in a Python script." +msgstr "" + +#: ../../library/turtle.rst:256 +msgid "The example above then becomes::" +msgstr "" + +#: ../../library/turtle.rst:270 +msgid "" +"Note the last line. ``t.screen`` is an instance of the :class:`Screen` that " +"a Turtle instance exists on; it's created automatically along with the " +"turtle." +msgstr "" + +#: ../../library/turtle.rst:274 +msgid "The turtle's screen can be customised, for example::" +msgstr "" + +#: ../../library/turtle.rst:283 msgid "Explanation" msgstr "" -#: ../../library/turtle.rst:171 +#: ../../library/turtle.rst:285 msgid "" "The :mod:`turtle` module is an extended reimplementation of the same-named " "module from the Python standard distribution up to version Python 2.5." msgstr "" -#: ../../library/turtle.rst:174 +#: ../../library/turtle.rst:288 msgid "" "It tries to keep the merits of the old turtle module and to be (nearly) 100% " "compatible with it. This means in the first place to enable the learning " @@ -227,7 +352,7 @@ msgid "" "using the module from within IDLE run with the ``-n`` switch." msgstr "" -#: ../../library/turtle.rst:179 +#: ../../library/turtle.rst:293 msgid "" "The turtle module provides turtle graphics primitives, in both object-" "oriented and procedure-oriented ways. Because it uses :mod:`tkinter` for " @@ -235,11 +360,11 @@ msgid "" "support." msgstr "" -#: ../../library/turtle.rst:183 +#: ../../library/turtle.rst:297 msgid "The object-oriented interface uses essentially two+two classes:" msgstr "" -#: ../../library/turtle.rst:185 +#: ../../library/turtle.rst:299 msgid "" "The :class:`TurtleScreen` class defines graphics windows as a playground for " "the drawing turtles. Its constructor needs a :class:`tkinter.Canvas` or a :" @@ -247,7 +372,7 @@ msgid "" "used as part of some application." msgstr "" -#: ../../library/turtle.rst:190 +#: ../../library/turtle.rst:304 msgid "" "The function :func:`Screen` returns a singleton object of a :class:" "`TurtleScreen` subclass. This function should be used when :mod:`turtle` is " @@ -255,13 +380,13 @@ msgid "" "inheriting from its class is not possible." msgstr "" -#: ../../library/turtle.rst:195 +#: ../../library/turtle.rst:309 msgid "" "All methods of TurtleScreen/Screen also exist as functions, i.e. as part of " "the procedure-oriented interface." msgstr "" -#: ../../library/turtle.rst:198 +#: ../../library/turtle.rst:312 msgid "" ":class:`RawTurtle` (alias: :class:`RawPen`) defines Turtle objects which " "draw on a :class:`TurtleScreen`. Its constructor needs a Canvas, " @@ -269,20 +394,20 @@ msgid "" "where to draw." msgstr "" -#: ../../library/turtle.rst:202 +#: ../../library/turtle.rst:316 msgid "" "Derived from RawTurtle is the subclass :class:`Turtle` (alias: :class:" "`Pen`), which draws on \"the\" :class:`Screen` instance which is " "automatically created, if not already present." msgstr "" -#: ../../library/turtle.rst:206 +#: ../../library/turtle.rst:320 msgid "" "All methods of RawTurtle/Turtle also exist as functions, i.e. part of the " "procedure-oriented interface." msgstr "" -#: ../../library/turtle.rst:209 +#: ../../library/turtle.rst:323 msgid "" "The procedural interface provides functions which are derived from the " "methods of the classes :class:`Screen` and :class:`Turtle`. They have the " @@ -292,32 +417,32 @@ msgid "" "functions derived from a Turtle method is called." msgstr "" -#: ../../library/turtle.rst:216 +#: ../../library/turtle.rst:330 msgid "" "To use multiple turtles on a screen one has to use the object-oriented " "interface." msgstr "" -#: ../../library/turtle.rst:219 +#: ../../library/turtle.rst:333 msgid "" "In the following documentation the argument list for functions is given. " "Methods, of course, have the additional first argument *self* which is " "omitted here." msgstr "" -#: ../../library/turtle.rst:225 +#: ../../library/turtle.rst:339 msgid "Turtle graphics reference" msgstr "" -#: ../../library/turtle.rst:228 +#: ../../library/turtle.rst:342 msgid "Turtle methods" msgstr "" -#: ../../library/turtle.rst:260 ../../library/turtle.rst:370 +#: ../../library/turtle.rst:374 ../../library/turtle.rst:484 msgid "Turtle motion" msgstr "" -#: ../../library/turtle.rst:248 +#: ../../library/turtle.rst:362 msgid "Move and draw" msgstr "" @@ -361,7 +486,7 @@ msgstr ":func:`setheading` | :func:`seth`" msgid ":func:`home`" msgstr ":func:`home`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2625 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2739 msgid ":func:`circle`" msgstr ":func:`circle`" @@ -369,7 +494,7 @@ msgstr ":func:`circle`" msgid ":func:`dot`" msgstr ":func:`dot`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2603 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2717 msgid ":func:`stamp`" msgstr ":func:`stamp`" @@ -389,7 +514,7 @@ msgstr ":func:`undo`" msgid ":func:`speed`" msgstr ":func:`speed`" -#: ../../library/turtle.rst:256 ../../library/turtle.rst:802 +#: ../../library/turtle.rst:370 ../../library/turtle.rst:916 msgid "Tell Turtle's state" msgstr "" @@ -417,7 +542,7 @@ msgstr ":func:`heading`" msgid ":func:`distance`" msgstr ":func:`distance`" -#: ../../library/turtle.rst:260 +#: ../../library/turtle.rst:374 msgid "Setting and measurement" msgstr "" @@ -429,7 +554,7 @@ msgstr ":func:`degrees`" msgid ":func:`radians`" msgstr ":func:`radians`" -#: ../../library/turtle.rst:268 ../../library/turtle.rst:956 +#: ../../library/turtle.rst:382 ../../library/turtle.rst:1070 msgid "Drawing state" msgstr "" @@ -453,7 +578,7 @@ msgstr ":func:`pen`" msgid ":func:`isdown`" msgstr ":func:`isdown`" -#: ../../library/turtle.rst:273 ../../library/turtle.rst:1048 +#: ../../library/turtle.rst:387 ../../library/turtle.rst:1162 msgid "Color control" msgstr "" @@ -469,7 +594,7 @@ msgstr ":func:`pencolor`" msgid ":func:`fillcolor`" msgstr ":func:`fillcolor`" -#: ../../library/turtle.rst:278 ../../library/turtle.rst:1180 +#: ../../library/turtle.rst:392 ../../library/turtle.rst:1294 msgid "Filling" msgstr "" @@ -485,7 +610,7 @@ msgstr ":func:`begin_fill`" msgid ":func:`end_fill`" msgstr ":func:`end_fill`" -#: ../../library/turtle.rst:283 ../../library/turtle.rst:1227 +#: ../../library/turtle.rst:397 ../../library/turtle.rst:1341 msgid "More drawing control" msgstr "" @@ -501,11 +626,11 @@ msgstr ":func:`clear`" msgid ":func:`write`" msgstr ":func:`write`" -#: ../../library/turtle.rst:300 ../../library/turtle.rst:1273 +#: ../../library/turtle.rst:414 ../../library/turtle.rst:1387 msgid "Turtle state" msgstr "" -#: ../../library/turtle.rst:289 ../../library/turtle.rst:1276 +#: ../../library/turtle.rst:403 ../../library/turtle.rst:1390 msgid "Visibility" msgstr "" @@ -521,7 +646,7 @@ msgstr ":func:`hideturtle` | :func:`ht`" msgid ":func:`isvisible`" msgstr ":func:`isvisible`" -#: ../../library/turtle.rst:300 ../../library/turtle.rst:1315 +#: ../../library/turtle.rst:414 ../../library/turtle.rst:1429 msgid "Appearance" msgstr "" @@ -561,11 +686,11 @@ msgstr ":func:`shapetransform`" msgid ":func:`get_shapepoly`" msgstr ":func:`get_shapepoly`" -#: ../../library/turtle.rst:305 ../../library/turtle.rst:1520 +#: ../../library/turtle.rst:419 ../../library/turtle.rst:1634 msgid "Using events" msgstr "" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2597 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2711 msgid ":func:`onclick`" msgstr ":func:`onclick`" @@ -573,11 +698,11 @@ msgstr ":func:`onclick`" msgid ":func:`onrelease`" msgstr ":func:`onrelease`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2580 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2694 msgid ":func:`ondrag`" msgstr ":func:`ondrag`" -#: ../../library/turtle.rst:316 ../../library/turtle.rst:1594 +#: ../../library/turtle.rst:430 ../../library/turtle.rst:1708 msgid "Special Turtle methods" msgstr "" @@ -593,7 +718,7 @@ msgstr ":func:`end_poly`" msgid ":func:`get_poly`" msgstr ":func:`get_poly`" -#: ../../library/turtle.rst:0 ../../library/turtle.rst:2619 +#: ../../library/turtle.rst:0 ../../library/turtle.rst:2733 msgid ":func:`clone`" msgstr ":func:`clone`" @@ -613,11 +738,11 @@ msgstr ":func:`setundobuffer`" msgid ":func:`undobufferentries`" msgstr ":func:`undobufferentries`" -#: ../../library/turtle.rst:319 +#: ../../library/turtle.rst:433 msgid "Methods of TurtleScreen/Screen" msgstr "" -#: ../../library/turtle.rst:327 ../../library/turtle.rst:1748 +#: ../../library/turtle.rst:441 ../../library/turtle.rst:1862 msgid "Window control" msgstr "" @@ -645,7 +770,7 @@ msgstr ":func:`screensize`" msgid ":func:`setworldcoordinates`" msgstr ":func:`setworldcoordinates`" -#: ../../library/turtle.rst:332 ../../library/turtle.rst:1871 +#: ../../library/turtle.rst:446 ../../library/turtle.rst:1985 msgid "Animation control" msgstr "" @@ -661,7 +786,7 @@ msgstr ":func:`tracer`" msgid ":func:`update`" msgstr ":func:`update`" -#: ../../library/turtle.rst:340 ../../library/turtle.rst:1924 +#: ../../library/turtle.rst:454 ../../library/turtle.rst:2038 msgid "Using screen events" msgstr "" @@ -689,7 +814,7 @@ msgstr ":func:`ontimer`" msgid ":func:`mainloop` | :func:`done`" msgstr ":func:`mainloop` | :func:`done`" -#: ../../library/turtle.rst:350 ../../library/turtle.rst:2069 +#: ../../library/turtle.rst:464 ../../library/turtle.rst:2183 msgid "Settings and special methods" msgstr "" @@ -725,7 +850,7 @@ msgstr ":func:`window_height`" msgid ":func:`window_width`" msgstr ":func:`window_width`" -#: ../../library/turtle.rst:354 ../../library/turtle.rst:2033 +#: ../../library/turtle.rst:468 ../../library/turtle.rst:2147 msgid "Input methods" msgstr "" @@ -737,7 +862,7 @@ msgstr ":func:`textinput`" msgid ":func:`numinput`" msgstr ":func:`numinput`" -#: ../../library/turtle.rst:361 +#: ../../library/turtle.rst:475 msgid "Methods specific to Screen" msgstr "" @@ -757,11 +882,11 @@ msgstr ":func:`setup`" msgid ":func:`title`" msgstr ":func:`title`" -#: ../../library/turtle.rst:364 +#: ../../library/turtle.rst:478 msgid "Methods of RawTurtle/Turtle and corresponding functions" msgstr "" -#: ../../library/turtle.rst:366 +#: ../../library/turtle.rst:480 msgid "" "Most of the examples in this section refer to a Turtle instance called " "``turtle``." @@ -771,70 +896,70 @@ msgstr "" msgid "Parameters" msgstr "參數" -#: ../../library/turtle.rst:375 ../../library/turtle.rst:420 -#: ../../library/turtle.rst:445 ../../library/turtle.rst:543 -#: ../../library/turtle.rst:566 ../../library/turtle.rst:589 +#: ../../library/turtle.rst:489 ../../library/turtle.rst:534 +#: ../../library/turtle.rst:559 ../../library/turtle.rst:657 +#: ../../library/turtle.rst:680 ../../library/turtle.rst:703 msgid "a number (integer or float)" msgstr "" -#: ../../library/turtle.rst:377 +#: ../../library/turtle.rst:491 msgid "" "Move the turtle forward by the specified *distance*, in the direction the " "turtle is headed." msgstr "" -#: ../../library/turtle.rst:397 ../../library/turtle.rst:639 -#: ../../library/turtle.rst:906 ../../library/turtle.rst:1414 -#: ../../library/turtle.rst:1433 +#: ../../library/turtle.rst:511 ../../library/turtle.rst:753 +#: ../../library/turtle.rst:1020 ../../library/turtle.rst:1528 +#: ../../library/turtle.rst:1547 msgid "a number" msgstr "" -#: ../../library/turtle.rst:399 +#: ../../library/turtle.rst:513 msgid "" "Move the turtle backward by *distance*, opposite to the direction the turtle " "is headed. Do not change the turtle's heading." msgstr "" -#: ../../library/turtle.rst:422 +#: ../../library/turtle.rst:536 msgid "" "Turn turtle right by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:447 +#: ../../library/turtle.rst:561 msgid "" "Turn turtle left by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: ../../library/turtle.rst:471 +#: ../../library/turtle.rst:585 msgid "a number or a pair/vector of numbers" msgstr "" -#: ../../library/turtle.rst:472 ../../library/turtle.rst:505 -#: ../../library/turtle.rst:506 +#: ../../library/turtle.rst:586 ../../library/turtle.rst:619 +#: ../../library/turtle.rst:620 msgid "a number or ``None``" msgstr "" -#: ../../library/turtle.rst:474 +#: ../../library/turtle.rst:588 msgid "" "If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` (e." "g. as returned by :func:`pos`)." msgstr "" -#: ../../library/turtle.rst:477 +#: ../../library/turtle.rst:591 msgid "" "Move turtle to an absolute position. If the pen is down, draw line. Do not " "change the turtle's orientation." msgstr "" -#: ../../library/turtle.rst:507 +#: ../../library/turtle.rst:621 msgid "a boolean" msgstr "" -#: ../../library/turtle.rst:509 +#: ../../library/turtle.rst:623 msgid "" "Move turtle to an absolute position. Unlike goto(x, y), a line will not be " "drawn. The turtle's orientation does not change. If currently filling, the " @@ -844,77 +969,77 @@ msgid "" "barrier like in goto(x, y)." msgstr "" -#: ../../library/turtle.rst:545 +#: ../../library/turtle.rst:659 msgid "" "Set the turtle's first coordinate to *x*, leave second coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:568 +#: ../../library/turtle.rst:682 msgid "" "Set the turtle's second coordinate to *y*, leave first coordinate unchanged." msgstr "" -#: ../../library/turtle.rst:591 +#: ../../library/turtle.rst:705 msgid "" "Set the orientation of the turtle to *to_angle*. Here are some common " "directions in degrees:" msgstr "" -#: ../../library/turtle.rst:595 +#: ../../library/turtle.rst:709 msgid "standard mode" msgstr "" -#: ../../library/turtle.rst:595 +#: ../../library/turtle.rst:709 msgid "logo mode" msgstr "" -#: ../../library/turtle.rst:597 +#: ../../library/turtle.rst:711 msgid "0 - east" msgstr "" -#: ../../library/turtle.rst:597 +#: ../../library/turtle.rst:711 msgid "0 - north" msgstr "" -#: ../../library/turtle.rst:598 +#: ../../library/turtle.rst:712 msgid "90 - north" msgstr "" -#: ../../library/turtle.rst:598 +#: ../../library/turtle.rst:712 msgid "90 - east" msgstr "" -#: ../../library/turtle.rst:599 +#: ../../library/turtle.rst:713 msgid "180 - west" msgstr "" -#: ../../library/turtle.rst:599 +#: ../../library/turtle.rst:713 msgid "180 - south" msgstr "" -#: ../../library/turtle.rst:600 +#: ../../library/turtle.rst:714 msgid "270 - south" msgstr "" -#: ../../library/turtle.rst:600 +#: ../../library/turtle.rst:714 msgid "270 - west" msgstr "" -#: ../../library/turtle.rst:613 +#: ../../library/turtle.rst:727 msgid "" "Move turtle to the origin -- coordinates (0,0) -- and set its heading to its " "start-orientation (which depends on the mode, see :func:`mode`)." msgstr "" -#: ../../library/turtle.rst:640 +#: ../../library/turtle.rst:754 msgid "a number (or ``None``)" msgstr "" -#: ../../library/turtle.rst:641 ../../library/turtle.rst:734 +#: ../../library/turtle.rst:755 ../../library/turtle.rst:848 msgid "an integer (or ``None``)" msgstr "" -#: ../../library/turtle.rst:643 +#: ../../library/turtle.rst:757 msgid "" "Draw a circle with given *radius*. The center is *radius* units left of the " "turtle; *extent* -- an angle -- determines which part of the circle is " @@ -925,117 +1050,117 @@ msgid "" "changed by the amount of *extent*." msgstr "" -#: ../../library/turtle.rst:651 +#: ../../library/turtle.rst:765 msgid "" "As the circle is approximated by an inscribed regular polygon, *steps* " "determines the number of steps to use. If not given, it will be calculated " "automatically. May be used to draw regular polygons." msgstr "" -#: ../../library/turtle.rst:677 +#: ../../library/turtle.rst:791 msgid "an integer >= 1 (if given)" msgstr "" -#: ../../library/turtle.rst:678 +#: ../../library/turtle.rst:792 msgid "a colorstring or a numeric color tuple" msgstr "" -#: ../../library/turtle.rst:680 +#: ../../library/turtle.rst:794 msgid "" "Draw a circular dot with diameter *size*, using *color*. If *size* is not " "given, the maximum of pensize+4 and 2*pensize is used." msgstr "" -#: ../../library/turtle.rst:698 +#: ../../library/turtle.rst:812 msgid "" "Stamp a copy of the turtle shape onto the canvas at the current turtle " "position. Return a stamp_id for that stamp, which can be used to delete it " "by calling ``clearstamp(stamp_id)``." msgstr "" -#: ../../library/turtle.rst:712 +#: ../../library/turtle.rst:826 msgid "an integer, must be return value of previous :func:`stamp` call" msgstr "" -#: ../../library/turtle.rst:715 +#: ../../library/turtle.rst:829 msgid "Delete stamp with given *stampid*." msgstr "" -#: ../../library/turtle.rst:736 +#: ../../library/turtle.rst:850 msgid "" "Delete all or first/last *n* of turtle's stamps. If *n* is ``None``, delete " "all stamps, if *n* > 0 delete first *n* stamps, else if *n* < 0 delete last " "*n* stamps." msgstr "" -#: ../../library/turtle.rst:752 +#: ../../library/turtle.rst:866 msgid "" "Undo (repeatedly) the last turtle action(s). Number of available undo " "actions is determined by the size of the undobuffer." msgstr "" -#: ../../library/turtle.rst:767 +#: ../../library/turtle.rst:881 msgid "an integer in the range 0..10 or a speedstring (see below)" msgstr "" -#: ../../library/turtle.rst:769 +#: ../../library/turtle.rst:883 msgid "" "Set the turtle's speed to an integer value in the range 0..10. If no " "argument is given, return current speed." msgstr "" -#: ../../library/turtle.rst:772 +#: ../../library/turtle.rst:886 msgid "" "If input is a number greater than 10 or smaller than 0.5, speed is set to " "0. Speedstrings are mapped to speedvalues as follows:" msgstr "" -#: ../../library/turtle.rst:775 +#: ../../library/turtle.rst:889 msgid "\"fastest\": 0" msgstr "" -#: ../../library/turtle.rst:776 +#: ../../library/turtle.rst:890 msgid "\"fast\": 10" msgstr "" -#: ../../library/turtle.rst:777 +#: ../../library/turtle.rst:891 msgid "\"normal\": 6" msgstr "" -#: ../../library/turtle.rst:778 +#: ../../library/turtle.rst:892 msgid "\"slow\": 3" msgstr "" -#: ../../library/turtle.rst:779 +#: ../../library/turtle.rst:893 msgid "\"slowest\": 1" msgstr "" -#: ../../library/turtle.rst:781 +#: ../../library/turtle.rst:895 msgid "" "Speeds from 1 to 10 enforce increasingly faster animation of line drawing " "and turtle turning." msgstr "" -#: ../../library/turtle.rst:784 +#: ../../library/turtle.rst:898 msgid "" "Attention: *speed* = 0 means that *no* animation takes place. forward/back " "makes turtle jump and likewise left/right make the turtle turn instantly." msgstr "" -#: ../../library/turtle.rst:807 +#: ../../library/turtle.rst:921 msgid "" "Return the turtle's current location (x,y) (as a :class:`Vec2D` vector)." msgstr "" -#: ../../library/turtle.rst:818 ../../library/turtle.rst:881 +#: ../../library/turtle.rst:932 ../../library/turtle.rst:995 msgid "a number or a pair/vector of numbers or a turtle instance" msgstr "" -#: ../../library/turtle.rst:819 ../../library/turtle.rst:882 +#: ../../library/turtle.rst:933 ../../library/turtle.rst:996 msgid "a number if *x* is a number, else ``None``" msgstr "" -#: ../../library/turtle.rst:821 +#: ../../library/turtle.rst:935 msgid "" "Return the angle between the line from turtle position to position specified " "by (x,y), the vector or the other turtle. This depends on the turtle's " @@ -1043,116 +1168,116 @@ msgid "" "\"logo\"." msgstr "" -#: ../../library/turtle.rst:835 +#: ../../library/turtle.rst:949 msgid "Return the turtle's x coordinate." msgstr "" -#: ../../library/turtle.rst:851 +#: ../../library/turtle.rst:965 msgid "Return the turtle's y coordinate." msgstr "" -#: ../../library/turtle.rst:867 +#: ../../library/turtle.rst:981 msgid "" "Return the turtle's current heading (value depends on the turtle mode, see :" "func:`mode`)." msgstr "" -#: ../../library/turtle.rst:884 +#: ../../library/turtle.rst:998 msgid "" "Return the distance from the turtle to (x,y), the given vector, or the given " "other turtle, in turtle step units." msgstr "" -#: ../../library/turtle.rst:902 +#: ../../library/turtle.rst:1016 msgid "Settings for measurement" msgstr "" -#: ../../library/turtle.rst:908 +#: ../../library/turtle.rst:1022 msgid "" "Set angle measurement units, i.e. set number of \"degrees\" for a full " "circle. Default value is 360 degrees." msgstr "" -#: ../../library/turtle.rst:931 +#: ../../library/turtle.rst:1045 msgid "" "Set the angle measurement units to radians. Equivalent to ``degrees(2*math." "pi)``." msgstr "" -#: ../../library/turtle.rst:962 +#: ../../library/turtle.rst:1076 msgid "Pull the pen down -- drawing when moving." msgstr "" -#: ../../library/turtle.rst:969 +#: ../../library/turtle.rst:1083 msgid "Pull the pen up -- no drawing when moving." msgstr "" -#: ../../library/turtle.rst:975 +#: ../../library/turtle.rst:1089 msgid "a positive number" msgstr "" -#: ../../library/turtle.rst:977 +#: ../../library/turtle.rst:1091 msgid "" "Set the line thickness to *width* or return it. If resizemode is set to " "\"auto\" and turtleshape is a polygon, that polygon is drawn with the same " "line thickness. If no argument is given, the current pensize is returned." msgstr "" -#: ../../library/turtle.rst:991 +#: ../../library/turtle.rst:1105 msgid "a dictionary with some or all of the below listed keys" msgstr "" -#: ../../library/turtle.rst:992 +#: ../../library/turtle.rst:1106 msgid "one or more keyword-arguments with the below listed keys as keywords" msgstr "" -#: ../../library/turtle.rst:994 +#: ../../library/turtle.rst:1108 msgid "" "Return or set the pen's attributes in a \"pen-dictionary\" with the " "following key/value pairs:" msgstr "" -#: ../../library/turtle.rst:997 +#: ../../library/turtle.rst:1111 msgid "\"shown\": True/False" msgstr "" -#: ../../library/turtle.rst:998 +#: ../../library/turtle.rst:1112 msgid "\"pendown\": True/False" msgstr "" -#: ../../library/turtle.rst:999 +#: ../../library/turtle.rst:1113 msgid "\"pencolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:1000 +#: ../../library/turtle.rst:1114 msgid "\"fillcolor\": color-string or color-tuple" msgstr "" -#: ../../library/turtle.rst:1001 +#: ../../library/turtle.rst:1115 msgid "\"pensize\": positive number" msgstr "" -#: ../../library/turtle.rst:1002 +#: ../../library/turtle.rst:1116 msgid "\"speed\": number in range 0..10" msgstr "" -#: ../../library/turtle.rst:1003 +#: ../../library/turtle.rst:1117 msgid "\"resizemode\": \"auto\" or \"user\" or \"noresize\"" msgstr "" -#: ../../library/turtle.rst:1004 +#: ../../library/turtle.rst:1118 msgid "\"stretchfactor\": (positive number, positive number)" msgstr "" -#: ../../library/turtle.rst:1005 +#: ../../library/turtle.rst:1119 msgid "\"outline\": positive number" msgstr "" -#: ../../library/turtle.rst:1006 +#: ../../library/turtle.rst:1120 msgid "\"tilt\": number" msgstr "" -#: ../../library/turtle.rst:1008 +#: ../../library/turtle.rst:1122 msgid "" "This dictionary can be used as argument for a subsequent call to :func:`pen` " "to restore the former pen-state. Moreover one or more of these attributes " @@ -1160,182 +1285,182 @@ msgid "" "attributes in one statement." msgstr "" -#: ../../library/turtle.rst:1034 +#: ../../library/turtle.rst:1148 msgid "Return ``True`` if pen is down, ``False`` if it's up." msgstr "" -#: ../../library/turtle.rst:1052 +#: ../../library/turtle.rst:1166 msgid "Return or set the pencolor." msgstr "" -#: ../../library/turtle.rst:1054 ../../library/turtle.rst:1103 +#: ../../library/turtle.rst:1168 ../../library/turtle.rst:1217 msgid "Four input formats are allowed:" msgstr "" -#: ../../library/turtle.rst:1059 +#: ../../library/turtle.rst:1173 msgid "``pencolor()``" msgstr "``pencolor()``" -#: ../../library/turtle.rst:1057 +#: ../../library/turtle.rst:1171 msgid "" "Return the current pencolor as color specification string or as a tuple (see " "example). May be used as input to another color/pencolor/fillcolor call." msgstr "" -#: ../../library/turtle.rst:1063 +#: ../../library/turtle.rst:1177 msgid "``pencolor(colorstring)``" msgstr "``pencolor(colorstring)``" -#: ../../library/turtle.rst:1062 +#: ../../library/turtle.rst:1176 msgid "" "Set pencolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:1068 +#: ../../library/turtle.rst:1182 msgid "``pencolor((r, g, b))``" msgstr "``pencolor((r, g, b))``" -#: ../../library/turtle.rst:1066 +#: ../../library/turtle.rst:1180 msgid "" "Set pencolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:1072 +#: ../../library/turtle.rst:1186 msgid "``pencolor(r, g, b)``" msgstr "``pencolor(r, g, b)``" -#: ../../library/turtle.rst:1071 +#: ../../library/turtle.rst:1185 msgid "" "Set pencolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:1074 +#: ../../library/turtle.rst:1188 msgid "" "If turtleshape is a polygon, the outline of that polygon is drawn with the " "newly set pencolor." msgstr "" -#: ../../library/turtle.rst:1101 +#: ../../library/turtle.rst:1215 msgid "Return or set the fillcolor." msgstr "" -#: ../../library/turtle.rst:1108 +#: ../../library/turtle.rst:1222 msgid "``fillcolor()``" msgstr "``fillcolor()``" -#: ../../library/turtle.rst:1106 +#: ../../library/turtle.rst:1220 msgid "" "Return the current fillcolor as color specification string, possibly in " "tuple format (see example). May be used as input to another color/pencolor/" "fillcolor call." msgstr "" -#: ../../library/turtle.rst:1112 +#: ../../library/turtle.rst:1226 msgid "``fillcolor(colorstring)``" msgstr "``fillcolor(colorstring)``" -#: ../../library/turtle.rst:1111 +#: ../../library/turtle.rst:1225 msgid "" "Set fillcolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: ../../library/turtle.rst:1117 +#: ../../library/turtle.rst:1231 msgid "``fillcolor((r, g, b))``" msgstr "``fillcolor((r, g, b))``" -#: ../../library/turtle.rst:1115 +#: ../../library/turtle.rst:1229 msgid "" "Set fillcolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: ../../library/turtle.rst:1121 +#: ../../library/turtle.rst:1235 msgid "``fillcolor(r, g, b)``" msgstr "``fillcolor(r, g, b)``" -#: ../../library/turtle.rst:1120 +#: ../../library/turtle.rst:1234 msgid "" "Set fillcolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: ../../library/turtle.rst:1123 +#: ../../library/turtle.rst:1237 msgid "" "If turtleshape is a polygon, the interior of that polygon is drawn with the " "newly set fillcolor." msgstr "" -#: ../../library/turtle.rst:1144 +#: ../../library/turtle.rst:1258 msgid "Return or set pencolor and fillcolor." msgstr "" -#: ../../library/turtle.rst:1146 +#: ../../library/turtle.rst:1260 msgid "" "Several input formats are allowed. They use 0 to 3 arguments as follows:" msgstr "" -#: ../../library/turtle.rst:1152 +#: ../../library/turtle.rst:1266 msgid "``color()``" msgstr "``color()``" -#: ../../library/turtle.rst:1150 +#: ../../library/turtle.rst:1264 msgid "" "Return the current pencolor and the current fillcolor as a pair of color " "specification strings or tuples as returned by :func:`pencolor` and :func:" "`fillcolor`." msgstr "" -#: ../../library/turtle.rst:1156 +#: ../../library/turtle.rst:1270 msgid "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" msgstr "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" -#: ../../library/turtle.rst:1155 +#: ../../library/turtle.rst:1269 msgid "" "Inputs as in :func:`pencolor`, set both, fillcolor and pencolor, to the " "given value." msgstr "" -#: ../../library/turtle.rst:1160 +#: ../../library/turtle.rst:1274 msgid "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" msgstr "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" -#: ../../library/turtle.rst:1159 +#: ../../library/turtle.rst:1273 msgid "" "Equivalent to ``pencolor(colorstring1)`` and ``fillcolor(colorstring2)`` and " "analogously if the other input format is used." msgstr "" -#: ../../library/turtle.rst:1162 +#: ../../library/turtle.rst:1276 msgid "" "If turtleshape is a polygon, outline and interior of that polygon is drawn " "with the newly set colors." msgstr "" -#: ../../library/turtle.rst:1176 +#: ../../library/turtle.rst:1290 msgid "See also: Screen method :func:`colormode`." msgstr "" -#: ../../library/turtle.rst:1190 +#: ../../library/turtle.rst:1304 msgid "Return fillstate (``True`` if filling, ``False`` else)." msgstr "" -#: ../../library/turtle.rst:1205 +#: ../../library/turtle.rst:1319 msgid "To be called just before drawing a shape to be filled." msgstr "" -#: ../../library/turtle.rst:1210 +#: ../../library/turtle.rst:1324 msgid "Fill the shape drawn after the last call to :func:`begin_fill`." msgstr "" -#: ../../library/turtle.rst:1212 +#: ../../library/turtle.rst:1326 msgid "" "Whether or not overlap regions for self-intersecting polygons or multiple " "shapes are filled depends on the operating system graphics, type of overlap, " @@ -1343,36 +1468,36 @@ msgid "" "all yellow or have some white regions." msgstr "" -#: ../../library/turtle.rst:1231 +#: ../../library/turtle.rst:1345 msgid "" "Delete the turtle's drawings from the screen, re-center the turtle and set " "variables to the default values." msgstr "" -#: ../../library/turtle.rst:1252 +#: ../../library/turtle.rst:1366 msgid "" "Delete the turtle's drawings from the screen. Do not move turtle. State " "and position of the turtle as well as drawings of other turtles are not " "affected." msgstr "" -#: ../../library/turtle.rst:1258 +#: ../../library/turtle.rst:1372 msgid "object to be written to the TurtleScreen" msgstr "" -#: ../../library/turtle.rst:1259 +#: ../../library/turtle.rst:1373 msgid "True/False" msgstr "" -#: ../../library/turtle.rst:1260 +#: ../../library/turtle.rst:1374 msgid "one of the strings \"left\", \"center\" or right\"" msgstr "" -#: ../../library/turtle.rst:1261 +#: ../../library/turtle.rst:1375 msgid "a triple (fontname, fontsize, fonttype)" msgstr "" -#: ../../library/turtle.rst:1263 +#: ../../library/turtle.rst:1377 msgid "" "Write text - the string representation of *arg* - at the current turtle " "position according to *align* (\"left\", \"center\" or \"right\") and with " @@ -1380,26 +1505,26 @@ msgid "" "corner of the text. By default, *move* is ``False``." msgstr "" -#: ../../library/turtle.rst:1281 +#: ../../library/turtle.rst:1395 msgid "" "Make the turtle invisible. It's a good idea to do this while you're in the " "middle of doing some complex drawing, because hiding the turtle speeds up " "the drawing observably." msgstr "" -#: ../../library/turtle.rst:1294 +#: ../../library/turtle.rst:1408 msgid "Make the turtle visible." msgstr "" -#: ../../library/turtle.rst:1304 +#: ../../library/turtle.rst:1418 msgid "Return ``True`` if the Turtle is shown, ``False`` if it's hidden." msgstr "" -#: ../../library/turtle.rst:1319 +#: ../../library/turtle.rst:1433 msgid "a string which is a valid shapename" msgstr "" -#: ../../library/turtle.rst:1321 +#: ../../library/turtle.rst:1435 msgid "" "Set turtle shape to shape with given *name* or, if name is not given, return " "name of current shape. Shape with *name* must exist in the TurtleScreen's " @@ -1409,45 +1534,45 @@ msgid "" "`register_shape`." msgstr "" -#: ../../library/turtle.rst:1339 +#: ../../library/turtle.rst:1453 msgid "one of the strings \"auto\", \"user\", \"noresize\"" msgstr "" -#: ../../library/turtle.rst:1341 +#: ../../library/turtle.rst:1455 msgid "" "Set resizemode to one of the values: \"auto\", \"user\", \"noresize\". If " "*rmode* is not given, return current resizemode. Different resizemodes have " "the following effects:" msgstr "" -#: ../../library/turtle.rst:1345 +#: ../../library/turtle.rst:1459 msgid "" "\"auto\": adapts the appearance of the turtle corresponding to the value of " "pensize." msgstr "" -#: ../../library/turtle.rst:1346 +#: ../../library/turtle.rst:1460 msgid "" "\"user\": adapts the appearance of the turtle according to the values of " "stretchfactor and outlinewidth (outline), which are set by :func:`shapesize`." msgstr "" -#: ../../library/turtle.rst:1349 +#: ../../library/turtle.rst:1463 msgid "\"noresize\": no adaption of the turtle's appearance takes place." msgstr "" -#: ../../library/turtle.rst:1351 +#: ../../library/turtle.rst:1465 msgid "" "``resizemode(\"user\")`` is called by :func:`shapesize` when used with " "arguments." msgstr "" -#: ../../library/turtle.rst:1366 ../../library/turtle.rst:1367 -#: ../../library/turtle.rst:1368 +#: ../../library/turtle.rst:1480 ../../library/turtle.rst:1481 +#: ../../library/turtle.rst:1482 msgid "positive number" msgstr "" -#: ../../library/turtle.rst:1370 +#: ../../library/turtle.rst:1484 msgid "" "Return or set the pen's attributes x/y-stretchfactors and/or outline. Set " "resizemode to \"user\". If and only if resizemode is set to \"user\", the " @@ -1457,12 +1582,12 @@ msgid "" "determines the width of the shape's outline." msgstr "" -#: ../../library/turtle.rst:1393 ../../library/turtle.rst:2052 -#: ../../library/turtle.rst:2053 ../../library/turtle.rst:2054 +#: ../../library/turtle.rst:1507 ../../library/turtle.rst:2166 +#: ../../library/turtle.rst:2167 ../../library/turtle.rst:2168 msgid "number (optional)" msgstr "" -#: ../../library/turtle.rst:1395 +#: ../../library/turtle.rst:1509 msgid "" "Set or return the current shearfactor. Shear the turtleshape according to " "the given shearfactor shear, which is the tangent of the shear angle. Do " @@ -1471,26 +1596,26 @@ msgid "" "by which lines parallel to the heading of the turtle are sheared." msgstr "" -#: ../../library/turtle.rst:1416 +#: ../../library/turtle.rst:1530 msgid "" "Rotate the turtleshape by *angle* from its current tilt-angle, but do *not* " "change the turtle's heading (direction of movement)." msgstr "" -#: ../../library/turtle.rst:1435 +#: ../../library/turtle.rst:1549 msgid "" "Rotate the turtleshape to point in the direction specified by *angle*, " "regardless of its current tilt-angle. *Do not* change the turtle's heading " "(direction of movement)." msgstr "" -#: ../../library/turtle.rst:1455 ../../library/turtle.rst:1478 -#: ../../library/turtle.rst:1479 ../../library/turtle.rst:1480 -#: ../../library/turtle.rst:1481 +#: ../../library/turtle.rst:1569 ../../library/turtle.rst:1592 +#: ../../library/turtle.rst:1593 ../../library/turtle.rst:1594 +#: ../../library/turtle.rst:1595 msgid "a number (optional)" msgstr "" -#: ../../library/turtle.rst:1457 +#: ../../library/turtle.rst:1571 msgid "" "Set or return the current tilt-angle. If angle is given, rotate the " "turtleshape to point in the direction specified by angle, regardless of its " @@ -1500,11 +1625,11 @@ msgid "" "turtle (its direction of movement)." msgstr "" -#: ../../library/turtle.rst:1483 +#: ../../library/turtle.rst:1597 msgid "Set or return the current transformation matrix of the turtle shape." msgstr "" -#: ../../library/turtle.rst:1485 +#: ../../library/turtle.rst:1599 msgid "" "If none of the matrix elements are given, return the transformation matrix " "as a tuple of 4 elements. Otherwise set the given elements and transform the " @@ -1514,101 +1639,101 @@ msgid "" "tiltangle according to the given matrix." msgstr "" -#: ../../library/turtle.rst:1507 +#: ../../library/turtle.rst:1621 msgid "" "Return the current shape polygon as tuple of coordinate pairs. This can be " "used to define a new shape or components of a compound shape." msgstr "" -#: ../../library/turtle.rst:1525 ../../library/turtle.rst:1547 -#: ../../library/turtle.rst:1572 ../../library/turtle.rst:1976 +#: ../../library/turtle.rst:1639 ../../library/turtle.rst:1661 +#: ../../library/turtle.rst:1686 ../../library/turtle.rst:2090 msgid "" "a function with two arguments which will be called with the coordinates of " "the clicked point on the canvas" msgstr "" -#: ../../library/turtle.rst:1527 ../../library/turtle.rst:1549 -#: ../../library/turtle.rst:1574 ../../library/turtle.rst:1978 +#: ../../library/turtle.rst:1641 ../../library/turtle.rst:1663 +#: ../../library/turtle.rst:1688 ../../library/turtle.rst:2092 msgid "number of the mouse-button, defaults to 1 (left mouse button)" msgstr "" -#: ../../library/turtle.rst:1528 ../../library/turtle.rst:1550 -#: ../../library/turtle.rst:1575 ../../library/turtle.rst:1979 +#: ../../library/turtle.rst:1642 ../../library/turtle.rst:1664 +#: ../../library/turtle.rst:1689 ../../library/turtle.rst:2093 msgid "" "``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise " "it will replace a former binding" msgstr "" -#: ../../library/turtle.rst:1531 +#: ../../library/turtle.rst:1645 msgid "" "Bind *fun* to mouse-click events on this turtle. If *fun* is ``None``, " "existing bindings are removed. Example for the anonymous turtle, i.e. the " "procedural way:" msgstr "" -#: ../../library/turtle.rst:1553 +#: ../../library/turtle.rst:1667 msgid "" "Bind *fun* to mouse-button-release events on this turtle. If *fun* is " "``None``, existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1578 +#: ../../library/turtle.rst:1692 msgid "" "Bind *fun* to mouse-move events on this turtle. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1581 +#: ../../library/turtle.rst:1695 msgid "" "Remark: Every sequence of mouse-move-events on a turtle is preceded by a " "mouse-click event on that turtle." msgstr "" -#: ../../library/turtle.rst:1589 +#: ../../library/turtle.rst:1703 msgid "" "Subsequently, clicking and dragging the Turtle will move it across the " "screen thereby producing handdrawings (if pen is down)." msgstr "" -#: ../../library/turtle.rst:1598 +#: ../../library/turtle.rst:1712 msgid "" "Start recording the vertices of a polygon. Current turtle position is first " "vertex of polygon." msgstr "" -#: ../../library/turtle.rst:1604 +#: ../../library/turtle.rst:1718 msgid "" "Stop recording the vertices of a polygon. Current turtle position is last " "vertex of polygon. This will be connected with the first vertex." msgstr "" -#: ../../library/turtle.rst:1610 +#: ../../library/turtle.rst:1724 msgid "Return the last recorded polygon." msgstr "" -#: ../../library/turtle.rst:1629 +#: ../../library/turtle.rst:1743 msgid "" "Create and return a clone of the turtle with same position, heading and " "turtle properties." msgstr "" -#: ../../library/turtle.rst:1642 +#: ../../library/turtle.rst:1756 msgid "" "Return the Turtle object itself. Only reasonable use: as a function to " "return the \"anonymous turtle\":" msgstr "" -#: ../../library/turtle.rst:1656 +#: ../../library/turtle.rst:1770 msgid "" "Return the :class:`TurtleScreen` object the turtle is drawing on. " "TurtleScreen methods can then be called for that object." msgstr "" -#: ../../library/turtle.rst:1670 +#: ../../library/turtle.rst:1784 msgid "an integer or ``None``" msgstr "" -#: ../../library/turtle.rst:1672 +#: ../../library/turtle.rst:1786 msgid "" "Set or disable undobuffer. If *size* is an integer, an empty undobuffer of " "given size is installed. *size* gives the maximum number of turtle actions " @@ -1616,71 +1741,71 @@ msgid "" "``None``, the undobuffer is disabled." msgstr "" -#: ../../library/turtle.rst:1685 +#: ../../library/turtle.rst:1799 msgid "Return number of entries in the undobuffer." msgstr "" -#: ../../library/turtle.rst:1698 +#: ../../library/turtle.rst:1812 msgid "Compound shapes" msgstr "" -#: ../../library/turtle.rst:1700 +#: ../../library/turtle.rst:1814 msgid "" "To use compound turtle shapes, which consist of several polygons of " "different color, you must use the helper class :class:`Shape` explicitly as " "described below:" msgstr "" -#: ../../library/turtle.rst:1704 +#: ../../library/turtle.rst:1818 msgid "Create an empty Shape object of type \"compound\"." msgstr "" -#: ../../library/turtle.rst:1705 +#: ../../library/turtle.rst:1819 msgid "" "Add as many components to this object as desired, using the :meth:`~Shape." "addcomponent` method." msgstr "" -#: ../../library/turtle.rst:1708 +#: ../../library/turtle.rst:1822 msgid "For example:" msgstr "舉例來說:" -#: ../../library/turtle.rst:1719 +#: ../../library/turtle.rst:1833 msgid "Now add the Shape to the Screen's shapelist and use it:" msgstr "" -#: ../../library/turtle.rst:1730 +#: ../../library/turtle.rst:1844 msgid "" "The :class:`Shape` class is used internally by the :func:`register_shape` " "method in different ways. The application programmer has to deal with the " "Shape class *only* when using compound shapes like shown above!" msgstr "" -#: ../../library/turtle.rst:1736 +#: ../../library/turtle.rst:1850 msgid "Methods of TurtleScreen/Screen and corresponding functions" msgstr "" -#: ../../library/turtle.rst:1738 +#: ../../library/turtle.rst:1852 msgid "" "Most of the examples in this section refer to a TurtleScreen instance called " "``screen``." msgstr "" -#: ../../library/turtle.rst:1752 +#: ../../library/turtle.rst:1866 msgid "" "a color string or three numbers in the range 0..colormode or a 3-tuple of " "such numbers" msgstr "" -#: ../../library/turtle.rst:1756 +#: ../../library/turtle.rst:1870 msgid "Set or return background color of the TurtleScreen." msgstr "" -#: ../../library/turtle.rst:1771 +#: ../../library/turtle.rst:1885 msgid "a string, name of a gif-file or ``\"nopic\"``, or ``None``" msgstr "" -#: ../../library/turtle.rst:1773 +#: ../../library/turtle.rst:1887 msgid "" "Set background image or return name of current backgroundimage. If " "*picname* is a filename, set the corresponding image as background. If " @@ -1688,44 +1813,44 @@ msgid "" "*picname* is ``None``, return the filename of the current backgroundimage. ::" msgstr "" -#: ../../library/turtle.rst:1789 +#: ../../library/turtle.rst:1903 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``clearscreen``. The global function ``clear`` is a different one " "derived from the Turtle method ``clear``." msgstr "" -#: ../../library/turtle.rst:1796 +#: ../../library/turtle.rst:1910 msgid "" "Delete all drawings and all turtles from the TurtleScreen. Reset the now " "empty TurtleScreen to its initial state: white background, no background " "image, no event bindings and tracing on." msgstr "" -#: ../../library/turtle.rst:1805 +#: ../../library/turtle.rst:1919 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``resetscreen``. The global function ``reset`` is another one derived " "from the Turtle method ``reset``." msgstr "" -#: ../../library/turtle.rst:1812 +#: ../../library/turtle.rst:1926 msgid "Reset all Turtles on the Screen to their initial state." msgstr "" -#: ../../library/turtle.rst:1817 +#: ../../library/turtle.rst:1931 msgid "positive integer, new width of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1818 +#: ../../library/turtle.rst:1932 msgid "positive integer, new height of canvas in pixels" msgstr "" -#: ../../library/turtle.rst:1819 +#: ../../library/turtle.rst:1933 msgid "colorstring or color-tuple, new background color" msgstr "" -#: ../../library/turtle.rst:1821 +#: ../../library/turtle.rst:1935 msgid "" "If no arguments are given, return current (canvaswidth, canvasheight). Else " "resize the canvas the turtles are drawing on. Do not alter the drawing " @@ -1734,59 +1859,59 @@ msgid "" "outside the canvas before." msgstr "" -#: ../../library/turtle.rst:1833 +#: ../../library/turtle.rst:1947 msgid "e.g. to search for an erroneously escaped turtle ;-)" msgstr "" -#: ../../library/turtle.rst:1838 +#: ../../library/turtle.rst:1952 msgid "a number, x-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1839 +#: ../../library/turtle.rst:1953 msgid "a number, y-coordinate of lower left corner of canvas" msgstr "" -#: ../../library/turtle.rst:1840 +#: ../../library/turtle.rst:1954 msgid "a number, x-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1841 +#: ../../library/turtle.rst:1955 msgid "a number, y-coordinate of upper right corner of canvas" msgstr "" -#: ../../library/turtle.rst:1843 +#: ../../library/turtle.rst:1957 msgid "" "Set up user-defined coordinate system and switch to mode \"world\" if " "necessary. This performs a ``screen.reset()``. If mode \"world\" is " "already active, all drawings are redrawn according to the new coordinates." msgstr "" -#: ../../library/turtle.rst:1847 +#: ../../library/turtle.rst:1961 msgid "" "**ATTENTION**: in user-defined coordinate systems angles may appear " "distorted." msgstr "" -#: ../../library/turtle.rst:1875 +#: ../../library/turtle.rst:1989 msgid "positive integer" msgstr "" -#: ../../library/turtle.rst:1877 +#: ../../library/turtle.rst:1991 msgid "" "Set or return the drawing *delay* in milliseconds. (This is approximately " "the time interval between two consecutive canvas updates.) The longer the " "drawing delay, the slower the animation." msgstr "" -#: ../../library/turtle.rst:1881 +#: ../../library/turtle.rst:1995 msgid "Optional argument:" msgstr "" -#: ../../library/turtle.rst:1895 ../../library/turtle.rst:1896 +#: ../../library/turtle.rst:2009 ../../library/turtle.rst:2010 msgid "nonnegative integer" msgstr "" -#: ../../library/turtle.rst:1898 +#: ../../library/turtle.rst:2012 msgid "" "Turn turtle animation on/off and set delay for update drawings. If *n* is " "given, only each n-th regular screen update is really performed. (Can be " @@ -1795,75 +1920,75 @@ msgid "" "delay value (see :func:`delay`)." msgstr "" -#: ../../library/turtle.rst:1918 +#: ../../library/turtle.rst:2032 msgid "Perform a TurtleScreen update. To be used when tracer is turned off." msgstr "" -#: ../../library/turtle.rst:1920 +#: ../../library/turtle.rst:2034 msgid "See also the RawTurtle/Turtle method :func:`speed`." msgstr "" -#: ../../library/turtle.rst:1928 +#: ../../library/turtle.rst:2042 msgid "" "Set focus on TurtleScreen (in order to collect key-events). Dummy arguments " "are provided in order to be able to pass :func:`listen` to the onclick " "method." msgstr "" -#: ../../library/turtle.rst:1935 ../../library/turtle.rst:1955 +#: ../../library/turtle.rst:2049 ../../library/turtle.rst:2069 msgid "a function with no arguments or ``None``" msgstr "" -#: ../../library/turtle.rst:1936 ../../library/turtle.rst:1956 +#: ../../library/turtle.rst:2050 ../../library/turtle.rst:2070 msgid "a string: key (e.g. \"a\") or key-symbol (e.g. \"space\")" msgstr "" -#: ../../library/turtle.rst:1938 +#: ../../library/turtle.rst:2052 msgid "" "Bind *fun* to key-release event of key. If *fun* is ``None``, event " "bindings are removed. Remark: in order to be able to register key-events, " "TurtleScreen must have the focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:1958 +#: ../../library/turtle.rst:2072 msgid "" "Bind *fun* to key-press event of key if key is given, or to any key-press-" "event if no key is given. Remark: in order to be able to register key-" "events, TurtleScreen must have focus. (See method :func:`listen`.)" msgstr "" -#: ../../library/turtle.rst:1982 +#: ../../library/turtle.rst:2096 msgid "" "Bind *fun* to mouse-click events on this screen. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: ../../library/turtle.rst:1985 +#: ../../library/turtle.rst:2099 msgid "" "Example for a TurtleScreen instance named ``screen`` and a Turtle instance " "named ``turtle``:" msgstr "" -#: ../../library/turtle.rst:1996 +#: ../../library/turtle.rst:2110 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``onscreenclick``. The global function ``onclick`` is another one " "derived from the Turtle method ``onclick``." msgstr "" -#: ../../library/turtle.rst:2003 +#: ../../library/turtle.rst:2117 msgid "a function with no arguments" msgstr "" -#: ../../library/turtle.rst:2004 +#: ../../library/turtle.rst:2118 msgid "a number >= 0" msgstr "" -#: ../../library/turtle.rst:2006 +#: ../../library/turtle.rst:2120 msgid "Install a timer that calls *fun* after *t* milliseconds." msgstr "" -#: ../../library/turtle.rst:2024 +#: ../../library/turtle.rst:2138 msgid "" "Starts event loop - calling Tkinter's mainloop function. Must be the last " "statement in a turtle graphics program. Must *not* be used if a script is " @@ -1871,12 +1996,12 @@ msgid "" "turtle graphics. ::" msgstr "" -#: ../../library/turtle.rst:2037 ../../library/turtle.rst:2038 -#: ../../library/turtle.rst:2050 ../../library/turtle.rst:2051 +#: ../../library/turtle.rst:2151 ../../library/turtle.rst:2152 +#: ../../library/turtle.rst:2164 ../../library/turtle.rst:2165 msgid "string" msgstr "string(字串)" -#: ../../library/turtle.rst:2040 +#: ../../library/turtle.rst:2154 msgid "" "Pop up a dialog window for input of a string. Parameter title is the title " "of the dialog window, prompt is a text mostly describing what information to " @@ -1884,7 +2009,7 @@ msgid "" "``None``. ::" msgstr "" -#: ../../library/turtle.rst:2056 +#: ../../library/turtle.rst:2170 msgid "" "Pop up a dialog window for input of a number. title is the title of the " "dialog window, prompt is a text mostly describing what numerical information " @@ -1895,17 +2020,17 @@ msgid "" "return ``None``. ::" msgstr "" -#: ../../library/turtle.rst:2073 +#: ../../library/turtle.rst:2187 msgid "one of the strings \"standard\", \"logo\" or \"world\"" msgstr "" -#: ../../library/turtle.rst:2075 +#: ../../library/turtle.rst:2189 msgid "" "Set turtle mode (\"standard\", \"logo\" or \"world\") and perform reset. If " "mode is not given, current mode is returned." msgstr "" -#: ../../library/turtle.rst:2078 +#: ../../library/turtle.rst:2192 msgid "" "Mode \"standard\" is compatible with old :mod:`turtle`. Mode \"logo\" is " "compatible with most Logo turtle graphics. Mode \"world\" uses user-defined " @@ -1913,121 +2038,121 @@ msgid "" "if ``x/y`` unit-ratio doesn't equal 1." msgstr "" -#: ../../library/turtle.rst:2084 +#: ../../library/turtle.rst:2198 msgid "Mode" msgstr "" -#: ../../library/turtle.rst:2084 +#: ../../library/turtle.rst:2198 msgid "Initial turtle heading" msgstr "" -#: ../../library/turtle.rst:2084 +#: ../../library/turtle.rst:2198 msgid "positive angles" msgstr "" -#: ../../library/turtle.rst:2086 +#: ../../library/turtle.rst:2200 msgid "\"standard\"" msgstr "" -#: ../../library/turtle.rst:2086 +#: ../../library/turtle.rst:2200 msgid "to the right (east)" msgstr "" -#: ../../library/turtle.rst:2086 +#: ../../library/turtle.rst:2200 msgid "counterclockwise" msgstr "" -#: ../../library/turtle.rst:2087 +#: ../../library/turtle.rst:2201 msgid "\"logo\"" msgstr "" -#: ../../library/turtle.rst:2087 +#: ../../library/turtle.rst:2201 msgid "upward (north)" msgstr "" -#: ../../library/turtle.rst:2087 +#: ../../library/turtle.rst:2201 msgid "clockwise" msgstr "" -#: ../../library/turtle.rst:2100 +#: ../../library/turtle.rst:2214 msgid "one of the values 1.0 or 255" msgstr "" -#: ../../library/turtle.rst:2102 +#: ../../library/turtle.rst:2216 msgid "" "Return the colormode or set it to 1.0 or 255. Subsequently *r*, *g*, *b* " "values of color triples have to be in the range 0..*cmode*." msgstr "" -#: ../../library/turtle.rst:2123 +#: ../../library/turtle.rst:2237 msgid "" "Return the Canvas of this TurtleScreen. Useful for insiders who know what " "to do with a Tkinter Canvas." msgstr "" -#: ../../library/turtle.rst:2136 +#: ../../library/turtle.rst:2250 msgid "Return a list of names of all currently available turtle shapes." msgstr "" -#: ../../library/turtle.rst:2148 +#: ../../library/turtle.rst:2262 msgid "There are three different ways to call this function:" msgstr "" -#: ../../library/turtle.rst:2150 +#: ../../library/turtle.rst:2264 msgid "" "*name* is the name of a gif-file and *shape* is ``None``: Install the " "corresponding image shape. ::" msgstr "" -#: ../../library/turtle.rst:2156 +#: ../../library/turtle.rst:2270 msgid "" "Image shapes *do not* rotate when turning the turtle, so they do not display " "the heading of the turtle!" msgstr "" -#: ../../library/turtle.rst:2159 +#: ../../library/turtle.rst:2273 msgid "" "*name* is an arbitrary string and *shape* is a tuple of pairs of " "coordinates: Install the corresponding polygon shape." msgstr "" -#: ../../library/turtle.rst:2167 +#: ../../library/turtle.rst:2281 msgid "" "*name* is an arbitrary string and *shape* is a (compound) :class:`Shape` " "object: Install the corresponding compound shape." msgstr "" -#: ../../library/turtle.rst:2170 +#: ../../library/turtle.rst:2284 msgid "" "Add a turtle shape to TurtleScreen's shapelist. Only thusly registered " "shapes can be used by issuing the command ``shape(shapename)``." msgstr "" -#: ../../library/turtle.rst:2176 +#: ../../library/turtle.rst:2290 msgid "Return the list of turtles on the screen." msgstr "" -#: ../../library/turtle.rst:2187 +#: ../../library/turtle.rst:2301 msgid "Return the height of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2195 +#: ../../library/turtle.rst:2309 msgid "Return the width of the turtle window. ::" msgstr "" -#: ../../library/turtle.rst:2204 +#: ../../library/turtle.rst:2318 msgid "Methods specific to Screen, not inherited from TurtleScreen" msgstr "" -#: ../../library/turtle.rst:2208 +#: ../../library/turtle.rst:2322 msgid "Shut the turtlegraphics window." msgstr "" -#: ../../library/turtle.rst:2213 +#: ../../library/turtle.rst:2327 msgid "Bind ``bye()`` method to mouse clicks on the Screen." msgstr "" -#: ../../library/turtle.rst:2216 +#: ../../library/turtle.rst:2330 msgid "" "If the value \"using_IDLE\" in the configuration dictionary is ``False`` " "(default value), also enter mainloop. Remark: If IDLE with the ``-n`` " @@ -2036,246 +2161,246 @@ msgid "" "client script." msgstr "" -#: ../../library/turtle.rst:2225 +#: ../../library/turtle.rst:2339 msgid "" "Set the size and position of the main window. Default values of arguments " "are stored in the configuration dictionary and can be changed via a :file:" "`turtle.cfg` file." msgstr "" -#: ../../library/turtle.rst:2229 +#: ../../library/turtle.rst:2343 msgid "" "if an integer, a size in pixels, if a float, a fraction of the screen; " "default is 50% of screen" msgstr "" -#: ../../library/turtle.rst:2231 +#: ../../library/turtle.rst:2345 msgid "" "if an integer, the height in pixels, if a float, a fraction of the screen; " "default is 75% of screen" msgstr "" -#: ../../library/turtle.rst:2233 +#: ../../library/turtle.rst:2347 msgid "" "if positive, starting position in pixels from the left edge of the screen, " "if negative from the right edge, if ``None``, center window horizontally" msgstr "" -#: ../../library/turtle.rst:2236 +#: ../../library/turtle.rst:2350 msgid "" "if positive, starting position in pixels from the top edge of the screen, if " "negative from the bottom edge, if ``None``, center window vertically" msgstr "" -#: ../../library/turtle.rst:2251 +#: ../../library/turtle.rst:2365 msgid "a string that is shown in the titlebar of the turtle graphics window" msgstr "" -#: ../../library/turtle.rst:2254 +#: ../../library/turtle.rst:2368 msgid "Set title of turtle window to *titlestring*." msgstr "" -#: ../../library/turtle.rst:2263 +#: ../../library/turtle.rst:2377 msgid "Public classes" msgstr "" -#: ../../library/turtle.rst:2269 +#: ../../library/turtle.rst:2383 msgid "" "a :class:`tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" "`TurtleScreen`" msgstr "" -#: ../../library/turtle.rst:2272 +#: ../../library/turtle.rst:2386 msgid "" "Create a turtle. The turtle has all methods described above as \"methods of " "Turtle/RawTurtle\"." msgstr "" -#: ../../library/turtle.rst:2278 +#: ../../library/turtle.rst:2392 msgid "" "Subclass of RawTurtle, has the same interface but draws on a default :class:" "`Screen` object created automatically when needed for the first time." msgstr "" -#: ../../library/turtle.rst:2284 +#: ../../library/turtle.rst:2398 msgid "a :class:`tkinter.Canvas`" msgstr "" -#: ../../library/turtle.rst:2286 +#: ../../library/turtle.rst:2400 msgid "" "Provides screen oriented methods like :func:`bgcolor` etc. that are " "described above." msgstr "" -#: ../../library/turtle.rst:2291 +#: ../../library/turtle.rst:2405 msgid "" "Subclass of TurtleScreen, with :ref:`four methods added `." msgstr "" -#: ../../library/turtle.rst:2296 +#: ../../library/turtle.rst:2410 msgid "" "some Tkinter widget to contain the ScrolledCanvas, i.e. a Tkinter-canvas " "with scrollbars added" msgstr "" -#: ../../library/turtle.rst:2299 +#: ../../library/turtle.rst:2413 msgid "" "Used by class Screen, which thus automatically provides a ScrolledCanvas as " "playground for the turtles." msgstr "" -#: ../../library/turtle.rst:2304 +#: ../../library/turtle.rst:2418 msgid "one of the strings \"polygon\", \"image\", \"compound\"" msgstr "" -#: ../../library/turtle.rst:2306 +#: ../../library/turtle.rst:2420 msgid "" "Data structure modeling shapes. The pair ``(type_, data)`` must follow this " "specification:" msgstr "" -#: ../../library/turtle.rst:2311 +#: ../../library/turtle.rst:2425 msgid "*type_*" msgstr "*type_*" -#: ../../library/turtle.rst:2311 +#: ../../library/turtle.rst:2425 msgid "*data*" msgstr "" -#: ../../library/turtle.rst:2313 +#: ../../library/turtle.rst:2427 msgid "\"polygon\"" msgstr "" -#: ../../library/turtle.rst:2313 +#: ../../library/turtle.rst:2427 msgid "a polygon-tuple, i.e. a tuple of pairs of coordinates" msgstr "" -#: ../../library/turtle.rst:2314 +#: ../../library/turtle.rst:2428 msgid "\"image\"" msgstr "" -#: ../../library/turtle.rst:2314 +#: ../../library/turtle.rst:2428 msgid "an image (in this form only used internally!)" msgstr "" -#: ../../library/turtle.rst:2315 +#: ../../library/turtle.rst:2429 msgid "\"compound\"" msgstr "" -#: ../../library/turtle.rst:2315 +#: ../../library/turtle.rst:2429 msgid "" "``None`` (a compound shape has to be constructed using the :meth:" "`addcomponent` method)" msgstr "" -#: ../../library/turtle.rst:2321 +#: ../../library/turtle.rst:2435 msgid "a polygon, i.e. a tuple of pairs of numbers" msgstr "" -#: ../../library/turtle.rst:2322 +#: ../../library/turtle.rst:2436 msgid "a color the *poly* will be filled with" msgstr "" -#: ../../library/turtle.rst:2323 +#: ../../library/turtle.rst:2437 msgid "a color for the poly's outline (if given)" msgstr "" -#: ../../library/turtle.rst:2325 +#: ../../library/turtle.rst:2439 msgid "Example:" msgstr "例如:" -#: ../../library/turtle.rst:2335 +#: ../../library/turtle.rst:2449 msgid "See :ref:`compoundshapes`." msgstr "請見\\ :ref:`compoundshapes`\\ 。" -#: ../../library/turtle.rst:2340 +#: ../../library/turtle.rst:2454 msgid "" "A two-dimensional vector class, used as a helper class for implementing " "turtle graphics. May be useful for turtle graphics programs too. Derived " "from tuple, so a vector is a tuple!" msgstr "" -#: ../../library/turtle.rst:2344 +#: ../../library/turtle.rst:2458 msgid "Provides (for *a*, *b* vectors, *k* number):" msgstr "" -#: ../../library/turtle.rst:2346 +#: ../../library/turtle.rst:2460 msgid "``a + b`` vector addition" msgstr "" -#: ../../library/turtle.rst:2347 +#: ../../library/turtle.rst:2461 msgid "``a - b`` vector subtraction" msgstr "" -#: ../../library/turtle.rst:2348 +#: ../../library/turtle.rst:2462 msgid "``a * b`` inner product" msgstr "" -#: ../../library/turtle.rst:2349 +#: ../../library/turtle.rst:2463 msgid "``k * a`` and ``a * k`` multiplication with scalar" msgstr "" -#: ../../library/turtle.rst:2350 +#: ../../library/turtle.rst:2464 msgid "``abs(a)`` absolute value of a" msgstr "" -#: ../../library/turtle.rst:2351 +#: ../../library/turtle.rst:2465 msgid "``a.rotate(angle)`` rotation" msgstr "" -#: ../../library/turtle.rst:2355 +#: ../../library/turtle.rst:2469 msgid "Help and configuration" msgstr "" -#: ../../library/turtle.rst:2358 +#: ../../library/turtle.rst:2472 msgid "How to use help" msgstr "" -#: ../../library/turtle.rst:2360 +#: ../../library/turtle.rst:2474 msgid "" "The public methods of the Screen and Turtle classes are documented " "extensively via docstrings. So these can be used as online-help via the " "Python help facilities:" msgstr "" -#: ../../library/turtle.rst:2364 +#: ../../library/turtle.rst:2478 msgid "" "When using IDLE, tooltips show the signatures and first lines of the " "docstrings of typed in function-/method calls." msgstr "" -#: ../../library/turtle.rst:2367 +#: ../../library/turtle.rst:2481 msgid "Calling :func:`help` on methods or functions displays the docstrings::" msgstr "" -#: ../../library/turtle.rst:2398 +#: ../../library/turtle.rst:2512 msgid "" "The docstrings of the functions which are derived from methods have a " "modified form::" msgstr "" -#: ../../library/turtle.rst:2432 +#: ../../library/turtle.rst:2546 msgid "" "These modified docstrings are created automatically together with the " "function definitions that are derived from the methods at import time." msgstr "" -#: ../../library/turtle.rst:2437 +#: ../../library/turtle.rst:2551 msgid "Translation of docstrings into different languages" msgstr "" -#: ../../library/turtle.rst:2439 +#: ../../library/turtle.rst:2553 msgid "" "There is a utility to create a dictionary the keys of which are the method " "names and the values of which are the docstrings of the public methods of " "the classes Screen and Turtle." msgstr "" -#: ../../library/turtle.rst:2445 +#: ../../library/turtle.rst:2559 msgid "a string, used as filename" msgstr "" -#: ../../library/turtle.rst:2447 +#: ../../library/turtle.rst:2561 msgid "" "Create and write docstring-dictionary to a Python script with the given " "filename. This function has to be called explicitly (it is not used by the " @@ -2284,37 +2409,37 @@ msgid "" "for translation of the docstrings into different languages." msgstr "" -#: ../../library/turtle.rst:2453 +#: ../../library/turtle.rst:2567 msgid "" "If you (or your students) want to use :mod:`turtle` with online help in your " "native language, you have to translate the docstrings and save the resulting " "file as e.g. :file:`turtle_docstringdict_german.py`." msgstr "" -#: ../../library/turtle.rst:2457 +#: ../../library/turtle.rst:2571 msgid "" "If you have an appropriate entry in your :file:`turtle.cfg` file this " "dictionary will be read in at import time and will replace the original " "English docstrings." msgstr "" -#: ../../library/turtle.rst:2460 +#: ../../library/turtle.rst:2574 msgid "" "At the time of this writing there are docstring dictionaries in German and " "in Italian. (Requests please to glingl@aon.at.)" msgstr "" -#: ../../library/turtle.rst:2466 +#: ../../library/turtle.rst:2580 msgid "How to configure Screen and Turtles" msgstr "" -#: ../../library/turtle.rst:2468 +#: ../../library/turtle.rst:2582 msgid "" "The built-in default configuration mimics the appearance and behaviour of " "the old turtle module in order to retain best possible compatibility with it." msgstr "" -#: ../../library/turtle.rst:2471 +#: ../../library/turtle.rst:2585 msgid "" "If you want to use a different configuration which better reflects the " "features of this module or which better fits to your needs, e.g. for use in " @@ -2323,54 +2448,54 @@ msgid "" "settings." msgstr "" -#: ../../library/turtle.rst:2476 +#: ../../library/turtle.rst:2590 msgid "" "The built in configuration would correspond to the following ``turtle.cfg``:" msgstr "" -#: ../../library/turtle.rst:2501 +#: ../../library/turtle.rst:2615 msgid "Short explanation of selected entries:" msgstr "" -#: ../../library/turtle.rst:2503 +#: ../../library/turtle.rst:2617 msgid "" "The first four lines correspond to the arguments of the :func:`Screen.setup " "` method." msgstr "" -#: ../../library/turtle.rst:2505 +#: ../../library/turtle.rst:2619 msgid "" "Line 5 and 6 correspond to the arguments of the method :func:`Screen." "screensize `." msgstr "" -#: ../../library/turtle.rst:2507 +#: ../../library/turtle.rst:2621 msgid "" "*shape* can be any of the built-in shapes, e.g: arrow, turtle, etc. For " "more info try ``help(shape)``." msgstr "" -#: ../../library/turtle.rst:2509 +#: ../../library/turtle.rst:2623 msgid "" "If you want to use no fill color (i.e. make the turtle transparent), you " "have to write ``fillcolor = \"\"`` (but all nonempty strings must not have " "quotes in the cfg file)." msgstr "" -#: ../../library/turtle.rst:2512 +#: ../../library/turtle.rst:2626 msgid "" "If you want to reflect the turtle its state, you have to use ``resizemode = " "auto``." msgstr "" -#: ../../library/turtle.rst:2514 +#: ../../library/turtle.rst:2628 msgid "" "If you set e.g. ``language = italian`` the docstringdict :file:" "`turtle_docstringdict_italian.py` will be loaded at import time (if present " "on the import path, e.g. in the same directory as :mod:`turtle`)." msgstr "" -#: ../../library/turtle.rst:2517 +#: ../../library/turtle.rst:2631 msgid "" "The entries *exampleturtle* and *examplescreen* define the names of these " "objects as they occur in the docstrings. The transformation of method-" @@ -2378,301 +2503,301 @@ msgid "" "docstrings." msgstr "" -#: ../../library/turtle.rst:2521 +#: ../../library/turtle.rst:2635 msgid "" "*using_IDLE*: Set this to ``True`` if you regularly work with IDLE and its " "``-n`` switch (\"no subprocess\"). This will prevent :func:`exitonclick` to " "enter the mainloop." msgstr "" -#: ../../library/turtle.rst:2525 +#: ../../library/turtle.rst:2639 msgid "" "There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` " "is stored and an additional one in the current working directory. The " "latter will override the settings of the first one." msgstr "" -#: ../../library/turtle.rst:2529 +#: ../../library/turtle.rst:2643 msgid "" "The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file. " "You can study it as an example and see its effects when running the demos " "(preferably not from within the demo-viewer)." msgstr "" -#: ../../library/turtle.rst:2535 +#: ../../library/turtle.rst:2649 msgid ":mod:`turtledemo` --- Demo scripts" msgstr "" -#: ../../library/turtle.rst:2540 +#: ../../library/turtle.rst:2654 msgid "" "The :mod:`turtledemo` package includes a set of demo scripts. These scripts " "can be run and viewed using the supplied demo viewer as follows::" msgstr "" -#: ../../library/turtle.rst:2545 +#: ../../library/turtle.rst:2659 msgid "" "Alternatively, you can run the demo scripts individually. For example, ::" msgstr "" -#: ../../library/turtle.rst:2549 +#: ../../library/turtle.rst:2663 msgid "The :mod:`turtledemo` package directory contains:" msgstr "" -#: ../../library/turtle.rst:2551 +#: ../../library/turtle.rst:2665 msgid "" "A demo viewer :file:`__main__.py` which can be used to view the sourcecode " "of the scripts and run them at the same time." msgstr "" -#: ../../library/turtle.rst:2553 +#: ../../library/turtle.rst:2667 msgid "" "Multiple scripts demonstrating different features of the :mod:`turtle` " "module. Examples can be accessed via the Examples menu. They can also be " "run standalone." msgstr "" -#: ../../library/turtle.rst:2556 +#: ../../library/turtle.rst:2670 msgid "" "A :file:`turtle.cfg` file which serves as an example of how to write and use " "such files." msgstr "" -#: ../../library/turtle.rst:2559 +#: ../../library/turtle.rst:2673 msgid "The demo scripts are:" msgstr "" -#: ../../library/turtle.rst:2566 +#: ../../library/turtle.rst:2680 msgid "Name" msgstr "" -#: ../../library/turtle.rst:2566 +#: ../../library/turtle.rst:2680 msgid "Description" msgstr "描述" -#: ../../library/turtle.rst:2566 +#: ../../library/turtle.rst:2680 msgid "Features" msgstr "" -#: ../../library/turtle.rst:2568 +#: ../../library/turtle.rst:2682 msgid "bytedesign" msgstr "" -#: ../../library/turtle.rst:2568 +#: ../../library/turtle.rst:2682 msgid "complex classical turtle graphics pattern" msgstr "" -#: ../../library/turtle.rst:2568 +#: ../../library/turtle.rst:2682 msgid ":func:`tracer`, delay, :func:`update`" msgstr "" -#: ../../library/turtle.rst:2571 +#: ../../library/turtle.rst:2685 msgid "chaos" msgstr "" -#: ../../library/turtle.rst:2571 +#: ../../library/turtle.rst:2685 msgid "" "graphs Verhulst dynamics, shows that computer's computations can generate " "results sometimes against the common sense expectations" msgstr "" -#: ../../library/turtle.rst:2571 +#: ../../library/turtle.rst:2685 msgid "world coordinates" msgstr "" -#: ../../library/turtle.rst:2577 +#: ../../library/turtle.rst:2691 msgid "clock" msgstr "" -#: ../../library/turtle.rst:2577 +#: ../../library/turtle.rst:2691 msgid "analog clock showing time of your computer" msgstr "" -#: ../../library/turtle.rst:2577 +#: ../../library/turtle.rst:2691 msgid "turtles as clock's hands, ontimer" msgstr "" -#: ../../library/turtle.rst:2580 +#: ../../library/turtle.rst:2694 msgid "colormixer" msgstr "" -#: ../../library/turtle.rst:2580 +#: ../../library/turtle.rst:2694 msgid "experiment with r, g, b" msgstr "" -#: ../../library/turtle.rst:2582 +#: ../../library/turtle.rst:2696 msgid "forest" msgstr "" -#: ../../library/turtle.rst:2582 +#: ../../library/turtle.rst:2696 msgid "3 breadth-first trees" msgstr "" -#: ../../library/turtle.rst:2582 +#: ../../library/turtle.rst:2696 msgid "randomization" msgstr "" -#: ../../library/turtle.rst:2584 +#: ../../library/turtle.rst:2698 msgid "fractalcurves" msgstr "" -#: ../../library/turtle.rst:2584 +#: ../../library/turtle.rst:2698 msgid "Hilbert & Koch curves" msgstr "" -#: ../../library/turtle.rst:2584 +#: ../../library/turtle.rst:2698 msgid "recursion" msgstr "" -#: ../../library/turtle.rst:2586 +#: ../../library/turtle.rst:2700 msgid "lindenmayer" msgstr "" -#: ../../library/turtle.rst:2586 +#: ../../library/turtle.rst:2700 msgid "ethnomathematics (indian kolams)" msgstr "" -#: ../../library/turtle.rst:2586 +#: ../../library/turtle.rst:2700 msgid "L-System" msgstr "" -#: ../../library/turtle.rst:2589 +#: ../../library/turtle.rst:2703 msgid "minimal_hanoi" msgstr "minimal_hanoi" -#: ../../library/turtle.rst:2589 +#: ../../library/turtle.rst:2703 msgid "Towers of Hanoi" msgstr "" -#: ../../library/turtle.rst:2589 +#: ../../library/turtle.rst:2703 msgid "Rectangular Turtles as Hanoi discs (shape, shapesize)" msgstr "" -#: ../../library/turtle.rst:2593 +#: ../../library/turtle.rst:2707 msgid "nim" msgstr "" -#: ../../library/turtle.rst:2593 +#: ../../library/turtle.rst:2707 msgid "" "play the classical nim game with three heaps of sticks against the computer." msgstr "" -#: ../../library/turtle.rst:2593 +#: ../../library/turtle.rst:2707 msgid "turtles as nimsticks, event driven (mouse, keyboard)" msgstr "" -#: ../../library/turtle.rst:2597 +#: ../../library/turtle.rst:2711 msgid "paint" msgstr "" -#: ../../library/turtle.rst:2597 +#: ../../library/turtle.rst:2711 msgid "super minimalistic drawing program" msgstr "" -#: ../../library/turtle.rst:2600 +#: ../../library/turtle.rst:2714 msgid "peace" msgstr "" -#: ../../library/turtle.rst:2600 +#: ../../library/turtle.rst:2714 msgid "elementary" msgstr "" -#: ../../library/turtle.rst:2600 +#: ../../library/turtle.rst:2714 msgid "turtle: appearance and animation" msgstr "" -#: ../../library/turtle.rst:2603 +#: ../../library/turtle.rst:2717 msgid "penrose" msgstr "" -#: ../../library/turtle.rst:2603 +#: ../../library/turtle.rst:2717 msgid "aperiodic tiling with kites and darts" msgstr "" -#: ../../library/turtle.rst:2606 +#: ../../library/turtle.rst:2720 msgid "planet_and_moon" msgstr "planet_and_moon" -#: ../../library/turtle.rst:2606 +#: ../../library/turtle.rst:2720 msgid "simulation of gravitational system" msgstr "" -#: ../../library/turtle.rst:2606 +#: ../../library/turtle.rst:2720 msgid "compound shapes, :class:`Vec2D`" msgstr "" -#: ../../library/turtle.rst:2609 +#: ../../library/turtle.rst:2723 msgid "rosette" msgstr "" -#: ../../library/turtle.rst:2609 +#: ../../library/turtle.rst:2723 msgid "a pattern from the wikipedia article on turtle graphics" msgstr "" -#: ../../library/turtle.rst:2609 +#: ../../library/turtle.rst:2723 msgid ":func:`clone`, :func:`undo`" msgstr ":func:`clone`, :func:`undo`" -#: ../../library/turtle.rst:2612 +#: ../../library/turtle.rst:2726 msgid "round_dance" msgstr "round_dance" -#: ../../library/turtle.rst:2612 +#: ../../library/turtle.rst:2726 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: ../../library/turtle.rst:2612 +#: ../../library/turtle.rst:2726 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: ../../library/turtle.rst:2616 +#: ../../library/turtle.rst:2730 msgid "sorting_animate" msgstr "sorting_animate" -#: ../../library/turtle.rst:2616 +#: ../../library/turtle.rst:2730 msgid "visual demonstration of different sorting methods" msgstr "" -#: ../../library/turtle.rst:2616 +#: ../../library/turtle.rst:2730 msgid "simple alignment, randomization" msgstr "" -#: ../../library/turtle.rst:2619 +#: ../../library/turtle.rst:2733 msgid "tree" msgstr "" -#: ../../library/turtle.rst:2619 +#: ../../library/turtle.rst:2733 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: ../../library/turtle.rst:2622 +#: ../../library/turtle.rst:2736 msgid "two_canvases" msgstr "two_canvases" -#: ../../library/turtle.rst:2622 +#: ../../library/turtle.rst:2736 msgid "simple design" msgstr "" -#: ../../library/turtle.rst:2622 +#: ../../library/turtle.rst:2736 msgid "turtles on two canvases" msgstr "" -#: ../../library/turtle.rst:2625 +#: ../../library/turtle.rst:2739 msgid "yinyang" msgstr "" -#: ../../library/turtle.rst:2625 +#: ../../library/turtle.rst:2739 msgid "another elementary example" msgstr "" -#: ../../library/turtle.rst:2628 +#: ../../library/turtle.rst:2742 msgid "Have fun!" msgstr "" -#: ../../library/turtle.rst:2632 +#: ../../library/turtle.rst:2746 msgid "Changes since Python 2.6" msgstr "" -#: ../../library/turtle.rst:2634 +#: ../../library/turtle.rst:2748 msgid "" "The methods :func:`Turtle.tracer `, :func:`Turtle.window_width " "` and :func:`Turtle.window_height ` have been " @@ -2683,14 +2808,14 @@ msgid "" "methods.)" msgstr "" -#: ../../library/turtle.rst:2642 +#: ../../library/turtle.rst:2756 msgid "" "The method :func:`!Turtle.fill` has been eliminated. The behaviour of :func:" "`begin_fill` and :func:`end_fill` have changed slightly: now every filling " "process must be completed with an ``end_fill()`` call." msgstr "" -#: ../../library/turtle.rst:2647 +#: ../../library/turtle.rst:2761 msgid "" "A method :func:`Turtle.filling ` has been added. It returns a " "boolean value: ``True`` if a filling process is under way, ``False`` " @@ -2698,11 +2823,11 @@ msgid "" "in Python 2.6." msgstr "" -#: ../../library/turtle.rst:2653 +#: ../../library/turtle.rst:2767 msgid "Changes since Python 3.0" msgstr "" -#: ../../library/turtle.rst:2655 +#: ../../library/turtle.rst:2769 msgid "" "The :class:`Turtle` methods :func:`shearfactor`, :func:`shapetransform` and :" "func:`get_shapepoly` have been added. Thus the full range of regular linear " @@ -2711,28 +2836,28 @@ msgid "" "set the tilt angle. :func:`settiltangle` has been deprecated." msgstr "" -#: ../../library/turtle.rst:2662 +#: ../../library/turtle.rst:2776 msgid "" "The :class:`Screen` method :func:`onkeypress` has been added as a complement " "to :func:`onkey`. As the latter binds actions to the key release event, an " "alias: :func:`onkeyrelease` was also added for it." msgstr "" -#: ../../library/turtle.rst:2666 +#: ../../library/turtle.rst:2780 msgid "" "The method :func:`Screen.mainloop ` has been added, so there is no " "longer a need to use the standalone :func:`mainloop` function when working " "with :class:`Screen` and :class:`Turtle` objects." msgstr "" -#: ../../library/turtle.rst:2670 +#: ../../library/turtle.rst:2784 msgid "" "Two input methods have been added: :func:`Screen.textinput ` and :" "func:`Screen.numinput `. These pop up input dialogs and return " "strings and numbers respectively." msgstr "" -#: ../../library/turtle.rst:2674 +#: ../../library/turtle.rst:2788 msgid "" "Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py` " "have been added to the :file:`Lib/turtledemo` directory." diff --git a/sphinx.po b/sphinx.po index 38d024e3ee..443deb3bf7 100644 --- a/sphinx.po +++ b/sphinx.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-07-26 00:03+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -295,23 +295,23 @@ msgstr "Python 開發者指南" #: ../../tools/templates/layout.html:6 msgid "" "This document is for an old version of Python that is no longer supported.\n" -" You should upgrade, and read the " -msgstr "這份說明文件是寫給一個不再被支援的舊版 Python。你應該升級,並閱讀 " +" You should upgrade, and read the" +msgstr "這份說明文件是寫給一個不再被支援的舊版 Python。你應該升級,並閱讀" #: ../../tools/templates/layout.html:8 -msgid " Python documentation for the current stable release" -msgstr " 當前穩定發行的 Python 版本說明文件" +msgid "Python documentation for the current stable release" +msgstr "當前穩定發行的 Python 版本說明文件" #: ../../tools/templates/layout.html:14 msgid "" "This is a deploy preview created from a pull request.\n" -" For authoritative documentation, see the " +" For authoritative documentation, see" msgstr "" "這是從 pull request(拉取請求)" " 上建立的部署預覽。\n" -" 文件請見 " +" 文件請見" #: ../../tools/templates/layout.html:16 -msgid " the current stable release" -msgstr " 當前的穩定發行版" +msgid "the current stable release" +msgstr "當前的穩定發行版" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 9c7facf927..ee580ee041 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-07-25 00:04+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -98,8 +98,8 @@ msgid "" "parentheses (``()``) can be used for grouping. For example::" msgstr "" "直譯器如同一台簡單的計算機:你可以輸入一個 expression(運算式),它會寫出該式" -"的值。Expression 的語法可以使用:運算子 ``+``、``-``、``*`` 和 ``/`` 可以" -"用來執行運算;括號 ``()`` 可以用來分群。例如:\n" +"的值。Expression 的語法可以使用:運算子 ``+``、``-``、``*`` 和 ``/`` 可以用來" +"執行運算;括號 ``()`` 可以用來分群。例如:\n" "\n" "::" @@ -197,38 +197,41 @@ msgstr "" "指定虛數的部份(即 ``3+5j``)。" #: ../../tutorial/introduction.rst:142 -msgid "Strings" -msgstr "字串 (String)" +msgid "Text" +msgstr "文字" #: ../../tutorial/introduction.rst:144 msgid "" -"Besides numbers, Python can also manipulate strings, which can be expressed " -"in several ways. They can be enclosed in single quotes (``'...'``) or " -"double quotes (``\"...\"``) with the same result [#]_. ``\\`` can be used " -"to escape quotes::" +"Python can manipulate text (represented by type :class:`str`, so-called " +"\"strings\") as well as numbers. This includes characters \"``!``\", words " +"\"``rabbit``\", names \"``Paris``\", sentences \"``Got your back.``\", etc. " +"\"``Yay! :)``\". They can be enclosed in single quotes (``'...'``) or double " +"quotes (``\"...\"``) with the same result [#]_." msgstr "" -"除了數字之外,Python 也可以操作字串,而表達字串有數種方式。它們可以用包含在單" -"引號 (``'...'``) 或雙引號 (``\"...\"``) 之中,兩者會得到相同的結果\\ " -"[#]_\\ 。使用 ``\\`` 跳脫出現於字串中的引號:\n" +"Python 可以操作文本(由 :class:`str` 型別表示,即所謂的「字串 (strings)」)和" +"數字。這包括字元 \"``!``\"、單詞 \"``rabbit``\"、名稱 \"``Paris``\"、句子 " +"\"``Got your back.``\" 等等。\"``Yay! :)``\"。它們可以用單引號 (``'...'``) 或" +"雙引號 (``\"...\"``) 括起來,會具有相同的結果 [#]_。" + +#: ../../tutorial/introduction.rst:157 +msgid "" +"To quote a quote, we need to \"escape\" it, by preceding it with ``\\``. " +"Alternatively, we can use the other type of quotation marks::" +msgstr "" +"要引用引文,我們需要在其前面加上 ``\\`` 來「跳脫」它。或者我們也可以使用其他" +"種類的引號:\n" "\n" "::" -#: ../../tutorial/introduction.rst:162 +#: ../../tutorial/introduction.rst:171 msgid "" -"In the interactive interpreter, the output string is enclosed in quotes and " -"special characters are escaped with backslashes. While this might sometimes " -"look different from the input (the enclosing quotes could change), the two " -"strings are equivalent. The string is enclosed in double quotes if the " -"string contains a single quote and no double quotes, otherwise it is " -"enclosed in single quotes. The :func:`print` function produces a more " -"readable output, by omitting the enclosing quotes and by printing escaped " -"and special characters::" +"In the Python shell, the string definition and output string can look " +"different. The :func:`print` function produces a more readable output, by " +"omitting the enclosing quotes and by printing escaped and special " +"characters::" msgstr "" -"在互動式的直譯器中,輸出的字串會被引號包圍且特殊符號會使用反斜線 (``\\``) 跳" -"脫。雖然這有時會讓它看起來跟輸入的字串不相同(包圍用的引號可能會改變),輸入" -"和輸出兩字串實為相同。一般來說,字串包含單引號而沒有雙引號時,會使用雙引號包" -"圍字串。函式 :func:`print` 會產生更易讀的輸出,它會去除掉包圍的引號,並且直接" -"印出被跳脫的字元和特殊字元:\n" +"在 Python shell 中,字串定義和輸出字串可能看起來不同。:func:`print` 函式透過" +"省略引號並印出跳脫字元和特殊字元來生成更具可讀性的輸出:\n" "\n" "::" @@ -249,6 +252,9 @@ msgid "" "odd number of ``\\`` characters; see :ref:`the FAQ entry ` for more information and workarounds." msgstr "" +"原始字串有一個微妙的地方:原始字串可能不會以奇數個 ``\\`` 字元結尾;請參閱" +"\\ :ref:`常見問答集 `\\ 來了解更多資訊" +"和解決方法。" #: ../../tutorial/introduction.rst:197 msgid ""