-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathexpressions.po
More file actions
3989 lines (3406 loc) · 160 KB
/
expressions.po
File metadata and controls
3989 lines (3406 loc) · 160 KB
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 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# python-doc bot, 2025
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-19 14:43+0000\n"
"PO-Revision-Date: 2025-09-16 00:02+0000\n"
"Last-Translator: python-doc bot, 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"
#: ../../reference/expressions.rst:6
msgid "Expressions"
msgstr "式 (expression)"
#: ../../reference/expressions.rst:10
msgid ""
"This chapter explains the meaning of the elements of expressions in Python."
msgstr "この章では、Python の式における個々の要素の意味について解説します。"
#: ../../reference/expressions.rst:12
msgid ""
"**Syntax Notes:** In this and the following chapters, :ref:`grammar notation "
"<notation>` will be used to describe syntax, not lexical analysis."
msgstr ""
#: ../../reference/expressions.rst:16
msgid "When (one alternative of) a syntax rule has the form:"
msgstr ""
#: ../../reference/expressions.rst:21
msgid ""
"and no semantics are given, the semantics of this form of ``name`` are the "
"same as for ``othername``."
msgstr ""
"で記述されていて、この構文特有の意味付け (semantics) が記述されていない場"
"合、 ``name`` の形式をとる構文の意味付けは ``othername`` の意味付けと同じにな"
"ります。"
#: ../../reference/expressions.rst:28
msgid "Arithmetic conversions"
msgstr "算術変換 (arithmetic conversion)"
#: ../../reference/expressions.rst:32
msgid ""
"When a description of an arithmetic operator below uses the phrase \"the "
"numeric arguments are converted to a common real type\", this means that the "
"operator implementation for built-in numeric types works as described in "
"the :ref:`Numeric Types <stdtypes-mixed-arithmetic>` section of the standard "
"library documentation."
msgstr ""
#: ../../reference/expressions.rst:38
msgid ""
"Some additional rules apply for certain operators and non-numeric operands "
"(for example, a string as a left argument to the ``%`` operator). Extensions "
"must define their own conversion behavior."
msgstr ""
#: ../../reference/expressions.rst:46
msgid "Atoms"
msgstr "アトム、原子的要素 (atom)"
#: ../../reference/expressions.rst:50
msgid ""
"Atoms are the most basic elements of expressions. The simplest atoms are :"
"ref:`names <identifiers>` or literals. Forms enclosed in parentheses, "
"brackets or braces are also categorized syntactically as atoms."
msgstr ""
#: ../../reference/expressions.rst:55
msgid "Formally, the syntax for atoms is:"
msgstr ""
#: ../../reference/expressions.rst:80
msgid "Built-in constants"
msgstr ""
#: ../../reference/expressions.rst:82
msgid ""
"The keywords ``True``, ``False``, and ``None`` name :ref:`built-in constants "
"<built-in-consts>`. The token ``...`` names the :py:data:`Ellipsis` constant."
msgstr ""
#: ../../reference/expressions.rst:86
msgid "Evaluation of these atoms yields the corresponding value."
msgstr ""
#: ../../reference/expressions.rst:90
msgid ""
"Several more built-in constants are available as global variables, but only "
"the ones mentioned here are :ref:`keywords <keywords>`. In particular, these "
"names cannot be reassigned or used as attributes:"
msgstr ""
#: ../../reference/expressions.rst:94
msgid ""
">>> False = 123\n"
" File \"<input>\", line 1\n"
" False = 123\n"
" ^^^^^\n"
"SyntaxError: cannot assign to False"
msgstr ""
#: ../../reference/expressions.rst:105
msgid "Identifiers (Names)"
msgstr "識別子 (identifier、または名前 (name))"
#: ../../reference/expressions.rst:109
msgid ""
"An identifier occurring as an atom is a name. See section :ref:"
"`identifiers` for lexical definition and section :ref:`naming` for "
"documentation of naming and binding."
msgstr ""
"アトムの形になっている識別子 (identifier) は名前 (name) です。字句定義につい"
"ては :ref:`identifiers` 節を、名前付けや束縛については :ref:`naming` 節を参照"
"してください。"
#: ../../reference/expressions.rst:115
msgid ""
"When the name is bound to an object, evaluation of the atom yields that "
"object. When a name is not bound, an attempt to evaluate it raises a :exc:"
"`NameError` exception."
msgstr ""
"名前があるオブジェクトに束縛されている場合、名前 atom を評価するとそのオブ"
"ジェクトになります。名前が束縛されていない場合、 atom を評価しようとすると :"
"exc:`NameError` 例外を送出します。"
#: ../../reference/expressions.rst:126
msgid "Private name mangling"
msgstr ""
#: ../../reference/expressions.rst:128
msgid ""
"When an identifier that textually occurs in a class definition begins with "
"two or more underscore characters and does not end in two or more "
"underscores, it is considered a :dfn:`private name` of that class."
msgstr ""
#: ../../reference/expressions.rst:134
msgid "The :ref:`class specifications <class>`."
msgstr ""
#: ../../reference/expressions.rst:136
msgid ""
"More precisely, private names are transformed to a longer form before code "
"is generated for them. If the transformed name is longer than 255 "
"characters, implementation-defined truncation may happen."
msgstr ""
#: ../../reference/expressions.rst:140
msgid ""
"The transformation is independent of the syntactical context in which the "
"identifier is used but only the following private identifiers are mangled:"
msgstr ""
#: ../../reference/expressions.rst:143
msgid ""
"Any name used as the name of a variable that is assigned or read or any name "
"of an attribute being accessed."
msgstr ""
#: ../../reference/expressions.rst:146
msgid ""
"The :attr:`~definition.__name__` attribute of nested functions, classes, and "
"type aliases is however not mangled."
msgstr ""
#: ../../reference/expressions.rst:149
msgid ""
"The name of imported modules, e.g., ``__spam`` in ``import __spam``. If the "
"module is part of a package (i.e., its name contains a dot), the name is "
"*not* mangled, e.g., the ``__foo`` in ``import __foo.bar`` is not mangled."
msgstr ""
#: ../../reference/expressions.rst:154
msgid ""
"The name of an imported member, e.g., ``__f`` in ``from spam import __f``."
msgstr ""
#: ../../reference/expressions.rst:156
msgid "The transformation rule is defined as follows:"
msgstr ""
#: ../../reference/expressions.rst:158
msgid ""
"The class name, with leading underscores removed and a single leading "
"underscore inserted, is inserted in front of the identifier, e.g., the "
"identifier ``__spam`` occurring in a class named ``Foo``, ``_Foo`` or "
"``__Foo`` is transformed to ``_Foo__spam``."
msgstr ""
#: ../../reference/expressions.rst:163
msgid ""
"If the class name consists only of underscores, the transformation is the "
"identity, e.g., the identifier ``__spam`` occurring in a class named ``_`` "
"or ``__`` is left as is."
msgstr ""
#: ../../reference/expressions.rst:170
msgid "Literals"
msgstr "リテラル"
#: ../../reference/expressions.rst:174
msgid ""
"A :dfn:`literal` is a textual representation of a value. Python supports "
"numeric, string and bytes literals. :ref:`Format strings <f-strings>` and :"
"ref:`template strings <t-strings>` are treated as string literals."
msgstr ""
#: ../../reference/expressions.rst:179
msgid ""
"Numeric literals consist of a single :token:`NUMBER <python-grammar:NUMBER>` "
"token, which names an integer, floating-point number, or an imaginary "
"number. See the :ref:`numbers` section in Lexical analysis documentation for "
"details."
msgstr ""
#: ../../reference/expressions.rst:183
msgid ""
"String and bytes literals may consist of several tokens. See section :ref:"
"`string-concatenation` for details."
msgstr ""
#: ../../reference/expressions.rst:186
msgid ""
"Note that negative and complex numbers, like ``-3`` or ``3+4.2j``, are "
"syntactically not literals, but :ref:`unary <unary>` or :ref:`binary "
"<binary>` arithmetic operations involving the ``-`` or ``+`` operator."
msgstr ""
#: ../../reference/expressions.rst:191
msgid ""
"Evaluation of a literal yields an object of the given type (:class:`int`, :"
"class:`float`, :class:`complex`, :class:`str`, :class:`bytes`, or :class:"
"`~string.templatelib.Template`) with the given value. The value may be "
"approximated in the case of floating-point and imaginary literals."
msgstr ""
#: ../../reference/expressions.rst:197
msgid "The formal grammar for literals is:"
msgstr ""
#: ../../reference/expressions.rst:210
msgid "Literals and object identity"
msgstr ""
#: ../../reference/expressions.rst:212
msgid ""
"All literals correspond to immutable data types, and hence the object's "
"identity is less important than its value. Multiple evaluations of literals "
"with the same value (either the same occurrence in the program text or a "
"different occurrence) may obtain the same object or a different object with "
"the same value."
msgstr ""
"リテラルは全て変更不能なデータ型に対応します。このため、オブジェクトのアイデ"
"ンティティはオブジェクトの値ほど重要ではありません。同じ値を持つ複数のリテラ"
"ルを評価した場合、(それらのリテラルがプログラムの同じ場所由来のものであって"
"も、そうでなくても) 同じオブジェクトを指しているか、まったく同じ値を持つ別の"
"オブジェクトになります。"
#: ../../reference/expressions.rst:218
msgid "CPython implementation detail"
msgstr ""
#: ../../reference/expressions.rst:220
msgid ""
"For example, in CPython, *small* integers with the same value evaluate to "
"the same object::"
msgstr ""
#: ../../reference/expressions.rst:223
msgid ""
">>> x = 7\n"
">>> y = 7\n"
">>> x is y\n"
"True"
msgstr ""
#: ../../reference/expressions.rst:228
msgid "However, large integers evaluate to different objects::"
msgstr ""
#: ../../reference/expressions.rst:230
msgid ""
">>> x = 123456789\n"
">>> y = 123456789\n"
">>> x is y\n"
"False"
msgstr ""
#: ../../reference/expressions.rst:235
msgid ""
"This behavior may change in future versions of CPython. In particular, the "
"boundary between \"small\" and \"large\" integers has already changed in the "
"past."
msgstr ""
#: ../../reference/expressions.rst:239
msgid ""
"CPython will emit a :py:exc:`SyntaxWarning` when you compare literals using "
"``is``::"
msgstr ""
#: ../../reference/expressions.rst:242
msgid ""
">>> x = 7\n"
">>> x is 7\n"
"<input>:1: SyntaxWarning: \"is\" with 'int' literal. Did you mean \"==\"?\n"
"True"
msgstr ""
#: ../../reference/expressions.rst:247
msgid "See :ref:`faq-identity-with-is` for more information."
msgstr ""
#: ../../reference/expressions.rst:249
msgid ""
":ref:`Template strings <t-strings>` are immutable but may reference mutable "
"objects as :class:`~string.templatelib.Interpolation` values. For the "
"purposes of this section, two t-strings have the \"same value\" if both "
"their structure and the *identity* of the values match."
msgstr ""
#: ../../reference/expressions.rst:256
msgid ""
"Currently, each evaluation of a template string results in a different "
"object."
msgstr ""
#: ../../reference/expressions.rst:263
msgid "String literal concatenation"
msgstr "文字列リテラルの結合 (concatenation)"
#: ../../reference/expressions.rst:265
msgid ""
"Multiple adjacent string or bytes literals, possibly using different quoting "
"conventions, are allowed, and their meaning is the same as their "
"concatenation::"
msgstr ""
#: ../../reference/expressions.rst:269
msgid ""
">>> \"hello\" 'world'\n"
"\"helloworld\""
msgstr ""
#: ../../reference/expressions.rst:272
msgid ""
"This feature is defined at the syntactical level, so it only works with "
"literals. To concatenate string expressions at run time, the '+' operator "
"may be used::"
msgstr ""
#: ../../reference/expressions.rst:275
msgid ""
">>> greeting = \"Hello\"\n"
">>> space = \" \"\n"
">>> name = \"Blaise\"\n"
">>> print(greeting + space + name) # not: print(greeting space name)\n"
"Hello Blaise"
msgstr ""
#: ../../reference/expressions.rst:281
msgid ""
"Literal concatenation can freely mix raw strings, triple-quoted strings, and "
"formatted string literals. For example::"
msgstr ""
#: ../../reference/expressions.rst:285
msgid ""
">>> \"Hello\" r', ' f\"{name}!\"\n"
"\"Hello, Blaise!\""
msgstr ""
#: ../../reference/expressions.rst:288
msgid ""
"This feature can be used to reduce the number of backslashes needed, to "
"split long strings conveniently across long lines, or even to add comments "
"to parts of strings. For example::"
msgstr ""
#: ../../reference/expressions.rst:292
msgid ""
"re.compile(\"[A-Za-z_]\" # letter or underscore\n"
" \"[A-Za-z0-9_]*\" # letter, digit or underscore\n"
" )"
msgstr ""
#: ../../reference/expressions.rst:296
msgid ""
"However, bytes literals may only be combined with other byte literals; not "
"with string literals of any kind. Also, template string literals may only be "
"combined with other template string literals::"
msgstr ""
#: ../../reference/expressions.rst:301
msgid ""
">>> t\"Hello\" t\"{name}!\"\n"
"Template(strings=('Hello', '!'), interpolations=(...))"
msgstr ""
#: ../../reference/expressions.rst:304
msgid "Formally:"
msgstr ""
#: ../../reference/expressions.rst:315
msgid "Parenthesized forms"
msgstr "丸括弧形式 (parenthesized form)"
#: ../../reference/expressions.rst:321
msgid ""
"A parenthesized form is an optional expression list enclosed in parentheses:"
msgstr "丸括弧形式とは、式リストの一形態で、丸括弧で囲ったものです:"
#: ../../reference/expressions.rst:326
msgid ""
"A parenthesized expression list yields whatever that expression list yields: "
"if the list contains at least one comma, it yields a tuple; otherwise, it "
"yields the single expression that makes up the expression list."
msgstr ""
"丸括弧で囲われた式のリストは、個々の式が表現するものになります: リスト内に少"
"なくとも一つのカンマが入っていた場合、タプルになります; そうでない場合、式の"
"リストを構成している単一の式自体の値になります。"
#: ../../reference/expressions.rst:332
msgid ""
"An empty pair of parentheses yields an empty tuple object. Since tuples are "
"immutable, the same rules as for literals apply (i.e., two occurrences of "
"the empty tuple may or may not yield the same object)."
msgstr ""
"中身が空の丸括弧のペアは、空のタプルオブジェクトを表します。\n"
"タプルは変更不能なので、リテラルと同じ規則が適用されます (すなわち、空のタプ"
"ルが二箇所で使われると、それらは同じオブジェクトになることもあるし、ならない"
"こともあります)。"
#: ../../reference/expressions.rst:340
msgid ""
"Note that tuples are not formed by the parentheses, but rather by use of the "
"comma. The exception is the empty tuple, for which parentheses *are* "
"required --- allowing unparenthesized \"nothing\" in expressions would cause "
"ambiguities and allow common typos to pass uncaught."
msgstr ""
"タプルは丸括弧で作成されるのではなく、カンマによって作成されることに注意して"
"ください。例外は空のタプルで、この場合には丸括弧が *必要です* --- 丸括弧のつ"
"かない \"何も記述しない式 (nothing)\" を使えるようにしてしまうと、文法があい"
"まいなものになってしまい、よくあるタイプミスが検出されなくなってしまいます。"
#: ../../reference/expressions.rst:349
msgid "Displays for lists, sets and dictionaries"
msgstr "リスト、集合、辞書の表示"
#: ../../reference/expressions.rst:353
msgid ""
"For constructing a list, a set or a dictionary Python provides special "
"syntax called \"displays\", each of them in two flavors:"
msgstr ""
"リスト、集合、辞書を構築するために、 Python は \"表示 (display)\" と呼ばれる"
"特別な構文を提供していて、次の二種類ずつがあります:"
#: ../../reference/expressions.rst:356
msgid "either the container contents are listed explicitly, or"
msgstr "コンテナの内容を明示的に列挙する"
#: ../../reference/expressions.rst:358
msgid ""
"they are computed via a set of looping and filtering instructions, called a :"
"dfn:`comprehension`."
msgstr ""
":dfn:`内包表記 (comprehension)` と呼ばれる、ループ処理とフィルター処理の組み"
"合わせを用いた計算結果"
#: ../../reference/expressions.rst:366
msgid "Common syntax elements for comprehensions are:"
msgstr "内包表記の共通の構文要素は次の通りです:"
#: ../../reference/expressions.rst:374
msgid ""
"The comprehension consists of a single expression followed by at least one :"
"keyword:`!for` clause and zero or more :keyword:`!for` or :keyword:`!if` "
"clauses. In this case, the elements of the new container are those that "
"would be produced by considering each of the :keyword:`!for` or :keyword:`!"
"if` clauses a block, nesting from left to right, and evaluating the "
"expression to produce an element each time the innermost block is reached."
msgstr ""
"内包表記はまず単一の式、続いて少なくとも 1 個の :keyword:`!for` 節、さらに続"
"いて 0 個以上の :keyword:`!for` 節あるいは :keyword:`!if` 節からなります。\n"
"この場合、各々の :keyword:`!for` 節や :keyword:`!if` 節を、左から右へ深くなっ"
"ていくネストしたブロックとみなし、ネストの最内のブロックに到達するごとに内包"
"表記の先頭にある式を評価した結果が、最終的にできあがるコンテナの各要素になり"
"ます。"
#: ../../reference/expressions.rst:381
msgid ""
"However, aside from the iterable expression in the leftmost :keyword:`!for` "
"clause, the comprehension is executed in a separate implicitly nested scope. "
"This ensures that names assigned to in the target list don't \"leak\" into "
"the enclosing scope."
msgstr ""
"ただし、最も左にある :keyword:`!for` 節のイテラブル式を除いて、内包表記は暗黙"
"的にネストされた個別のスコープで実行されます。\n"
"この仕組みのおかげで、対象のリスト内で代入された名前が外側のスコープに \"漏れ"
"る\" ことはありません。"
#: ../../reference/expressions.rst:385
msgid ""
"The iterable expression in the leftmost :keyword:`!for` clause is evaluated "
"directly in the enclosing scope and then passed as an argument to the "
"implicitly nested scope. Subsequent :keyword:`!for` clauses and any filter "
"condition in the leftmost :keyword:`!for` clause cannot be evaluated in the "
"enclosing scope as they may depend on the values obtained from the leftmost "
"iterable. For example: ``[x*y for x in range(10) for y in range(x, x+10)]``."
msgstr ""
"最も左にある :keyword:`!for` 節のイテラブル式は、それを直接囲んでいるスコープ"
"でそのまま評価され、暗黙的な入れ子のスコープに引数として渡されます。\n"
"後に続く :keyword:`!for` 節と、最も左にある :keyword:`!for` 節のフィルター条"
"件はイテラブル式を直接囲んでいるスコープでは評価できません。というのは、それ"
"らは最も左のイテラブルから得られる値に依存しているかもしれないからです。\n"
"例えば次の通りです: ``[x*y for x in range(10) for y in range(x, x+10)]`` 。"
#: ../../reference/expressions.rst:392
msgid ""
"To ensure the comprehension always results in a container of the appropriate "
"type, ``yield`` and ``yield from`` expressions are prohibited in the "
"implicitly nested scope."
msgstr ""
"内包表記が常に適切な型のコンテナになるのを保証するために、 ``yield`` 式や "
"``yield from`` 式は暗黙的な入れ子のスコープでは禁止されています。"
#: ../../reference/expressions.rst:399
msgid ""
"Since Python 3.6, in an :keyword:`async def` function, an :keyword:`!async "
"for` clause may be used to iterate over a :term:`asynchronous iterator`. A "
"comprehension in an :keyword:`!async def` function may consist of either a :"
"keyword:`!for` or :keyword:`!async for` clause following the leading "
"expression, may contain additional :keyword:`!for` or :keyword:`!async for` "
"clauses, and may also use :keyword:`await` expressions."
msgstr ""
#: ../../reference/expressions.rst:406
msgid ""
"If a comprehension contains :keyword:`!async for` clauses, or if it "
"contains :keyword:`!await` expressions or other asynchronous comprehensions "
"anywhere except the iterable expression in the leftmost :keyword:`!for` "
"clause, it is called an :dfn:`asynchronous comprehension`. An asynchronous "
"comprehension may suspend the execution of the coroutine function in which "
"it appears. See also :pep:`530`."
msgstr ""
#: ../../reference/expressions.rst:413
msgid "Asynchronous comprehensions were introduced."
msgstr "非同期内包表記が導入されました。"
#: ../../reference/expressions.rst:416 ../../reference/expressions.rst:595
msgid "``yield`` and ``yield from`` prohibited in the implicitly nested scope."
msgstr ""
"``yield`` および ``yield from`` は暗黙的な入れ子のスコープでは禁止となりまし"
"た。"
#: ../../reference/expressions.rst:419
msgid ""
"Asynchronous comprehensions are now allowed inside comprehensions in "
"asynchronous functions. Outer comprehensions implicitly become asynchronous."
msgstr ""
#: ../../reference/expressions.rst:428
msgid "List displays"
msgstr "リスト表示"
#: ../../reference/expressions.rst:438
msgid ""
"A list display is a possibly empty series of expressions enclosed in square "
"brackets:"
msgstr ""
"リスト表示は、角括弧で囲われた式の系列です。系列は空の系列であってもかまいま"
"せん:"
#: ../../reference/expressions.rst:444
msgid ""
"A list display yields a new list object, the contents being specified by "
"either a list of expressions or a comprehension. When a comma-separated "
"list of expressions is supplied, its elements are evaluated from left to "
"right and placed into the list object in that order. When a comprehension "
"is supplied, the list is constructed from the elements resulting from the "
"comprehension."
msgstr ""
"リスト表示は、新しいリストオブジェクトを与えます。リストの内容は、式のリスト"
"またはリスト内包表記 (list comprehension) で指定されます。\n"
"カンマで区切られた式のリストが与えられたときは、それらの各要素は左から右へと"
"順に評価され、その順にリスト内に配置されます。\n"
"内包表記が与えられたときは、内包表記の結果の要素でリストが構成されます。"
#: ../../reference/expressions.rst:454
msgid "Set displays"
msgstr "集合表示"
#: ../../reference/expressions.rst:463
msgid ""
"A set display is denoted by curly braces and distinguishable from dictionary "
"displays by the lack of colons separating keys and values:"
msgstr ""
"集合表示は波括弧で表され、キーと値を分けるコロンがないことで辞書表現と区別さ"
"れます:"
#: ../../reference/expressions.rst:469
msgid ""
"A set display yields a new mutable set object, the contents being specified "
"by either a sequence of expressions or a comprehension. When a comma-"
"separated list of expressions is supplied, its elements are evaluated from "
"left to right and added to the set object. When a comprehension is "
"supplied, the set is constructed from the elements resulting from the "
"comprehension."
msgstr ""
"集合表示は、新しいミュータブルな集合オブジェクトを与えます。集合の内容は、式"
"の並びまたは内包表記によって指定されます。\n"
"カンマ区切りの式のリストが与えられたときは、その要素は左から右へ順に評価さ"
"れ、集合オブジェクトに加えられます。\n"
"内包表記が与えられたときは、内包表記の結果の要素で集合が構成されます。"
#: ../../reference/expressions.rst:475
msgid ""
"An empty set cannot be constructed with ``{}``; this literal constructs an "
"empty dictionary."
msgstr "空集合は ``{}`` で構成できません。このリテラルは空の辞書を構成します。"
#: ../../reference/expressions.rst:482
msgid "Dictionary displays"
msgstr "辞書表示"
#: ../../reference/expressions.rst:493
msgid ""
"A dictionary display is a possibly empty series of dict items (key/value "
"pairs) enclosed in curly braces:"
msgstr ""
#: ../../reference/expressions.rst:502
msgid "A dictionary display yields a new dictionary object."
msgstr "辞書表示は、新たな辞書オブジェクトを表します。"
#: ../../reference/expressions.rst:504
msgid ""
"If a comma-separated sequence of dict items is given, they are evaluated "
"from left to right to define the entries of the dictionary: each key object "
"is used as a key into the dictionary to store the corresponding value. This "
"means that you can specify the same key multiple times in the dict item "
"list, and the final dictionary's value for that key will be the last one "
"given."
msgstr ""
#: ../../reference/expressions.rst:514
msgid ""
"A double asterisk ``**`` denotes :dfn:`dictionary unpacking`. Its operand "
"must be a :term:`mapping`. Each mapping item is added to the new "
"dictionary. Later values replace values already set by earlier dict items "
"and earlier dictionary unpackings."
msgstr ""
#: ../../reference/expressions.rst:519
msgid "Unpacking into dictionary displays, originally proposed by :pep:`448`."
msgstr "辞書表示のアンパックは最初に :pep:`448` で提案されました。"
#: ../../reference/expressions.rst:522
msgid ""
"A dict comprehension, in contrast to list and set comprehensions, needs two "
"expressions separated with a colon followed by the usual \"for\" and \"if\" "
"clauses. When the comprehension is run, the resulting key and value elements "
"are inserted in the new dictionary in the order they are produced."
msgstr ""
"辞書内包表記は、リストや集合の内包表記とは対照的に、通常の \"for\" や \"if\" "
"節の前に、コロンで分けられた 2 つの式が必要です。内包表記が起動すると、結果の"
"キーと値の要素が、作られた順に新しい辞書に挿入されます。"
#: ../../reference/expressions.rst:530
msgid ""
"Restrictions on the types of the key values are listed earlier in section :"
"ref:`types`. (To summarize, the key type should be :term:`hashable`, which "
"excludes all mutable objects.) Clashes between duplicate keys are not "
"detected; the last value (textually rightmost in the display) stored for a "
"given key value prevails."
msgstr ""
#: ../../reference/expressions.rst:536
msgid ""
"Prior to Python 3.8, in dict comprehensions, the evaluation order of key and "
"value was not well-defined. In CPython, the value was evaluated before the "
"key. Starting with 3.8, the key is evaluated before the value, as proposed "
"by :pep:`572`."
msgstr ""
"Python 3.8 より前のバージョンでは、辞書内包表記において、キーと値の評価順序は"
"明示されていませんでした。CPython では、値がキーより先に評価されていました。"
"バージョン 3.8 からは :pep:`572` で提案されているように、キーが値より先に評価"
"されます。"
#: ../../reference/expressions.rst:546
msgid "Generator expressions"
msgstr "ジェネレータ式"
#: ../../reference/expressions.rst:553
msgid "A generator expression is a compact generator notation in parentheses:"
msgstr ""
"ジェネレータ式 (generator expression) とは、丸括弧を使ったコンパクトなジェネ"
"レータ表記法です:"
#: ../../reference/expressions.rst:558
msgid ""
"A generator expression yields a new generator object. Its syntax is the "
"same as for comprehensions, except that it is enclosed in parentheses "
"instead of brackets or curly braces."
msgstr ""
"ジェネレータ式は新たなジェネレータオブジェクトを与えます。この構文は内包表記"
"とほぼ同じですが、角括弧や波括弧ではなく、丸括弧で囲まれます。"
#: ../../reference/expressions.rst:562
msgid ""
"Variables used in the generator expression are evaluated lazily when the :"
"meth:`~generator.__next__` method is called for the generator object (in the "
"same fashion as normal generators). However, the iterable expression in the "
"leftmost :keyword:`!for` clause is immediately evaluated, and the :term:"
"`iterator` is immediately created for that iterable, so that an error "
"produced while creating the iterator will be emitted at the point where the "
"generator expression is defined, rather than at the point where the first "
"value is retrieved. Subsequent :keyword:`!for` clauses and any filter "
"condition in the leftmost :keyword:`!for` clause cannot be evaluated in the "
"enclosing scope as they may depend on the values obtained from the leftmost "
"iterable. For example: ``(x*y for x in range(10) for y in range(x, x+10))``."
msgstr ""
#: ../../reference/expressions.rst:574
msgid ""
"The parentheses can be omitted on calls with only one argument. See "
"section :ref:`calls` for details."
msgstr ""
"関数の唯一の引数として渡す場合には、丸括弧を省略できます。詳しくは :ref:"
"`calls` 節を参照してください。"
#: ../../reference/expressions.rst:577
msgid ""
"To avoid interfering with the expected operation of the generator expression "
"itself, ``yield`` and ``yield from`` expressions are prohibited in the "
"implicitly defined generator."
msgstr ""
"ジェネレータ式自身の期待される動作を妨げないために、 ``yield`` 式や ``yield "
"from`` 式は暗黙的に定義されたジェネレータでは禁止されています。"
#: ../../reference/expressions.rst:581
msgid ""
"If a generator expression contains either :keyword:`!async for` clauses or :"
"keyword:`await` expressions it is called an :dfn:`asynchronous generator "
"expression`. An asynchronous generator expression returns a new "
"asynchronous generator object, which is an asynchronous iterator (see :ref:"
"`async-iterators`)."
msgstr ""
"ジェネレータ式が :keyword:`!async for` 節あるいは :keyword:`await` 式を含んで"
"いる場合、それは :dfn:`非同期ジェネレータ式` と呼ばれます。\n"
"非同期ジェネレータ式は、非同期イテレータである新しい非同期ジェネレータオブ"
"ジェクトを返します (:ref:`async-iterators` を参照してください)。"
#: ../../reference/expressions.rst:587
msgid "Asynchronous generator expressions were introduced."
msgstr "非同期ジェネレータ式が導入されました。"
#: ../../reference/expressions.rst:590
msgid ""
"Prior to Python 3.7, asynchronous generator expressions could only appear "
"in :keyword:`async def` coroutines. Starting with 3.7, any function can use "
"asynchronous generator expressions."
msgstr ""
"Python 3.7 より前では、非同期ジェネレータ式は :keyword:`async def` コルーチン"
"でしか使えませんでした。\n"
"3.7 からは、任意の関数で非同期ジェネレータ式が使えるようになりました。"
#: ../../reference/expressions.rst:602
msgid "Yield expressions"
msgstr "Yield 式"
#: ../../reference/expressions.rst:615
msgid ""
"The yield expression is used when defining a :term:`generator` function or "
"an :term:`asynchronous generator` function and thus can only be used in the "
"body of a function definition. Using a yield expression in a function's "
"body causes that function to be a generator function, and using it in an :"
"keyword:`async def` function's body causes that coroutine function to be an "
"asynchronous generator function. For example::"
msgstr ""
"yield 式は :term:`ジェネレータ <generator>` 関数や :term:`非同期ジェネレータ "
"<asynchronous generator>` 関数を定義するときに使われます。従って、関数定義の"
"本体でのみ使えます。\n"
"関数の本体で yield 式 を使用するとその関数はジェネレータ関数になり、 :"
"keyword:`async def` 関数の本体で使用するとそのコルーチン関数は非同期ジェネ"
"レータ関数になります。\n"
"例えば次のようになります::"
#: ../../reference/expressions.rst:622
msgid ""
"def gen(): # defines a generator function\n"
" yield 123\n"
"\n"
"async def agen(): # defines an asynchronous generator function\n"
" yield 123"
msgstr ""
#: ../../reference/expressions.rst:628
msgid ""
"Due to their side effects on the containing scope, ``yield`` expressions are "
"not permitted as part of the implicitly defined scopes used to implement "
"comprehensions and generator expressions."
msgstr ""
"含まれているスコープの副作用のため、 ``yield`` 式は暗黙的に定義されたスコープ"
"の一部として内包表記やジェネレータ式を実装するのに使うことは許可されていませ"
"ん。 "
#: ../../reference/expressions.rst:632
msgid ""
"Yield expressions prohibited in the implicitly nested scopes used to "
"implement comprehensions and generator expressions."
msgstr ""
"yield 式は、暗黙的な入れ子のスコープで内包表記やジェネレータ式を実装するため"
"の使用が禁止になりました。"
#: ../../reference/expressions.rst:636
msgid ""
"Generator functions are described below, while asynchronous generator "
"functions are described separately in section :ref:`asynchronous-generator-"
"functions`."
msgstr ""
"ジェネレータ関数についてはすぐ下で説明されています。非同期ジェネレータ関数"
"は、 :ref:`asynchronous-generator-functions` 節に分けて説明されています。"
#: ../../reference/expressions.rst:640
msgid ""
"When a generator function is called, it returns an iterator known as a "
"generator. That generator then controls the execution of the generator "
"function. The execution starts when one of the generator's methods is "
"called. At that time, the execution proceeds to the first yield expression, "
"where it is suspended again, returning the value of :token:`~python-grammar:"
"yield_list` to the generator's caller, or ``None`` if :token:`~python-"
"grammar:yield_list` is omitted. By suspended, we mean that all local state "
"is retained, including the current bindings of local variables, the "
"instruction pointer, the internal evaluation stack, and the state of any "
"exception handling. When the execution is resumed by calling one of the "
"generator's methods, the function can proceed exactly as if the yield "
"expression were just another external call. The value of the yield "
"expression after resuming depends on the method which resumed the "
"execution. If :meth:`~generator.__next__` is used (typically via either a :"
"keyword:`for` or the :func:`next` builtin) then the result is :const:"
"`None`. Otherwise, if :meth:`~generator.send` is used, then the result will "
"be the value passed in to that method."
msgstr ""
#: ../../reference/expressions.rst:660
msgid ""
"All of this makes generator functions quite similar to coroutines; they "
"yield multiple times, they have more than one entry point and their "
"execution can be suspended. The only difference is that a generator "
"function cannot control where the execution should continue after it yields; "
"the control is always transferred to the generator's caller."
msgstr ""
"これまで説明した内容から、ジェネレータ関数はコルーチンにとてもよく似ていま"
"す。ジェネレータ関数は何度も生成し、1つ以上のエントリポイントを持ち、その実行"
"は一時停止されます。ジェネレータ関数は yield した後で実行の継続を制御できない"
"ことが唯一の違いです。その制御は常にジェネレータの呼び出し元へ移されます。"
#: ../../reference/expressions.rst:666
msgid ""
"Yield expressions are allowed anywhere in a :keyword:`try` construct. If "
"the generator is not resumed before it is finalized (by reaching a zero "
"reference count or by being garbage collected), the generator-iterator's :"
"meth:`~generator.close` method will be called, allowing any pending :keyword:"
"`finally` clauses to execute."
msgstr ""
"yield 式は :keyword:`try` 構造内で使用できます。ジェネレータの (参照カウント"
"がゼロに達するか、ガベージコレクションによる) 完了前に再開されない場合、ジェ"
"ネレータ-イテレータの :meth:`~generator.close` メソッドが呼ばれ、:keyword:"
"`finally` 節が実行されます。"
#: ../../reference/expressions.rst:675
msgid ""
"When ``yield from <expr>`` is used, the supplied expression must be an "
"iterable. The values produced by iterating that iterable are passed directly "
"to the caller of the current generator's methods. Any values passed in with :"
"meth:`~generator.send` and any exceptions passed in with :meth:`~generator."
"throw` are passed to the underlying iterator if it has the appropriate "
"methods. If this is not the case, then :meth:`~generator.send` will raise :"
"exc:`AttributeError` or :exc:`TypeError`, while :meth:`~generator.throw` "
"will just raise the passed in exception immediately."
msgstr ""
"``yield from <expr>`` を使用した場合、与えられた式はイテラブルでなければなり"
"ません。そのイテラブルをイテレートすることで生成された値は現在のジェネレータ"
"のメソッドの呼び出し元へ直接渡されます。:meth:`~generator.send` で渡されたあ"
"らゆる値と :meth:`~generator.throw` で渡されたあらゆる例外は根底のイテレータ"
"に適切なメソッドがあれば渡されます。適切なメソッドがない場合、:meth:"
"`~generator.send` は :exc:`AttributeError` か :exc:`TypeError` を、:meth:"
"`~generator.throw` は渡された例外を即座に送出します。"
#: ../../reference/expressions.rst:684
msgid ""
"When the underlying iterator is complete, the :attr:`~StopIteration.value` "
"attribute of the raised :exc:`StopIteration` instance becomes the value of "
"the yield expression. It can be either set explicitly when raising :exc:"
"`StopIteration`, or automatically when the subiterator is a generator (by "
"returning a value from the subgenerator)."
msgstr ""
"根底のイテレータの完了時、引き起こされた :exc:`StopIteration` インスタンス"
"の :attr:`~StopIteration.value` 属性はその yield 式の値となります。\n"
":exc:`StopIteration` を起こす際に明示的にセットされるか、サブイテレータがジェ"
"ネレータであれば (サブイテレータからかえる値で) 自動的にセットされるかのどち"
"らかです。"
#: ../../reference/expressions.rst:690
msgid "Added ``yield from <expr>`` to delegate control flow to a subiterator."
msgstr ""
"サブイテレータに制御フローを委譲するために ``yield from <expr>`` が追加されま"
"した。"
#: ../../reference/expressions.rst:693
msgid ""
"The parentheses may be omitted when the yield expression is the sole "
"expression on the right hand side of an assignment statement."
msgstr "yield 式が代入文の単独の右辺式であるとき、括弧は省略できます。"
#: ../../reference/expressions.rst:698
msgid ":pep:`255` - Simple Generators"
msgstr ":pep:`255` - 単純なジェネレータ"
#: ../../reference/expressions.rst:699
msgid ""
"The proposal for adding generators and the :keyword:`yield` statement to "
"Python."
msgstr "Python へのジェネレータと :keyword:`yield` 文の導入提案。"
#: ../../reference/expressions.rst:701
msgid ":pep:`342` - Coroutines via Enhanced Generators"
msgstr ":pep:`342` - 拡張されたジェネレータを用いたコルーチン"
#: ../../reference/expressions.rst:702
msgid ""
"The proposal to enhance the API and syntax of generators, making them usable "
"as simple coroutines."
msgstr ""
"シンプルなコルーチンとして利用できるように、ジェネレータの構文と API を拡張す"
"る提案。"
#: ../../reference/expressions.rst:705
msgid ":pep:`380` - Syntax for Delegating to a Subgenerator"
msgstr ":pep:`380` - サブジェネレータへの委譲構文"
#: ../../reference/expressions.rst:706
msgid ""
"The proposal to introduce the :token:`~python-grammar:yield_from` syntax, "
"making delegation to subgenerators easy."
msgstr ""
"サブジェネレータの委譲を簡単にするための、 :token:`~python-grammar:"
"yield_from` 構文の導入提案。"
#: ../../reference/expressions.rst:709
msgid ":pep:`525` - Asynchronous Generators"
msgstr ":pep:`525` - 非同期ジェネレータ"
#: ../../reference/expressions.rst:710
msgid ""
"The proposal that expanded on :pep:`492` by adding generator capabilities to "
"coroutine functions."
msgstr ""
"コルーチン関数へのジェネレータの実装能力の追加による :pep:`492` の拡張提案。"
#: ../../reference/expressions.rst:717
msgid "Generator-iterator methods"
msgstr "ジェネレータ-イテレータメソッド"
#: ../../reference/expressions.rst:719
msgid ""
"This subsection describes the methods of a generator iterator. They can be "
"used to control the execution of a generator function."
msgstr ""
"この説ではジェネレータイテレータのメソッドについて説明します。これらはジェネ"
"レータ関数の実行制御に使用できます。"
#: ../../reference/expressions.rst:722
msgid ""
"Note that calling any of the generator methods below when the generator is "
"already executing raises a :exc:`ValueError` exception."
msgstr ""
"以下のジェネレータメソッドの呼び出しは、ジェネレータが既に実行中の場合 :exc:"
"`ValueError` 例外を送出する点に注意してください。"
#: ../../reference/expressions.rst:730
msgid ""