@@ -2712,21 +2712,27 @@ msgstr "クラスはこのように使えます:"
2712
2712
2713
2713
#: ../../faq/programming.rst:1952
2714
2714
msgid "How do I cache method calls?"
2715
- msgstr ""
2715
+ msgstr "メソッド呼び出しをキャッシュするには どうしたらいいですか? "
2716
2716
2717
2717
#: ../../faq/programming.rst:1954
2718
2718
msgid ""
2719
2719
"The two principal tools for caching methods are :func:`functools."
2720
2720
"cached_property` and :func:`functools.lru_cache`. The former stores results "
2721
2721
"at the instance level and the latter at the class level."
2722
2722
msgstr ""
2723
+ "メソッドキャッシュの主な道具は2つあり、 :func:`functools.cached_property` "
2724
+ "と :func:`functools.lru_cache` です。前者はインスタンスレベル、後者はクラスレ"
2725
+ "ベルで結果を保存します。"
2723
2726
2724
2727
#: ../../faq/programming.rst:1959
2725
2728
msgid ""
2726
2729
"The *cached_property* approach only works with methods that do not take any "
2727
2730
"arguments. It does not create a reference to the instance. The cached "
2728
2731
"method result will be kept only as long as the instance is alive."
2729
2732
msgstr ""
2733
+ "*cached_property* アプローチは、引数を取らないメソッドでのみ働きます。これは"
2734
+ "インスタンスへの参照を作りません。キャッシュされたメソッドの結果は、インスタ"
2735
+ "ンスが生きている間だけ保持されます。"
2730
2736
2731
2737
#: ../../faq/programming.rst:1963
2732
2738
msgid ""
@@ -2735,6 +2741,9 @@ msgid ""
2735
2741
"accumulate, so too will the accumulated method results. They can grow "
2736
2742
"without bound."
2737
2743
msgstr ""
2744
+ "利点は、インスタンスが使われなくなった場合、キャッシュされたメソッドの結果が"
2745
+ "すぐに解放されることです。欠点は、インスタンスが溜まると、溜められたメソッド"
2746
+ "の結果も増えてしまうことです。それらは際限なく増える恐れがあります。"
2738
2747
2739
2748
#: ../../faq/programming.rst:1968
2740
2749
msgid ""
@@ -2749,17 +2758,24 @@ msgid ""
2749
2758
"bounded by the specified *maxsize*. The disadvantage is that instances are "
2750
2759
"kept alive until they age out of the cache or until the cache is cleared."
2751
2760
msgstr ""
2761
+ "least recently used アルゴリズム(訳注:LRU 直近に使われたものを残す)の利点"
2762
+ "は、キャッシュが指定された *maxsize* で制限されることです。欠点は、キャッシュ"
2763
+ "から期限切れで追い出されるかクリアされるまで、インスタンスが生き続けることで"
2764
+ "す。"
2752
2765
2753
2766
#: ../../faq/programming.rst:1977
2754
2767
msgid "This example shows the various techniques::"
2755
- msgstr ""
2768
+ msgstr "この例は各種テクニックを示します:: "
2756
2769
2757
2770
#: ../../faq/programming.rst:2001
2758
2771
msgid ""
2759
2772
"The above example assumes that the *station_id* never changes. If the "
2760
2773
"relevant instance attributes are mutable, the *cached_property* approach "
2761
2774
"can't be made to work because it cannot detect changes to the attributes."
2762
2775
msgstr ""
2776
+ "上の例では、 *station_id* が常に変わらないことを前提としています。関連するイ"
2777
+ "ンスタンスの属性が可変である場合、 *cached_property* アプローチは属性の変更を"
2778
+ "検出できないため、機能しなくなります。"
2763
2779
2764
2780
#: ../../faq/programming.rst:2006
2765
2781
msgid ""
0 commit comments