GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-docs-ja/library/2to3.po at 3.12 · python/python-docs-ja Expand file tree/ Copy path2to3.poMore file actions 789 lines (668 loc) · 33.8 KB / Copy path2to3.poFile metadata and controls789 lines (668 loc) · 33.8 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 # SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # # Translators: # Tetsuo Koyama <[email protected]>, 2021 # Keigo Fushio <[email protected]>, 2021 # Shin Saito, 2021 # tomo, 2022 # Arihiro TAKASE, 2023 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-05-04 01:27+0000\n" "PO-Revision-Date: 2021-06-28 00:54+0000\n" "Last-Translator: Arihiro TAKASE, 2023\n" "Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/2to3.rst:4 msgid "2to3 --- Automated Python 2 to 3 code translation" msgstr "2to3 --- Python 2 から 3 への自動コード変換" #: ../../library/2to3.rst:8 msgid "" "2to3 is a Python program that reads Python 2.x source code and applies a " "series of *fixers* to transform it into valid Python 3.x code. The standard " "library contains a rich set of fixers that will handle almost all code. " "2to3 supporting library :mod:`lib2to3` is, however, a flexible and generic " "library, so it is possible to write your own fixers for 2to3." msgstr "" "2to3 は、 Python 2.x のソースコードを読み込み、一連の *変換プログラム " "(fixer)* を適用して正しい Python 3.x のコードに変換する Python プログラムで" "す。標準ライブラリはほとんど全てのコードを取り扱うのに十分な fixer を含んでい" "ます。ただし 2to3 を構成している :mod:`lib2to3` は柔軟かつ一般的なライブラリ" "なので、 2to3 のために独自の fixer を書くこともできます。" #: ../../library/2to3.rst:19 msgid "" "The ``lib2to3`` module was marked pending for deprecation in Python 3.9 " "(raising :exc:`PendingDeprecationWarning` on import) and fully deprecated in " "Python 3.11 (raising :exc:`DeprecationWarning`). The ``2to3`` tool is part " "of that. It will be removed in Python 3.13." msgstr "" #: ../../library/2to3.rst:23 msgid "Using 2to3" msgstr "2to3 の使用" #: ../../library/2to3.rst:25 msgid "" "2to3 will usually be installed with the Python interpreter as a script. It " "is also located in the :file:`Tools/scripts` directory of the Python root." msgstr "" "2to3 は大抵の場合、 Python インタープリターと共に、スクリプトとしてインストー" "ルされます。場所は、 Python のルートディレクトリにある、 :file:`Tools/" "scripts` ディレクトリです。" #: ../../library/2to3.rst:28 msgid "" "2to3's basic arguments are a list of files or directories to transform. The " "directories are recursively traversed for Python sources." msgstr "" "2to3 に与える基本の引数は、変換対象のファイル、もしくは、ディレクトリのリスト" "です。ディレクトリの場合は、 Python ソースコードを再帰的に探索します。" #: ../../library/2to3.rst:31 msgid "Here is a sample Python 2.x source file, :file:`example.py`::" msgstr "Python 2.x のサンプルコード、 :file:`example.py` を示します::" #: ../../library/2to3.rst:39 msgid "It can be converted to Python 3.x code via 2to3 on the command line:" msgstr "" "これは、コマンドラインから 2to3 を呼び出すことで、Python 3.x コードに変換され" "ます:" #: ../../library/2to3.rst:45 msgid "" "A diff against the original source file is printed. 2to3 can also write the " "needed modifications right back to the source file. (A backup of the " "original file is made unless :option:`!-n` is also given.) Writing the " "changes back is enabled with the :option:`!-w` flag:" msgstr "" "オリジナルのソースファイルに対する差分が表示されます。 2to3 は必要となる変更" "をソースファイルに書き込むこともできます (:option:`!-n` も与えたのでない限り" "オリジナルのバックアップも作成されます)。変更の書き戻しは :option:`!-w` フラ" "グによって有効化されます:" #: ../../library/2to3.rst:54 msgid "After transformation, :file:`example.py` looks like this::" msgstr "変換後、 :file:`example.py` は以下のようになります::" #: ../../library/2to3.rst:62 msgid "" "Comments and exact indentation are preserved throughout the translation " "process." msgstr "変換処理を通じて、コメントと、インデントは保存されます。" #: ../../library/2to3.rst:64 msgid "" "By default, 2to3 runs a set of :ref:`predefined fixers <2to3-fixers>`. The :" "option:`!-l` flag lists all available fixers. An explicit set of fixers to " "run can be given with :option:`!-f`. Likewise the :option:`!-x` explicitly " "disables a fixer. The following example runs only the ``imports`` and " "``has_key`` fixers:" msgstr "" "デフォルトでは、 2to3 は一連の :ref:`事前定義された変換プログラム <2to3-" "fixers>` を実行します。 :option:`!-l` フラグは、利用可能な変換プログラムの一" "覧を表示します。 :option:`!-f` フラグにより、実行する変換プログラムを明示的に" "与えることもできます。同様に、 :option:`!-x` は変換プログラムを明示的に無効化" "します。下記の例では、 ``imports`` と ``has_key`` 変換プログラムだけを実行し" "ます:" #: ../../library/2to3.rst:73 msgid "This command runs every fixer except the ``apply`` fixer:" msgstr "このコマンドは ``apply`` 以外のすべての変換プログラムを実行します:" #: ../../library/2to3.rst:79 msgid "" "Some fixers are *explicit*, meaning they aren't run by default and must be " "listed on the command line to be run. Here, in addition to the default " "fixers, the ``idioms`` fixer is run:" msgstr "" "いくつかの変換プログラムは *明示的*、つまり、デフォルトでは実行されず、コマン" "ドラインで実行するものとして列記する必要があります。デフォルトの変換プログラ" "ムに ``idioms`` 変換プログラムを追加して実行するには、下記のようにします:" #: ../../library/2to3.rst:87 msgid "Notice how passing ``all`` enables all default fixers." msgstr "" "ここで、 ``all`` を指定することで、全てのデフォルトの変換プログラムを有効化で" "きることに注意して下さい。" #: ../../library/2to3.rst:89 msgid "" "Sometimes 2to3 will find a place in your source code that needs to be " "changed, but 2to3 cannot fix automatically. In this case, 2to3 will print a " "warning beneath the diff for a file. You should address the warning in " "order to have compliant 3.x code." msgstr "" "2to3 がソースコードに修正すべき点を見つけても、自動的には修正できない場合もあ" "ります。この場合、 2to3 はファイルの変更点の下に警告を表示します。 3.x に準拠" "したコードにするために、あなたはこの警告に対処しなくてはなりません。" #: ../../library/2to3.rst:94 msgid "" "2to3 can also refactor doctests. To enable this mode, use the :option:`!-d` " "flag. Note that *only* doctests will be refactored. This also doesn't " "require the module to be valid Python. For example, doctest like examples " "in a reST document could also be refactored with this option." msgstr "" "2to3 は doctest の修正もできます。このモードを有効化するには :option:`!-d` フ" "ラグを指定して下さい。 doctest *だけ* が修正されることに注意して下さい。これ" "は、モジュールが有効な Python コードであることを要求しないということでもあり" "ます。例えば、 reST ドキュメント中の doctest に似たサンプルコードなども、この" "オプションで修正することができます。" #: ../../library/2to3.rst:99 msgid "" "The :option:`!-v` option enables output of more information on the " "translation process." msgstr ":option:`!-v` は、変換処理のより詳しい情報の出力を有効化します。" #: ../../library/2to3.rst:102 msgid "" "Since some print statements can be parsed as function calls or statements, " "2to3 cannot always read files containing the print function. When 2to3 " "detects the presence of the ``from __future__ import print_function`` " "compiler directive, it modifies its internal grammar to interpret :func:" "`print` as a function. This change can also be enabled manually with the :" "option:`!-p` flag. Use :option:`!-p` to run fixers on code that already has " "had its print statements converted. Also :option:`!-e` can be used to make :" "func:`exec` a function." msgstr "" "いくつかの print 文は関数呼び出しとしても文としても解析できるので、 2to3 は " "print 関数を含むファイルを常に読めるとは限りません。 2to3 は ``from " "__future__ import print_function`` コンパイラディレクティブが存在することを検" "出すると、内部の文法を変更して :func:`print` を関数として解釈するようになりま" "す。 :option:`!-p` フラグによって手動でこの変更を有効化することもできます。 " "print 文を変換済みのコードに対して変換プログラムを適用するには :option:`!-p` " "を使用してください。同様に、:func:`exec` を関数として解釈させるには :option:" "`!-e` を使用してください。" #: ../../library/2to3.rst:110 msgid "" "The :option:`!-o` or :option:`!--output-dir` option allows specification of " "an alternate directory for processed output files to be written to. The :" "option:`!-n` flag is required when using this as backup files do not make " "sense when not overwriting the input files." msgstr "" ":option:`!-o` または :option:`!--output-dir` で処理結果の出力先ディレクトリを" "変更出来ます。入力ファイルを上書きしないならバックアップは意味をなさないの" "で、オプション :option:`!-n` フラグが要ります。" #: ../../library/2to3.rst:115 msgid "The :option:`!-o` option was added." msgstr ":option:`!-o` オプションが追加されました。" #: ../../library/2to3.rst:118 msgid "" "The :option:`!-W` or :option:`!--write-unchanged-files` flag tells 2to3 to " "always write output files even if no changes were required to the file. " "This is most useful with :option:`!-o` so that an entire Python source tree " "is copied with translation from one directory to another. This option " "implies the :option:`!-w` flag as it would not make sense otherwise." msgstr "" ":option:`!-W` または :option:`!--write-unchanged-files` により、たとえファイ" "ルに変更が必要なくても常にファイルを出力するように 2to3 に指示することが出来" "ます。これは、 :option:`!-o` とともに使って、Python ソースツリー全体を変換し" "て別のディレクトリに書き出す際に最も有用です。" #: ../../library/2to3.rst:124 msgid "The :option:`!-W` flag was added." msgstr ":option:`!-W` フラグが追加されました。" #: ../../library/2to3.rst:127 msgid "" "The :option:`!--add-suffix` option specifies a string to append to all " "output filenames. The :option:`!-n` flag is required when specifying this " "as backups are not necessary when writing to different filenames. Example:" msgstr "" "オプション :option:`!--add-suffix` で、全ての出力ファイル名に与えた文字列を追" "加します。これを指定するのであれば別名で書き出されるためバックアップは必要な" "いので、オプション :option:`!-n` フラグが要ります。例えば:" #: ../../library/2to3.rst:135 msgid "Will cause a converted file named ``example.py3`` to be written." msgstr "とすれば変換後ファイルは ``example.py3`` として書き出されます。" #: ../../library/2to3.rst:137 msgid "The :option:`!--add-suffix` option was added." msgstr ":option:`!--add-suffix` オプションが追加されました。" #: ../../library/2to3.rst:140 msgid "To translate an entire project from one directory tree to another use:" msgstr "" "ひとつのディレクトリツリーからプロジェクト全体を変換したければこのように使い" "ます:" #: ../../library/2to3.rst:150 msgid "Fixers" msgstr "変換プログラム" #: ../../library/2to3.rst:152 msgid "" "Each step of transforming code is encapsulated in a fixer. The command " "``2to3 -l`` lists them. As :ref:`documented above <2to3-using>`, each can " "be turned on and off individually. They are described here in more detail." msgstr "" "コード変形の各ステップは変換プログラムに隠蔽されます。 ``2to3 -l`` コマンドは" "変換プログラムのリストを表示します。 :ref:`上記 <2to3-using>` の通り、それぞ" "れの変換プログラムを個別に有効化したり無効化したりすることができます。ここで" "はそれらをさらに詳細に説明します。" #: ../../library/2to3.rst:159 msgid "" "Removes usage of :func:`apply`. For example ``apply(function, *args, " "**kwargs)`` is converted to ``function(*args, **kwargs)``." msgstr "" ":func:`apply` の使用を削除します。例えば ``apply(function, *args, " "**kwargs)`` は ``function(*args, **kwargs)`` に変換されます。" #: ../../library/2to3.rst:164 msgid "Replaces deprecated :mod:`unittest` method names with the correct ones." msgstr "廃止になった :mod:`unittest` メソッド名を新しい名前に置換します。" #: ../../library/2to3.rst:167 ../../library/2to3.rst:356 msgid "From" msgstr "対象" #: ../../library/2to3.rst:167 ../../library/2to3.rst:356 msgid "To" msgstr "変換先" #: ../../library/2to3.rst:169 msgid "``failUnlessEqual(a, b)``" msgstr "``failUnlessEqual(a, b)``" #: ../../library/2to3.rst:169 ../../library/2to3.rst:171 msgid ":meth:`assertEqual(a, b) <unittest.TestCase.assertEqual>`" msgstr ":meth:`assertEqual(a, b) <unittest.TestCase.assertEqual>`" #: ../../library/2to3.rst:171 msgid "``assertEquals(a, b)``" msgstr "``assertEquals(a, b)``" #: ../../library/2to3.rst:173 msgid "``failIfEqual(a, b)``" msgstr "``failIfEqual(a, b)``" #: ../../library/2to3.rst:173 ../../library/2to3.rst:175 msgid ":meth:`assertNotEqual(a, b) <unittest.TestCase.assertNotEqual>`" msgstr ":meth:`assertNotEqual(a, b) <unittest.TestCase.assertNotEqual>`" #: ../../library/2to3.rst:175 msgid "``assertNotEquals(a, b)``" msgstr "``assertNotEquals(a, b)``" #: ../../library/2to3.rst:177 msgid "``failUnless(a)``" msgstr "``failUnless(a)``" #: ../../library/2to3.rst:177 ../../library/2to3.rst:179 msgid ":meth:`assertTrue(a) <unittest.TestCase.assertTrue>`" msgstr ":meth:`assertTrue(a) <unittest.TestCase.assertTrue>`" #: ../../library/2to3.rst:179 msgid "``assert_(a)``" msgstr "``assert_(a)``" #: ../../library/2to3.rst:181 msgid "``failIf(a)``" msgstr "``failIf(a)``" #: ../../library/2to3.rst:181 msgid ":meth:`assertFalse(a) <unittest.TestCase.assertFalse>`" msgstr ":meth:`assertFalse(a) <unittest.TestCase.assertFalse>`" #: ../../library/2to3.rst:183 msgid "``failUnlessRaises(exc, cal)``" msgstr "``failUnlessRaises(exc, cal)``" #: ../../library/2to3.rst:183 msgid ":meth:`assertRaises(exc, cal) <unittest.TestCase.assertRaises>`" msgstr ":meth:`assertRaises(exc, cal) <unittest.TestCase.assertRaises>`" #: ../../library/2to3.rst:185 msgid "``failUnlessAlmostEqual(a, b)``" msgstr "``failUnlessAlmostEqual(a, b)``" #: ../../library/2to3.rst:185 ../../library/2to3.rst:187 msgid ":meth:`assertAlmostEqual(a, b) <unittest.TestCase.assertAlmostEqual>`" msgstr ":meth:`assertAlmostEqual(a, b) <unittest.TestCase.assertAlmostEqual>`" #: ../../library/2to3.rst:187 msgid "``assertAlmostEquals(a, b)``" msgstr "``assertAlmostEquals(a, b)``" #: ../../library/2to3.rst:189 msgid "``failIfAlmostEqual(a, b)``" msgstr "``failIfAlmostEqual(a, b)``" #: ../../library/2to3.rst:189 ../../library/2to3.rst:191 msgid "" ":meth:`assertNotAlmostEqual(a, b) <unittest.TestCase.assertNotAlmostEqual>`" msgstr "" ":meth:`assertNotAlmostEqual(a, b) <unittest.TestCase.assertNotAlmostEqual>`" #: ../../library/2to3.rst:191 msgid "``assertNotAlmostEquals(a, b)``" msgstr "``assertNotAlmostEquals(a, b)``" #: ../../library/2to3.rst:197 msgid "Converts :class:`basestring` to :class:`str`." msgstr ":class:`basestring` を :class:`str` に変換します。" #: ../../library/2to3.rst:201 msgid "" "Converts :class:`buffer` to :class:`memoryview`. This fixer is optional " "because the :class:`memoryview` API is similar but not exactly the same as " "that of :class:`buffer`." msgstr "" ":class:`buffer` を :class:`memoryview` に変換します。 :class:`memoryview` " "API は :class:`buffer` と似ているものの厳密に同じではないので、この変換プログ" "ラムはオプションです。" #: ../../library/2to3.rst:207 msgid "" "Fixes dictionary iteration methods. :meth:`dict.iteritems` is converted to :" "meth:`dict.items`, :meth:`dict.iterkeys` to :meth:`dict.keys`, and :meth:" "`dict.itervalues` to :meth:`dict.values`. Similarly, :meth:`dict." "viewitems`, :meth:`dict.viewkeys` and :meth:`dict.viewvalues` are converted " "respectively to :meth:`dict.items`, :meth:`dict.keys` and :meth:`dict." "values`. It also wraps existing usages of :meth:`dict.items`, :meth:`dict." "keys`, and :meth:`dict.values` in a call to :class:`list`." msgstr "" "辞書をイテレートするメソッドを修正します。 :meth:`dict.iteritems` は :meth:" "`dict.items` に、 :meth:`dict.iterkeys` は :meth:`dict.keys` に、 :meth:" "`dict.itervalues` は :meth:`dict.values` に変換されます。同様に :meth:`dict." "viewitems`, :meth:`dict.viewkeys` :meth:`dict.viewvalues` はそれぞれ :meth:" "`dict.items`, :meth:`dict.keys`, :meth:`dict.values` に変換されます。また、 :" "class:`list` の呼び出しの中で :meth:`dict.items`, :meth:`dict.keys`, :meth:" "`dict.values` を使用している場合はそれをラップします。" #: ../../library/2to3.rst:217 msgid "Converts ``except X, T`` to ``except X as T``." msgstr "``except X, T`` を ``except X as T`` に変換します。" #: ../../library/2to3.rst:221 msgid "Converts the ``exec`` statement to the :func:`exec` function." msgstr "``exec`` 文を :func:`exec` 関数に変換します。" #: ../../library/2to3.rst:225 msgid "" "Removes usage of :func:`execfile`. The argument to :func:`execfile` is " "wrapped in calls to :func:`open`, :func:`compile`, and :func:`exec`." msgstr "" ":func:`execfile` の使用を削除します。 :func:`execfile` への引数は :func:" "`open`, :func:`compile`, :func:`exec` の呼び出しでラップされます。" #: ../../library/2to3.rst:230 msgid "" "Changes assignment of :attr:`sys.exitfunc` to use of the :mod:`atexit` " "module." msgstr "" ":attr:`sys.exitfunc` への代入を :mod:`atexit` モジュールの使用に変更します。" #: ../../library/2to3.rst:235 msgid "Wraps :func:`filter` usage in a :class:`list` call." msgstr "" ":class:`list` 呼び出しの中で :func:`filter` を使用している部分をラップしま" "す。" #: ../../library/2to3.rst:239 msgid "" "Fixes function attributes that have been renamed. For example, " "``my_function.func_closure`` is converted to ``my_function.__closure__``." msgstr "" "名前が変更された関数の属性を修正します。例えば ``my_function.func_closure`` " "は ``my_function.__closure__`` に変換されます。" #: ../../library/2to3.rst:244 msgid "Removes ``from __future__ import new_feature`` statements." msgstr "``from __future__ import new_feature`` 文を削除します。" #: ../../library/2to3.rst:248 msgid "Renames :func:`os.getcwdu` to :func:`os.getcwd`." msgstr ":func:`os.getcwdu` を :func:`os.getcwd` に置き換えます。" #: ../../library/2to3.rst:252 msgid "Changes ``dict.has_key(key)`` to ``key in dict``." msgstr "``dict.has_key(key)`` を ``key in dict`` に変更します。" #: ../../library/2to3.rst:256 msgid "" "This optional fixer performs several transformations that make Python code " "more idiomatic. Type comparisons like ``type(x) is SomeClass`` and " "``type(x) == SomeClass`` are converted to ``isinstance(x, SomeClass)``. " "``while 1`` becomes ``while True``. This fixer also tries to make use of :" "func:`sorted` in appropriate places. For example, this block ::" msgstr "" "このオプションの変換プログラムは、 Python コードをより Python らしい書き方に" "するいくつかの変形を行います。 ``type(x) is SomeClass`` や ``type(x) == " "SomeClass`` のような型の比較は ``isinstance(x, SomeClass)`` に変換されます。 " "``while 1`` は ``while True`` になります。また、適切な場所では :func:" "`sorted` が使われるようにします。例えば、このブロックは ::" #: ../../library/2to3.rst:265 msgid "is changed to ::" msgstr "次のように変更されます ::" #: ../../library/2to3.rst:271 msgid "Detects sibling imports and converts them to relative imports." msgstr "" "暗黙の相対インポート (sibling imports) を検出して、明示的な相対インポート " "(relative imports) に変換します。" #: ../../library/2to3.rst:275 msgid "Handles module renames in the standard library." msgstr "標準ライブラリ中のモジュール名の変更を扱います。" #: ../../library/2to3.rst:279 msgid "" "Handles other modules renames in the standard library. It is separate from " "the :2to3fixer:`imports` fixer only because of technical limitations." msgstr "" "標準ライブラリ中の別のモジュール名の変更を扱います。単に技術的な制約のため" "に :2to3fixer:`imports` とは別になっています。" #: ../../library/2to3.rst:284 msgid "Converts ``input(prompt)`` to ``eval(input(prompt))``." msgstr "``input(prompt)`` を ``eval(input(prompt))`` に変換します。" #: ../../library/2to3.rst:288 msgid "Converts :func:`intern` to :func:`sys.intern`." msgstr ":func:`intern` を :func:`sys.intern` に変換します。" #: ../../library/2to3.rst:292 msgid "" "Fixes duplicate types in the second argument of :func:`isinstance`. For " "example, ``isinstance(x, (int, int))`` is converted to ``isinstance(x, " "int)`` and ``isinstance(x, (int, float, int))`` is converted to " "``isinstance(x, (int, float))``." msgstr "" ":func:`isinstance` の第 2 引数の重複を修正します。例えば ``isinstance(x, " "(int, int))`` は ``isinstance(x, int)`` に ``isinstance(x, (int, float, " "int))`` は ``isinstance(x, (int, float))`` に変換されます。" #: ../../library/2to3.rst:299 msgid "" "Removes imports of :func:`itertools.ifilter`, :func:`itertools.izip`, and :" "func:`itertools.imap`. Imports of :func:`itertools.ifilterfalse` are also " "changed to :func:`itertools.filterfalse`." msgstr "" ":func:`itertools.ifilter`, :func:`itertools.izip`, :func:`itertools.imap` の" "インポートを削除します。また :func:`itertools.ifilterfalse` のインポートを :" "func:`itertools.filterfalse` に変換します。" #: ../../library/2to3.rst:305 msgid "" "Changes usage of :func:`itertools.ifilter`, :func:`itertools.izip`, and :" "func:`itertools.imap` to their built-in equivalents. :func:`itertools." "ifilterfalse` is changed to :func:`itertools.filterfalse`." msgstr "" ":func:`itertools.ifilter`, :func:`itertools.izip`, :func:`itertools.imap` を" "使っている箇所を同等の組み込み関数で置き換えます。 :func:`itertools." "ifilterfalse` は :func:`itertools.filterfalse` に変換されます。" #: ../../library/2to3.rst:311 msgid "Renames :class:`long` to :class:`int`." msgstr ":class:`long` を :class:`int` に変更します。" #: ../../library/2to3.rst:315 msgid "" "Wraps :func:`map` in a :class:`list` call. It also changes ``map(None, x)`` " "to ``list(x)``. Using ``from future_builtins import map`` disables this " "fixer." msgstr "" ":class:`list` 呼び出しの中の :func:`map` をラップします。また、 ``map(None, " "x)`` を ``list(x)`` に変換します。 ``from future_builtins import map`` を使う" "と、この変換プログラムを無効にできます。" #: ../../library/2to3.rst:321 msgid "" "Converts the old metaclass syntax (``__metaclass__ = Meta`` in the class " "body) to the new (``class X(metaclass=Meta)``)." msgstr "" "古いメタクラス構文 (クラス定義中の ``__metaclass__ = Meta``) を、新しい構文 " "(``class X(metaclass=Meta)``) に変換します。" #: ../../library/2to3.rst:326 msgid "" "Fixes old method attribute names. For example, ``meth.im_func`` is " "converted to ``meth.__func__``." msgstr "" "古いメソッドの属性名を修正します。例えば ``meth.im_func`` は ``meth." "__func__`` に変換されます。" #: ../../library/2to3.rst:331 msgid "Converts the old not-equal syntax, ``<>``, to ``!=``." msgstr "古い不等号の構文 ``<>`` を ``!=`` に変換します。" #: ../../library/2to3.rst:335 msgid "" "Converts the use of iterator's :meth:`~iterator.next` methods to the :func:" "`next` function. It also renames :meth:`next` methods to :meth:`~iterator." "__next__`." msgstr "" "イテレータの :meth:`~iterator.next` メソッドの使用を :func:`next` 関数に変換" "します。また :meth:`next` メソッドを :meth:`~iterator.__next__` に変更しま" "す。" #: ../../library/2to3.rst:341 msgid "" "Renames definitions of methods called :meth:`__nonzero__` to :meth:`~object." "__bool__`." msgstr ":meth:`__nonzero__` を :meth:`~object.__bool__` に変更します。" #: ../../library/2to3.rst:346 msgid "Converts octal literals into the new syntax." msgstr "8 進数リテラルを新しい構文に変換します。" #: ../../library/2to3.rst:350 msgid "" "Converts calls to various functions in the :mod:`operator` module to other, " "but equivalent, function calls. When needed, the appropriate ``import`` " "statements are added, e.g. ``import collections.abc``. The following " "mapping are made:" msgstr "" ":mod:`operator` モジュール内のさまざまな関数呼び出しを、他の、しかし機能的に" "は同等の関数呼び出しに変換します。必要に応じて、``import collections.abc`` な" "どの適切な ``import`` ステートメントが追加されます。以下のマッピングが行われ" "ます。" #: ../../library/2to3.rst:358 msgid "``operator.isCallable(obj)``" msgstr "``operator.isCallable(obj)``" #: ../../library/2to3.rst:358 msgid "``callable(obj)``" msgstr "``callable(obj)``" #: ../../library/2to3.rst:359 msgid "``operator.sequenceIncludes(obj)``" msgstr "``operator.sequenceIncludes(obj)``" #: ../../library/2to3.rst:359 msgid "``operator.contains(obj)``" msgstr "``operator.contains(obj)``" #: ../../library/2to3.rst:360 msgid "``operator.isSequenceType(obj)``" msgstr "``operator.isSequenceType(obj)``" #: ../../library/2to3.rst:360 msgid "``isinstance(obj, collections.abc.Sequence)``" msgstr "``isinstance(obj, collections.abc.Sequence)``" #: ../../library/2to3.rst:361 msgid "``operator.isMappingType(obj)``" msgstr "``operator.isMappingType(obj)``" #: ../../library/2to3.rst:361 msgid "``isinstance(obj, collections.abc.Mapping)``" msgstr "``isinstance(obj, collections.abc.Mapping)``" #: ../../library/2to3.rst:362 msgid "``operator.isNumberType(obj)``" msgstr "``operator.isNumberType(obj)``" #: ../../library/2to3.rst:362 msgid "``isinstance(obj, numbers.Number)``" msgstr "``isinstance(obj, numbers.Number)``" #: ../../library/2to3.rst:363 msgid "``operator.repeat(obj, n)``" msgstr "``operator.repeat(obj, n)``" #: ../../library/2to3.rst:363 msgid "``operator.mul(obj, n)``" msgstr "``operator.mul(obj, n)``" #: ../../library/2to3.rst:364 msgid "``operator.irepeat(obj, n)``" msgstr "``operator.irepeat(obj, n)``" #: ../../library/2to3.rst:364 msgid "``operator.imul(obj, n)``" msgstr "``operator.imul(obj, n)``" #: ../../library/2to3.rst:369 msgid "" "Add extra parenthesis where they are required in list comprehensions. For " "example, ``[x for x in 1, 2]`` becomes ``[x for x in (1, 2)]``." msgstr "" "リスト内包表記で必要になる括弧を追加します。例えば ``[x for x in 1, 2]`` は " "``[x for x in (1, 2)]`` になります。" #: ../../library/2to3.rst:374 msgid "Converts the ``print`` statement to the :func:`print` function." msgstr "``print`` 文を :func:`print` 関数に変換します。" #: ../../library/2to3.rst:378 msgid "" "Converts ``raise E, V`` to ``raise E(V)``, and ``raise E, V, T`` to ``raise " "E(V).with_traceback(T)``. If ``E`` is a tuple, the translation will be " "incorrect because substituting tuples for exceptions has been removed in 3.0." msgstr "" "``raise E, V`` を ``raise E(V)`` に、``raise E, V, T`` を ``raise E(V)." "with_traceback(T)`` に変換します。例外の代わりにタプルを使用することは 3.0 で" "削除されたので、``E`` がタプルならこの変換は不正確になります。" #: ../../library/2to3.rst:384 msgid "Converts :func:`raw_input` to :func:`input`." msgstr ":func:`raw_input` を :func:`input` に変換します。" #: ../../library/2to3.rst:388 msgid "Handles the move of :func:`reduce` to :func:`functools.reduce`." msgstr "" ":func:`reduce` が :func:`functools.reduce` に移動されたことを扱います。" #: ../../library/2to3.rst:392 msgid "Converts :func:`reload` to :func:`importlib.reload`." msgstr ":func:`reload` を :func:`importlib.reload` に変換します。" #: ../../library/2to3.rst:396 msgid "Changes :data:`sys.maxint` to :data:`sys.maxsize`." msgstr ":data:`sys.maxint` を :data:`sys.maxsize` に変更します。" #: ../../library/2to3.rst:400 msgid "Replaces backtick repr with the :func:`repr` function." msgstr "バッククォートを使った repr を :func:`repr` 関数に置き換えます。" #: ../../library/2to3.rst:404 msgid "" "Replaces use of the :class:`set` constructor with set literals. This fixer " "is optional." msgstr "" ":class:`set` コンストラクタの使用を set リテラルに置換します。この変換プログ" "ラムはオプションです。" #: ../../library/2to3.rst:409 msgid "Renames :exc:`StandardError` to :exc:`Exception`." msgstr ":exc:`StandardError` を :exc:`Exception` に変更します。" #: ../../library/2to3.rst:413 msgid "" "Changes the deprecated :data:`sys.exc_value`, :data:`sys.exc_type`, :data:" "`sys.exc_traceback` to use :func:`sys.exc_info`." msgstr "" "廃止された :data:`sys.exc_value`, :data:`sys.exc_type`, :data:`sys." "exc_traceback` の代わりに :func:`sys.exc_info` を使うように変更します。" #: ../../library/2to3.rst:418 msgid "Fixes the API change in generator's :meth:`throw` method." msgstr "ジェネレータの :meth:`throw` メソッドの API 変更を修正します。" #: ../../library/2to3.rst:422 msgid "" "Removes implicit tuple parameter unpacking. This fixer inserts temporary " "variables." msgstr "" "関数定義における暗黙的なタプルパラメータの展開を取り除きます。この変換プログ" "ラムによって一時変数が追加されます。" #: ../../library/2to3.rst:427 msgid "" "Fixes code broken from the removal of some members in the :mod:`types` " "module." msgstr "" ":mod:`types` モジュールのいくつかのメンバオブジェクトが削除されたことによって" "壊れたコードを修正します。" #: ../../library/2to3.rst:432 msgid "Renames :class:`unicode` to :class:`str`." msgstr ":class:`unicode` を :class:`str` に変更します。" #: ../../library/2to3.rst:436 msgid "" "Handles the rename of :mod:`urllib` and :mod:`urllib2` to the :mod:`urllib` " "package." msgstr "" ":mod:`urllib` と :mod:`urllib2` が :mod:`urllib` パッケージに変更されたことを" "扱います。" #: ../../library/2to3.rst:441 msgid "" "Removes excess whitespace from comma separated items. This fixer is " "optional." msgstr "" "コンマ区切りの要素から余計な空白を取り除きます。この変換プログラムはオプショ" "ンです。" #: ../../library/2to3.rst:446 msgid "" "Renames :func:`xrange` to :func:`range` and wraps existing :func:`range` " "calls with :class:`list`." msgstr "" ":func:`xrange` を :func:`range` に変更して、既存の :func:`range` 呼び出しを :" "class:`list` でラップします。" #: ../../library/2to3.rst:451 msgid "Changes ``for x in file.xreadlines()`` to ``for x in file``." msgstr "``for x in file.xreadlines()`` を ``for x in file`` に変更します。" #: ../../library/2to3.rst:455 msgid "" "Wraps :func:`zip` usage in a :class:`list` call. This is disabled when " "``from future_builtins import zip`` appears." msgstr "" ":class:`list` 呼び出しの中で使われている :func:`zip` をラップします。これは " "``from future_builtins import zip`` が見つかった場合は無効にされます。" #: ../../library/2to3.rst:460 msgid ":mod:`lib2to3` --- 2to3's library" msgstr ":mod:`lib2to3` --- 2to3's library" #: ../../library/2to3.rst:469 msgid "**Source code:** :source:`Lib/lib2to3/`" msgstr "**ソースコード:** :source:`Lib/lib2to3/`" #: ../../library/2to3.rst:482 msgid "" "Python 3.9 switched to a PEG parser (see :pep:`617`) while lib2to3 is using " "a less flexible LL(1) parser. Python 3.10 includes new language syntax that " "is not parsable by lib2to3's LL(1) parser (see :pep:`634`). The ``lib2to3`` " "module was marked pending for deprecation in Python 3.9 (raising :exc:" "`PendingDeprecationWarning` on import) and fully deprecated in Python 3.11 " "(raising :exc:`DeprecationWarning`). It will be removed from the standard " "library in Python 3.13. Consider third-party alternatives such as `LibCST`_ " "or `parso`_." msgstr "" #: ../../library/2to3.rst:485 msgid "" "The :mod:`lib2to3` API should be considered unstable and may change " "drastically in the future." msgstr "" ":mod:`lib2to3` API は安定しておらず、将来、劇的に変更されるかも知れないと考え" "るべきです。" |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |