@@ -404,7 +404,7 @@ msgid ""
404404msgstr ""
405405"这是一个可选的修复器,会进行多种转换,将 Python 代码变成更加常见的写法。类似 ``type(x) is SomeClass`` 和 "
406406"``type(x) == SomeClass`` 的类型对比会被转换成 ``isinstance(x, SomeClass)``。``while 1``"
407- " 转换成 ``while True``。这个修复器还会在合适的地方使用 :func:`sorted` 函数。举个例子,这样的代码 :"
407+ " 转换成 ``while True``。这个修复器还会在合适的地方使用 :func:`sorted` 函数。举个例子,这样的代码块 :"
408408
409409#: ../../library/2to3.rst:262
410410msgid "is changed to ::"
@@ -416,21 +416,21 @@ msgstr "检测 sibling imports,并将其转换成相对 import。"
416416
417417#: ../../library/2to3.rst:272
418418msgid "Handles module renames in the standard library."
419- msgstr ""
419+ msgstr "处理标准库模块的重命名。 "
420420
421421#: ../../library/2to3.rst:276
422422msgid ""
423423"Handles other modules renames in the standard library. It is separate from "
424424"the :2to3fixer:`imports` fixer only because of technical limitations."
425- msgstr ""
425+ msgstr "处理标准库中其他模块的重命名。这个修复器由于一些技术上的限制,因此和 :2to3fixer:`imports` 拆分开了。 "
426426
427427#: ../../library/2to3.rst:281
428428msgid "Converts ``input(prompt)`` to ``eval(input(prompt))``."
429- msgstr ""
429+ msgstr "将 ``input(prompt)`` 转换为 ``eval(input(prompt))``。 "
430430
431431#: ../../library/2to3.rst:285
432432msgid "Converts :func:`intern` to :func:`sys.intern`."
433- msgstr ""
433+ msgstr "将 :func:`intern` 转换为 :func:`sys.intern`。 "
434434
435435#: ../../library/2to3.rst:289
436436msgid ""
@@ -439,62 +439,76 @@ msgid ""
439439"int)`` and ``isinstance(x, (int, float, int))`` is converted to "
440440"``isinstance(x, (int, float))``."
441441msgstr ""
442+ "修复 :func:`isinstance` 函数第二个实参中重复的类型。举例来说,``isinstance(x, (int, int))`` 会转换为 "
443+ "``isinstance(x, int)``, ``isinstance(x, (int, float, int))`` 会转换为 "
444+ "``isinstance(x, (int, float))``。"
442445
443446#: ../../library/2to3.rst:296
444447msgid ""
445448"Removes imports of :func:`itertools.ifilter`, :func:`itertools.izip`, and "
446449":func:`itertools.imap`. Imports of :func:`itertools.ifilterfalse` are also "
447450"changed to :func:`itertools.filterfalse`."
448451msgstr ""
452+ "移除 :func:`itertools.ifilter`,:func:`itertools.izip` 以及 "
453+ ":func:`itertools.imap` 的 import。对 :func:`itertools.ifilterfalse` 的 import "
454+ "也会替换成 :func:`itertools.filterfalse`。"
449455
450456#: ../../library/2to3.rst:302
451457msgid ""
452458"Changes usage of :func:`itertools.ifilter`, :func:`itertools.izip`, and "
453459":func:`itertools.imap` to their built-in equivalents. "
454460":func:`itertools.ifilterfalse` is changed to :func:`itertools.filterfalse`."
455461msgstr ""
462+ "修改 :func:`itertools.ifilter`,:func:`itertools.izip` 和 :func:`itertools.imap`"
463+ " 的调用为对应的内建实现。:func:`itertools.ifilterfalse` 会替换成 "
464+ ":func:`itertools.filterfalse`。"
456465
457466#: ../../library/2to3.rst:308
458467msgid "Renames :class:`long` to :class:`int`."
459- msgstr ""
468+ msgstr "将 :class:`long` 重命名为 :class:`int`。 "
460469
461470#: ../../library/2to3.rst:312
462471msgid ""
463472"Wraps :func:`map` in a :class:`list` call. It also changes ``map(None, x)``"
464473" to ``list(x)``. Using ``from future_builtins import map`` disables this "
465474"fixer."
466475msgstr ""
476+ "用 :class:`list` 包装 :func:`map`。同时也会将 ``map(None, x)`` 替换为 ``list(x)``。使用 "
477+ "``from future_builtins import map`` 禁用这个修复器。"
467478
468479#: ../../library/2to3.rst:318
469480msgid ""
470481"Converts the old metaclass syntax (``__metaclass__ = Meta`` in the class "
471482"body) to the new (``class X(metaclass=Meta)``)."
472483msgstr ""
484+ "将老的元类语法(类体中的 ``__metaclass__ = Meta``)替换为新的(``class X(metaclass=Meta)``)。"
473485
474486#: ../../library/2to3.rst:323
475487msgid ""
476488"Fixes old method attribute names. For example, ``meth.im_func`` is "
477489"converted to ``meth.__func__``."
478- msgstr ""
490+ msgstr "修复老的方法属性名。例如 ``meth.im_func`` 会被转换为 ``meth.__func__``。 "
479491
480492#: ../../library/2to3.rst:328
481493msgid "Converts the old not-equal syntax, ``<>``, to ``!=``."
482- msgstr ""
494+ msgstr "转换老的不等语法,将 ``<>`` 转为 ``!=``。 "
483495
484496#: ../../library/2to3.rst:332
485497msgid ""
486498"Converts the use of iterator's :meth:`~iterator.next` methods to the "
487499":func:`next` function. It also renames :meth:`next` methods to "
488500":meth:`~iterator.__next__`."
489501msgstr ""
502+ "将迭代器的 :meth:`iterator.next` 方法调用转为 :func:`next` 函数。也会将 :meth:`next` 方法重命名为 "
503+ ":meth:`iterator.__next__`。"
490504
491505#: ../../library/2to3.rst:338
492506msgid "Renames :meth:`__nonzero__` to :meth:`~object.__bool__`."
493- msgstr ""
507+ msgstr "将 :meth:`__nonzero__` 转换为 :meth:`object.__bool__`。 "
494508
495509#: ../../library/2to3.rst:342
496510msgid "Converts octal literals into the new syntax."
497- msgstr ""
511+ msgstr "将八进制字面量转为新的语法。 "
498512
499513#: ../../library/2to3.rst:346
500514msgid ""
@@ -503,72 +517,74 @@ msgid ""
503517"statements are added, e.g. ``import collections.abc``. The following "
504518"mapping are made:"
505519msgstr ""
520+ "将 :mod:`operator` 模块中的许多方法调用转为其他的等效函数调用。如果有需要,会添加适当的 ``import`` 语句,比如 "
521+ "``import collections.abc``。有以下转换映射:"
506522
507523#: ../../library/2to3.rst:354
508524msgid "``operator.isCallable(obj)``"
509- msgstr ""
525+ msgstr "``operator.isCallable(obj)`` "
510526
511527#: ../../library/2to3.rst:354
512528msgid "``callable(obj)``"
513- msgstr ""
529+ msgstr "``callable(obj)`` "
514530
515531#: ../../library/2to3.rst:355
516532msgid "``operator.sequenceIncludes(obj)``"
517- msgstr ""
533+ msgstr "``operator.sequenceIncludes(obj)`` "
518534
519535#: ../../library/2to3.rst:355
520536msgid "``operator.contains(obj)``"
521- msgstr ""
537+ msgstr "``operator.contains(obj)`` "
522538
523539#: ../../library/2to3.rst:356
524540msgid "``operator.isSequenceType(obj)``"
525- msgstr ""
541+ msgstr "``operator.isSequenceType(obj)`` "
526542
527543#: ../../library/2to3.rst:356
528544msgid "``isinstance(obj, collections.abc.Sequence)``"
529- msgstr ""
545+ msgstr "``isinstance(obj, collections.abc.Sequence)`` "
530546
531547#: ../../library/2to3.rst:357
532548msgid "``operator.isMappingType(obj)``"
533- msgstr ""
549+ msgstr "``operator.isMappingType(obj)`` "
534550
535551#: ../../library/2to3.rst:357
536552msgid "``isinstance(obj, collections.abc.Mapping)``"
537- msgstr ""
553+ msgstr "``isinstance(obj, collections.abc.Mapping)`` "
538554
539555#: ../../library/2to3.rst:358
540556msgid "``operator.isNumberType(obj)``"
541- msgstr ""
557+ msgstr "``operator.isNumberType(obj)`` "
542558
543559#: ../../library/2to3.rst:358
544560msgid "``isinstance(obj, numbers.Number)``"
545- msgstr ""
561+ msgstr "``isinstance(obj, numbers.Number)`` "
546562
547563#: ../../library/2to3.rst:359
548564msgid "``operator.repeat(obj, n)``"
549- msgstr ""
565+ msgstr "``operator.repeat(obj, n)`` "
550566
551567#: ../../library/2to3.rst:359
552568msgid "``operator.mul(obj, n)``"
553- msgstr ""
569+ msgstr "``operator.mul(obj, n)`` "
554570
555571#: ../../library/2to3.rst:360
556572msgid "``operator.irepeat(obj, n)``"
557- msgstr ""
573+ msgstr "``operator.irepeat(obj, n)`` "
558574
559575#: ../../library/2to3.rst:360
560576msgid "``operator.imul(obj, n)``"
561- msgstr ""
577+ msgstr "``operator.imul(obj, n)`` "
562578
563579#: ../../library/2to3.rst:365
564580msgid ""
565581"Add extra parenthesis where they are required in list comprehensions. For "
566582"example, ``[x for x in 1, 2]`` becomes ``[x for x in (1, 2)]``."
567- msgstr ""
583+ msgstr "在列表生成式中增加必须的括号。例如将 ``[x for x in 1, 2]`` 转换为 ``[x for x in (1, 2)]``。 "
568584
569585#: ../../library/2to3.rst:370
570586msgid "Converts the ``print`` statement to the :func:`print` function."
571- msgstr ""
587+ msgstr "将 ``print`` 语句转换为 :func:`print` 函数。 "
572588
573589#: ../../library/2to3.rst:374
574590msgid ""
@@ -577,101 +593,108 @@ msgid ""
577593"incorrect because substituting tuples for exceptions has been removed in "
578594"3.0."
579595msgstr ""
596+ "将 ``raise E, V`` 转换为 ``raise E(V)``,将 ``raise E, V, T`` 转换为 ``raise "
597+ "E(V).with_traceback(T)``。如果 ``E`` 是元组,这样的转换是不正确的,因为用元组代替异常的做法在 3.0 中已经移除了。"
580598
581599#: ../../library/2to3.rst:380
582600msgid "Converts :func:`raw_input` to :func:`input`."
583- msgstr ""
601+ msgstr "将 :func:`raw_input` 转换为 :func:`input`。 "
584602
585603#: ../../library/2to3.rst:384
586604msgid "Handles the move of :func:`reduce` to :func:`functools.reduce`."
587- msgstr ""
605+ msgstr "将 :func:`reduce` 转换为 :func:`functools.reduce`。 "
588606
589607#: ../../library/2to3.rst:388
590608msgid "Converts :func:`reload` to :func:`importlib.reload`."
591- msgstr ""
609+ msgstr "将 :func:`reload` 转换为 :func:`importlib.reload`。 "
592610
593611#: ../../library/2to3.rst:392
594612msgid "Changes :data:`sys.maxint` to :data:`sys.maxsize`."
595- msgstr ""
613+ msgstr "将 :data:`sys.maxint` 转换为 :data:`sys.maxsize`。 "
596614
597615#: ../../library/2to3.rst:396
598616msgid "Replaces backtick repr with the :func:`repr` function."
599- msgstr ""
617+ msgstr "将反引号 repr 表达式替换为 :func:`repr` 函数。 "
600618
601619#: ../../library/2to3.rst:400
602620msgid ""
603621"Replaces use of the :class:`set` constructor with set literals. This fixer "
604622"is optional."
605- msgstr ""
623+ msgstr "将 :class:`set` 构造函数替换为 set literals 写法。这个修复器是可选的。 "
606624
607625#: ../../library/2to3.rst:405
608626msgid "Renames :exc:`StandardError` to :exc:`Exception`."
609- msgstr ""
627+ msgstr "将 :exc:`StandardError` 重命名为 :exc:`Exception`。 "
610628
611629#: ../../library/2to3.rst:409
612630msgid ""
613631"Changes the deprecated :data:`sys.exc_value`, :data:`sys.exc_type`, "
614632":data:`sys.exc_traceback` to use :func:`sys.exc_info`."
615633msgstr ""
634+ "将弃用的 :data:`sys.exc_value`,:data:`sys.exc_type`,:data:`sys.exc_traceback` "
635+ "替换为 :func:`sys.exc_info` 的用法。"
616636
617637#: ../../library/2to3.rst:414
618638msgid "Fixes the API change in generator's :meth:`throw` method."
619- msgstr ""
639+ msgstr "修复生成器的 :meth:`throw` 方法的 API 变更。 "
620640
621641#: ../../library/2to3.rst:418
622642msgid ""
623643"Removes implicit tuple parameter unpacking. This fixer inserts temporary "
624644"variables."
625- msgstr ""
645+ msgstr "移除隐式的元组参数解包。这个修复器会插入临时变量。 "
626646
627647#: ../../library/2to3.rst:423
628648msgid ""
629649"Fixes code broken from the removal of some members in the :mod:`types` "
630650"module."
631- msgstr ""
651+ msgstr "修复 :mod:`type` 模块中一些成员的移除引起的代码问题。 "
632652
633653#: ../../library/2to3.rst:428
634654msgid "Renames :class:`unicode` to :class:`str`."
635- msgstr ""
655+ msgstr "将 :class:`unicode` 重命名为 :class:`str`。 "
636656
637657#: ../../library/2to3.rst:432
638658msgid ""
639659"Handles the rename of :mod:`urllib` and :mod:`urllib2` to the :mod:`urllib` "
640660"package."
641- msgstr ""
661+ msgstr "将 :mod:`urllib` 和 :mod:`urllib2` 重命名为 :mod:`urllib` 包。 "
642662
643663#: ../../library/2to3.rst:437
644664msgid ""
645665"Removes excess whitespace from comma separated items. This fixer is "
646666"optional."
647- msgstr ""
667+ msgstr "移除逗号分隔的元素之间多余的空白。这个修复器是可选的。 "
648668
649669#: ../../library/2to3.rst:442
650670msgid ""
651671"Renames :func:`xrange` to :func:`range` and wraps existing :func:`range` "
652672"calls with :class:`list`."
653673msgstr ""
674+ "将 :func:`xrange` 重命名为 :func:`range`,并用 :class:`list` 包装原有的 :func:`range`。"
654675
655676#: ../../library/2to3.rst:447
656677msgid "Changes ``for x in file.xreadlines()`` to ``for x in file``."
657- msgstr ""
678+ msgstr "将 ``for x in file.xreadlines()`` 转换为 ``for x in file``。 "
658679
659680#: ../../library/2to3.rst:451
660681msgid ""
661682"Wraps :func:`zip` usage in a :class:`list` call. This is disabled when "
662683"``from future_builtins import zip`` appears."
663684msgstr ""
685+ "用 :class:`list` 包装 :func:`zip`。如果使用了 ``from future_builtins import zip`` "
686+ "的话会禁用。"
664687
665688#: ../../library/2to3.rst:456
666689msgid ":mod:`lib2to3` - 2to3's library"
667- msgstr ""
690+ msgstr ":mod:`lib2to3` —— 2to3 支持库 "
668691
669692#: ../../library/2to3.rst:465
670693msgid "**Source code:** :source:`Lib/lib2to3/`"
671- msgstr ""
694+ msgstr "**源代码:** :source:`Lib/lib2to3/` "
672695
673696#: ../../library/2to3.rst:471
674697msgid ""
675698"The :mod:`lib2to3` API should be considered unstable and may change "
676699"drastically in the future."
677- msgstr ""
700+ msgstr ":mod:`lib2to3` API 并不稳定,并可能在未来大幅修改。 "
0 commit comments