-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy path3.10.po
3627 lines (3077 loc) · 119 KB
/
3.10.po
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
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2025, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Arihiro TAKASE, 2023
# souma987, 2023
# tomo, 2024
# Takanori Suzuki <[email protected]>, 2025
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-02-14 14:17+0000\n"
"PO-Revision-Date: 2021-06-29 13:04+0000\n"
"Last-Translator: Takanori Suzuki <[email protected]>, 2025\n"
"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/"
"ja/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ja\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../whatsnew/3.10.rst:3
msgid "What's New In Python 3.10"
msgstr "What's New In Python 3.10"
#: ../../whatsnew/3.10.rst:0
msgid "Editor"
msgstr "編集者"
#: ../../whatsnew/3.10.rst:5
msgid "Pablo Galindo Salgado"
msgstr "Pablo Galindo Salgado"
#: ../../whatsnew/3.10.rst:47
msgid ""
"This article explains the new features in Python 3.10, compared to 3.9. "
"Python 3.10 was released on October 4, 2021. For full details, see the :ref:"
"`changelog <changelog>`."
msgstr ""
"この記事では Python 3.9 と比較した Python 3.10 の新機能を解説します。Python "
"3.10 は2021年10月4日にリリースされました。全詳細については :ref:`変更履歴 "
"<changelog>` をご覧ください。"
#: ../../whatsnew/3.10.rst:52
msgid "Summary -- Release highlights"
msgstr "概要 -- リリースハイライト"
#: ../../whatsnew/3.10.rst:60
msgid "New syntax features:"
msgstr "新たな文法機能:"
#: ../../whatsnew/3.10.rst:62
msgid ":pep:`634`, Structural Pattern Matching: Specification"
msgstr ":pep:`634`、構造的パターンマッチ: 仕様"
#: ../../whatsnew/3.10.rst:63
msgid ":pep:`635`, Structural Pattern Matching: Motivation and Rationale"
msgstr ":pep:`635`、構造的パターンマッチ: モチベーションと原理"
#: ../../whatsnew/3.10.rst:64
msgid ":pep:`636`, Structural Pattern Matching: Tutorial"
msgstr ":pep:`636`、構造的パターンマッチ: チュートリアル"
#: ../../whatsnew/3.10.rst:65
msgid ""
":issue:`12782`, Parenthesized context managers are now officially allowed."
msgstr ":issue:`12782`、カッコ内のコンテキストマネージャーが正式にサポート"
#: ../../whatsnew/3.10.rst:67
msgid "New features in the standard library:"
msgstr "標準ライブラリの新機能:"
#: ../../whatsnew/3.10.rst:69
msgid ":pep:`618`, Add Optional Length-Checking To zip."
msgstr ":pep:`618`、zipに長さチェックのオプション引数が追加"
#: ../../whatsnew/3.10.rst:71
msgid "Interpreter improvements:"
msgstr "インタプリタの改善:"
#: ../../whatsnew/3.10.rst:73
msgid ":pep:`626`, Precise line numbers for debugging and other tools."
msgstr ""
#: ../../whatsnew/3.10.rst:75
msgid "New typing features:"
msgstr "新しい型ヒントの機能:"
#: ../../whatsnew/3.10.rst:77
msgid ":pep:`604`, Allow writing union types as X | Y"
msgstr ""
#: ../../whatsnew/3.10.rst:78
msgid ":pep:`612`, Parameter Specification Variables"
msgstr ""
#: ../../whatsnew/3.10.rst:79
msgid ":pep:`613`, Explicit Type Aliases"
msgstr ""
#: ../../whatsnew/3.10.rst:80
msgid ":pep:`647`, User-Defined Type Guards"
msgstr ""
#: ../../whatsnew/3.10.rst:82
msgid "Important deprecations, removals or restrictions:"
msgstr "重要な非推奨化、削除または制限:"
#: ../../whatsnew/3.10.rst:84
msgid ":pep:`644`, Require OpenSSL 1.1.1 or newer"
msgstr ""
#: ../../whatsnew/3.10.rst:85
msgid ":pep:`632`, Deprecate distutils module."
msgstr ""
#: ../../whatsnew/3.10.rst:86
msgid ""
":pep:`623`, Deprecate and prepare for the removal of the wstr member in "
"PyUnicodeObject."
msgstr ""
#: ../../whatsnew/3.10.rst:87
msgid ":pep:`624`, Remove Py_UNICODE encoder APIs"
msgstr ""
#: ../../whatsnew/3.10.rst:88
msgid ":pep:`597`, Add optional EncodingWarning"
msgstr ""
#: ../../whatsnew/3.10.rst:92 ../../whatsnew/3.10.rst:2053
msgid "New Features"
msgstr "新しい機能"
#: ../../whatsnew/3.10.rst:97
msgid "Parenthesized context managers"
msgstr "カッコ内のコンテキストマネージャー"
#: ../../whatsnew/3.10.rst:99
msgid ""
"Using enclosing parentheses for continuation across multiple lines in "
"context managers is now supported. This allows formatting a long collection "
"of context managers in multiple lines in a similar way as it was previously "
"possible with import statements. For instance, all these examples are now "
"valid:"
msgstr ""
"コンテキストマネージャーを複数行で継続して記述する場合に、カッコで囲むことが"
"できるようになりました。複数行でたくさんのコンテキストマネージャーを記述する"
"ときに、従来のimport文と同じようにフォーマットできます。たとえば、以下のすべ"
"ての例は有効です::"
#: ../../whatsnew/3.10.rst:105
msgid ""
"with (CtxManager() as example):\n"
" ...\n"
"\n"
"with (\n"
" CtxManager1(),\n"
" CtxManager2()\n"
"):\n"
" ...\n"
"\n"
"with (CtxManager1() as example,\n"
" CtxManager2()):\n"
" ...\n"
"\n"
"with (CtxManager1(),\n"
" CtxManager2() as example):\n"
" ...\n"
"\n"
"with (\n"
" CtxManager1() as example1,\n"
" CtxManager2() as example2\n"
"):\n"
" ..."
msgstr ""
#: ../../whatsnew/3.10.rst:130
msgid ""
"it is also possible to use a trailing comma at the end of the enclosed group:"
msgstr ""
"カッコに囲まれたグループの最後の要素に対する、末尾のカンマも指定可能です。"
#: ../../whatsnew/3.10.rst:133
msgid ""
"with (\n"
" CtxManager1() as example1,\n"
" CtxManager2() as example2,\n"
" CtxManager3() as example3,\n"
"):\n"
" ..."
msgstr ""
#: ../../whatsnew/3.10.rst:142
msgid ""
"This new syntax uses the non LL(1) capacities of the new parser. Check :pep:"
"`617` for more details."
msgstr ""
"この新しい構文は、新パーサーによるLL(1)以外の能力を使用しています。詳細は :"
"pep:`617` を参照してください。"
#: ../../whatsnew/3.10.rst:145
msgid ""
"(Contributed by Guido van Rossum, Pablo Galindo and Lysandros Nikolaou in :"
"issue:`12782` and :issue:`40334`.)"
msgstr ""
"(Guido van Rossum、Pablo Galindo、Lysandros Nikolaou の貢献による :issue:"
"`12782`、:issue:`40334`)"
#: ../../whatsnew/3.10.rst:150
msgid "Better error messages"
msgstr "エラーメッセージの改善"
#: ../../whatsnew/3.10.rst:153
msgid "SyntaxErrors"
msgstr "SyntaxErrors"
#: ../../whatsnew/3.10.rst:155
msgid ""
"When parsing code that contains unclosed parentheses or brackets the "
"interpreter now includes the location of the unclosed bracket of parentheses "
"instead of displaying *SyntaxError: unexpected EOF while parsing* or "
"pointing to some incorrect location. For instance, consider the following "
"code (notice the unclosed '{'):"
msgstr ""
#: ../../whatsnew/3.10.rst:160
msgid ""
"expected = {9: 1, 18: 2, 19: 2, 27: 3, 28: 3, 29: 3, 36: 4, 37: 4,\n"
" 38: 4, 39: 4, 45: 5, 46: 5, 47: 5, 48: 5, 49: 5, 54: 6,\n"
"some_other_code = foo()"
msgstr ""
#: ../../whatsnew/3.10.rst:166
msgid ""
"Previous versions of the interpreter reported confusing places as the "
"location of the syntax error:"
msgstr ""
"以前のバージョンのインタープリタは、構文エラーの位置として混乱する場所を報告"
"していました:"
#: ../../whatsnew/3.10.rst:169
msgid ""
"File \"example.py\", line 3\n"
" some_other_code = foo()\n"
" ^\n"
"SyntaxError: invalid syntax"
msgstr ""
#: ../../whatsnew/3.10.rst:176
msgid "but in Python 3.10 a more informative error is emitted:"
msgstr "しかしPython 3.10ではより有益なエラーが出力されます:"
#: ../../whatsnew/3.10.rst:178
msgid ""
"File \"example.py\", line 1\n"
" expected = {9: 1, 18: 2, 19: 2, 27: 3, 28: 3, 29: 3, 36: 4, 37: 4,\n"
" ^\n"
"SyntaxError: '{' was never closed"
msgstr ""
#: ../../whatsnew/3.10.rst:186
msgid ""
"In a similar way, errors involving unclosed string literals (single and "
"triple quoted) now point to the start of the string instead of reporting EOF/"
"EOL."
msgstr ""
#: ../../whatsnew/3.10.rst:189
msgid ""
"These improvements are inspired by previous work in the PyPy interpreter."
msgstr ""
#: ../../whatsnew/3.10.rst:191
msgid ""
"(Contributed by Pablo Galindo in :issue:`42864` and Batuhan Taskaya in :"
"issue:`40176`.)"
msgstr ""
"(Pablo Galindoの貢献による :issue:`42864`、Batuhan Taskayaの貢献による :"
"issue:`40176`)"
#: ../../whatsnew/3.10.rst:194
msgid ""
":exc:`SyntaxError` exceptions raised by the interpreter will now highlight "
"the full error range of the expression that constitutes the syntax error "
"itself, instead of just where the problem is detected. In this way, instead "
"of displaying (before Python 3.10):"
msgstr ""
#: ../../whatsnew/3.10.rst:199
msgid ""
">>> foo(x, z for z in range(10), t, w)\n"
" File \"<stdin>\", line 1\n"
" foo(x, z for z in range(10), t, w)\n"
" ^\n"
"SyntaxError: Generator expression must be parenthesized"
msgstr ""
#: ../../whatsnew/3.10.rst:207
msgid "now Python 3.10 will display the exception as:"
msgstr ""
#: ../../whatsnew/3.10.rst:209
msgid ""
">>> foo(x, z for z in range(10), t, w)\n"
" File \"<stdin>\", line 1\n"
" foo(x, z for z in range(10), t, w)\n"
" ^^^^^^^^^^^^^^^^^^^^\n"
"SyntaxError: Generator expression must be parenthesized"
msgstr ""
#: ../../whatsnew/3.10.rst:217
msgid "This improvement was contributed by Pablo Galindo in :issue:`43914`."
msgstr ""
#: ../../whatsnew/3.10.rst:219
msgid ""
"A considerable amount of new specialized messages for :exc:`SyntaxError` "
"exceptions have been incorporated. Some of the most notable ones are as "
"follows:"
msgstr ""
#: ../../whatsnew/3.10.rst:222
msgid "Missing ``:`` before blocks:"
msgstr "ブロックの前の ``:`` が存在しない:"
#: ../../whatsnew/3.10.rst:224
msgid ""
">>> if rocket.position > event_horizon\n"
" File \"<stdin>\", line 1\n"
" if rocket.position > event_horizon\n"
" ^\n"
"SyntaxError: expected ':'"
msgstr ""
#: ../../whatsnew/3.10.rst:232
msgid "(Contributed by Pablo Galindo in :issue:`42997`.)"
msgstr "(Pablo Galindo の貢献による :issue:`42997`)"
#: ../../whatsnew/3.10.rst:234
msgid "Unparenthesised tuples in comprehensions targets:"
msgstr "内包表記のターゲットにカッコのないタプルを使用:"
#: ../../whatsnew/3.10.rst:236
msgid ""
">>> {x,y for x,y in zip('abcd', '1234')}\n"
" File \"<stdin>\", line 1\n"
" {x,y for x,y in zip('abcd', '1234')}\n"
" ^\n"
"SyntaxError: did you forget parentheses around the comprehension target?"
msgstr ""
#: ../../whatsnew/3.10.rst:244
msgid "(Contributed by Pablo Galindo in :issue:`43017`.)"
msgstr "(Pablo Galindo の貢献による :issue:`43017`)"
#: ../../whatsnew/3.10.rst:246
msgid "Missing commas in collection literals and between expressions:"
msgstr "コレクションリテラルや式の間のカンマが存在しない:"
#: ../../whatsnew/3.10.rst:248
msgid ""
">>> items = {\n"
"... x: 1,\n"
"... y: 2\n"
"... z: 3,\n"
" File \"<stdin>\", line 3\n"
" y: 2\n"
" ^\n"
"SyntaxError: invalid syntax. Perhaps you forgot a comma?"
msgstr ""
#: ../../whatsnew/3.10.rst:259
msgid "(Contributed by Pablo Galindo in :issue:`43822`.)"
msgstr "(Pablo Galindo の貢献による :issue:`43822`)"
#: ../../whatsnew/3.10.rst:261
msgid "Multiple Exception types without parentheses:"
msgstr "複数の例外の型をカッコで囲んでいない:"
#: ../../whatsnew/3.10.rst:263
msgid ""
">>> try:\n"
"... build_dyson_sphere()\n"
"... except NotEnoughScienceError, NotEnoughResourcesError:\n"
" File \"<stdin>\", line 3\n"
" except NotEnoughScienceError, NotEnoughResourcesError:\n"
" ^\n"
"SyntaxError: multiple exception types must be parenthesized"
msgstr ""
#: ../../whatsnew/3.10.rst:273
msgid "(Contributed by Pablo Galindo in :issue:`43149`.)"
msgstr "(Pablo Galindo の貢献による :issue:`43149`)"
#: ../../whatsnew/3.10.rst:275
msgid "Missing ``:`` and values in dictionary literals:"
msgstr "辞書のリテラルで ``:`` と値が存在しない:"
#: ../../whatsnew/3.10.rst:277
msgid ""
">>> values = {\n"
"... x: 1,\n"
"... y: 2,\n"
"... z:\n"
"... }\n"
" File \"<stdin>\", line 4\n"
" z:\n"
" ^\n"
"SyntaxError: expression expected after dictionary key and ':'\n"
"\n"
">>> values = {x:1, y:2, z w:3}\n"
" File \"<stdin>\", line 1\n"
" values = {x:1, y:2, z w:3}\n"
" ^\n"
"SyntaxError: ':' expected after dictionary key"
msgstr ""
#: ../../whatsnew/3.10.rst:295
msgid "(Contributed by Pablo Galindo in :issue:`43823`.)"
msgstr "(Pablo Galindo の貢献による :issue:`43823`)"
#: ../../whatsnew/3.10.rst:297
msgid "``try`` blocks without ``except`` or ``finally`` blocks:"
msgstr "``try`` ブロックに ``except`` または ``finally`` ブロックが存在しない:"
#: ../../whatsnew/3.10.rst:299
msgid ""
">>> try:\n"
"... x = 2\n"
"... something = 3\n"
" File \"<stdin>\", line 3\n"
" something = 3\n"
" ^^^^^^^^^\n"
"SyntaxError: expected 'except' or 'finally' block"
msgstr ""
#: ../../whatsnew/3.10.rst:309
msgid "(Contributed by Pablo Galindo in :issue:`44305`.)"
msgstr "(Pablo Galindo の貢献による :issue:`44305`)"
#: ../../whatsnew/3.10.rst:311
msgid "Usage of ``=`` instead of ``==`` in comparisons:"
msgstr "比較で ``==`` の代わりに ``=`` を使用している:"
#: ../../whatsnew/3.10.rst:313
msgid ""
">>> if rocket.position = event_horizon:\n"
" File \"<stdin>\", line 1\n"
" if rocket.position = event_horizon:\n"
" ^\n"
"SyntaxError: cannot assign to attribute here. Maybe you meant '==' instead "
"of '='?"
msgstr ""
#: ../../whatsnew/3.10.rst:321
msgid "(Contributed by Pablo Galindo in :issue:`43797`.)"
msgstr "(Pablo Galindo の貢献による :issue:`43797`)"
#: ../../whatsnew/3.10.rst:323
msgid "Usage of ``*`` in f-strings:"
msgstr "f-stringで ``*`` を使用している:"
#: ../../whatsnew/3.10.rst:325
msgid ""
">>> f\"Black holes {*all_black_holes} and revelations\"\n"
" File \"<stdin>\", line 1\n"
" (*all_black_holes)\n"
" ^\n"
"SyntaxError: f-string: cannot use starred expression here"
msgstr ""
#: ../../whatsnew/3.10.rst:333
msgid "(Contributed by Pablo Galindo in :issue:`41064`.)"
msgstr "(Pablo Galindo の貢献による :issue:`41064`)"
#: ../../whatsnew/3.10.rst:336
msgid "IndentationErrors"
msgstr "IndentationErrors"
#: ../../whatsnew/3.10.rst:338
msgid ""
"Many :exc:`IndentationError` exceptions now have more context regarding what "
"kind of block was expecting an indentation, including the location of the "
"statement:"
msgstr ""
#: ../../whatsnew/3.10.rst:341
msgid ""
">>> def foo():\n"
"... if lel:\n"
"... x = 2\n"
" File \"<stdin>\", line 3\n"
" x = 2\n"
" ^\n"
"IndentationError: expected an indented block after 'if' statement in line 2"
msgstr ""
#: ../../whatsnew/3.10.rst:353
msgid "AttributeErrors"
msgstr "AttributeErrors"
#: ../../whatsnew/3.10.rst:355
msgid ""
"When printing :exc:`AttributeError`, :c:func:`!PyErr_Display` will offer "
"suggestions of similar attribute names in the object that the exception was "
"raised from:"
msgstr ""
#: ../../whatsnew/3.10.rst:359
msgid ""
">>> collections.namedtoplo\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 1, in <module>\n"
"AttributeError: module 'collections' has no attribute 'namedtoplo'. Did you "
"mean: namedtuple?"
msgstr ""
#: ../../whatsnew/3.10.rst:366 ../../whatsnew/3.10.rst:388
msgid "(Contributed by Pablo Galindo in :issue:`38530`.)"
msgstr "(Pablo Galindo の貢献による :issue:`38530`)"
#: ../../whatsnew/3.10.rst:369
msgid ""
"Notice this won't work if :c:func:`!PyErr_Display` is not called to display "
"the error which can happen if some other custom error display function is "
"used. This is a common scenario in some REPLs like IPython."
msgstr ""
#: ../../whatsnew/3.10.rst:374
msgid "NameErrors"
msgstr "NameErrors"
#: ../../whatsnew/3.10.rst:376
msgid ""
"When printing :exc:`NameError` raised by the interpreter, :c:func:`!"
"PyErr_Display` will offer suggestions of similar variable names in the "
"function that the exception was raised from:"
msgstr ""
#: ../../whatsnew/3.10.rst:380
msgid ""
">>> schwarzschild_black_hole = None\n"
">>> schwarschild_black_hole\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 1, in <module>\n"
"NameError: name 'schwarschild_black_hole' is not defined. Did you mean: "
"schwarzschild_black_hole?"
msgstr ""
#: ../../whatsnew/3.10.rst:391
msgid ""
"Notice this won't work if :c:func:`!PyErr_Display` is not called to display "
"the error, which can happen if some other custom error display function is "
"used. This is a common scenario in some REPLs like IPython."
msgstr ""
#: ../../whatsnew/3.10.rst:397
msgid "PEP 626: Precise line numbers for debugging and other tools"
msgstr ""
#: ../../whatsnew/3.10.rst:399
msgid ""
"PEP 626 brings more precise and reliable line numbers for debugging, "
"profiling and coverage tools. Tracing events, with the correct line number, "
"are generated for all lines of code executed and only for lines of code that "
"are executed."
msgstr ""
#: ../../whatsnew/3.10.rst:402
msgid ""
"The :attr:`~frame.f_lineno` attribute of frame objects will always contain "
"the expected line number."
msgstr ""
#: ../../whatsnew/3.10.rst:405
msgid ""
"The :attr:`~codeobject.co_lnotab` attribute of :ref:`code objects <code-"
"objects>` is deprecated and will be removed in 3.12. Code that needs to "
"convert from offset to line number should use the new :meth:`~codeobject."
"co_lines` method instead."
msgstr ""
#: ../../whatsnew/3.10.rst:412
msgid "PEP 634: Structural Pattern Matching"
msgstr "PEP 634: 構造的パターンマッチ"
#: ../../whatsnew/3.10.rst:414
msgid ""
"Structural pattern matching has been added in the form of a *match "
"statement* and *case statements* of patterns with associated actions. "
"Patterns consist of sequences, mappings, primitive data types as well as "
"class instances. Pattern matching enables programs to extract information "
"from complex data types, branch on the structure of data, and apply specific "
"actions based on different forms of data."
msgstr ""
#: ../../whatsnew/3.10.rst:422
msgid "Syntax and operations"
msgstr ""
#: ../../whatsnew/3.10.rst:424
msgid "The generic syntax of pattern matching is::"
msgstr ""
#: ../../whatsnew/3.10.rst:426
msgid ""
"match subject:\n"
" case <pattern_1>:\n"
" <action_1>\n"
" case <pattern_2>:\n"
" <action_2>\n"
" case <pattern_3>:\n"
" <action_3>\n"
" case _:\n"
" <action_wildcard>"
msgstr ""
#: ../../whatsnew/3.10.rst:436
msgid ""
"A match statement takes an expression and compares its value to successive "
"patterns given as one or more case blocks. Specifically, pattern matching "
"operates by:"
msgstr ""
#: ../../whatsnew/3.10.rst:440
msgid "using data with type and shape (the ``subject``)"
msgstr ""
#: ../../whatsnew/3.10.rst:441
msgid "evaluating the ``subject`` in the ``match`` statement"
msgstr ""
#: ../../whatsnew/3.10.rst:442
msgid ""
"comparing the subject with each pattern in a ``case`` statement from top to "
"bottom until a match is confirmed."
msgstr ""
#: ../../whatsnew/3.10.rst:444
msgid "executing the action associated with the pattern of the confirmed match"
msgstr ""
#: ../../whatsnew/3.10.rst:446
msgid ""
"If an exact match is not confirmed, the last case, a wildcard ``_``, if "
"provided, will be used as the matching case. If an exact match is not "
"confirmed and a wildcard case does not exist, the entire match block is a no-"
"op."
msgstr ""
#: ../../whatsnew/3.10.rst:452
msgid "Declarative approach"
msgstr ""
#: ../../whatsnew/3.10.rst:454
msgid ""
"Readers may be aware of pattern matching through the simple example of "
"matching a subject (data object) to a literal (pattern) with the switch "
"statement found in C, Java or JavaScript (and many other languages). Often "
"the switch statement is used for comparison of an object/expression with "
"case statements containing literals."
msgstr ""
#: ../../whatsnew/3.10.rst:460
msgid ""
"More powerful examples of pattern matching can be found in languages such as "
"Scala and Elixir. With structural pattern matching, the approach is "
"\"declarative\" and explicitly states the conditions (the patterns) for data "
"to match."
msgstr ""
#: ../../whatsnew/3.10.rst:464
msgid ""
"While an \"imperative\" series of instructions using nested \"if\" "
"statements could be used to accomplish something similar to structural "
"pattern matching, it is less clear than the \"declarative\" approach. "
"Instead the \"declarative\" approach states the conditions to meet for a "
"match and is more readable through its explicit patterns. While structural "
"pattern matching can be used in its simplest form comparing a variable to a "
"literal in a case statement, its true value for Python lies in its handling "
"of the subject's type and shape."
msgstr ""
#: ../../whatsnew/3.10.rst:473
msgid "Simple pattern: match to a literal"
msgstr ""
#: ../../whatsnew/3.10.rst:475
msgid ""
"Let's look at this example as pattern matching in its simplest form: a "
"value, the subject, being matched to several literals, the patterns. In the "
"example below, ``status`` is the subject of the match statement. The "
"patterns are each of the case statements, where literals represent request "
"status codes. The associated action to the case is executed after a match::"
msgstr ""
#: ../../whatsnew/3.10.rst:481
msgid ""
"def http_error(status):\n"
" match status:\n"
" case 400:\n"
" return \"Bad request\"\n"
" case 404:\n"
" return \"Not found\"\n"
" case 418:\n"
" return \"I'm a teapot\"\n"
" case _:\n"
" return \"Something's wrong with the internet\""
msgstr ""
#: ../../whatsnew/3.10.rst:492
msgid ""
"If the above function is passed a ``status`` of 418, \"I'm a teapot\" is "
"returned. If the above function is passed a ``status`` of 500, the case "
"statement with ``_`` will match as a wildcard, and \"Something's wrong with "
"the internet\" is returned. Note the last block: the variable name, ``_``, "
"acts as a *wildcard* and insures the subject will always match. The use of "
"``_`` is optional."
msgstr ""
#: ../../whatsnew/3.10.rst:499
msgid ""
"You can combine several literals in a single pattern using ``|`` (\"or\")::"
msgstr ""
"複数のリテラルを``|`` (\"or\")を使用して組み合わせて1つのパターンにできます。"
#: ../../whatsnew/3.10.rst:501
msgid ""
"case 401 | 403 | 404:\n"
" return \"Not allowed\""
msgstr ""
"case 401 | 403 | 404:\n"
" return \"Not allowed\""
#: ../../whatsnew/3.10.rst:505
msgid "Behavior without the wildcard"
msgstr ""
#: ../../whatsnew/3.10.rst:507
msgid ""
"If we modify the above example by removing the last case block, the example "
"becomes::"
msgstr ""
#: ../../whatsnew/3.10.rst:510
msgid ""
"def http_error(status):\n"
" match status:\n"
" case 400:\n"
" return \"Bad request\"\n"
" case 404:\n"
" return \"Not found\"\n"
" case 418:\n"
" return \"I'm a teapot\""
msgstr ""
#: ../../whatsnew/3.10.rst:519
msgid ""
"Without the use of ``_`` in a case statement, a match may not exist. If no "
"match exists, the behavior is a no-op. For example, if ``status`` of 500 is "
"passed, a no-op occurs."
msgstr ""
#: ../../whatsnew/3.10.rst:524
msgid "Patterns with a literal and variable"
msgstr ""
#: ../../whatsnew/3.10.rst:526
msgid ""
"Patterns can look like unpacking assignments, and a pattern may be used to "
"bind variables. In this example, a data point can be unpacked to its x-"
"coordinate and y-coordinate::"
msgstr ""
#: ../../whatsnew/3.10.rst:530
msgid ""
"# point is an (x, y) tuple\n"
"match point:\n"
" case (0, 0):\n"
" print(\"Origin\")\n"
" case (0, y):\n"
" print(f\"Y={y}\")\n"
" case (x, 0):\n"
" print(f\"X={x}\")\n"
" case (x, y):\n"
" print(f\"X={x}, Y={y}\")\n"
" case _:\n"
" raise ValueError(\"Not a point\")"
msgstr ""
#: ../../whatsnew/3.10.rst:543
msgid ""
"The first pattern has two literals, ``(0, 0)``, and may be thought of as an "
"extension of the literal pattern shown above. The next two patterns combine "
"a literal and a variable, and the variable *binds* a value from the subject "
"(``point``). The fourth pattern captures two values, which makes it "
"conceptually similar to the unpacking assignment ``(x, y) = point``."
msgstr ""
#: ../../whatsnew/3.10.rst:550
msgid "Patterns and classes"
msgstr ""
#: ../../whatsnew/3.10.rst:552
msgid ""
"If you are using classes to structure your data, you can use as a pattern "
"the class name followed by an argument list resembling a constructor. This "
"pattern has the ability to capture class attributes into variables::"
msgstr ""
#: ../../whatsnew/3.10.rst:556
msgid ""
"class Point:\n"
" x: int\n"
" y: int\n"
"\n"
"def location(point):\n"
" match point:\n"
" case Point(x=0, y=0):\n"
" print(\"Origin is the point's location.\")\n"
" case Point(x=0, y=y):\n"
" print(f\"Y={y} and the point is on the y-axis.\")\n"
" case Point(x=x, y=0):\n"
" print(f\"X={x} and the point is on the x-axis.\")\n"
" case Point():\n"
" print(\"The point is located somewhere else on the plane.\")\n"
" case _:\n"
" print(\"Not a point\")"
msgstr ""
#: ../../whatsnew/3.10.rst:574
msgid "Patterns with positional parameters"
msgstr ""
#: ../../whatsnew/3.10.rst:576
msgid ""
"You can use positional parameters with some builtin classes that provide an "
"ordering for their attributes (e.g. dataclasses). You can also define a "
"specific position for attributes in patterns by setting the "
"``__match_args__`` special attribute in your classes. If it's set to (\"x\", "
"\"y\"), the following patterns are all equivalent (and all bind the ``y`` "
"attribute to the ``var`` variable)::"
msgstr ""
"いくつかの組み込みクラスでは位置引数が使用でき、属性の順番を提供します(例: "
"データクラス)。クラスの ``__match_args__`` 特殊属性でによって、パターンの中で"
"属性の明確な位置を定義することもできます。(\"x\", \"y\")が設定された場合、以"
"下のすべてのパターンは等価です(すべて属性 ``y`` が ``var`` 変数に関連づけられ"
"ます)::"
#: ../../whatsnew/3.10.rst:582
msgid ""
"Point(1, var)\n"
"Point(1, y=var)\n"
"Point(x=1, y=var)\n"
"Point(y=var, x=1)"
msgstr ""
#: ../../whatsnew/3.10.rst:588
msgid "Nested patterns"
msgstr ""
#: ../../whatsnew/3.10.rst:590
msgid ""
"Patterns can be arbitrarily nested. For example, if our data is a short "
"list of points, it could be matched like this::"
msgstr ""
#: ../../whatsnew/3.10.rst:593
msgid ""
"match points:\n"
" case []:\n"
" print(\"No points in the list.\")\n"
" case [Point(0, 0)]:\n"
" print(\"The origin is the only point in the list.\")\n"
" case [Point(x, y)]:\n"
" print(f\"A single point {x}, {y} is in the list.\")\n"
" case [Point(0, y1), Point(0, y2)]:\n"
" print(f\"Two points on the Y axis at {y1}, {y2} are in the list.\")\n"
" case _:\n"
" print(\"Something else is found in the list.\")"
msgstr ""
#: ../../whatsnew/3.10.rst:606
msgid "Complex patterns and the wildcard"
msgstr ""
#: ../../whatsnew/3.10.rst:608
msgid ""
"To this point, the examples have used ``_`` alone in the last case "
"statement. A wildcard can be used in more complex patterns, such as "
"``('error', code, _)``. For example::"
msgstr ""
#: ../../whatsnew/3.10.rst:612
msgid ""
"match test_variable:\n"
" case ('warning', code, 40):\n"
" print(\"A warning has been received.\")\n"
" case ('error', code, _):\n"
" print(f\"An error {code} occurred.\")"
msgstr ""
#: ../../whatsnew/3.10.rst:618
msgid ""
"In the above case, ``test_variable`` will match for ('error', code, 100) and "
"('error', code, 800)."
msgstr ""
#: ../../whatsnew/3.10.rst:622
msgid "Guard"
msgstr ""
#: ../../whatsnew/3.10.rst:624
msgid ""
"We can add an ``if`` clause to a pattern, known as a \"guard\". If the "
"guard is false, ``match`` goes on to try the next case block. Note that "
"value capture happens before the guard is evaluated::"
msgstr ""
"パターンに ``if`` 節を追加できます。これは \"ガード\" と呼ばれます。ガードが"
"falseの場合、``match`` は次のcaseブロックの処理に移動します。ガードを評価する"
"前に値が取り出されることに注意してください::"
#: ../../whatsnew/3.10.rst:628
msgid ""
"match point:\n"
" case Point(x, y) if x == y:\n"
" print(f\"The point is located on the diagonal Y=X at {x}.\")\n"
" case Point(x, y):\n"
" print(f\"Point is not on the diagonal.\")"
msgstr ""
#: ../../whatsnew/3.10.rst:635
msgid "Other Key Features"
msgstr ""
#: ../../whatsnew/3.10.rst:637
msgid "Several other key features:"
msgstr ""
#: ../../whatsnew/3.10.rst:639
msgid ""
"Like unpacking assignments, tuple and list patterns have exactly the same "
"meaning and actually match arbitrary sequences. Technically, the subject "
"must be a sequence. Therefore, an important exception is that patterns don't "
"match iterators. Also, to prevent a common mistake, sequence patterns don't "
"match strings."
msgstr ""
#: ../../whatsnew/3.10.rst:645
msgid ""
"Sequence patterns support wildcards: ``[x, y, *rest]`` and ``(x, y, *rest)`` "
"work similar to wildcards in unpacking assignments. The name after ``*`` "
"may also be ``_``, so ``(x, y, *_)`` matches a sequence of at least two "
"items without binding the remaining items."
msgstr ""
#: ../../whatsnew/3.10.rst:650
msgid ""
"Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the "
"``\"bandwidth\"`` and ``\"latency\"`` values from a dict. Unlike sequence "
"patterns, extra keys are ignored. A wildcard ``**rest`` is also supported. "
"(But ``**_`` would be redundant, so is not allowed.)"
msgstr ""
#: ../../whatsnew/3.10.rst:655
msgid "Subpatterns may be captured using the ``as`` keyword::"
msgstr "サブパターンでは ``as`` キーワードを使用して値を取り込みます::"
#: ../../whatsnew/3.10.rst:657
msgid "case (Point(x1, y1), Point(x2, y2) as p2): ..."
msgstr ""
#: ../../whatsnew/3.10.rst:659
msgid ""
"This binds x1, y1, x2, y2 like you would expect without the ``as`` clause, "
"and p2 to the entire second item of the subject."
msgstr ""
#: ../../whatsnew/3.10.rst:662
msgid ""
"Most literals are compared by equality. However, the singletons ``True``, "
"``False`` and ``None`` are compared by identity."
msgstr ""
#: ../../whatsnew/3.10.rst:665
msgid ""
"Named constants may be used in patterns. These named constants must be "
"dotted names to prevent the constant from being interpreted as a capture "
"variable::"
msgstr ""
#: ../../whatsnew/3.10.rst:669
msgid ""