-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathcontextlib.po
1094 lines (969 loc) · 54.6 KB
/
contextlib.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-2022, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Rafael Fontenelle <[email protected]>, 2022
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-30 14:59+0000\n"
"PO-Revision-Date: 2022-11-05 17:21+0000\n"
"Last-Translator: Rafael Fontenelle <[email protected]>, 2022\n"
"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/"
"ja/)\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/contextlib.rst:2
msgid ""
":mod:`!contextlib` --- Utilities for :keyword:`!with`\\ -statement contexts"
msgstr ":mod:`!contextlib` --- :keyword:`!with` 文コンテキスト用ユーティリティ"
#: ../../library/contextlib.rst:7
msgid "**Source code:** :source:`Lib/contextlib.py`"
msgstr "**ソースコード:** :source:`Lib/contextlib.py`"
#: ../../library/contextlib.rst:11
msgid ""
"This module provides utilities for common tasks involving the :keyword:"
"`with` statement. For more information see also :ref:`typecontextmanager` "
"and :ref:`context-managers`."
msgstr ""
"このモジュールは :keyword:`with` 文に関わる一般的なタスクのためのユーティリ"
"ティを提供します。詳しい情報は、 :ref:`typecontextmanager` と :ref:`context-"
"managers` を参照してください。"
#: ../../library/contextlib.rst:17
msgid "Utilities"
msgstr "ユーティリティ"
#: ../../library/contextlib.rst:19
msgid "Functions and classes provided:"
msgstr "以下の関数とクラスを提供しています:"
#: ../../library/contextlib.rst:23
msgid ""
"An :term:`abstract base class` for classes that implement :meth:`object."
"__enter__` and :meth:`object.__exit__`. A default implementation for :meth:"
"`object.__enter__` is provided which returns ``self`` while :meth:`object."
"__exit__` is an abstract method which by default returns ``None``. See also "
"the definition of :ref:`typecontextmanager`."
msgstr ""
":meth:`object.__enter__` と :meth:`object.__exit__` の2つのメソッドを実装した"
"抽象基底クラス (:term:`abstract base class`) です。 :meth:`object.__enter__` "
"は ``self`` を返すデフォルトの実装が提供されるいっぽう、 :meth:`object."
"__exit__` はデフォルトで ``None`` を返す抽象メソッドです。 :ref:"
"`typecontextmanager` の定義も参照してください。"
#: ../../library/contextlib.rst:34
msgid ""
"An :term:`abstract base class` for classes that implement :meth:`object."
"__aenter__` and :meth:`object.__aexit__`. A default implementation for :meth:"
"`object.__aenter__` is provided which returns ``self`` while :meth:`object."
"__aexit__` is an abstract method which by default returns ``None``. See also "
"the definition of :ref:`async-context-managers`."
msgstr ""
":meth:`object.__aenter__` と :meth:`object.__aexit__` の2つのメソッドを実装す"
"るクラスのための抽象基底クラス (:term:`abstract base class`) です。 :meth:"
"`object.__aenter__` は ``self`` を返すデフォルト実装が提供されるいっぽう、 :"
"meth:`object.__aexit__` はデフォルトで ``None`` を返す抽象メソッドです。 :"
"ref:`async-context-managers` の定義も参照してください。"
#: ../../library/contextlib.rst:46
msgid ""
"This function is a :term:`decorator` that can be used to define a factory "
"function for :keyword:`with` statement context managers, without needing to "
"create a class or separate :meth:`__enter__` and :meth:`__exit__` methods."
msgstr ""
"この関数は :keyword:`with` 文コンテキストマネージャのファクトリ関数を定義する"
"ために利用できる :term:`デコレータ <decorator>` です。新しいクラスや :meth:"
"`__enter__` と :meth:`__exit__` メソッドを別々に定義しなくても、ファクトリ関"
"数を定義することができます。"
#: ../../library/contextlib.rst:50
msgid ""
"While many objects natively support use in with statements, sometimes a "
"resource needs to be managed that isn't a context manager in its own right, "
"and doesn't implement a ``close()`` method for use with ``contextlib."
"closing``"
msgstr ""
"多くのオブジェクトが with 文の仕様を固有にサポートしていますが、コンテキスト"
"マネージャの権限に属さず、 ``close()`` メソッドを実装していないために "
"``contextlib.closing`` の利用もできないリソースを管理する必要があることがあり"
"ます。"
#: ../../library/contextlib.rst:54
msgid ""
"An abstract example would be the following to ensure correct resource "
"management::"
msgstr ""
"リソースを正しく管理するよう保証する抽象的な例は以下のようなものでしょう::"
#: ../../library/contextlib.rst:69
msgid "The function can then be used like this::"
msgstr "このとき、関数は次のように使うことができます::"
#: ../../library/contextlib.rst:75
msgid ""
"The function being decorated must return a :term:`generator`-iterator when "
"called. This iterator must yield exactly one value, which will be bound to "
"the targets in the :keyword:`with` statement's :keyword:`!as` clause, if any."
msgstr ""
"デコレート対象の関数は呼び出されたときに :term:`ジェネレータ <generator>`-イ"
"テレータを返す必要があります。このイテレータは必ず値を1つ yield しなければな"
"りません。 :keyword:`with` 文の :keyword:`!as` 節が存在するなら、その値は as "
"節のターゲットへ束縛されることになります。"
#: ../../library/contextlib.rst:79
msgid ""
"At the point where the generator yields, the block nested in the :keyword:"
"`with` statement is executed. The generator is then resumed after the block "
"is exited. If an unhandled exception occurs in the block, it is reraised "
"inside the generator at the point where the yield occurred. Thus, you can "
"use a :keyword:`try`...\\ :keyword:`except`...\\ :keyword:`finally` "
"statement to trap the error (if any), or ensure that some cleanup takes "
"place. If an exception is trapped merely in order to log it or to perform "
"some action (rather than to suppress it entirely), the generator must "
"reraise that exception. Otherwise the generator context manager will "
"indicate to the :keyword:`!with` statement that the exception has been "
"handled, and execution will resume with the statement immediately following "
"the :keyword:`!with` statement."
msgstr ""
"ジェネレータが yield を実行した箇所で :keyword:`with` 文のネストされたブロッ"
"クが実行されます。ブロックから抜けた後でジェネレータは再開されます。ブロック"
"内で処理されない例外が発生した場合は、ジェネレータ内部の yield を実行した箇所"
"で例外が再送出されます。なので、(もしあれば) エラーを捕捉したり、クリーンアッ"
"プ処理を確実に実行したりするために、:keyword:`try`...\\ :keyword:`except`..."
"\\ :keyword:`finally` 構文を使用できます。例外を捕捉する目的が、(完全に例外を"
"抑制してしまうのではなく) 単に例外のログをとるため、もしくはあるアクションを"
"実行するためなら、ジェネレータはその例外を再送出しなければなりません。例外を"
"再送出しない場合、ジェネレータのコンテキストマネージャは :keyword:`!with` 文"
"に対して例外が処理されたことを示し、:keyword:`!with` 文の直後の文から実行を再"
"開します。"
#: ../../library/contextlib.rst:91
msgid ""
":func:`contextmanager` uses :class:`ContextDecorator` so the context "
"managers it creates can be used as decorators as well as in :keyword:`with` "
"statements. When used as a decorator, a new generator instance is implicitly "
"created on each function call (this allows the otherwise \"one-shot\" "
"context managers created by :func:`contextmanager` to meet the requirement "
"that context managers support multiple invocations in order to be used as "
"decorators)."
msgstr ""
":func:`contextmanager` は :class:`ContextDecorator` を使っているので、 :func:"
"`contextmanager` で作ったコンテキストマネージャは :keyword:`with` 文だけでな"
"くデコレータとしても利用できます。デコレーターとして利用された場合、新しい "
"generator インスタンスが関数呼び出しのたびに暗黙に生成されます (このことに"
"よって、 :func:`contextmanager` によって作られたなにがしか「単発」コンテキス"
"トマネージャを、コンテキストマネージャがデコレータとして使われるためには多重"
"に呼び出されることをサポートする必要がある、という要件に合致させることが出来"
"ます。)"
#: ../../library/contextlib.rst:98
msgid "Use of :class:`ContextDecorator`."
msgstr ":class:`ContextDecorator` の使用。"
#: ../../library/contextlib.rst:104
msgid ""
"Similar to :func:`~contextlib.contextmanager`, but creates an :ref:"
"`asynchronous context manager <async-context-managers>`."
msgstr ""
":func:`~contextlib.contextmanager` と似ていますが、 :ref:`非同期コンテキスト"
"マネージャ (asynchronous context manager) <async-context-managers>` を生成し"
"ます。"
#: ../../library/contextlib.rst:107
msgid ""
"This function is a :term:`decorator` that can be used to define a factory "
"function for :keyword:`async with` statement asynchronous context managers, "
"without needing to create a class or separate :meth:`__aenter__` and :meth:"
"`__aexit__` methods. It must be applied to an :term:`asynchronous generator` "
"function."
msgstr ""
"この関数は :keyword:`async with` 文のための非同期コンテキストマネージャのファ"
"クトリ関数を定義するために利用できるデコレータ (:term:`decorator`) です。新し"
"いクラスや :meth:`__aenter__` と :meth:`__aexit__` メソッドを個別に定義する"
"必要はありません。このデコレータは非同期ジェネレータ (:term:`asynchronous "
"generator`) 関数に適用しなければなりません。"
#: ../../library/contextlib.rst:113
msgid "A simple example::"
msgstr "簡単な例::"
#: ../../library/contextlib.rst:131
msgid ""
"Context managers defined with :func:`asynccontextmanager` can be used either "
"as decorators or with :keyword:`async with` statements::"
msgstr ""
":func:`asynccontextmanager` とともに定義されたコンテキストマネージャは、デコ"
"レータとして使うことも :keyword:`async with` 文と組み合わせて使うこともできま"
"す::"
#: ../../library/contextlib.rst:149
msgid ""
"When used as a decorator, a new generator instance is implicitly created on "
"each function call. This allows the otherwise \"one-shot\" context managers "
"created by :func:`asynccontextmanager` to meet the requirement that context "
"managers support multiple invocations in order to be used as decorators."
msgstr ""
"デコレータとして使われた場合は、各関数呼び出しに対して暗黙のうちに新しいジェ"
"ネレータインスタンスが生成されます。これにより、 :func:`asynccontextmanager` "
"で生成された単回使用のコンテキストマネージャが複数回呼び出し可能となり、コン"
"テキストマネージャをデコレータとして使うことができるための要件を満たすように"
"することができます。"
#: ../../library/contextlib.rst:154
msgid ""
"Async context managers created with :func:`asynccontextmanager` can be used "
"as decorators."
msgstr ""
":func:`asynccontextmanager` により生成された非同期コンテキストマネージャをデ"
"コレータとして使うことができるようになりました。"
#: ../../library/contextlib.rst:161
msgid ""
"Return a context manager that closes *thing* upon completion of the block. "
"This is basically equivalent to::"
msgstr ""
"ブロックの完了時に *thing* を close するコンテキストマネージャを返します。こ"
"れは基本的に以下と等価です::"
#: ../../library/contextlib.rst:173
msgid "And lets you write code like this::"
msgstr ""
"そして、明示的に ``page`` を close する必要なしに、次のように書くことができま"
"す::"
#: ../../library/contextlib.rst:182
msgid ""
"without needing to explicitly close ``page``. Even if an error occurs, "
"``page.close()`` will be called when the :keyword:`with` block is exited."
msgstr ""
"``page`` を明示的に close する必要は無く、エラーが発生した場合でも、 :"
"keyword:`with` ブロックを出るときに ``page.close()`` が呼ばれます。"
#: ../../library/contextlib.rst:188
msgid ""
"Return an async context manager that calls the ``aclose()`` method of "
"*thing* upon completion of the block. This is basically equivalent to::"
msgstr ""
"ブロックの完了時に *thing* の ``aclose()`` メソッドを呼び出すような非同期コン"
"テキストマネージャを返します。これは基本的に以下と等価です::"
#: ../../library/contextlib.rst:200
msgid ""
"Significantly, ``aclosing()`` supports deterministic cleanup of async "
"generators when they happen to exit early by :keyword:`break` or an "
"exception. For example::"
msgstr ""
"重要なことは、たとえば次の例のように :keyword:`break` や例外によって早期にブ"
"ロックが終了した場合に、 ``aclosing()`` は非同期ジェネレータの決定論的なク"
"リーンアップをサポートすることです::"
#: ../../library/contextlib.rst:211
msgid ""
"This pattern ensures that the generator's async exit code is executed in the "
"same context as its iterations (so that exceptions and context variables "
"work as expected, and the exit code isn't run after the lifetime of some "
"task it depends on)."
msgstr ""
"このパターンは、ジェネレータの非同期な終了のコードがイテレーション処理と同じ"
"コンテキストの中で実行されることを保証します (すなわち例外とコンテキスト変数"
"は期待通りに動作し、またジェネレータが依存するタスクの寿命が尽きたあとに終了"
"のコードが実行されることもありません)。"
#: ../../library/contextlib.rst:223
msgid ""
"Return a context manager that returns *enter_result* from ``__enter__``, but "
"otherwise does nothing. It is intended to be used as a stand-in for an "
"optional context manager, for example::"
msgstr ""
"*enter_result* を ``__enter__`` メソッドが返すだけで、その他は何もしないコン"
"テキストマネージャを返します。たとえば以下のように、ある機能を持った別のコン"
"テキストマネージャに対する、選択可能な代役として使われることが意図されていま"
"す::"
#: ../../library/contextlib.rst:237
msgid "An example using *enter_result*::"
msgstr "*enter_result* を使った例です::"
#: ../../library/contextlib.rst:250
msgid ""
"It can also be used as a stand-in for :ref:`asynchronous context managers "
"<async-context-managers>`::"
msgstr ""
":ref:`非同期コンテキストマネージャ <async-context-managers>` の代役として使う"
"こともできます::"
#: ../../library/contextlib.rst:266
msgid ":term:`asynchronous context manager` support was added."
msgstr ""
"非同期コンテキストマネージャ (:term:`asynchronous context manager`) のサポー"
"トが追加されました。"
#: ../../library/contextlib.rst:273
msgid ""
"Return a context manager that suppresses any of the specified exceptions if "
"they occur in the body of a :keyword:`!with` statement and then resumes "
"execution with the first statement following the end of the :keyword:`!with` "
"statement."
msgstr ""
":keyword:`!with` 文の内部で指定された例外の発生を抑えるコンテキストマネージャ"
"を返します。 :keyword:`!with` 文の後に続く最初の文から処理が再開されます。"
#: ../../library/contextlib.rst:278
msgid ""
"As with any other mechanism that completely suppresses exceptions, this "
"context manager should be used only to cover very specific errors where "
"silently continuing with program execution is known to be the right thing to "
"do."
msgstr ""
"ほかの完全に例外を抑制するメカニズム同様、このコンテキストマネージャは、黙っ"
"てプログラム実行を続けることが正しいことであるとわかっている、非常に限定的な"
"エラーをカバーする以上の使い方はしてはいけません。"
#: ../../library/contextlib.rst:283
msgid "For example::"
msgstr "例えば::"
#: ../../library/contextlib.rst:293
msgid "This code is equivalent to::"
msgstr "これは以下と等価です::"
#: ../../library/contextlib.rst:305 ../../library/contextlib.rst:345
#: ../../library/contextlib.rst:355
msgid "This context manager is :ref:`reentrant <reentrant-cms>`."
msgstr ""
"このコンテキストマネージャは :ref:`再入可能(リエントラント) <reentrant-cms>` "
"です。"
#: ../../library/contextlib.rst:312
msgid ""
"Context manager for temporarily redirecting :data:`sys.stdout` to another "
"file or file-like object."
msgstr ""
":data:`sys.stdout` を一時的に別のファイルまたは file-like オブジェクトにリダ"
"イレクトするコンテキストマネージャです。"
#: ../../library/contextlib.rst:315
msgid ""
"This tool adds flexibility to existing functions or classes whose output is "
"hardwired to stdout."
msgstr ""
"このツールは、出力先が標準出力 (stdout) に固定されている既存の関数やクラスに"
"出力先の柔軟性を追加します。"
#: ../../library/contextlib.rst:318
msgid ""
"For example, the output of :func:`help` normally is sent to *sys.stdout*. "
"You can capture that output in a string by redirecting the output to an :"
"class:`io.StringIO` object. The replacement stream is returned from the "
"``__enter__`` method and so is available as the target of the :keyword:"
"`with` statement::"
msgstr ""
"たとえば、 :func:`help` の出力は通常標準出力 (*sys.stdout*) に送られます。出"
"力される文字列を :class:`io.StringIO` オブジェクトにリダイレクトすることに"
"よって捕捉することができます。代替の出力ストリームは ``__enter__`` メソッドに"
"よって返されるので、 :keyword:`with` 文のターゲットとして利用可能です::"
#: ../../library/contextlib.rst:328
msgid ""
"To send the output of :func:`help` to a file on disk, redirect the output to "
"a regular file::"
msgstr ""
":func:`help` の出力をディスク上のファイルに送るためには、出力を通常のファイル"
"にリダイレクトします::"
#: ../../library/contextlib.rst:335
msgid "To send the output of :func:`help` to *sys.stderr*::"
msgstr ""
":func:`help` の出力を標準エラー出力 (*sys.stderr*) に送るには以下のようにしま"
"す::"
#: ../../library/contextlib.rst:340
msgid ""
"Note that the global side effect on :data:`sys.stdout` means that this "
"context manager is not suitable for use in library code and most threaded "
"applications. It also has no effect on the output of subprocesses. However, "
"it is still a useful approach for many utility scripts."
msgstr ""
":data:`sys.stdout` のシステム全体にわたる副作用により、このコンテキストマネー"
"ジャはライブラリコードやマルチスレッドアプリケーションでの使用には適していま"
"せん。また、サブプロセスの出力に対しても効果がありません。そのような制限はあ"
"りますが、それでも多くのユーティリティスクリプトに対して有用なアプローチで"
"す。"
#: ../../library/contextlib.rst:352
msgid ""
"Similar to :func:`~contextlib.redirect_stdout` but redirecting :data:`sys."
"stderr` to another file or file-like object."
msgstr ""
":func:`~contextlib.redirect_stdout` と同じですが、標準エラー出力 (:data:`sys."
"stderr`) を別のファイルや file-like オブジェクトにリダイレクトします。"
#: ../../library/contextlib.rst:362
msgid ""
"A base class that enables a context manager to also be used as a decorator."
msgstr ""
"コンテキストマネージャをデコレータとしても使用できるようにする基底クラスで"
"す。"
#: ../../library/contextlib.rst:364
msgid ""
"Context managers inheriting from ``ContextDecorator`` have to implement "
"``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional "
"exception handling even when used as a decorator."
msgstr ""
"``ContextDecorator`` から継承したコンテキストマネージャは、通常のコンテキスト"
"マネージャーと同じく ``__enter__`` および ``__exit__`` を実装する必要がありま"
"す。``__exit__`` はデコレータとして使用された場合でも例外をオプションの引数と"
"して受け取ります。"
#: ../../library/contextlib.rst:368
msgid ""
"``ContextDecorator`` is used by :func:`contextmanager`, so you get this "
"functionality automatically."
msgstr ""
":func:`contextmanager` は ``ContextDecorator`` を利用しているので、自動的にデ"
"コレーターとしても利用できるようになります。"
#: ../../library/contextlib.rst:371
msgid "Example of ``ContextDecorator``::"
msgstr "``ContextDecorator`` の例::"
#: ../../library/contextlib.rst:384 ../../library/contextlib.rst:456
msgid "The class can then be used like this::"
msgstr "このとき、クラスは次のように使うことができます::"
#: ../../library/contextlib.rst:402
msgid ""
"This change is just syntactic sugar for any construct of the following form::"
msgstr "これは次のような形のコードに対するシンタックスシュガーになります::"
#: ../../library/contextlib.rst:408
msgid "``ContextDecorator`` lets you instead write::"
msgstr "``ContextDecorator`` を使うと代わりに次のように書けます::"
#: ../../library/contextlib.rst:414
msgid ""
"It makes it clear that the ``cm`` applies to the whole function, rather than "
"just a piece of it (and saving an indentation level is nice, too)."
msgstr ""
"デコレーターを使うと、``cm`` が関数の一部ではなく全体に適用されていることが明"
"確になります (インデントレベルを1つ節約できるのもメリットです)。"
#: ../../library/contextlib.rst:417
msgid ""
"Existing context managers that already have a base class can be extended by "
"using ``ContextDecorator`` as a mixin class::"
msgstr ""
"すでに基底クラスを持っているコンテキストマネージャーも、``ContextDecorator`` "
"を mixin クラスとして利用することで拡張できます::"
#: ../../library/contextlib.rst:430
msgid ""
"As the decorated function must be able to be called multiple times, the "
"underlying context manager must support use in multiple :keyword:`with` "
"statements. If this is not the case, then the original construct with the "
"explicit :keyword:`!with` statement inside the function should be used."
msgstr ""
"デコレートされた関数が複数回呼び出せるように、内部のコンテキストマネージャー"
"は複数の :keyword:`with` 文に対応する必要があります。そうでないなら、明示的"
"な :keyword:`!with` 文を関数内で利用するべきです。"
#: ../../library/contextlib.rst:440
msgid ""
"Similar to :class:`ContextDecorator` but only for asynchronous functions."
msgstr ":class:`ContextDecorator` と同じですが、非同期関数専用のクラスです。"
#: ../../library/contextlib.rst:442
msgid "Example of ``AsyncContextDecorator``::"
msgstr "``AsyncContextDecorator`` の使用例::"
#: ../../library/contextlib.rst:481
msgid ""
"A context manager that is designed to make it easy to programmatically "
"combine other context managers and cleanup functions, especially those that "
"are optional or otherwise driven by input data."
msgstr ""
"他の、特にオプションであったり入力に依存するようなコンテキストマネージャーや"
"クリーンアップ関数を動的に組み合わせるためのコンテキストマネージャーです。"
#: ../../library/contextlib.rst:485
msgid ""
"For example, a set of files may easily be handled in a single with statement "
"as follows::"
msgstr "例えば、複数のファイルを1つの with 文で簡単に扱うことができます::"
#: ../../library/contextlib.rst:494
msgid ""
"The :meth:`__enter__` method returns the :class:`ExitStack` instance, and "
"performs no additional operations."
msgstr ""
":meth:`__enter__` メソッドは :class:`ExitStack` インスタンスを返し、それ以外"
"のいかなる処理も行いません。"
#: ../../library/contextlib.rst:497
msgid ""
"Each instance maintains a stack of registered callbacks that are called in "
"reverse order when the instance is closed (either explicitly or implicitly "
"at the end of a :keyword:`with` statement). Note that callbacks are *not* "
"invoked implicitly when the context stack instance is garbage collected."
msgstr ""
"各インスタンスは登録されたコールバックのスタックを管理し、インスタンスが (明"
"示的に、あるいは :keyword:`with` 文の終わりに暗黙的に) close されるときに逆"
"順でそれを呼び出します。コンテキストスタックのインスタンスが暗黙的にガベージ"
"コレクトされたときには callback は呼び出され **ません** 。"
#: ../../library/contextlib.rst:502
msgid ""
"This stack model is used so that context managers that acquire their "
"resources in their ``__init__`` method (such as file objects) can be handled "
"correctly."
msgstr ""
"このスタックモデルは、(file オブジェクトのように) ``__init__`` メソッドでリ"
"ソースを確保するコンテキストマネージャーを正しく扱うためのものです。"
#: ../../library/contextlib.rst:506
msgid ""
"Since registered callbacks are invoked in the reverse order of registration, "
"this ends up behaving as if multiple nested :keyword:`with` statements had "
"been used with the registered set of callbacks. This even extends to "
"exception handling - if an inner callback suppresses or replaces an "
"exception, then outer callbacks will be passed arguments based on that "
"updated state."
msgstr ""
"登録されたコールバックが登録の逆順で実行されるので、複数のネストされた :"
"keyword:`with` 文を利用するのと同じ振る舞いをします。これは例外処理にも適用さ"
"れます。内側のコールバックが例外を抑制したり置き換えたりした場合、外側のコー"
"ルバックには更新された状態に応じた引数が渡されます。"
#: ../../library/contextlib.rst:513
msgid ""
"This is a relatively low level API that takes care of the details of "
"correctly unwinding the stack of exit callbacks. It provides a suitable "
"foundation for higher level context managers that manipulate the exit stack "
"in application specific ways."
msgstr ""
"これは正しく exit callback の stack を巻き戻すための、比較的低レベルな API で"
"す。アプリケーション独自のより高レベルなコンテキストマネージャーを作るための"
"基板として使うのに適しています。"
#: ../../library/contextlib.rst:522
msgid ""
"Enters a new context manager and adds its :meth:`__exit__` method to the "
"callback stack. The return value is the result of the context manager's own :"
"meth:`__enter__` method."
msgstr ""
"新しいコンテキストマネージャーに enter し、その :meth:`__exit__` method を"
"コールバックスタックに追加します。渡されたコンテキストマネージャーの :meth:"
"`__enter__` メソッドの戻り値を返します。"
#: ../../library/contextlib.rst:526
msgid ""
"These context managers may suppress exceptions just as they normally would "
"if used directly as part of a :keyword:`with` statement."
msgstr ""
"コンテキストマネージャーは、普段 :keyword:`with` 文で利用された時と同じよう"
"に、例外を抑制することができます。"
#: ../../library/contextlib.rst:531
msgid "Adds a context manager's :meth:`__exit__` method to the callback stack."
msgstr ""
"コンテキストマネージャーの :meth:`__exit__` メソッドをコールバックスタックに"
"追加します。"
#: ../../library/contextlib.rst:533
msgid ""
"As ``__enter__`` is *not* invoked, this method can be used to cover part of "
"an :meth:`__enter__` implementation with a context manager's own :meth:"
"`__exit__` method."
msgstr ""
"このメソッドは ``__enter__`` を **呼び出さない** ので、コンテキストマネー"
"ジャーを実装するときに、 :meth:`__enter__` の実装の一部を自身の :meth:"
"`__exit__` メソッドでカバーするために利用できます。"
#: ../../library/contextlib.rst:537
msgid ""
"If passed an object that is not a context manager, this method assumes it is "
"a callback with the same signature as a context manager's :meth:`__exit__` "
"method and adds it directly to the callback stack."
msgstr ""
"コンテキストマネージャーではないオブジェクトが渡された場合、このメソッドはそ"
"のオブジェクトをコンテキストマネージャーの :meth:`__exit__` メソッドと同じシ"
"グネチャを持つコールバック関数だと仮定して、直接コールバックスタックに追加し"
"ます。"
#: ../../library/contextlib.rst:541
msgid ""
"By returning true values, these callbacks can suppress exceptions the same "
"way context manager :meth:`__exit__` methods can."
msgstr ""
"それらのコールバック関数も、コンテキストマネージャーの :meth:`__exit__` と同"
"じく、 true 値を返すことで例外を抑制することができます。"
#: ../../library/contextlib.rst:544
msgid ""
"The passed in object is returned from the function, allowing this method to "
"be used as a function decorator."
msgstr ""
"この関数はデコレータとしても使えるように、受け取ったオブジェクトをそのまま返"
"します。"
#: ../../library/contextlib.rst:549
msgid ""
"Accepts an arbitrary callback function and arguments and adds it to the "
"callback stack."
msgstr "任意の関数と引数を受け取り、コールバックスタックに追加します。"
#: ../../library/contextlib.rst:552
msgid ""
"Unlike the other methods, callbacks added this way cannot suppress "
"exceptions (as they are never passed the exception details)."
msgstr ""
"他のメソッドと異なり、このメソッドで追加されたコールバックは例外を抑制しませ"
"ん (例外の詳細も渡されません)。"
#: ../../library/contextlib.rst:555
msgid ""
"The passed in callback is returned from the function, allowing this method "
"to be used as a function decorator."
msgstr ""
"この関数はデコレータとしても使えるように、受け取った callback をそのまま返し"
"ます。"
#: ../../library/contextlib.rst:560
msgid ""
"Transfers the callback stack to a fresh :class:`ExitStack` instance and "
"returns it. No callbacks are invoked by this operation - instead, they will "
"now be invoked when the new stack is closed (either explicitly or implicitly "
"at the end of a :keyword:`with` statement)."
msgstr ""
"コールバックスタックを新しい :class:`ExitStack` インスタンスに移して、それを"
"返します。このメソッドは callback を実行しません。代わりに、新しい stack が "
"(明示的に、あるいは :keyword:`with` 文の終わりに暗黙的に) close されるときに"
"実行されます。"
#: ../../library/contextlib.rst:565
msgid ""
"For example, a group of files can be opened as an \"all or nothing\" "
"operation as follows::"
msgstr ""
"例えば、複数のファイルを \"all or nothing\" に開く処理を次のように書けます::"
#: ../../library/contextlib.rst:579
msgid ""
"Immediately unwinds the callback stack, invoking callbacks in the reverse "
"order of registration. For any context managers and exit callbacks "
"registered, the arguments passed in will indicate that no exception occurred."
msgstr ""
"すぐにコールバックスタックを巻き戻し、コールバック関数を登録の逆順に呼び出し"
"ます。登録されたすべてのコンテキストマネージャーと終了 callback に、例外が起"
"こらなかった場合の引数が渡されます。"
#: ../../library/contextlib.rst:586
msgid ""
"An :ref:`asynchronous context manager <async-context-managers>`, similar to :"
"class:`ExitStack`, that supports combining both synchronous and asynchronous "
"context managers, as well as having coroutines for cleanup logic."
msgstr ""
":class:`ExitStack` に似た :ref:`非同期コンテキストマネージャ <async-context-"
"managers>` です。スタック上で同期と非同期の両方のコンテキストマネージャの組み"
"合わせをサポートします。また、後処理のためのコルーチンも持っています。"
#: ../../library/contextlib.rst:591
msgid ""
"The :meth:`close` method is not implemented, :meth:`aclose` must be used "
"instead."
msgstr ""
":meth:`close` メソッドは実装されていません。代わりに :meth:`aclose` を使って"
"ください。"
#: ../../library/contextlib.rst:596
msgid ""
"Similar to :meth:`enter_context` but expects an asynchronous context manager."
msgstr ""
":meth:`enter_context` と同様のメソッドですが、非同期コンテキストマネージャを"
"受け取ります。"
#: ../../library/contextlib.rst:601
msgid ""
"Similar to :meth:`push` but expects either an asynchronous context manager "
"or a coroutine function."
msgstr ""
":meth:`push` と同様のメソッドですが、非同期コンテキストマネージャかコルーチン"
"関数を受け取ります。"
#: ../../library/contextlib.rst:606
msgid "Similar to :meth:`callback` but expects a coroutine function."
msgstr ""
":meth:`callback` と同様のメソッドですが、コルーチン関数を受け取ります。"
#: ../../library/contextlib.rst:610
msgid "Similar to :meth:`close` but properly handles awaitables."
msgstr ""
":meth:`close` と同様のメソッドですが、待ち受け可能オブジェクト (awaitables) "
"を適切に処理します。"
#: ../../library/contextlib.rst:612
msgid "Continuing the example for :func:`asynccontextmanager`::"
msgstr ":func:`asynccontextmanager` の使用例の続きです::"
#: ../../library/contextlib.rst:624
msgid "Examples and Recipes"
msgstr "例とレシピ"
#: ../../library/contextlib.rst:626
msgid ""
"This section describes some examples and recipes for making effective use of "
"the tools provided by :mod:`contextlib`."
msgstr ""
"このセクションでは、 :mod:`contextlib` が提供するツールの効果的な使い方を示す"
"例とレシピを紹介します。"
#: ../../library/contextlib.rst:631
msgid "Supporting a variable number of context managers"
msgstr "可変数個のコンテキストマネージャーをサポートする"
#: ../../library/contextlib.rst:633
msgid ""
"The primary use case for :class:`ExitStack` is the one given in the class "
"documentation: supporting a variable number of context managers and other "
"cleanup operations in a single :keyword:`with` statement. The variability "
"may come from the number of context managers needed being driven by user "
"input (such as opening a user specified collection of files), or from some "
"of the context managers being optional::"
msgstr ""
":class:`ExitStack` の第一のユースケースは、クラスのドキュメントにかかれている"
"通り、一つの :keyword:`with` 文で可変数個のコンテキストマネージャーや他のク"
"リーンアップ関数をサポートすることです。ユーザーの入力 (指定された複数個の"
"ファイルを開く場合など) に応じて複数個のコンテキストマネージャーが必要となる"
"場合や、いくつかのコンテキストマネージャーがオプションとなる場合に、可変数個"
"のコンテキストマネージャーが必要になります::"
#: ../../library/contextlib.rst:648
msgid ""
"As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with` "
"statements to manage arbitrary resources that don't natively support the "
"context management protocol."
msgstr ""
"上の例にあるように、 :class:`ExitStack` はコンテキストマネージャープロトコル"
"をサポートしていないリソースの管理を :keyword:`with` 文を使って簡単に行えるよ"
"うにします。"
#: ../../library/contextlib.rst:654
msgid "Catching exceptions from ``__enter__`` methods"
msgstr "``__enter__`` メソッドからの例外をキャッチする"
#: ../../library/contextlib.rst:656
msgid ""
"It is occasionally desirable to catch exceptions from an ``__enter__`` "
"method implementation, *without* inadvertently catching exceptions from the :"
"keyword:`with` statement body or the context manager's ``__exit__`` method. "
"By using :class:`ExitStack` the steps in the context management protocol can "
"be separated slightly in order to allow this::"
msgstr ""
"稀に、 ``__enter__`` メソッドからの例外を、 :keyword:`with` 文の body やコン"
"テキストマネージャーの ``__exit__`` メソッドからの例外は間違えて捕まえないよ"
"うに、 catch したい場合があります。 :class:`ExitStack` を使って、コンテキスト"
"マネージャープロトコル内のステップを分離することができます::"
#: ../../library/contextlib.rst:671
msgid ""
"Actually needing to do this is likely to indicate that the underlying API "
"should be providing a direct resource management interface for use with :"
"keyword:`try`/:keyword:`except`/:keyword:`finally` statements, but not all "
"APIs are well designed in that regard. When a context manager is the only "
"resource management API provided, then :class:`ExitStack` can make it easier "
"to handle various situations that can't be handled directly in a :keyword:"
"`with` statement."
msgstr ""
"実際のところ、このようなコードが必要になるのならば、利用している API 側で :"
"keyword:`try`/:keyword:`except`/:keyword:`finally` 文を使った直接的なリソース"
"管理インターフェースを提供するべきです。しかし、すべての API がそのようによく"
"設計されているとは限りません。もしコンテキストマネージャーが提供されている唯"
"一のリソース管理APIであるなら、 :class:`ExitStack` を使って :keyword:`with` "
"文を使って処理することができない様々なシチュエーションの処理をすることができ"
"ます。"
#: ../../library/contextlib.rst:681
msgid "Cleaning up in an ``__enter__`` implementation"
msgstr "``__enter__`` 実装内のクリーンアップ"
#: ../../library/contextlib.rst:683
msgid ""
"As noted in the documentation of :meth:`ExitStack.push`, this method can be "
"useful in cleaning up an already allocated resource if later steps in the :"
"meth:`__enter__` implementation fail."
msgstr ""
":meth:`ExitStack.push` のドキュメントで言及したとおり、このメソッドはすでに獲"
"得したリソースを、 :meth:`__enter__` メソッドの残りのステップが失敗した時にク"
"リーンアップするために利用することができます。"
#: ../../library/contextlib.rst:687
msgid ""
"Here's an example of doing this for a context manager that accepts resource "
"acquisition and release functions, along with an optional validation "
"function, and maps them to the context management protocol::"
msgstr ""
"次の例では、リソースの確保と開放の関数に加えて、オプションのバリデーション関"
"数を受け取るコンテキストマネージャーで、この方法を使ってコンテキストマネー"
"ジャープロトコルを提供しています::"
#: ../../library/contextlib.rst:727
msgid "Replacing any use of ``try-finally`` and flag variables"
msgstr "``try-finally`` + flag 変数パターンを置き換える"
#: ../../library/contextlib.rst:729
msgid ""
"A pattern you will sometimes see is a ``try-finally`` statement with a flag "
"variable to indicate whether or not the body of the ``finally`` clause "
"should be executed. In its simplest form (that can't already be handled just "
"by using an ``except`` clause instead), it looks something like this::"
msgstr ""
"``try-finally`` 文に、``finally`` 句の内容を実行するかどうかを示すフラグ変数"
"を組み合わせたパターンを目にすることがあるかもしれません。一番シンプルな (単"
"に ``except`` 句を使うだけでは処理できない) ケースでは次のようなコードになり"
"ます::"
#: ../../library/contextlib.rst:743
msgid ""
"As with any ``try`` statement based code, this can cause problems for "
"development and review, because the setup code and the cleanup code can end "
"up being separated by arbitrarily long sections of code."
msgstr ""
"``try`` 文を使ったコードでは、セットアップとクリーンアップのコードが任意の長"
"さのコードで分離してしまうので、開発者やレビューアにとって問題になりえます。"
#: ../../library/contextlib.rst:747
msgid ""
":class:`ExitStack` makes it possible to instead register a callback for "
"execution at the end of a ``with`` statement, and then later decide to skip "
"executing that callback::"
msgstr ""
":class:`ExitStack` を使えば、代わりに ``with`` 文の終わりに実行されるコール"
"バックを登録し、後でそのコールバックをスキップするかどうかを決定できます::"
#: ../../library/contextlib.rst:759
msgid ""
"This allows the intended cleanup up behaviour to be made explicit up front, "
"rather than requiring a separate flag variable."
msgstr ""
"これにより、別のフラグ変数を使う代わりに、必要なクリーンアップ処理を手前に明"
"示しておくことができます。"
#: ../../library/contextlib.rst:762
msgid ""
"If a particular application uses this pattern a lot, it can be simplified "
"even further by means of a small helper class::"
msgstr ""
"もしあるアプリケーションがこのパターンを多用するのであれば、小さいヘルパーク"
"ラスを導入してよりシンプルにすることができます::"
#: ../../library/contextlib.rst:780
msgid ""
"If the resource cleanup isn't already neatly bundled into a standalone "
"function, then it is still possible to use the decorator form of :meth:"
"`ExitStack.callback` to declare the resource cleanup in advance::"
msgstr ""
"もしリソースのクリーンアップが単体の関数にまとまってない場合でも、 :meth:"
"`ExitStack.callback` のデコレーター形式を利用してリソース開放処理を宣言するこ"
"とができます::"
#: ../../library/contextlib.rst:795
msgid ""
"Due to the way the decorator protocol works, a callback function declared "
"this way cannot take any parameters. Instead, any resources to be released "
"must be accessed as closure variables."
msgstr ""
"デコレータープロトコルの使用上、このように宣言されたコールバック関数は引数を"
"取ることができません。その代わりに、リリースするリソースをクロージャー変数と"
"してアクセスできる必要があります。"
#: ../../library/contextlib.rst:801
msgid "Using a context manager as a function decorator"
msgstr "コンテキストマネージャーを関数デコレーターとして使う"
#: ../../library/contextlib.rst:803
msgid ""
":class:`ContextDecorator` makes it possible to use a context manager in both "
"an ordinary ``with`` statement and also as a function decorator."
msgstr ""
":class:`ContextDecorator` はコンテキストマネージャーを通常の ``with`` 文に加"
"えて関数デコレーターとしても利用できるようにします。"
#: ../../library/contextlib.rst:806
msgid ""
"For example, it is sometimes useful to wrap functions or groups of "
"statements with a logger that can track the time of entry and time of exit. "
"Rather than writing both a function decorator and a context manager for the "
"task, inheriting from :class:`ContextDecorator` provides both capabilities "
"in a single definition::"
msgstr ""
"例えば、関数やまとまった文を、そこに入った時と出た時の時間をトラックするロ"
"ガーでラップしたい場合があります。そのために関数デコレーターとコンテキストマ"
"ネージャーを別々に書く代わりに、 :class:`ContextDecorator` を継承すると1つの"
"定義で両方の機能を提供できます::"
#: ../../library/contextlib.rst:827
msgid "Instances of this class can be used as both a context manager::"
msgstr "このクラスのインスタンスはコンテキストマネージャーとしても利用でき::"
#: ../../library/contextlib.rst:833
msgid "And also as a function decorator::"
msgstr "また関数デコレーターとしても利用できます::"
#: ../../library/contextlib.rst:840
msgid ""
"Note that there is one additional limitation when using context managers as "
"function decorators: there's no way to access the return value of :meth:"
"`__enter__`. If that value is needed, then it is still necessary to use an "
"explicit ``with`` statement."
msgstr ""
"コンテキストマネージャーを関数デコレーターとして使う場合、 :meth:`__enter__` "
"メソッドの戻り値にアクセスする手段がないという制限があることに注意してくださ"
"い。もしその値が必要であれば、明示的な ``with`` 文を使う必要があります。"
#: ../../library/contextlib.rst:848
msgid ":pep:`343` - The \"with\" statement"
msgstr ":pep:`343` - \"with\" ステートメント"
#: ../../library/contextlib.rst:848
msgid ""
"The specification, background, and examples for the Python :keyword:`with` "
"statement."
msgstr "Python の :keyword:`with` 文の仕様、背景、および例が記載されています。"
#: ../../library/contextlib.rst:854
msgid "Single use, reusable and reentrant context managers"
msgstr "単回使用、再利用可能、およびリエントラントなコンテキストマネージャ"
#: ../../library/contextlib.rst:856
msgid ""
"Most context managers are written in a way that means they can only be used "
"effectively in a :keyword:`with` statement once. These single use context "
"managers must be created afresh each time they're used - attempting to use "
"them a second time will trigger an exception or otherwise not work correctly."
msgstr ""
"ほとんどのコンテキストマネージャは、 :keyword:`with` 文の中で一度だけ使われる"
"ような場合に効果的になるように書かれています。これら単回使用のコンテキストマ"
"ネージャは毎回新規に生成されなければなりません - それらを再利用しようとする"
"と、例外を引き起こすか、正しく動作しません。"
#: ../../library/contextlib.rst:862
msgid ""
"This common limitation means that it is generally advisable to create "
"context managers directly in the header of the :keyword:`with` statement "
"where they are used (as shown in all of the usage examples above)."
msgstr ""
"この共通の制限が意味することは、コンテキストマネージャは (上記すべての使用例"
"に示すとおり) 一般に :keyword:`with` 文のヘッダ部分で直接生成することが推奨さ"
"れるということです。"
#: ../../library/contextlib.rst:866
msgid ""
"Files are an example of effectively single use context managers, since the "
"first :keyword:`with` statement will close the file, preventing any further "
"IO operations using that file object."
msgstr ""
"ファイルオブジェクトは単回使用のコンテキストマネージャ有効に利用した例です。"
"最初の :keyword:`with` 文によりファイルがクローズされ、それ以降そのファイルオ"
"ブジェクトに対するすべての IO 操作を防止します。"
#: ../../library/contextlib.rst:870
msgid ""
"Context managers created using :func:`contextmanager` are also single use "
"context managers, and will complain about the underlying generator failing "
"to yield if an attempt is made to use them a second time::"
msgstr ""
":func:`contextmanager` により生成されたコンテキストマネージャも単回使用のコン"
"テキスト マネージャです。二回目に使おうとした場合、内部にあるジェネレータが"
"値の生成に失敗したと訴えるでしょう::"
#: ../../library/contextlib.rst:898
msgid "Reentrant context managers"
msgstr "リエントラントなコンテキストマネージャ"
#: ../../library/contextlib.rst:900
msgid ""
"More sophisticated context managers may be \"reentrant\". These context "
"managers can not only be used in multiple :keyword:`with` statements, but "
"may also be used *inside* a :keyword:`!with` statement that is already using "