Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1327503

Browse files
[po] auto sync
1 parent 07b18e7 commit 1327503

1 file changed

Lines changed: 18 additions & 19 deletions

File tree

tutorial/controlflow.po

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -347,36 +347,36 @@ msgid ""
347347
"this example it is equivalent to ``result = result + [a]``, but more "
348348
"efficient."
349349
msgstr ""
350-
"``result.append(a)`` 语句调用了列表对象 ``result`` 的 *方法* 。方法是“属于”一个对象的函数,它被命名为 "
351-
"``obj.methodname`` ,其中 ``obj`` 是某个对象(也可能是一个表达式), ``methodname`` "
352-
"是由对象类型中定义的方法的名称。不同的类型可以定义不同的方法。不同类型的方法可以有相同的名称而不会引起歧义。(可以使用 *类* "
353-
"定义自己的对象类型和方法,请参阅 :ref:`tut-classes` )示例中的方法 :meth:`append` "
354-
"是为列表对象定义的;它会在列表的最后添加一个新的元素。在这个示例中它相当于 ``result = result + [a]`` ,但更高效。"
350+
"``result.append(a)`` 语句调用了列表对象 ``result`` 的 *方法* 。方法是“从属于”对象的函数,命名为 "
351+
"``obj.methodname``,其中``obj`` 是对象(也可以是表达式), ``methodname`` "
352+
"是对象类型定义的方法名称。不同类型定义的方法不同。不同类型的方法可以有相同的名称,还不会引起歧义。(*类* 可以定义自定义对象类型和方法,详见 :ref"
353+
":`tut-classes` )示例中的方法 :meth:`append` 是为列表对象定义的;用于在列表的末尾添加新元素。本例中,它相当于 "
354+
"``result = result + [a]`` ,但更高效。"
355355

356356
#: ../../tutorial/controlflow.rst:359
357357
msgid "More on Defining Functions"
358-
msgstr "函数定义的更多形式"
358+
msgstr "函数定义详解"
359359

360360
#: ../../tutorial/controlflow.rst:361
361361
msgid ""
362362
"It is also possible to define functions with a variable number of arguments."
363363
" There are three forms, which can be combined."
364-
msgstr "给函数定义有可变数目的参数也是可行的。这里有三种形式,可以组合使用。"
364+
msgstr "函数定义支持可变数量的参数。这里列出三种可以组合使用的形式。"
365365

366366
#: ../../tutorial/controlflow.rst:368
367367
msgid "Default Argument Values"
368-
msgstr "参数默认值"
368+
msgstr "默认值参数"
369369

370370
#: ../../tutorial/controlflow.rst:370
371371
msgid ""
372372
"The most useful form is to specify a default value for one or more "
373373
"arguments. This creates a function that can be called with fewer arguments "
374374
"than it is defined to allow. For example::"
375-
msgstr "最有用的形式是对一个或多个参数指定一个默认值。这样创建的函数,可以用比定义时允许的更少的参数调用,比如::"
375+
msgstr "为参数指定默认值是非常有用的方式。调用函数时,可以使用比定义时更少的参数,例如:"
376376

377377
#: ../../tutorial/controlflow.rst:386
378378
msgid "This function can be called in several ways:"
379-
msgstr "这个函数可以通过几种方式调用:"
379+
msgstr "该函数可以用以下方式调用:"
380380

381381
#: ../../tutorial/controlflow.rst:388
382382
msgid ""
@@ -388,31 +388,31 @@ msgstr "只给出必需的参数:``ask_ok('Do you really want to quit?')``"
388388
msgid ""
389389
"giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', "
390390
"2)``"
391-
msgstr "给出一个可选的参数:``ask_ok('OK to overwrite the file?', 2)``"
391+
msgstr "给出一个可选参数:``ask_ok('OK to overwrite the file?', 2)``"
392392

393393
#: ../../tutorial/controlflow.rst:392
394394
msgid ""
395395
"or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come"
396396
" on, only yes or no!')``"
397397
msgstr ""
398-
"或者给出所有的参数:``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or "
398+
"给出所有参数:``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or "
399399
"no!')``"
400400

401401
#: ../../tutorial/controlflow.rst:395
402402
msgid ""
403403
"This example also introduces the :keyword:`in` keyword. This tests whether "
404404
"or not a sequence contains a certain value."
405-
msgstr "这个示例还介绍了 :keyword:`in` 关键字。它可以测试一个序列是否包含某个值。"
405+
msgstr "本例还使用了关键字 :keyword:`in` ,用于确认序列中是否包含某个值。"
406406

407407
#: ../../tutorial/controlflow.rst:398
408408
msgid ""
409409
"The default values are evaluated at the point of function definition in the "
410410
"*defining* scope, so that ::"
411-
msgstr "默认值是在 *定义过程* 中在函数定义处计算的,所以 ::"
411+
msgstr "默认值在 *定义* 作用域里的函数定义中求值,所以"
412412

413413
#: ../../tutorial/controlflow.rst:409
414414
msgid "will print ``5``."
415-
msgstr "会打印 ``5``。"
415+
msgstr "上例输出的是 ``5``。"
416416

417417
#: ../../tutorial/controlflow.rst:411
418418
msgid ""
@@ -421,18 +421,17 @@ msgid ""
421421
"dictionary, or instances of most classes. For example, the following "
422422
"function accumulates the arguments passed to it on subsequent calls::"
423423
msgstr ""
424-
"**重要警告:** "
425-
"默认值只会执行一次。这条规则在默认值为可变对象(列表、字典以及大多数类实例)时很重要。比如,下面的函数会存储在后续调用中传递给它的参数::"
424+
"**重要警告:** 默认值只计算一次。默认值为列表、字典或类实例等可变对象时,会产生与该规则不同的结果。例如,下面的函数会累积后续调用时传递的参数:"
426425

427426
#: ../../tutorial/controlflow.rst:424
428427
msgid "This will print ::"
429-
msgstr "这将打印出 ::"
428+
msgstr "输出结果如下:"
430429

431430
#: ../../tutorial/controlflow.rst:430
432431
msgid ""
433432
"If you don't want the default to be shared between subsequent calls, you can"
434433
" write the function like this instead::"
435-
msgstr "如果你不想要在后续调用之间共享默认值,你可以这样写这个函数::"
434+
msgstr "不需要在后续调用之间共享默认值时,应以如下方式编写函数:"
436435

437436
#: ../../tutorial/controlflow.rst:443
438437
msgid "Keyword Arguments"

0 commit comments

Comments
 (0)