88msgstr ""
99"Project-Id-Version : Python 3.7\n "
1010"Report-Msgid-Bugs-To : \n "
11- "POT-Creation-Date : 2018-09-15 09:11 +0900\n "
11+ "POT-Creation-Date : 2018-10-24 09:34 +0900\n "
1212"PO-Revision-Date : YEAR-MO-DA HO:MI+ZONE\n "
1313"
Last-Translator :
Freesand Leo <[email protected] >, 2018\n "
1414"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -57,7 +57,7 @@ msgid ""
5757" one argument and returns another value to be used as the sort key."
5858msgstr ""
5959
60- #: ../../library/functools.rst:37 ../../library/functools.rst:225
60+ #: ../../library/functools.rst:37 ../../library/functools.rst:226
6161msgid "Example::"
6262msgstr "示例::"
6363
@@ -183,14 +183,14 @@ msgstr ""
183183
184184#: ../../library/functools.rst:175
185185msgid ""
186- "Return a new :class :`partial` object which when called will behave like "
187- "*func* called with the positional arguments *args* and keyword arguments "
188- "*keywords*. If more arguments are supplied to the call, they are appended to "
189- " *args*. If additional keyword arguments are supplied, they extend and "
190- "override *keywords*. Roughly equivalent to::"
186+ "Return a new :ref :`partial object<partial-objects>` which when called will "
187+ "behave like *func* called with the positional arguments *args* and keyword "
188+ "arguments *keywords*. If more arguments are supplied to the call, they are "
189+ "appended to *args*. If additional keyword arguments are supplied, they "
190+ "extend and override *keywords*. Roughly equivalent to::"
191191msgstr ""
192192
193- #: ../../library/functools.rst:191
193+ #: ../../library/functools.rst:192
194194msgid ""
195195"The :func:`partial` is used for partial function application which "
196196"\" freezes\" some portion of a function's arguments and/or keywords resulting"
@@ -199,29 +199,29 @@ msgid ""
199199"where the *base* argument defaults to two:"
200200msgstr ""
201201
202- #: ../../library/functools.rst:206
202+ #: ../../library/functools.rst:207
203203msgid ""
204204"Return a new :class:`partialmethod` descriptor which behaves like "
205205":class:`partial` except that it is designed to be used as a method "
206206"definition rather than being directly callable."
207207msgstr ""
208208
209- #: ../../library/functools.rst:210
209+ #: ../../library/functools.rst:211
210210msgid ""
211211"*func* must be a :term:`descriptor` or a callable (objects which are both, "
212212"like normal functions, are handled as descriptors)."
213213msgstr ""
214214
215- #: ../../library/functools.rst:213
215+ #: ../../library/functools.rst:214
216216msgid ""
217217"When *func* is a descriptor (such as a normal Python function, "
218218":func:`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another"
219219" instance of :class:`partialmethod`), calls to ``__get__`` are delegated to "
220- "the underlying descriptor, and an appropriate :class :`partial` object "
221- "returned as the result."
220+ "the underlying descriptor, and an appropriate :ref :`partial object<partial- "
221+ "objects>` returned as the result."
222222msgstr ""
223223
224- #: ../../library/functools.rst:219
224+ #: ../../library/functools.rst:220
225225msgid ""
226226"When *func* is a non-descriptor callable, an appropriate bound method is "
227227"created dynamically. This behaves like a normal Python function when used as"
@@ -230,7 +230,7 @@ msgid ""
230230":class:`partialmethod` constructor."
231231msgstr ""
232232
233- #: ../../library/functools.rst:250
233+ #: ../../library/functools.rst:251
234234msgid ""
235235"Apply *function* of two arguments cumulatively to the items of *sequence*, "
236236"from left to right, so as to reduce the sequence to a single value. For "
@@ -243,57 +243,57 @@ msgid ""
243243" the first item is returned."
244244msgstr ""
245245
246- #: ../../library/functools.rst:259
246+ #: ../../library/functools.rst:260
247247msgid "Roughly equivalent to::"
248248msgstr "大致相当于:"
249249
250- #: ../../library/functools.rst:274
250+ #: ../../library/functools.rst:275
251251msgid ""
252252"Transform a function into a :term:`single-dispatch <single dispatch>` "
253253":term:`generic function`."
254254msgstr ""
255255
256- #: ../../library/functools.rst:277
256+ #: ../../library/functools.rst:278
257257msgid ""
258258"To define a generic function, decorate it with the ``@singledispatch`` "
259259"decorator. Note that the dispatch happens on the type of the first argument,"
260260" create your function accordingly::"
261261msgstr ""
262262
263- #: ../../library/functools.rst:288
263+ #: ../../library/functools.rst:289
264264msgid ""
265265"To add overloaded implementations to the function, use the :func:`register` "
266266"attribute of the generic function. It is a decorator. For functions "
267267"annotated with types, the decorator will infer the type of the first "
268268"argument automatically::"
269269msgstr ""
270270
271- #: ../../library/functools.rst:306
271+ #: ../../library/functools.rst:307
272272msgid ""
273273"For code which doesn't use type annotations, the appropriate type argument "
274274"can be passed explicitly to the decorator itself::"
275275msgstr ""
276276
277- #: ../../library/functools.rst:317
277+ #: ../../library/functools.rst:318
278278msgid ""
279279"To enable registering lambdas and pre-existing functions, the "
280280":func:`register` attribute can be used in a functional form::"
281281msgstr ""
282282
283- #: ../../library/functools.rst:325
283+ #: ../../library/functools.rst:326
284284msgid ""
285285"The :func:`register` attribute returns the undecorated function which "
286286"enables decorator stacking, pickling, as well as creating unit tests for "
287287"each variant independently::"
288288msgstr ""
289289
290- #: ../../library/functools.rst:339
290+ #: ../../library/functools.rst:340
291291msgid ""
292292"When called, the generic function dispatches on the type of the first "
293293"argument::"
294294msgstr ""
295295
296- #: ../../library/functools.rst:359
296+ #: ../../library/functools.rst:360
297297msgid ""
298298"Where there is no registered implementation for a specific type, its method "
299299"resolution order is used to find a more generic implementation. The original"
@@ -302,23 +302,23 @@ msgid ""
302302"found."
303303msgstr ""
304304
305- #: ../../library/functools.rst:365
305+ #: ../../library/functools.rst:366
306306msgid ""
307307"To check which implementation will the generic function choose for a given "
308308"type, use the ``dispatch()`` attribute::"
309309msgstr ""
310310
311- #: ../../library/functools.rst:373
311+ #: ../../library/functools.rst:374
312312msgid ""
313313"To access all registered implementations, use the read-only ``registry`` "
314314"attribute::"
315315msgstr ""
316316
317- #: ../../library/functools.rst:387
317+ #: ../../library/functools.rst:388
318318msgid "The :func:`register` attribute supports using type annotations."
319319msgstr ""
320320
321- #: ../../library/functools.rst:393
321+ #: ../../library/functools.rst:394
322322msgid ""
323323"Update a *wrapper* function to look like the *wrapped* function. The "
324324"optional arguments are tuples to specify which attributes of the original "
@@ -332,15 +332,15 @@ msgid ""
332332"``__dict__``, i.e. the instance dictionary)."
333333msgstr ""
334334
335- #: ../../library/functools.rst:403
335+ #: ../../library/functools.rst:404
336336msgid ""
337337"To allow access to the original function for introspection and other "
338338"purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), "
339339"this function automatically adds a ``__wrapped__`` attribute to the wrapper "
340340"that refers to the function being wrapped."
341341msgstr ""
342342
343- #: ../../library/functools.rst:408
343+ #: ../../library/functools.rst:409
344344msgid ""
345345"The main intended use for this function is in :term:`decorator` functions "
346346"which wrap the decorated function and return the wrapper. If the wrapper "
@@ -349,7 +349,7 @@ msgid ""
349349"is typically less than helpful."
350350msgstr ""
351351
352- #: ../../library/functools.rst:414
352+ #: ../../library/functools.rst:415
353353msgid ""
354354":func:`update_wrapper` may be used with callables other than functions. Any "
355355"attributes named in *assigned* or *updated* that are missing from the object"
@@ -358,69 +358,69 @@ msgid ""
358358"wrapper function itself is missing any attributes named in *updated*."
359359msgstr ""
360360
361- #: ../../library/functools.rst:420
361+ #: ../../library/functools.rst:421
362362msgid "Automatic addition of the ``__wrapped__`` attribute."
363363msgstr ""
364364
365- #: ../../library/functools.rst:423
365+ #: ../../library/functools.rst:424
366366msgid "Copying of the ``__annotations__`` attribute by default."
367367msgstr ""
368368
369- #: ../../library/functools.rst:426
369+ #: ../../library/functools.rst:427
370370msgid "Missing attributes no longer trigger an :exc:`AttributeError`."
371371msgstr ""
372372
373- #: ../../library/functools.rst:429
373+ #: ../../library/functools.rst:430
374374msgid ""
375375"The ``__wrapped__`` attribute now always refers to the wrapped function, "
376376"even if that function defined a ``__wrapped__`` attribute. (see "
377377":issue:`17482`)"
378378msgstr ""
379379
380- #: ../../library/functools.rst:437
380+ #: ../../library/functools.rst:438
381381msgid ""
382382"This is a convenience function for invoking :func:`update_wrapper` as a "
383383"function decorator when defining a wrapper function. It is equivalent to "
384384"``partial(update_wrapper, wrapped=wrapped, assigned=assigned, "
385385"updated=updated)``. For example::"
386386msgstr ""
387387
388- #: ../../library/functools.rst:463
388+ #: ../../library/functools.rst:464
389389msgid ""
390390"Without the use of this decorator factory, the name of the example function "
391391"would have been ``'wrapper'``, and the docstring of the original "
392392":func:`example` would have been lost."
393393msgstr ""
394394
395- #: ../../library/functools.rst:471
395+ #: ../../library/functools.rst:472
396396msgid ":class:`partial` Objects"
397397msgstr ""
398398
399- #: ../../library/functools.rst:473
399+ #: ../../library/functools.rst:474
400400msgid ""
401401":class:`partial` objects are callable objects created by :func:`partial`. "
402402"They have three read-only attributes:"
403403msgstr ""
404404
405- #: ../../library/functools.rst:479
405+ #: ../../library/functools.rst:480
406406msgid ""
407407"A callable object or function. Calls to the :class:`partial` object will be"
408408" forwarded to :attr:`func` with new arguments and keywords."
409409msgstr ""
410410
411- #: ../../library/functools.rst:485
411+ #: ../../library/functools.rst:486
412412msgid ""
413413"The leftmost positional arguments that will be prepended to the positional "
414414"arguments provided to a :class:`partial` object call."
415415msgstr ""
416416
417- #: ../../library/functools.rst:491
417+ #: ../../library/functools.rst:492
418418msgid ""
419419"The keyword arguments that will be supplied when the :class:`partial` object"
420420" is called."
421421msgstr ""
422422
423- #: ../../library/functools.rst:494
423+ #: ../../library/functools.rst:495
424424msgid ""
425425":class:`partial` objects are like :class:`function` objects in that they are"
426426" callable, weak referencable, and can have attributes. There are some "
0 commit comments