@@ -11,7 +11,7 @@ msgid ""
11
11
msgstr ""
12
12
"Project-Id-Version : Python 3.14\n "
13
13
"Report-Msgid-Bugs-To : \n "
14
- "POT-Creation-Date : 2025-05-09 14:19 +0000\n "
14
+ "POT-Creation-Date : 2025-07-31 14:20 +0000\n "
15
15
"PO-Revision-Date : 2025-07-18 18:48+0000\n "
16
16
"
Last-Translator :
Rafael Fontenelle <[email protected] >, 2025\n "
17
17
"Language-Team : Japanese (https://app.transifex.com/python-doc/teams/5390/ "
@@ -50,10 +50,20 @@ msgid ""
50
50
msgstr ""
51
51
52
52
#: ../../library/bisect.rst:29
53
+ msgid ""
54
+ "The functions in this module are not thread-safe. If multiple threads "
55
+ "concurrently use :mod:`bisect` functions on the same sequence, this may "
56
+ "result in undefined behaviour. Likewise, if the provided sequence is mutated "
57
+ "by a different thread while a :mod:`bisect` function is operating on it, the "
58
+ "result is undefined. For example, using :py:func:`~bisect.insort_left` on "
59
+ "the same list from multiple threads may result in the list becoming unsorted."
60
+ msgstr ""
61
+
62
+ #: ../../library/bisect.rst:39
53
63
msgid "The following functions are provided:"
54
64
msgstr "次の関数が用意されています:"
55
65
56
- #: ../../library/bisect.rst:34
66
+ #: ../../library/bisect.rst:44
57
67
msgid ""
58
68
"Locate the insertion point for *x* in *a* to maintain sorted order. The "
59
69
"parameters *lo* and *hi* may be used to specify a subset of the list which "
@@ -69,105 +79,105 @@ msgstr ""
69
79
"insert()`` の第一引数として使うのに適しています。*a* はすでにソートされている"
70
80
"ものとします。"
71
81
72
- #: ../../library/bisect.rst:41
82
+ #: ../../library/bisect.rst:51
73
83
msgid ""
74
84
"The returned insertion point *ip* partitions the array *a* into two slices "
75
85
"such that ``all(elem < x for elem in a[lo : ip])`` is true for the left "
76
86
"slice and ``all(elem >= x for elem in a[ip : hi])`` is true for the right "
77
87
"slice."
78
88
msgstr ""
79
89
80
- #: ../../library/bisect.rst:46
90
+ #: ../../library/bisect.rst:56
81
91
msgid ""
82
92
"*key* specifies a :term:`key function` of one argument that is used to "
83
93
"extract a comparison key from each element in the array. To support "
84
94
"searching complex records, the key function is not applied to the *x* value."
85
95
msgstr ""
86
96
87
- #: ../../library/bisect.rst:50
97
+ #: ../../library/bisect.rst:60
88
98
msgid ""
89
99
"If *key* is ``None``, the elements are compared directly and no key function "
90
100
"is called."
91
101
msgstr ""
92
102
93
- #: ../../library/bisect.rst:53 ../../library/bisect.rst:67
94
- #: ../../library/bisect.rst:85 ../../library/bisect.rst:105
103
+ #: ../../library/bisect.rst:63 ../../library/bisect.rst:77
104
+ #: ../../library/bisect.rst:95 ../../library/bisect.rst:115
95
105
msgid "Added the *key* parameter."
96
106
msgstr "*key* パラメータが追加されました。"
97
107
98
- #: ../../library/bisect.rst:60
108
+ #: ../../library/bisect.rst:70
99
109
msgid ""
100
110
"Similar to :py:func:`~bisect.bisect_left`, but returns an insertion point "
101
111
"which comes after (to the right of) any existing entries of *x* in *a*."
102
112
msgstr ""
103
113
104
- #: ../../library/bisect.rst:63
114
+ #: ../../library/bisect.rst:73
105
115
msgid ""
106
116
"The returned insertion point *ip* partitions the array *a* into two slices "
107
117
"such that ``all(elem <= x for elem in a[lo : ip])`` is true for the left "
108
118
"slice and ``all(elem > x for elem in a[ip : hi])`` is true for the right "
109
119
"slice."
110
120
msgstr ""
111
121
112
- #: ../../library/bisect.rst:73
122
+ #: ../../library/bisect.rst:83
113
123
msgid "Insert *x* in *a* in sorted order."
114
124
msgstr "*x* を *a* にソート順で挿入します。"
115
125
116
- #: ../../library/bisect.rst:75
126
+ #: ../../library/bisect.rst:85
117
127
msgid ""
118
128
"This function first runs :py:func:`~bisect.bisect_left` to locate an "
119
129
"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert "
120
130
"*x* at the appropriate position to maintain sort order."
121
131
msgstr ""
122
132
123
- #: ../../library/bisect.rst:79 ../../library/bisect.rst:99
133
+ #: ../../library/bisect.rst:89 ../../library/bisect.rst:109
124
134
msgid ""
125
135
"To support inserting records in a table, the *key* function (if any) is "
126
136
"applied to *x* for the search step but not for the insertion step."
127
137
msgstr ""
128
138
129
- #: ../../library/bisect.rst:82 ../../library/bisect.rst:102
139
+ #: ../../library/bisect.rst:92 ../../library/bisect.rst:112
130
140
msgid ""
131
141
"Keep in mind that the *O*\\ (log *n*) search is dominated by the slow *O*\\ "
132
142
"(*n*) insertion step."
133
143
msgstr ""
134
144
135
- #: ../../library/bisect.rst:92
145
+ #: ../../library/bisect.rst:102
136
146
msgid ""
137
147
"Similar to :py:func:`~bisect.insort_left`, but inserting *x* in *a* after "
138
148
"any existing entries of *x*."
139
149
msgstr ""
140
150
141
- #: ../../library/bisect.rst:95
151
+ #: ../../library/bisect.rst:105
142
152
msgid ""
143
153
"This function first runs :py:func:`~bisect.bisect_right` to locate an "
144
154
"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert "
145
155
"*x* at the appropriate position to maintain sort order."
146
156
msgstr ""
147
157
148
- #: ../../library/bisect.rst:110
158
+ #: ../../library/bisect.rst:120
149
159
msgid "Performance Notes"
150
160
msgstr "パフォーマンスに関するメモ"
151
161
152
- #: ../../library/bisect.rst:112
162
+ #: ../../library/bisect.rst:122
153
163
msgid ""
154
164
"When writing time sensitive code using *bisect()* and *insort()*, keep these "
155
165
"thoughts in mind:"
156
166
msgstr ""
157
167
158
- #: ../../library/bisect.rst:115
168
+ #: ../../library/bisect.rst:125
159
169
msgid ""
160
170
"Bisection is effective for searching ranges of values. For locating specific "
161
171
"values, dictionaries are more performant."
162
172
msgstr ""
163
173
164
- #: ../../library/bisect.rst:118
174
+ #: ../../library/bisect.rst:128
165
175
msgid ""
166
176
"The *insort()* functions are *O*\\ (*n*) because the logarithmic search step "
167
177
"is dominated by the linear time insertion step."
168
178
msgstr ""
169
179
170
- #: ../../library/bisect.rst:121
180
+ #: ../../library/bisect.rst:131
171
181
msgid ""
172
182
"The search functions are stateless and discard key function results after "
173
183
"they are used. Consequently, if the search functions are used in a loop, "
@@ -178,14 +188,14 @@ msgid ""
178
188
"shown in the examples section below)."
179
189
msgstr ""
180
190
181
- #: ../../library/bisect.rst:131
191
+ #: ../../library/bisect.rst:141
182
192
msgid ""
183
193
"`Sorted Collections <https://grantjenks.com/docs/sortedcollections/>`_ is a "
184
194
"high performance module that uses *bisect* to managed sorted collections of "
185
195
"data."
186
196
msgstr ""
187
197
188
- #: ../../library/bisect.rst:135
198
+ #: ../../library/bisect.rst:145
189
199
msgid ""
190
200
"The `SortedCollection recipe <https://code.activestate.com/recipes/577197-"
191
201
"sortedcollection/>`_ uses bisect to build a full-featured collection class "
@@ -198,19 +208,19 @@ msgstr ""
198
208
"activestate.com/recipes/577197-sortedcollection/>`_\\ 。キーは、探索中に不必"
199
209
"要な呼び出しをさせないために、予め計算しておきます。"
200
210
201
- #: ../../library/bisect.rst:143
211
+ #: ../../library/bisect.rst:153
202
212
msgid "Searching Sorted Lists"
203
213
msgstr "ソート済みリストの探索"
204
214
205
- #: ../../library/bisect.rst:145
215
+ #: ../../library/bisect.rst:155
206
216
msgid ""
207
217
"The above `bisect functions`_ are useful for finding insertion points but "
208
218
"can be tricky or awkward to use for common searching tasks. The following "
209
219
"five functions show how to transform them into the standard lookups for "
210
220
"sorted lists::"
211
221
msgstr ""
212
222
213
- #: ../../library/bisect.rst:150
223
+ #: ../../library/bisect.rst:160
214
224
msgid ""
215
225
"def index(a, x):\n"
216
226
" 'Locate the leftmost value exactly equal to x'\n"
@@ -248,19 +258,19 @@ msgid ""
248
258
" raise ValueError"
249
259
msgstr ""
250
260
251
- #: ../../library/bisect.rst:187
261
+ #: ../../library/bisect.rst:197
252
262
msgid "Examples"
253
263
msgstr "使用例"
254
264
255
- #: ../../library/bisect.rst:191
265
+ #: ../../library/bisect.rst:201
256
266
msgid ""
257
267
"The :py:func:`~bisect.bisect` function can be useful for numeric table "
258
268
"lookups. This example uses :py:func:`~bisect.bisect` to look up a letter "
259
269
"grade for an exam score (say) based on a set of ordered numeric breakpoints: "
260
270
"90 and up is an 'A', 80 to 89 is a 'B', and so on::"
261
271
msgstr ""
262
272
263
- #: ../../library/bisect.rst:196
273
+ #: ../../library/bisect.rst:206
264
274
msgid ""
265
275
">>> def grade(score, breakpoints=[60, 70, 80, 90], grades='FDCBA'):\n"
266
276
"... i = bisect(breakpoints, score)\n"
@@ -270,14 +280,14 @@ msgid ""
270
280
"['F', 'A', 'C', 'C', 'B', 'A', 'A']"
271
281
msgstr ""
272
282
273
- #: ../../library/bisect.rst:203
283
+ #: ../../library/bisect.rst:213
274
284
msgid ""
275
285
"The :py:func:`~bisect.bisect` and :py:func:`~bisect.insort` functions also "
276
286
"work with lists of tuples. The *key* argument can serve to extract the "
277
287
"field used for ordering records in a table::"
278
288
msgstr ""
279
289
280
- #: ../../library/bisect.rst:207
290
+ #: ../../library/bisect.rst:217
281
291
msgid ""
282
292
">>> from collections import namedtuple\n"
283
293
">>> from operator import attrgetter\n"
@@ -310,13 +320,13 @@ msgid ""
310
320
" Movie(name='Titanic', released=1997, director='Cameron')]"
311
321
msgstr ""
312
322
313
- #: ../../library/bisect.rst:237
323
+ #: ../../library/bisect.rst:247
314
324
msgid ""
315
325
"If the key function is expensive, it is possible to avoid repeated function "
316
326
"calls by searching a list of precomputed keys to find the index of a record::"
317
327
msgstr ""
318
328
319
- #: ../../library/bisect.rst:240
329
+ #: ../../library/bisect.rst:250
320
330
msgid ""
321
331
">>> data = [('red', 5), ('blue', 1), ('yellow', 8), ('black', 0)]\n"
322
332
">>> data.sort(key=lambda r: r[1]) # Or use operator.itemgetter(1).\n"
0 commit comments