33# This file is distributed under the same license as the Python package.
44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
6+ # Translators:
7+ # ww song <[email protected] >, 20188+ # zc Jin <[email protected] >, 20189+ # Freesand Leo <[email protected] >, 201810+ #
611#, fuzzy
712msgid ""
813msgstr ""
914"Project-Id-Version : Python 3.7\n "
1015"Report-Msgid-Bugs-To : \n "
11- "POT-Creation-Date : 2018-10-24 09:34 +0900\n "
12- "PO-Revision-Date : YEAR-MO-DA HO:MI+ZONE \n "
16+ "POT-Creation-Date : 2018-11-27 09:51 +0900\n "
17+ "PO-Revision-Date : 2017-02-16 23:12+0000 \n "
1318"
Last-Translator :
Freesand Leo <[email protected] >, 2018\n "
1419"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
1520"MIME-Version : 1.0\n "
@@ -57,7 +62,7 @@ msgid ""
5762" one argument and returns another value to be used as the sort key."
5863msgstr ""
5964
60- #: ../../library/functools.rst:37 ../../library/functools.rst:226
65+ #: ../../library/functools.rst:37 ../../library/functools.rst:231
6166msgid "Example::"
6267msgstr "示例::"
6368
@@ -133,40 +138,48 @@ msgid ""
133138msgstr ""
134139
135140#: ../../library/functools.rst:88
141+ msgid ""
142+ "In general, the LRU cache should only be used when you want to reuse "
143+ "previously computed values. Accordingly, it doesn't make sense to cache "
144+ "functions with side-effects, functions that need to create distinct mutable "
145+ "objects on each call, or impure functions such as time() or random()."
146+ msgstr ""
147+
148+ #: ../../library/functools.rst:93
136149msgid "Example of an LRU cache for static web content::"
137150msgstr ""
138151
139- #: ../../library/functools.rst:107
152+ #: ../../library/functools.rst:112
140153msgid ""
141154"Example of efficiently computing `Fibonacci numbers "
142155"<https://en.wikipedia.org/wiki/Fibonacci_number>`_ using a cache to "
143156"implement a `dynamic programming "
144157"<https://en.wikipedia.org/wiki/Dynamic_programming>`_ technique::"
145158msgstr ""
146159
147- #: ../../library/functools.rst:127
160+ #: ../../library/functools.rst:132
148161msgid "Added the *typed* option."
149162msgstr ""
150163
151- #: ../../library/functools.rst:132
164+ #: ../../library/functools.rst:137
152165msgid ""
153166"Given a class defining one or more rich comparison ordering methods, this "
154167"class decorator supplies the rest. This simplifies the effort involved in "
155168"specifying all of the possible rich comparison operations:"
156169msgstr ""
157170
158- #: ../../library/functools.rst:136
171+ #: ../../library/functools.rst:141
159172msgid ""
160173"The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`,"
161174" or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` "
162175"method."
163176msgstr ""
164177
165- #: ../../library/functools.rst:140
178+ #: ../../library/functools.rst:145
166179msgid "For example::"
167180msgstr "例如::"
168181
169- #: ../../library/functools.rst:160
182+ #: ../../library/functools.rst:165
170183msgid ""
171184"While this decorator makes it easy to create well behaved totally ordered "
172185"types, it *does* come at the cost of slower execution and more complex stack"
@@ -175,13 +188,13 @@ msgid ""
175188" rich comparison methods instead is likely to provide an easy speed boost."
176189msgstr ""
177190
178- #: ../../library/functools.rst:169
191+ #: ../../library/functools.rst:174
179192msgid ""
180193"Returning NotImplemented from the underlying comparison function for "
181194"unrecognised types is now supported."
182195msgstr ""
183196
184- #: ../../library/functools.rst:175
197+ #: ../../library/functools.rst:180
185198msgid ""
186199"Return a new :ref:`partial object<partial-objects>` which when called will "
187200"behave like *func* called with the positional arguments *args* and keyword "
@@ -190,7 +203,7 @@ msgid ""
190203"extend and override *keywords*. Roughly equivalent to::"
191204msgstr ""
192205
193- #: ../../library/functools.rst:192
206+ #: ../../library/functools.rst:197
194207msgid ""
195208"The :func:`partial` is used for partial function application which "
196209"\" freezes\" some portion of a function's arguments and/or keywords resulting"
@@ -199,20 +212,20 @@ msgid ""
199212"where the *base* argument defaults to two:"
200213msgstr ""
201214
202- #: ../../library/functools.rst:207
215+ #: ../../library/functools.rst:212
203216msgid ""
204217"Return a new :class:`partialmethod` descriptor which behaves like "
205218":class:`partial` except that it is designed to be used as a method "
206219"definition rather than being directly callable."
207220msgstr ""
208221
209- #: ../../library/functools.rst:211
222+ #: ../../library/functools.rst:216
210223msgid ""
211224"*func* must be a :term:`descriptor` or a callable (objects which are both, "
212225"like normal functions, are handled as descriptors)."
213226msgstr ""
214227
215- #: ../../library/functools.rst:214
228+ #: ../../library/functools.rst:219
216229msgid ""
217230"When *func* is a descriptor (such as a normal Python function, "
218231":func:`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another"
@@ -221,7 +234,7 @@ msgid ""
221234"objects>` returned as the result."
222235msgstr ""
223236
224- #: ../../library/functools.rst:220
237+ #: ../../library/functools.rst:225
225238msgid ""
226239"When *func* is a non-descriptor callable, an appropriate bound method is "
227240"created dynamically. This behaves like a normal Python function when used as"
@@ -230,7 +243,7 @@ msgid ""
230243":class:`partialmethod` constructor."
231244msgstr ""
232245
233- #: ../../library/functools.rst:251
246+ #: ../../library/functools.rst:256
234247msgid ""
235248"Apply *function* of two arguments cumulatively to the items of *sequence*, "
236249"from left to right, so as to reduce the sequence to a single value. For "
@@ -243,57 +256,57 @@ msgid ""
243256" the first item is returned."
244257msgstr ""
245258
246- #: ../../library/functools.rst:260
259+ #: ../../library/functools.rst:265
247260msgid "Roughly equivalent to::"
248261msgstr "大致相当于:"
249262
250- #: ../../library/functools.rst:275
263+ #: ../../library/functools.rst:280
251264msgid ""
252265"Transform a function into a :term:`single-dispatch <single dispatch>` "
253266":term:`generic function`."
254267msgstr ""
255268
256- #: ../../library/functools.rst:278
269+ #: ../../library/functools.rst:283
257270msgid ""
258271"To define a generic function, decorate it with the ``@singledispatch`` "
259272"decorator. Note that the dispatch happens on the type of the first argument,"
260273" create your function accordingly::"
261274msgstr ""
262275
263- #: ../../library/functools.rst:289
276+ #: ../../library/functools.rst:294
264277msgid ""
265278"To add overloaded implementations to the function, use the :func:`register` "
266279"attribute of the generic function. It is a decorator. For functions "
267280"annotated with types, the decorator will infer the type of the first "
268281"argument automatically::"
269282msgstr ""
270283
271- #: ../../library/functools.rst:307
284+ #: ../../library/functools.rst:312
272285msgid ""
273286"For code which doesn't use type annotations, the appropriate type argument "
274287"can be passed explicitly to the decorator itself::"
275288msgstr ""
276289
277- #: ../../library/functools.rst:318
290+ #: ../../library/functools.rst:323
278291msgid ""
279292"To enable registering lambdas and pre-existing functions, the "
280293":func:`register` attribute can be used in a functional form::"
281294msgstr ""
282295
283- #: ../../library/functools.rst:326
296+ #: ../../library/functools.rst:331
284297msgid ""
285298"The :func:`register` attribute returns the undecorated function which "
286299"enables decorator stacking, pickling, as well as creating unit tests for "
287300"each variant independently::"
288301msgstr ""
289302
290- #: ../../library/functools.rst:340
303+ #: ../../library/functools.rst:345
291304msgid ""
292305"When called, the generic function dispatches on the type of the first "
293306"argument::"
294307msgstr ""
295308
296- #: ../../library/functools.rst:360
309+ #: ../../library/functools.rst:365
297310msgid ""
298311"Where there is no registered implementation for a specific type, its method "
299312"resolution order is used to find a more generic implementation. The original"
@@ -302,23 +315,23 @@ msgid ""
302315"found."
303316msgstr ""
304317
305- #: ../../library/functools.rst:366
318+ #: ../../library/functools.rst:371
306319msgid ""
307320"To check which implementation will the generic function choose for a given "
308321"type, use the ``dispatch()`` attribute::"
309322msgstr ""
310323
311- #: ../../library/functools.rst:374
324+ #: ../../library/functools.rst:379
312325msgid ""
313326"To access all registered implementations, use the read-only ``registry`` "
314327"attribute::"
315328msgstr ""
316329
317- #: ../../library/functools.rst:388
330+ #: ../../library/functools.rst:393
318331msgid "The :func:`register` attribute supports using type annotations."
319332msgstr ""
320333
321- #: ../../library/functools.rst:394
334+ #: ../../library/functools.rst:399
322335msgid ""
323336"Update a *wrapper* function to look like the *wrapped* function. The "
324337"optional arguments are tuples to specify which attributes of the original "
@@ -332,15 +345,15 @@ msgid ""
332345"``__dict__``, i.e. the instance dictionary)."
333346msgstr ""
334347
335- #: ../../library/functools.rst:404
348+ #: ../../library/functools.rst:409
336349msgid ""
337350"To allow access to the original function for introspection and other "
338351"purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), "
339352"this function automatically adds a ``__wrapped__`` attribute to the wrapper "
340353"that refers to the function being wrapped."
341354msgstr ""
342355
343- #: ../../library/functools.rst:409
356+ #: ../../library/functools.rst:414
344357msgid ""
345358"The main intended use for this function is in :term:`decorator` functions "
346359"which wrap the decorated function and return the wrapper. If the wrapper "
@@ -349,7 +362,7 @@ msgid ""
349362"is typically less than helpful."
350363msgstr ""
351364
352- #: ../../library/functools.rst:415
365+ #: ../../library/functools.rst:420
353366msgid ""
354367":func:`update_wrapper` may be used with callables other than functions. Any "
355368"attributes named in *assigned* or *updated* that are missing from the object"
@@ -358,69 +371,69 @@ msgid ""
358371"wrapper function itself is missing any attributes named in *updated*."
359372msgstr ""
360373
361- #: ../../library/functools.rst:421
374+ #: ../../library/functools.rst:426
362375msgid "Automatic addition of the ``__wrapped__`` attribute."
363376msgstr ""
364377
365- #: ../../library/functools.rst:424
378+ #: ../../library/functools.rst:429
366379msgid "Copying of the ``__annotations__`` attribute by default."
367380msgstr ""
368381
369- #: ../../library/functools.rst:427
382+ #: ../../library/functools.rst:432
370383msgid "Missing attributes no longer trigger an :exc:`AttributeError`."
371384msgstr ""
372385
373- #: ../../library/functools.rst:430
386+ #: ../../library/functools.rst:435
374387msgid ""
375388"The ``__wrapped__`` attribute now always refers to the wrapped function, "
376389"even if that function defined a ``__wrapped__`` attribute. (see "
377390":issue:`17482`)"
378391msgstr ""
379392
380- #: ../../library/functools.rst:438
393+ #: ../../library/functools.rst:443
381394msgid ""
382395"This is a convenience function for invoking :func:`update_wrapper` as a "
383396"function decorator when defining a wrapper function. It is equivalent to "
384397"``partial(update_wrapper, wrapped=wrapped, assigned=assigned, "
385398"updated=updated)``. For example::"
386399msgstr ""
387400
388- #: ../../library/functools.rst:464
401+ #: ../../library/functools.rst:469
389402msgid ""
390403"Without the use of this decorator factory, the name of the example function "
391404"would have been ``'wrapper'``, and the docstring of the original "
392405":func:`example` would have been lost."
393406msgstr ""
394407
395- #: ../../library/functools.rst:472
408+ #: ../../library/functools.rst:477
396409msgid ":class:`partial` Objects"
397410msgstr ""
398411
399- #: ../../library/functools.rst:474
412+ #: ../../library/functools.rst:479
400413msgid ""
401414":class:`partial` objects are callable objects created by :func:`partial`. "
402415"They have three read-only attributes:"
403416msgstr ""
404417
405- #: ../../library/functools.rst:480
418+ #: ../../library/functools.rst:485
406419msgid ""
407420"A callable object or function. Calls to the :class:`partial` object will be"
408421" forwarded to :attr:`func` with new arguments and keywords."
409422msgstr ""
410423
411- #: ../../library/functools.rst:486
424+ #: ../../library/functools.rst:491
412425msgid ""
413426"The leftmost positional arguments that will be prepended to the positional "
414427"arguments provided to a :class:`partial` object call."
415428msgstr ""
416429
417- #: ../../library/functools.rst:492
430+ #: ../../library/functools.rst:497
418431msgid ""
419432"The keyword arguments that will be supplied when the :class:`partial` object"
420433" is called."
421434msgstr ""
422435
423- #: ../../library/functools.rst:495
436+ #: ../../library/functools.rst:500
424437msgid ""
425438":class:`partial` objects are like :class:`function` objects in that they are"
426439" callable, weak referencable, and can have attributes. There are some "
0 commit comments