Skip to content

Commit 00b3fa0

Browse files
author
github-actions
committed
Merge 3.14 into 3.13
1 parent 0c1529d commit 00b3fa0

File tree

6 files changed

+162
-25
lines changed

6 files changed

+162
-25
lines changed

library/faulthandler.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ msgstr ""
127127

128128
#: ../../library/faulthandler.rst:49
129129
msgid "Module :mod:`pdb`"
130-
msgstr ""
130+
msgstr ":mod:`pdb` モジュール"
131131

132132
#: ../../library/faulthandler.rst:50
133133
msgid "Interactive source code debugger for Python programs."

library/hashlib.po

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ msgid ""
6363
"using the :meth:`digest()<hash.digest>` or :meth:`hexdigest()<hash."
6464
"hexdigest>` methods."
6565
msgstr ""
66+
"各 :dfn:`hash` の名前が付いたコンストラクタがあります。いずれも同一で簡単なイ"
67+
"ンターフェイスのあるハッシュオブジェクトを返します。例えば、SHA-256 ハッシュ"
68+
"オブジェクトを作るには :func:`sha256` を使います。このオブジェクトには :meth:"
69+
"`update<hash.update>` メソッドを用いて :term:`bytes-like オブジェクト <bytes-"
70+
"like object>` (通常 :class:`bytes`) を渡すことができます。:meth:"
71+
"`digest()<hash.digest>` や :meth:`hexdigest()<hash.hexdigest>` メソッドを用い"
72+
"て、それまでに渡したデータを連結したものの :dfn:`digest` をいつでも要求するこ"
73+
"とができます。"
6674

6775
#: ../../library/hashlib.rst:48
6876
msgid ""
@@ -133,6 +141,8 @@ msgid ""
133141
"To obtain the digest of the byte string ``b\"Nobody inspects the spammish "
134142
"repetition\"``::"
135143
msgstr ""
144+
"``b\"Nobody inspects the spammish repetition\"``というバイト文字列のダイジェ"
145+
"ストを取得するには次のようにします::"
136146

137147
#: ../../library/hashlib.rst:103
138148
msgid ""
@@ -154,7 +164,7 @@ msgstr "もっと簡潔に書くと、このようになります:"
154164

155165
#: ../../library/hashlib.rst:118
156166
msgid "Constructors"
157-
msgstr ""
167+
msgstr "コンストラクタ"
158168

159169
#: ../../library/hashlib.rst:122
160170
msgid ""
@@ -163,6 +173,9 @@ msgid ""
163173
"above listed hashes as well as any other algorithms that your OpenSSL "
164174
"library may offer."
165175
msgstr ""
176+
"一般的なコンストラクタで、第一引数にアルゴリズム名を文字列 *name* で受け取り"
177+
"ます。他にも、前述のハッシュアルゴリズムだけでなく OpenSSL ライブラリーが提供"
178+
"するような他のアルゴリズムにアクセスすることができます。"
166179

167180
#: ../../library/hashlib.rst:127
168181
msgid "Using :func:`new` with an algorithm name:"
@@ -309,21 +322,26 @@ msgid ""
309322
"far. This is a bytes object of size *length* which may contain bytes in the "
310323
"whole range from 0 to 255."
311324
msgstr ""
325+
"これまで :meth:`~hash.update` メソッドに渡されたデータのダイジェスト値を返し"
326+
"ます。これは *length* と同じ長さの、0 から 255 の範囲全てを含み得るバイトの列"
327+
"です。"
312328

313329
#: ../../library/hashlib.rst:250
314330
msgid ""
315331
"Like :meth:`digest` except the digest is returned as a string object of "
316332
"double length, containing only hexadecimal digits. This may be used to "
317333
"exchange the value in email or other non-binary environments."
318334
msgstr ""
335+
":meth:`digest` と似ていますが、倍の長さの、16進形式文字列を返します。これは、"
336+
"電子メールなどの非バイナリ環境で値を交換する場合に便利です。"
319337

320338
#: ../../library/hashlib.rst:254
321339
msgid "Example use:"
322-
msgstr ""
340+
msgstr "使用例:"
323341

324342
#: ../../library/hashlib.rst:261
325343
msgid "File hashing"
326-
msgstr ""
344+
msgstr "ファイルのハッシュ化"
327345

328346
#: ../../library/hashlib.rst:263
329347
msgid ""
@@ -424,6 +442,9 @@ msgid ""
424442
"then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for "
425443
"SHA-512."
426444
msgstr ""
445+
"*dklen* は、導出されたバイト列の鍵の長さです。 *dklen* が ``None`` の場合、"
446+
"ハッシュアルゴリズム *hash_name* のダイジェストサイズが使われます。例えば "
447+
"SHA-512 では 64 です。"
427448

428449
#: ../../library/hashlib.rst:345
429450
msgid "Function only available when Python is compiled with OpenSSL."

library/pdb.po

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ msgstr ""
8787

8888
#: ../../library/pdb.rst:41
8989
msgid "import pdb; pdb.set_trace()"
90-
msgstr ""
90+
msgstr "import pdb; pdb.set_trace()"
9191

9292
#: ../../library/pdb.rst:43
9393
msgid "Or::"
94-
msgstr ""
94+
msgstr "もしくは::"
9595

9696
#: ../../library/pdb.rst:45
9797
msgid "breakpoint()"
98-
msgstr ""
98+
msgstr "breakpoint()"
9999

100100
#: ../../library/pdb.rst:47
101101
msgid ""
@@ -153,7 +153,7 @@ msgstr ""
153153

154154
#: ../../library/pdb.rst:83
155155
msgid "python -m pdb [-c command] (-m module | -p pid | pyfile) [args ...]"
156-
msgstr ""
156+
msgstr "python -m pdb [-c command] (-m module | -p pid | pyfile) [args ...]"
157157

158158
#: ../../library/pdb.rst:85
159159
msgid ""
@@ -177,7 +177,7 @@ msgstr ""
177177

178178
#: ../../library/pdb.rst:96
179179
msgid "Added the ``-c`` option."
180-
msgstr ""
180+
msgstr "``-c`` オプションが追加されました。"
181181

182182
#: ../../library/pdb.rst:101
183183
msgid ""
@@ -187,7 +187,7 @@ msgstr ""
187187

188188
#: ../../library/pdb.rst:104
189189
msgid "Added the ``-m`` option."
190-
msgstr ""
190+
msgstr "``-m`` オプションが追加されました。"
191191

192192
#: ../../library/pdb.rst:109
193193
msgid "Attach to the process with the specified PID."
@@ -201,7 +201,7 @@ msgstr ""
201201

202202
#: ../../library/pdb.rst:117
203203
msgid "python -m pdb -p 1234"
204-
msgstr ""
204+
msgstr "python -m pdb -p 1234"
205205

206206
#: ../../library/pdb.rst:121
207207
msgid ""
@@ -357,7 +357,7 @@ msgstr ""
357357

358358
#: ../../library/pdb.rst:231
359359
msgid "Support for exception objects was added."
360-
msgstr ""
360+
msgstr "例外オブジェクトのサポートが追加されました。"
361361

362362
#: ../../library/pdb.rst:236
363363
msgid ""
@@ -466,7 +466,7 @@ msgstr "*skip* を使ってトレースする呼び出しの例::"
466466

467467
#: ../../library/pdb.rst:299
468468
msgid "import pdb; pdb.Pdb(skip=['django.*']).set_trace()"
469-
msgstr ""
469+
msgstr "import pdb; pdb.Pdb(skip=['django.*']).set_trace()"
470470

471471
#: ../../library/pdb.rst:301
472472
msgid ""
@@ -489,15 +489,15 @@ msgstr "*readrc* 引数。"
489489

490490
#: ../../library/pdb.rst:313
491491
msgid "Added the *mode* argument."
492-
msgstr ""
492+
msgstr "*mode* 引数が追加されました。"
493493

494494
#: ../../library/pdb.rst:316
495495
msgid "Added the *backend* argument."
496-
msgstr ""
496+
msgstr "*backend* 引数が追加されました。"
497497

498498
#: ../../library/pdb.rst:319
499499
msgid "Added the *colorize* argument."
500-
msgstr ""
500+
msgstr "*colorize* 引数が追加されました。"
501501

502502
#: ../../library/pdb.rst:322
503503
msgid ""

library/secrets.po

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ msgstr "[0, *exclusive_upper_bound*) の範囲のランダムな整数を返し
8787

8888
#: ../../library/secrets.rst:55
8989
msgid "Return a non-negative int with *k* random bits."
90-
msgstr ""
90+
msgstr "ランダムな *k* ビットの非負の整数を返します。"
9191

9292
#: ../../library/secrets.rst:59
9393
msgid "Generating tokens"
@@ -115,6 +115,8 @@ msgid ""
115115
">>> token_bytes(16)\n"
116116
"b'\\xebr\\x17D*t\\xae\\xd4\\xe3S\\xb6\\xe2\\xebP1\\x8b'"
117117
msgstr ""
118+
">>> token_bytes(16)\n"
119+
"b'\\xebr\\x17D*t\\xae\\xd4\\xe3S\\xb6\\xe2\\xebP1\\x8b'"
118120

119121
#: ../../library/secrets.rst:79
120122
msgid ""
@@ -131,6 +133,8 @@ msgid ""
131133
">>> token_hex(16)\n"
132134
"'f9bf78b9a18ce6d46a0cd2b0b86df9da'"
133135
msgstr ""
136+
">>> token_hex(16)\n"
137+
"'f9bf78b9a18ce6d46a0cd2b0b86df9da'"
134138

135139
#: ../../library/secrets.rst:90
136140
msgid ""
@@ -149,6 +153,8 @@ msgid ""
149153
">>> token_urlsafe(16)\n"
150154
"'Drmhze6EPcv0fN_81Bj-nA'"
151155
msgstr ""
156+
">>> token_urlsafe(16)\n"
157+
"'Drmhze6EPcv0fN_81Bj-nA'"
152158

153159
#: ../../library/secrets.rst:102
154160
msgid "How many bytes should tokens use?"
@@ -239,6 +245,10 @@ msgid ""
239245
"alphabet = string.ascii_letters + string.digits\n"
240246
"password = ''.join(secrets.choice(alphabet) for i in range(8))"
241247
msgstr ""
248+
"import string\n"
249+
"import secrets\n"
250+
"alphabet = string.ascii_letters + string.digits\n"
251+
"password = ''.join(secrets.choice(alphabet) for i in range(8))"
242252

243253
#: ../../library/secrets.rst:157
244254
msgid ""
@@ -270,6 +280,15 @@ msgid ""
270280
" and sum(c.isdigit() for c in password) >= 3):\n"
271281
" break"
272282
msgstr ""
283+
"import string\n"
284+
"import secrets\n"
285+
"alphabet = string.ascii_letters + string.digits\n"
286+
"while True:\n"
287+
" password = ''.join(secrets.choice(alphabet) for i in range(10))\n"
288+
" if (any(c.islower() for c in password)\n"
289+
" and any(c.isupper() for c in password)\n"
290+
" and sum(c.isdigit() for c in password) >= 3):\n"
291+
" break"
273292

274293
#: ../../library/secrets.rst:180
275294
msgid "Generate an `XKCD-style passphrase <https://xkcd.com/936/>`_:"
@@ -298,3 +317,5 @@ msgid ""
298317
"import secrets\n"
299318
"url = 'https://example.com/reset=' + secrets.token_urlsafe()"
300319
msgstr ""
320+
"import secrets\n"
321+
"url = 'https://example.com/reset=' + secrets.token_urlsafe()"

library/timeit.po

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ msgid ""
6969
"$ python -m timeit \"'-'.join(map(str, range(100)))\"\n"
7070
"10000 loops, best of 5: 23.2 usec per loop"
7171
msgstr ""
72+
"$ python -m timeit \"'-'.join(str(n) for n in range(100))\"\n"
73+
"10000 loops, best of 5: 30.2 usec per loop\n"
74+
"$ python -m timeit \"'-'.join([str(n) for n in range(100)])\"\n"
75+
"10000 loops, best of 5: 27.5 usec per loop\n"
76+
"$ python -m timeit \"'-'.join(map(str, range(100)))\"\n"
77+
"10000 loops, best of 5: 23.2 usec per loop"
7278

7379
#: ../../library/timeit.rst:37
7480
msgid "This can be achieved from the :ref:`python-interface` with::"
@@ -84,6 +90,13 @@ msgid ""
8490
">>> timeit.timeit('\"-\".join(map(str, range(100)))', number=10000)\n"
8591
"0.23702679807320237"
8692
msgstr ""
93+
">>> import timeit\n"
94+
">>> timeit.timeit('\"-\".join(str(n) for n in range(100))', number=10000)\n"
95+
"0.3018611848820001\n"
96+
">>> timeit.timeit('\"-\".join([str(n) for n in range(100)])', number=10000)\n"
97+
"0.2727368790656328\n"
98+
">>> timeit.timeit('\"-\".join(map(str, range(100)))', number=10000)\n"
99+
"0.23702679807320237"
87100

88101
#: ../../library/timeit.rst:47
89102
msgid "A callable can also be passed from the :ref:`python-interface`::"
@@ -95,6 +108,8 @@ msgid ""
95108
">>> timeit.timeit(lambda: \"-\".join(map(str, range(100))), number=10000)\n"
96109
"0.19665591977536678"
97110
msgstr ""
111+
">>> timeit.timeit(lambda: \"-\".join(map(str, range(100))), number=10000)\n"
112+
"0.19665591977536678"
98113

99114
#: ../../library/timeit.rst:52
100115
msgid ""
@@ -244,7 +259,7 @@ msgstr ""
244259

245260
#: ../../library/timeit.rst:143
246261
msgid "timeit.Timer('for i in range(10): oct(i)', 'gc.enable()').timeit()"
247-
msgstr ""
262+
msgstr "timeit.Timer('for i in range(10): oct(i)', 'gc.enable()').timeit()"
248263

249264
#: ../../library/timeit.rst:148
250265
msgid "Automatically determine how many times to call :meth:`.timeit`."
@@ -345,6 +360,7 @@ msgstr "コマンドラインからプログラムとして呼び出す場合は
345360
msgid ""
346361
"python -m timeit [-n N] [-r N] [-u U] [-s S] [-p] [-v] [-h] [statement ...]"
347362
msgstr ""
363+
"python -m timeit [-n N] [-r N] [-u U] [-s S] [-p] [-v] [-h] [statement ...]"
348364

349365
#: ../../library/timeit.rst:213
350366
msgid "Where the following options are understood:"
@@ -454,6 +470,12 @@ msgid ""
454470
"find(char)\"\n"
455471
"1000000 loops, best of 5: 0.342 usec per loop"
456472
msgstr ""
473+
"$ python -m timeit -s \"text = 'sample string'; char = 'g'\" \"char in "
474+
"text\"\n"
475+
"5000000 loops, best of 5: 0.0877 usec per loop\n"
476+
"$ python -m timeit -s \"text = 'sample string'; char = 'g'\" \"text."
477+
"find(char)\"\n"
478+
"1000000 loops, best of 5: 0.342 usec per loop"
457479

458480
#: ../../library/timeit.rst:287
459481
msgid ""
@@ -479,6 +501,13 @@ msgid ""
479501
"\"g\"')\n"
480502
"1.7246671520006203"
481503
msgstr ""
504+
">>> import timeit\n"
505+
">>> timeit.timeit('char in text', setup='text = \"sample string\"; char = "
506+
"\"g\"')\n"
507+
"0.41440500499993504\n"
508+
">>> timeit.timeit('text.find(char)', setup='text = \"sample string\"; char = "
509+
"\"g\"')\n"
510+
"1.7246671520006203"
482511

483512
#: ../../library/timeit.rst:302
484513
msgid "The same can be done using the :class:`Timer` class and its methods::"
@@ -496,6 +525,14 @@ msgid ""
496525
"[0.40183617287970225, 0.37027556854118704, 0.38344867356679524, "
497526
"0.3712595970846668, 0.37866875250654886]"
498527
msgstr ""
528+
">>> import timeit\n"
529+
">>> t = timeit.Timer('char in text', setup='text = \"sample string\"; char = "
530+
"\"g\"')\n"
531+
">>> t.timeit()\n"
532+
"0.3955516149999312\n"
533+
">>> t.repeat()\n"
534+
"[0.40183617287970225, 0.37027556854118704, 0.38344867356679524, "
535+
"0.3712595970846668, 0.37866875250654886]"
499536

500537
#: ../../library/timeit.rst:312
501538
msgid ""
@@ -521,6 +558,17 @@ msgid ""
521558
"$ python -m timeit \"if hasattr(int, '__bool__'): pass\"\n"
522559
"100000 loops, best of 5: 2.23 usec per loop"
523560
msgstr ""
561+
"$ python -m timeit \"try:\" \" str.__bool__\" \"except AttributeError:\" "
562+
"\" pass\"\n"
563+
"20000 loops, best of 5: 15.7 usec per loop\n"
564+
"$ python -m timeit \"if hasattr(str, '__bool__'): pass\"\n"
565+
"50000 loops, best of 5: 4.26 usec per loop\n"
566+
"\n"
567+
"$ python -m timeit \"try:\" \" int.__bool__\" \"except AttributeError:\" "
568+
"\" pass\"\n"
569+
"200000 loops, best of 5: 1.43 usec per loop\n"
570+
"$ python -m timeit \"if hasattr(int, '__bool__'): pass\"\n"
571+
"100000 loops, best of 5: 2.23 usec per loop"
524572

525573
#: ../../library/timeit.rst:330
526574
msgid ""
@@ -593,6 +641,15 @@ msgid ""
593641
"import timeit\n"
594642
"print(timeit.timeit('[func(42) for func in (f,g,h)]', globals=globals()))"
595643
msgstr ""
644+
"def f(x):\n"
645+
" return x**2\n"
646+
"def g(x):\n"
647+
" return x**4\n"
648+
"def h(x):\n"
649+
" return x**8\n"
650+
"\n"
651+
"import timeit\n"
652+
"print(timeit.timeit('[func(42) for func in (f,g,h)]', globals=globals()))"
596653

597654
#: ../../library/timeit.rst:9
598655
msgid "Benchmarking"

0 commit comments

Comments
 (0)