@@ -1567,17 +1567,20 @@ msgstr ""
1567
1567
1568
1568
#: ../../library/inspect.rst:883
1569
1569
msgid "The *unquote_annotations* parameter was added."
1570
- msgstr ""
1570
+ msgstr "*unquote_annotations* パラメータが追加されました。 "
1571
1571
1572
1572
#: ../../library/inspect.rst:888
1573
1573
msgid ""
1574
1574
"Return a :class:`Signature` (or its subclass) object for a given callable "
1575
1575
"*obj*."
1576
1576
msgstr ""
1577
+ "与えられた呼び出し可能オブジェクト *obj* に対する :class:`Signature` (または"
1578
+ "そのサブクラスの) オブジェクトを返します。"
1577
1579
1578
1580
#: ../../library/inspect.rst:891
1579
1581
msgid "This method simplifies subclassing of :class:`Signature`:"
1580
1582
msgstr ""
1583
+ "このメソッドは :class:`Signature` からサブクラスを作る作業を簡素化します:"
1581
1584
1582
1585
#: ../../library/inspect.rst:893
1583
1586
msgid ""
@@ -1586,21 +1589,31 @@ msgid ""
1586
1589
"sig = MySignature.from_callable(sum)\n"
1587
1590
"assert isinstance(sig, MySignature)"
1588
1591
msgstr ""
1592
+ "class MySignature(Signature):\n"
1593
+ " pass\n"
1594
+ "sig = MySignature.from_callable(sum)\n"
1595
+ "assert isinstance(sig, MySignature)"
1589
1596
1590
1597
#: ../../library/inspect.rst:900
1591
1598
msgid "Its behavior is otherwise identical to that of :func:`signature`."
1592
- msgstr ""
1599
+ msgstr "このメソッドの振る舞いは、上記を除けば :func:`signature` と同じです。 "
1593
1600
1594
1601
#: ../../library/inspect.rst:910
1595
1602
msgid ""
1596
1603
":class:`!Parameter` objects are *immutable*. Instead of modifying a :class:`!"
1597
1604
"Parameter` object, you can use :meth:`Parameter.replace` or :func:`copy."
1598
1605
"replace` to create a modified copy."
1599
1606
msgstr ""
1607
+ ":class:`!Parameter` オブジェクトはイミュータブル (*immutable*) すなわち変更不"
1608
+ "可能です。 :class:`!Parameter` オブジェクトを変更する代わりに、 :meth:"
1609
+ "`Parameter.replace` や :func:`copy.replace` を使ってオブジェクトの内容を変更"
1610
+ "したコピーを作成することができます。"
1600
1611
1601
1612
#: ../../library/inspect.rst:914
1602
1613
msgid "Parameter objects are now picklable and :term:`hashable`."
1603
1614
msgstr ""
1615
+ "Parameter オブジェクトはピックル化可能 (picklable) かつ ハッシュ化可能 (:"
1616
+ "term:`hashable`) になりました。"
1604
1617
1605
1618
#: ../../library/inspect.rst:919
1606
1619
msgid ""
@@ -1621,12 +1634,16 @@ msgid ""
1621
1634
"CPython generates implicit parameter names of the form ``.0`` on the code "
1622
1635
"objects used to implement comprehensions and generator expressions."
1623
1636
msgstr ""
1637
+ "CPython は内包表記やジェネレータ式を実装するためのコードオブジェクトにおい"
1638
+ "て、 ``.0`` という形式で暗黙のパラメータ名を生成します。"
1624
1639
1625
1640
#: ../../library/inspect.rst:933
1626
1641
msgid ""
1627
1642
"These parameter names are now exposed by this module as names like "
1628
1643
"``implicit0``."
1629
1644
msgstr ""
1645
+ "このモジュールにより、これら暗黙のパラメータ名は ``implicit0`` のような名前で"
1646
+ "公開されるようになりました。"
1630
1647
1631
1648
#: ../../library/inspect.rst:939
1632
1649
msgid ""
@@ -1650,6 +1667,9 @@ msgid ""
1650
1667
"values are accessible via :class:`Parameter` (like ``Parameter."
1651
1668
"KEYWORD_ONLY``), and support comparison and ordering, in the following order:"
1652
1669
msgstr ""
1670
+ "引数の値がどのようにパラメータと紐付けられるかを記述します。指定可能な値は :"
1671
+ "class:`Parameter` を介して (``Parameter.KEYWORD_ONLY`` のように) アクセス可能"
1672
+ "で、以下に示す順番で比較や順序付けをサポートしています:"
1653
1673
1654
1674
#: ../../library/inspect.rst:956
1655
1675
msgid "Name"
@@ -1669,6 +1689,8 @@ msgid ""
1669
1689
"are those which appear before a ``/`` entry (if present) in a Python "
1670
1690
"function definition."
1671
1691
msgstr ""
1692
+ "値は位置引数として渡されなければなりません。 Python の関数定義において、位置"
1693
+ "専用引数は (もし存在すれば) ``/`` エントリの前に現れるものを指します。"
1672
1694
1673
1695
#: ../../library/inspect.rst:963
1674
1696
msgid "*POSITIONAL_OR_KEYWORD*"
@@ -1721,7 +1743,7 @@ msgstr ""
1721
1743
1722
1744
#: ../../library/inspect.rst:984
1723
1745
msgid "Example: print all keyword-only arguments without default values:"
1724
- msgstr ""
1746
+ msgstr "例: デフォルト値を持たないキーワード専用引数を全て出力します: "
1725
1747
1726
1748
#: ../../library/inspect.rst:986
1727
1749
msgid ""
@@ -1735,14 +1757,23 @@ msgid ""
1735
1757
"... print('Parameter:', param)\n"
1736
1758
"Parameter: c"
1737
1759
msgstr ""
1760
+ ">>> def foo(a, b, *, c, d=10):\n"
1761
+ "... pass\n"
1762
+ "\n"
1763
+ ">>> sig = signature(foo)\n"
1764
+ ">>> for param in sig.parameters.values():\n"
1765
+ "... if (param.kind == param.KEYWORD_ONLY and\n"
1766
+ "... param.default is param.empty):\n"
1767
+ "... print('Parameter:', param)\n"
1768
+ "Parameter: c"
1738
1769
1739
1770
#: ../../library/inspect.rst:1000
1740
1771
msgid "Describes an enum value of :attr:`Parameter.kind`."
1741
- msgstr ""
1772
+ msgstr ":attr:`Parameter.kind` 列挙型の各定数を説明します。 "
1742
1773
1743
1774
#: ../../library/inspect.rst:1004
1744
1775
msgid "Example: print all descriptions of arguments:"
1745
- msgstr ""
1776
+ msgstr "例: 全ての引数に対する説明を出力します: "
1746
1777
1747
1778
#: ../../library/inspect.rst:1006
1748
1779
msgid ""
@@ -1757,6 +1788,16 @@ msgid ""
1757
1788
"keyword-only\n"
1758
1789
"keyword-only"
1759
1790
msgstr ""
1791
+ ">>> def foo(a, b, *, c, d=10):\n"
1792
+ "... pass\n"
1793
+ "\n"
1794
+ ">>> sig = signature(foo)\n"
1795
+ ">>> for param in sig.parameters.values():\n"
1796
+ "... print(param.kind.description)\n"
1797
+ "positional or keyword\n"
1798
+ "positional or keyword\n"
1799
+ "keyword-only\n"
1800
+ "keyword-only"
1760
1801
1761
1802
#: ../../library/inspect.rst:1021
1762
1803
msgid ""
@@ -1765,6 +1806,11 @@ msgid ""
1765
1806
"corresponding argument. To remove a default value or/and an annotation from "
1766
1807
"a :class:`!Parameter`, pass :attr:`Parameter.empty`."
1767
1808
msgstr ""
1809
+ "このメソッドの呼び出し元のインスタンスをもとにして、新たな :class:"
1810
+ "`Parameter` インスタンスを生成します。 :class:`!Parameter` の属性をオーバーラ"
1811
+ "イドするには、対応する引数をこのメソッドに渡してください。 :class:`!"
1812
+ "Parameter` からデフォルト値やアノテーションを取り除きたい場合は、 :attr:"
1813
+ "`Parameter.empty` を渡してください。"
1768
1814
1769
1815
#: ../../library/inspect.rst:1026
1770
1816
msgid ""
@@ -1779,51 +1825,78 @@ msgid ""
1779
1825
">>> str(param.replace(default=Parameter.empty, annotation='spam'))\n"
1780
1826
"\" foo: 'spam'\" "
1781
1827
msgstr ""
1828
+ ">>> from inspect import Parameter\n"
1829
+ ">>> param = Parameter('foo', Parameter.KEYWORD_ONLY, default=42)\n"
1830
+ ">>> str(param)\n"
1831
+ "'foo=42'\n"
1832
+ "\n"
1833
+ ">>> str(param.replace()) # Will create a shallow copy of 'param'\n"
1834
+ "'foo=42'\n"
1835
+ "\n"
1836
+ ">>> str(param.replace(default=Parameter.empty, annotation='spam'))\n"
1837
+ "\" foo: 'spam'\" "
1782
1838
1783
1839
#: ../../library/inspect.rst:1039
1784
1840
msgid ""
1785
1841
":class:`Parameter` objects are also supported by the generic function :func:"
1786
1842
"`copy.replace`."
1787
1843
msgstr ""
1844
+ ":class:`Parameter` オブジェクトは汎用関数 :func:`copy.replace` でもサポートさ"
1845
+ "れています。"
1788
1846
1789
1847
#: ../../library/inspect.rst:1042
1790
1848
msgid ""
1791
1849
"In Python 3.3 :class:`Parameter` objects were allowed to have ``name`` set "
1792
1850
"to ``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no "
1793
1851
"longer permitted."
1794
1852
msgstr ""
1853
+ "Python 3.3 では、``kind`` が ``POSITIONAL_ONLY`` の場合に限り、 ``name`` が "
1854
+ "``None`` であるような :class:`Parameter` オブジェクトが許されていました。です"
1855
+ "が、そのようなオブジェクトはもはや許可されていません。"
1795
1856
1796
1857
#: ../../library/inspect.rst:1049
1797
1858
msgid ""
1798
1859
"Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call. "
1799
1860
"Holds the mapping of arguments to the function's parameters."
1800
1861
msgstr ""
1862
+ ":meth:`Signature.bind` または :meth:`Signature.bind_partial` を呼び出して得ら"
1863
+ "れる結果です。引数と関数のパラメータとの間のマッピング情報を保持します。"
1801
1864
1802
1865
#: ../../library/inspect.rst:1054
1803
1866
msgid ""
1804
1867
"A mutable mapping of parameters' names to arguments' values. Contains only "
1805
1868
"explicitly bound arguments. Changes in :attr:`arguments` will reflect in :"
1806
1869
"attr:`args` and :attr:`kwargs`."
1807
1870
msgstr ""
1871
+ "パラメータの名前と引数の値との間のミュータブルなマッピングです。明示的に紐付"
1872
+ "けされた引数だけを含みます。 :attr:`arguments` に対する変更は :attr:`args` "
1873
+ "と :attr:`kwargs` に反映されます。"
1808
1874
1809
1875
#: ../../library/inspect.rst:1058
1810
1876
msgid ""
1811
1877
"Should be used in conjunction with :attr:`Signature.parameters` for any "
1812
1878
"argument processing purposes."
1813
1879
msgstr ""
1880
+ "いかなる引数処理の目的でも、 :attr:`Signature.parameters` とあわせて使うよう"
1881
+ "にしてください。"
1814
1882
1815
1883
#: ../../library/inspect.rst:1063
1816
1884
msgid ""
1817
1885
"Arguments for which :meth:`Signature.bind` or :meth:`Signature.bind_partial` "
1818
1886
"relied on a default value are skipped. However, if needed, use :meth:"
1819
1887
"`BoundArguments.apply_defaults` to add them."
1820
1888
msgstr ""
1889
+ ":meth:`Signature.bind` または :meth:`Signature.bind_partial` でデフォルト値を"
1890
+ "あてにするとされた引数は、スキップされます。それらをマッピングに加えたい場合"
1891
+ "は、必要に応じて :meth:`BoundArguments.apply_defaults` を使ってください。"
1821
1892
1822
1893
#: ../../library/inspect.rst:1068
1823
1894
msgid ""
1824
1895
":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :"
1825
1896
"class:`collections.OrderedDict`."
1826
1897
msgstr ""
1898
+ ":attr:`arguments` の型が :class:`dict` になりました。以前は :class:"
1899
+ "`collections.OrderedDict` 型でした。"
1827
1900
1828
1901
#: ../../library/inspect.rst:1074
1829
1902
msgid ""
@@ -1838,6 +1911,9 @@ msgid ""
1838
1911
"`arguments` attribute. Arguments that can be passed positionally are "
1839
1912
"included in :attr:`args` instead."
1840
1913
msgstr ""
1914
+ "キーワード引数の値の辞書です。 :attr:`arguments` 属性から動的に計算されます。"
1915
+ "位置引数として渡すことができる引数は、 :attr:`args` に含まれることに注意して"
1916
+ "ください。"
1841
1917
1842
1918
#: ../../library/inspect.rst:1085
1843
1919
msgid "A reference to the parent :class:`Signature` object."
@@ -1850,12 +1926,13 @@ msgstr "存在しない引数のデフォルト値を設定します。"
1850
1926
#: ../../library/inspect.rst:1091
1851
1927
msgid ""
1852
1928
"For variable-positional arguments (``*args``) the default is an empty tuple."
1853
- msgstr ""
1929
+ msgstr "可変長位置引数 (``*args``) に対するデフォルト値は、空のタプルです。 "
1854
1930
1855
1931
#: ../../library/inspect.rst:1094
1856
1932
msgid ""
1857
1933
"For variable-keyword arguments (``**kwargs``) the default is an empty dict."
1858
1934
msgstr ""
1935
+ "可変長キーワード引数 (``**kwargs``) に対するデフォルト値は、空の辞書です。"
1859
1936
1860
1937
#: ../../library/inspect.rst:1097
1861
1938
msgid ""
@@ -1865,12 +1942,19 @@ msgid ""
1865
1942
">>> ba.arguments\n"
1866
1943
"{'a': 'spam', 'b': 'ham', 'args': ()}"
1867
1944
msgstr ""
1945
+ ">>> def foo(a, b='ham', *args): pass\n"
1946
+ ">>> ba = inspect.signature(foo).bind('spam')\n"
1947
+ ">>> ba.apply_defaults()\n"
1948
+ ">>> ba.arguments\n"
1949
+ "{'a': 'spam', 'b': 'ham', 'args': ()}"
1868
1950
1869
1951
#: ../../library/inspect.rst:1107
1870
1952
msgid ""
1871
1953
"The :attr:`args` and :attr:`kwargs` properties can be used to invoke "
1872
1954
"functions:"
1873
1955
msgstr ""
1956
+ ":attr:`args` と :attr:`kwargs` の2つのプロパティは、関数の呼び出しに使うこと"
1957
+ "ができます:"
1874
1958
1875
1959
#: ../../library/inspect.rst:1110
1876
1960
msgid ""
@@ -1881,14 +1965,20 @@ msgid ""
1881
1965
"ba = sig.bind(10, b=20)\n"
1882
1966
"test(*ba.args, **ba.kwargs)"
1883
1967
msgstr ""
1968
+ "def test(a, *, b):\n"
1969
+ " ...\n"
1970
+ "\n"
1971
+ "sig = signature(test)\n"
1972
+ "ba = sig.bind(10, b=20)\n"
1973
+ "test(*ba.args, **ba.kwargs)"
1884
1974
1885
1975
#: ../../library/inspect.rst:1122
1886
1976
msgid ":pep:`362` - Function Signature Object."
1887
1977
msgstr ":pep:`362`: - 関数シグニチャオブジェクト"
1888
1978
1889
1979
#: ../../library/inspect.rst:1123
1890
1980
msgid "The detailed specification, implementation details and examples."
1891
- msgstr ""
1981
+ msgstr "仕様の詳細、実装の詳細および使用例を示しています。 "
1892
1982
1893
1983
#: ../../library/inspect.rst:1129
1894
1984
msgid "Classes and functions"
@@ -1915,6 +2005,8 @@ msgid ""
1915
2005
"Get the names and default values of a Python function's parameters. A :term:"
1916
2006
"`named tuple` is returned:"
1917
2007
msgstr ""
2008
+ "Python 関数のパラメータの名前とデフォルト値を取得します。 :term:`named "
2009
+ "tuple` を返します:"
1918
2010
1919
2011
#: ../../library/inspect.rst:1147
1920
2012
msgid ""
0 commit comments