- Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathdis.po
2498 lines (2102 loc) · 101 KB
/
dis.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:
# 云line, 2023
# Alpha Du <alphanow@gmail.com>, 2023
# Dai Xu <daixu61@hotmail.com>, 2023
# lqks, 2024
# Freesand Leo <yuqinju@163.com>, 2025
#
#,fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-04-25 14:19+0000\n"
"PO-Revision-Date: 2021-06-28 01:04+0000\n"
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2025\n"
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#:../../library/dis.rst:2
msgid":mod:`!dis` --- Disassembler for Python bytecode"
msgstr":mod:`!dis` --- Python 字节码反汇编器"
#:../../library/dis.rst:7
msgid"**Source code:** :source:`Lib/dis.py`"
msgstr"**源代码:** :source:`Lib/dis.py`"
#:../../library/dis.rst:17
msgid""
"The :mod:`dis` module supports the analysis of CPython :term:`bytecode` by "
"disassembling it. The CPython bytecode which this module takes as an input "
"is defined in the file :file:`Include/opcode.h` and used by the compiler and"
" the interpreter."
msgstr""
":mod:`dis` 模块通过反汇编支持CPython的 :term:`bytecode` 分析。该模块作为输入的 CPython 字节码在文件 "
":file:`Include/opcode.h` 中定义,并由编译器和解释器使用。"
#:../../library/dis.rst:24
msgid""
"Bytecode is an implementation detail of the CPython interpreter. No "
"guarantees are made that bytecode will not be added, removed, or changed "
"between versions of Python. Use of this module should not be considered to "
"work across Python VMs or Python releases."
msgstr""
"字节码是 CPython 解释器的实现细节。不保证不会在Python版本之间添加、删除或更改字节码。不应考虑将此模块的跨 Python VM 或 "
"Python 版本的使用。"
#:../../library/dis.rst:29
msgid""
"Use 2 bytes for each instruction. Previously the number of bytes varied by "
"instruction."
msgstr"每条指令使用2个字节。以前字节数因指令而异。"
#:../../library/dis.rst:33
msgid""
"The argument of jump, exception handling and loop instructions is now the "
"instruction offset rather than the byte offset."
msgstr"跳转、异常处理和循环指令的参数现在将为指令偏移量而不是字节偏移量。"
#:../../library/dis.rst:37
msgid""
"Some instructions are accompanied by one or more inline cache entries, which"
" take the form of :opcode:`CACHE` instructions. These instructions are "
"hidden by default, but can be shown by passing ``show_caches=True`` to any "
":mod:`dis` utility. Furthermore, the interpreter now adapts the bytecode to "
"specialize it for different runtime conditions. The adaptive bytecode can be"
" shown by passing ``adaptive=True``."
msgstr""
"有些指令带有一个或多个内联缓存条目,它们是采用 :opcode:`CACHE` 指令的形式。 这些指令默认是隐藏的,但可以通过将 "
"``show_caches=True`` 传给任何 :mod:`dis` 工具对象来显示。 "
"此外,解释器现在会适配字节码以使其能针对不同的运行时条件实现专门化。 适配的字节码可通过传入 ``adaptive=True`` 来显示。"
#:../../library/dis.rst:45
msgid""
"The argument of a jump is the offset of the target instruction relative to "
"the instruction that appears immediately after the jump instruction's "
":opcode:`CACHE` entries."
msgstr"跳转的参数是目标指令相对于紧接在跳转指令的 :opcode:`CACHE` 条目之后的指令的偏移量。"
#:../../library/dis.rst:50
msgid""
"As a consequence, the presence of the :opcode:`CACHE` instructions is "
"transparent for forward jumps but needs to be taken into account when "
"reasoning about backward jumps."
msgstr"因此,:opcode:`CACHE` 指令的存在对前向跳转是透明的但在处理后向跳转时则需要将其纳入考虑。"
#:../../library/dis.rst:54
msgid""
"The output shows logical labels rather than instruction offsets for jump "
"targets and exception handlers. The ``-O`` command line option and the "
"``show_offsets`` argument were added."
msgstr"对于跳转目标和异常处理器输出将显示逻辑标签而不是指令偏移量。 增加了 ``-O`` 命令行选项和 ``show_offsets`` 参数。"
#:../../library/dis.rst:59
msgid"Example: Given the function :func:`!myfunc`::"
msgstr"示例:给定函数 :func:`!myfunc`::"
#:../../library/dis.rst:61
msgid""
"def myfunc(alist):\n"
" return len(alist)"
msgstr""
"def myfunc(alist):\n"
" return len(alist)"
#:../../library/dis.rst:64
msgid""
"the following command can be used to display the disassembly of "
":func:`!myfunc`:"
msgstr"可以使用以下命令显示 :func:`!myfunc` 的反汇编:"
#:../../library/dis.rst:67
msgid""
">>> dis.dis(myfunc)\n"
" 2 RESUME 0\n"
"\n"
" 3 LOAD_GLOBAL 1 (len + NULL)\n"
" LOAD_FAST 0 (alist)\n"
" CALL 1\n"
" RETURN_VALUE"
msgstr""
">>> dis.dis(myfunc)\n"
" 2 RESUME 0\n"
"\n"
" 3 LOAD_GLOBAL 1 (len + NULL)\n"
" LOAD_FAST 0 (alist)\n"
" CALL 1\n"
" RETURN_VALUE"
#:../../library/dis.rst:77
msgid"(The \"2\" is a line number)."
msgstr"(\"2\" 是行号)。"
#:../../library/dis.rst:82
msgid"Command-line interface"
msgstr"命令行接口"
#:../../library/dis.rst:84
msgid""
"The :mod:`dis` module can be invoked as a script from the command line:"
msgstr":mod:`dis` 模块可以在命令行下作为一个脚本来唤起:"
#:../../library/dis.rst:86
msgid"python -m dis [-h] [-C] [-O] [infile]"
msgstr"python -m dis [-h] [-C] [-O] [infile]"
#:../../library/dis.rst:90
msgid"The following options are accepted:"
msgstr"可以接受以下选项:"
#:../../library/dis.rst:96
msgid"Display usage and exit."
msgstr"显示用法并退出。"
#:../../library/dis.rst:100
msgid"Show inline caches."
msgstr"显示内联缓存。"
#:../../library/dis.rst:106
msgid"Show offsets of instructions."
msgstr"显示指令偏移量。"
#:../../library/dis.rst:110
msgid""
"If :file:`infile` is specified, its disassembled code will be written to "
"stdout. Otherwise, disassembly is performed on compiled source code received"
" from stdin."
msgstr"如果指定了 :file:`infile`,其反汇编代码将被写入到标准输出。 在其他情况下,反汇编将在从标准输入接收的已编译源代码上进行。"
#:../../library/dis.rst:114
msgid"Bytecode analysis"
msgstr"字节码分析"
#:../../library/dis.rst:118
msgid""
"The bytecode analysis API allows pieces of Python code to be wrapped in a "
":class:`Bytecode` object that provides easy access to details of the "
"compiled code."
msgstr"字节码分析 API 允许将 Python 代码片段包装在 :class:`Bytecode` 对象中,以便轻松访问已编译代码的详细信息。"
#:../../library/dis.rst:125
msgid""
"Analyse the bytecode corresponding to a function, generator, asynchronous "
"generator, coroutine, method, string of source code, or a code object (as "
"returned by :func:`compile`)."
msgstr"分析的字节码对应于函数、生成器、异步生成器、协程、方法、源代码字符串或代码对象(由 :func:`compile` 返回)。"
#:../../library/dis.rst:129
msgid""
"This is a convenience wrapper around many of the functions listed below, "
"most notably :func:`get_instructions`, as iterating over a :class:`Bytecode`"
" instance yields the bytecode operations as :class:`Instruction` instances."
msgstr""
"这是下面列出的许多函数的便利包装,最值得注意的是 :func:`get_instructions` ,迭代于 :class:`Bytecode` "
"的实例产生字节码操作 :class:`Instruction` 的实例。"
#:../../library/dis.rst:133../../library/dis.rst:330
msgid""
"If *first_line* is not ``None``, it indicates the line number that should be"
" reported for the first source line in the disassembled code. Otherwise, "
"the source line information (if any) is taken directly from the disassembled"
" code object."
msgstr""
"如果 *first_line* 不是 ``None`` "
",则表示应该为反汇编代码中的第一个源代码行报告的行号。否则,源行信息(如果有的话)直接来自反汇编的代码对象。"
#:../../library/dis.rst:138
msgid""
"If *current_offset* is not ``None``, it refers to an instruction offset in "
"the disassembled code. Setting this means :meth:`.dis` will display a "
"\"current instruction\" marker against the specified opcode."
msgstr""
"如果 *current_offset* 不是 ``None`` ,它指的就是汇编代码中的指令偏移量。设置它意味着 :meth:`.dis` "
"将针对指定的操作码显示“当前指令”标记。"
#:../../library/dis.rst:142
msgid""
"If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries"
" used by the interpreter to specialize the bytecode."
msgstr"如果 *show_caches* 为 ``True``,:meth:`.dis` 将显示解释器用来专门化字节码的内联缓存条目。"
#:../../library/dis.rst:145
msgid""
"If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode "
"that may be different from the original bytecode."
msgstr"如果 *adaptive* 为 ``True``,:meth:`.dis` 将显示可能不同于原始字节码的专门化字节码。"
#:../../library/dis.rst:148
msgid""
"If *show_offsets* is ``True``, :meth:`.dis` will include instruction offsets"
" in the output."
msgstr"若 *show_offsets* 是 ``True``,:meth:`.dis` 的输出将会显示指令偏移量。"
#:../../library/dis.rst:153
msgid""
"Construct a :class:`Bytecode` instance from the given traceback, setting "
"*current_offset* to the instruction responsible for the exception."
msgstr"从给定回溯构造一个 :class:`Bytecode` 实例,将设置 *current_offset* 为异常负责的指令。"
#:../../library/dis.rst:158
msgid"The compiled code object."
msgstr"已编译的代码对象。"
#:../../library/dis.rst:162
msgid"The first source line of the code object (if available)"
msgstr"代码对象的第一个源代码行(如果可用)"
#:../../library/dis.rst:166
msgid""
"Return a formatted view of the bytecode operations (the same as printed by "
":func:`dis.dis`, but returned as a multi-line string)."
msgstr"返回字节码操作的格式化视图(与 :func:`dis.dis` 打印相同,但作为多行字符串返回)。"
#:../../library/dis.rst:171
msgid""
"Return a formatted multi-line string with detailed information about the "
"code object, like :func:`code_info`."
msgstr"返回带有关于代码对象的详细信息的格式化多行字符串,如 :func:`code_info` 。"
#:../../library/dis.rst:174../../library/dis.rst:214
#:../../library/dis.rst:266
msgid"This can now handle coroutine and asynchronous generator objects."
msgstr"现在可以处理协程和异步生成器对象。"
#:../../library/dis.rst:177../../library/dis.rst:269
#:../../library/dis.rst:286../../library/dis.rst:316
#:../../library/dis.rst:339
msgid"Added the *show_caches* and *adaptive* parameters."
msgstr"增加了 *show_caches* 和 *adaptive* 形参。"
#:../../library/dis.rst:180
msgid"Example:"
msgstr"示例:"
#:../../library/dis.rst:182
msgid""
">>> bytecode = dis.Bytecode(myfunc)\n"
">>> for instr in bytecode:\n"
"... print(instr.opname)\n"
"...\n"
"RESUME\n"
"LOAD_GLOBAL\n"
"LOAD_FAST\n"
"CALL\n"
"RETURN_VALUE"
msgstr""
">>> bytecode = dis.Bytecode(myfunc)\n"
">>> for instr in bytecode:\n"
"... print(instr.opname)\n"
"...\n"
"RESUME\n"
"LOAD_GLOBAL\n"
"LOAD_FAST\n"
"CALL\n"
"RETURN_VALUE"
#:../../library/dis.rst:196
msgid"Analysis functions"
msgstr"分析函数"
#:../../library/dis.rst:198
msgid""
"The :mod:`dis` module also defines the following analysis functions that "
"convert the input directly to the desired output. They can be useful if only"
" a single operation is being performed, so the intermediate analysis object "
"isn't useful:"
msgstr":mod:`dis` 模块还定义了以下分析函数,它们将输入直接转换为所需的输出。如果只执行单个操作,它们可能很有用,因此中间分析对象没用:"
#:../../library/dis.rst:204
msgid""
"Return a formatted multi-line string with detailed code object information "
"for the supplied function, generator, asynchronous generator, coroutine, "
"method, source code string or code object."
msgstr"返回格式化的多行字符串,其包含详细代码对象信息的用于被提供的函数、生成器、异步生成器、协程、方法、源代码字符串或代码对象。"
#:../../library/dis.rst:208
msgid""
"Note that the exact contents of code info strings are highly implementation "
"dependent and they may change arbitrarily across Python VMs or Python "
"releases."
msgstr"请注意,代码信息字符串的确切内容是高度依赖于实现的,它们可能会在Python VM或Python版本中任意更改。"
#:../../library/dis.rst:220
msgid""
"Print detailed code object information for the supplied function, method, "
"source code string or code object to *file* (or ``sys.stdout`` if *file* is "
"not specified)."
msgstr""
"将提供的函数、方法。源代码字符串或代码对象的详细代码对象信息打印到 *file* (如果未指定 *file* ,则为 ``sys.stdout`` )。"
#:../../library/dis.rst:224
msgid""
"This is a convenient shorthand for ``print(code_info(x), file=file)``, "
"intended for interactive exploration at the interpreter prompt."
msgstr"这是 ``print(code_info(x), file=file)`` 的便捷简写,用于在解释器提示符下进行交互式探索。"
#:../../library/dis.rst:229../../library/dis.rst:260
#:../../library/dis.rst:283../../library/dis.rst:313
msgid"Added *file* parameter."
msgstr"添加 *file* 形参。"
#:../../library/dis.rst:235
msgid""
"Disassemble the *x* object. *x* can denote either a module, a class, a "
"method, a function, a generator, an asynchronous generator, a coroutine, a "
"code object, a string of source code or a byte sequence of raw bytecode. For"
" a module, it disassembles all functions. For a class, it disassembles all "
"methods (including class and static methods). For a code object or sequence "
"of raw bytecode, it prints one line per bytecode instruction. It also "
"recursively disassembles nested code objects. These can include generator "
"expressions, nested functions, the bodies of nested classes, and the code "
"objects used for :ref:`annotation scopes <annotation-scopes>`. Strings are "
"first compiled to code objects with the :func:`compile` built-in function "
"before being disassembled. If no object is provided, this function "
"disassembles the last traceback."
msgstr""
"反汇编 *x* 对象。 *x* 可以表示模块、类、方法、函数、生成器、异步生成器、协程、代码对象、源代码字符串或原始字节码的字节序列。 "
"对于模块,它会反汇编所有函数。 对于一个类,它会反汇编所有方法(包括类方法和静态方法)。 对于代码对象或原始字节码序列,它会为每条字节码指令打印一行。 "
"它还会递归地反汇编嵌套代码对象。 这些对象包括生成器表达式、嵌套函数、嵌套类的语句体以及用于 :ref:`标注作用域 <annotation-"
"scopes>` 的代码对象。 在反汇编之前,首先使用 :func:`compile` 内置函数将字符串编译为代码对象。 "
"如果未提供任何对象,则该函数将反汇编最后一次回溯。"
#:../../library/dis.rst:248../../library/dis.rst:280
#:../../library/dis.rst:310
msgid""
"The disassembly is written as text to the supplied *file* argument if "
"provided and to ``sys.stdout`` otherwise."
msgstr"如果提供的话,反汇编将作为文本写入提供的 *file* 参数,否则写入 ``sys.stdout`` 。"
#:../../library/dis.rst:251
msgid""
"The maximal depth of recursion is limited by *depth* unless it is ``None``. "
"``depth=0`` means no recursion."
msgstr"递归的最大深度受 *depth* 限制,除非它是 ``None`` 。 ``depth=0`` 表示没有递归。"
#:../../library/dis.rst:254
msgid""
"If *show_caches* is ``True``, this function will display inline cache "
"entries used by the interpreter to specialize the bytecode."
msgstr"如果 *show_caches* 为 ``True``,此函数将显示解释器用来专门化字节码的内联缓存条目。"
#:../../library/dis.rst:257
msgid""
"If *adaptive* is ``True``, this function will display specialized bytecode "
"that may be different from the original bytecode."
msgstr"如果 *adaptive* 为 ``True``,此函数将显示可能不同于原始字节码的专门化字节码。"
#:../../library/dis.rst:263
msgid"Implemented recursive disassembling and added *depth* parameter."
msgstr"实现了递归反汇编并添加了 *depth* 参数。"
#:../../library/dis.rst:276
msgid""
"Disassemble the top-of-stack function of a traceback, using the last "
"traceback if none was passed. The instruction causing the exception is "
"indicated."
msgstr"如果没有传递,则使用最后一个回溯来反汇编回溯的堆栈顶部函数。 指示了导致异常的指令。"
#:../../library/dis.rst:289../../library/dis.rst:319
msgid"Added the *show_offsets* parameter."
msgstr"添加了*show_offsets*参数。"
#:../../library/dis.rst:296
msgid""
"Disassemble a code object, indicating the last instruction if *lasti* was "
"provided. The output is divided in the following columns:"
msgstr"反汇编代码对象,如果提供了 *lasti* ,则指示最后一条指令。输出分为以下几列:"
#:../../library/dis.rst:299
msgid"the line number, for the first instruction of each line"
msgstr"行号,用于每行的第一条指令"
#:../../library/dis.rst:300
msgid"the current instruction, indicated as ``-->``,"
msgstr"当前指令,表示为 ``-->`` ,"
#:../../library/dis.rst:301
msgid"a labelled instruction, indicated with ``>>``,"
msgstr"一个标记的指令,用 ``>>`` 表示,"
#:../../library/dis.rst:302
msgid"the address of the instruction,"
msgstr"指令的地址,"
#:../../library/dis.rst:303
msgid"the operation code name,"
msgstr"操作码名称,"
#:../../library/dis.rst:304
msgid"operation parameters, and"
msgstr"操作参数,和"
#:../../library/dis.rst:305
msgid"interpretation of the parameters in parentheses."
msgstr"括号中参数的解释。"
#:../../library/dis.rst:307
msgid""
"The parameter interpretation recognizes local and global variable names, "
"constant values, branch targets, and compare operators."
msgstr"参数解释识别本地和全局变量名称、常量值、分支目标和比较运算符。"
#:../../library/dis.rst:324
msgid""
"Return an iterator over the instructions in the supplied function, method, "
"source code string or code object."
msgstr"在所提供的函数、方法、源代码字符串或代码对象中的指令上返回一个迭代器。"
#:../../library/dis.rst:327
msgid""
"The iterator generates a series of :class:`Instruction` named tuples giving "
"the details of each operation in the supplied code."
msgstr"迭代器生成一系列 :class:`Instruction` ,命名为元组,提供所提供代码中每个操作的详细信息。"
#:../../library/dis.rst:335
msgid"The *adaptive* parameter works as it does in :func:`dis`."
msgstr"参数 *adaptive* 和其在 :func:`dis` 中的工作方式一样。"
#:../../library/dis.rst:342
msgid""
"The *show_caches* parameter is deprecated and has no effect. The iterator "
"generates the :class:`Instruction` instances with the *cache_info* field "
"populated (regardless of the value of *show_caches*) and it no longer "
"generates separate items for the cache entries."
msgstr""
"*show_caches* 参数被弃用并且失效。 迭代器保证 :class:`Instruction` 实例一定有 *cache_info* 字段(无论"
" *show_caches* 传入什么),不再生成单独的缓存项。"
#:../../library/dis.rst:350
msgid""
"This generator function uses the :meth:`~codeobject.co_lines` method of the "
":ref:`code object <code-objects>` *code* to find the offsets which are "
"starts of lines in the source code. They are generated as ``(offset, "
"lineno)`` pairs."
msgstr""
"这个生成器函数使用 :ref:`代码对象 <code-objects>` *code* 的 :meth:`~codeobject.co_lines` "
"方法来查找源代码中行开头的偏移量。 它们将作为 ``(offset, lineno)`` 对被生成。"
#:../../library/dis.rst:355
msgid"Line numbers can be decreasing. Before, they were always increasing."
msgstr"行号可能会减少。 以前,他们总是在增加。"
#:../../library/dis.rst:358
msgid""
"The :pep:`626` :meth:`~codeobject.co_lines` method is used instead of the "
":attr:`~codeobject.co_firstlineno` and :attr:`~codeobject.co_lnotab` "
"attributes of the :ref:`code object <code-objects>`."
msgstr""
"使用 :pep:`626` :meth:`~codeobject.co_lines` 方法而不是 :ref:`代码对象 <code-objects>` "
"的 :attr:`~codeobject.co_firstlineno` 和 :attr:`~codeobject.co_lnotab` 属性。"
#:../../library/dis.rst:363
msgid""
"Line numbers can be ``None`` for bytecode that does not map to source lines."
msgstr"若字节码不对应任何一行,行号可以是``None``。"
#:../../library/dis.rst:369
msgid""
"Detect all offsets in the raw compiled bytecode string *code* which are jump"
" targets, and return a list of these offsets."
msgstr"检测作为跳转目标的原始编译后字节码字符串 *code* 中的所有偏移量,并返回这些偏移量的列表。"
#:../../library/dis.rst:375
msgid"Compute the stack effect of *opcode* with argument *oparg*."
msgstr"使用参数 *oparg* 计算 *opcode* 的堆栈效果。"
#:../../library/dis.rst:377
msgid""
"If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` "
"will return the stack effect of jumping. If *jump* is ``False``, it will "
"return the stack effect of not jumping. And if *jump* is ``None`` (default),"
" it will return the maximal stack effect of both cases."
msgstr""
"如果代码有一个跳转目标并且 *jump* 是 ``True`` ,则 :func:`~drag_effect` 将返回跳转的堆栈效果。如果 *jump*"
" 是 ``False`` ,它将返回不跳跃的堆栈效果。如果 *jump* 是 ``None`` (默认值),它将返回两种情况的最大堆栈效果。"
#:../../library/dis.rst:384
msgid"Added *jump* parameter."
msgstr"添加 *jump* 参数。"
#:../../library/dis.rst:387
msgid""
"If ``oparg`` is omitted (or ``None``), the stack effect is now returned for "
"``oparg=0``. Previously this was an error for opcodes that use their arg. It"
" is also no longer an error to pass an integer ``oparg`` when the ``opcode``"
" does not use it; the ``oparg`` in this case is ignored."
msgstr""
"如果``oparg`` 被省略(或传入``None`` ),过去如果字节码使用参数,此时会抛出错误,而现在会返回``oparg=0``时的结果 "
"。当``opcode`` 不使用整数 ``oparg`` 时,传入的``oparg``将被忽略,不会抛出错误。"
#:../../library/dis.rst:397
msgid"Python Bytecode Instructions"
msgstr"Python字节码说明"
#:../../library/dis.rst:399
msgid""
"The :func:`get_instructions` function and :class:`Bytecode` class provide "
"details of bytecode instructions as :class:`Instruction` instances:"
msgstr""
":func:`get_instructions` 函数和 :class:`Bytecode` 类提供字节码指令的详细信息的 "
":class:`Instruction` 实例:"
#:../../library/dis.rst:404
msgid"Details for a bytecode operation"
msgstr"字节码操作的详细信息"
#:../../library/dis.rst:408
msgid""
"numeric code for operation, corresponding to the opcode values listed below "
"and the bytecode values in the :ref:`opcode_collections`."
msgstr"操作的数字代码,对应于下面列出的操作码值和 :ref:`opcode_collections` 中的字节码值。"
#:../../library/dis.rst:414
msgid"human readable name for operation"
msgstr"人类可读的操作名称"
#:../../library/dis.rst:419
msgid""
"numeric code for the base operation if operation is specialized; otherwise "
"equal to :data:`opcode`"
msgstr"如果操作是专用的则为基本操作的数字码;否则等于 :data:`opcode`"
#:../../library/dis.rst:425
msgid""
"human readable name for the base operation if operation is specialized; "
"otherwise equal to :data:`opname`"
msgstr"如果操作是专用的则为基本操作的人类易读的名称;否则等于 :data:`opname`"
#:../../library/dis.rst:431
msgid"numeric argument to operation (if any), otherwise ``None``"
msgstr"操作的数字参数(如果有的话),否则为 ``None``"
#:../../library/dis.rst:435
msgid"alias for :data:`arg`"
msgstr":data:`arg` 的别名"
#:../../library/dis.rst:439
msgid"resolved arg value (if any), otherwise ``None``"
msgstr"已解析的 arg 值(如果有的话),否则为 ``None``"
#:../../library/dis.rst:444
msgid""
"human readable description of operation argument (if any), otherwise an "
"empty string."
msgstr"人类可读的操作参数(如果存在)的描述,否则为空字符串。"
#:../../library/dis.rst:450
msgid"start index of operation within bytecode sequence"
msgstr"在字节码序列中的起始操作索引"
#:../../library/dis.rst:455
msgid""
"start index of operation within bytecode sequence, including prefixed "
"``EXTENDED_ARG`` operations if present; otherwise equal to :data:`offset`"
msgstr"在字节码序列中的起始索引,包括前面的 ``EXTENDED_ARG`` 操作(如有),否则和 :data:`offset` 相等。"
#:../../library/dis.rst:461
msgid"start index of the cache entries following the operation"
msgstr"在操作后面的缓存条目的起始索引"
#:../../library/dis.rst:466
msgid"end index of the cache entries following the operation"
msgstr"操作后面的缓存条目的结束索引"
#:../../library/dis.rst:471
msgid"``True`` if this opcode starts a source line, otherwise ``False``"
msgstr"如果这个操作在源代码行的开始,为``True``,否则为``False``。"
#:../../library/dis.rst:476
msgid""
"source line number associated with this opcode (if any), otherwise ``None``"
msgstr"操作码对应的源代码行号(如有),否则为``None``"
#:../../library/dis.rst:481
msgid"``True`` if other code jumps to here, otherwise ``False``"
msgstr"如果其他代码跳到这里,则为 ``True`` ,否则为 ``False``"
#:../../library/dis.rst:486
msgid""
"bytecode index of the jump target if this is a jump operation, otherwise "
"``None``"
msgstr"跳转的目标的字节码索引,如果有跳转操作,否则为``None``"
#:../../library/dis.rst:492
msgid""
":class:`dis.Positions` object holding the start and end locations that are "
"covered by this instruction."
msgstr":class:`dis.Positions` 对象保存了这条指令所涵盖的起始和结束位置。"
#:../../library/dis.rst:497
msgid""
"Information about the cache entries of this instruction, as triplets of the "
"form ``(name, size, data)``, where the ``name`` and ``size`` describe the "
"cache format and data is the contents of the cache. ``cache_info`` is "
"``None`` if the instruction does not have caches."
msgstr""
"有关该指令的缓存条目的信息,为 ``(name, size, data)`` 形式的三元组,其中 ``name`` 和 ``size`` "
"描述缓存的格式而 data 为缓存的内容。 如果指令没有缓存则 ``cache_info`` 为 ``None``。"
#:../../library/dis.rst:507
msgid"Field ``positions`` is added."
msgstr"增加了 ``positions`` 字段。"
#:../../library/dis.rst:511
msgid"Changed field ``starts_line``."
msgstr"更改了字段``starts_line``。"
#:../../library/dis.rst:513
msgid""
"Added fields ``start_offset``, ``cache_offset``, ``end_offset``, "
"``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``, ``line_number`` "
"and ``cache_info``."
msgstr""
"添加了字段``start_offset``、``cache_offset``、``end_offset``、``baseopname``、``baseopcode``、``jump_target``、``oparg``、``line_number``和``cache_info``"
#:../../library/dis.rst:520
msgid""
"In case the information is not available, some fields might be ``None``."
msgstr"考虑到此信息不可用的情况,某些字段可能为 ``None``。"
#:../../library/dis.rst:530
msgid""
"The Python compiler currently generates the following bytecode instructions."
msgstr"Python编译器当前生成以下字节码指令。"
#:../../library/dis.rst:533
msgid"**General instructions**"
msgstr"**一般指令**"
#:../../library/dis.rst:535
msgid""
"In the following, We will refer to the interpreter stack as ``STACK`` and "
"describe operations on it as if it was a Python list. The top of the stack "
"corresponds to ``STACK[-1]`` in this language."
msgstr""
"在下文中,我们将把解释器栈称为 ``STACK`` 并像描述 Python 列表一样描述对它的操作。 栈顶对应于该语言中的 ``STACK[-1]``。"
#:../../library/dis.rst:541
msgid""
"Do nothing code. Used as a placeholder by the bytecode optimizer, and to "
"generate line tracing events."
msgstr"无操作代码。 被字节码优化器用作占位符,以及生成行追踪事件。"
#:../../library/dis.rst:547
msgid"Removes the top-of-stack item::"
msgstr"移除除堆栈顶部的项:"
#:../../library/dis.rst:549
msgid"STACK.pop()"
msgstr"STACK.pop()"
#:../../library/dis.rst:554
msgid""
"Removes the top-of-stack item. Equivalent to ``POP_TOP``. Used to clean up "
"at the end of loops, hence the name."
msgstr"移除栈顶。 等价于 ``POP_TOP``。用于循环结束时的清理,因此而得名。"
#:../../library/dis.rst:563
msgid"Implements ``del STACK[-2]``. Used to clean up when a generator exits."
msgstr"实现 ``del STACK[-2]``。 用于在生成器退出时进行清理。"
#:../../library/dis.rst:571
msgid""
"Push the i-th item to the top of the stack without removing it from its "
"original location::"
msgstr"将第 *i* 项推入栈顶,并不移除原项:"
#:../../library/dis.rst:574
msgid""
"assert i > 0\n"
"STACK.append(STACK[-i])"
msgstr""
"assert i > 0\n"
"STACK.append(STACK[-i])"
#:../../library/dis.rst:582
msgid"Swap the top of the stack with the i-th element::"
msgstr"将栈顶的项与栈中第 *i* 项互换:"
#:../../library/dis.rst:584
msgid"STACK[-i], STACK[-1] = STACK[-1], STACK[-i]"
msgstr"STACK[-i], STACK[-1] = STACK[-1], STACK[-i]"
#:../../library/dis.rst:591
msgid""
"Rather than being an actual instruction, this opcode is used to mark extra "
"space for the interpreter to cache useful data directly in the bytecode "
"itself. It is automatically hidden by all ``dis`` utilities, but can be "
"viewed with ``show_caches=True``."
msgstr""
"此操作码不是真正的指令,它被用来为解释器标记额外空间以便在字节码中直接缓存有用的数据。 它会被所有 ``dis`` 工具自动隐藏,但可以通过 "
"``show_caches=True`` 来查看。"
#:../../library/dis.rst:596
msgid""
"Logically, this space is part of the preceding instruction. Many opcodes "
"expect to be followed by an exact number of caches, and will instruct the "
"interpreter to skip over them at runtime."
msgstr"从逻辑上说,此空间是之前的指令的组成部分。 许多操作码都预期带有固定数量的缓存,并会指示解释器在运行时跳过它们。"
#:../../library/dis.rst:600
msgid""
"Populated caches can look like arbitrary instructions, so great care should "
"be taken when reading or modifying raw, adaptive bytecode containing "
"quickened data."
msgstr"被填充的缓存看起来可以像是任意的指令,因此在读取或修改包含快取数据的原始自适应字节码时应当非常小心。"
#:../../library/dis.rst:607
msgid"**Unary operations**"
msgstr"**一元操作**"
#:../../library/dis.rst:609
msgid""
"Unary operations take the top of the stack, apply the operation, and push "
"the result back on the stack."
msgstr"一元操作获取堆栈顶部元素,应用操作,并将结果推回堆栈。"
#:../../library/dis.rst:615
msgid"Implements ``STACK[-1] = -STACK[-1]``."
msgstr"实现 ``STACK[-1] = -STACK[-1]`` 。"
#:../../library/dis.rst:620
msgid"Implements ``STACK[-1] = not STACK[-1]``."
msgstr"实现 ``STACK[-1] = not STACK[-1]`` 。"
#:../../library/dis.rst:622../../library/dis.rst:1318
#:../../library/dis.rst:1334
msgid"This instruction now requires an exact :class:`bool` operand."
msgstr"现在,操作对象需要是 :class:`bool` 类型。"
#:../../library/dis.rst:628
msgid"Implements ``STACK[-1] = ~STACK[-1]``."
msgstr"实现 ``STACK[-1] = ~STACK[-1]`` 。"
#:../../library/dis.rst:633
msgid"Implements ``STACK[-1] = iter(STACK[-1])``."
msgstr"实现 ``STACK[-1] = iter(STACK[-1])`` 。"
#:../../library/dis.rst:638
msgid""
"If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object"
" it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``."
msgstr""
"如果 ``STACK[-1]`` 是一个 :term:`generator iterator` 或 :term:`coroutine` "
"对象则它将保持原样。 否则,将实现 ``STACK[-1] = iter(STACK[-1])``。"
#:../../library/dis.rst:646
msgid"Implements ``STACK[-1] = bool(STACK[-1])``."
msgstr"实现``STACK[-1] = bool(STACK[-1])``。"
#:../../library/dis.rst:651
msgid"**Binary and in-place operations**"
msgstr"**双目和原地操作**"
#:../../library/dis.rst:653
msgid""
"Binary operations remove the top two items from the stack (``STACK[-1]`` and"
" ``STACK[-2]``). They perform the operation, then put the result back on the"
" stack."
msgstr"双目操作移除栈顶的两项( ``STACK[-1]`` 和 ``STACK[-2]`` ),执行其运算操作,并将结果放回栈中。"
#:../../library/dis.rst:656
msgid""
"In-place operations are like binary operations, but the operation is done "
"in-place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may"
" be (but does not have to be) the original ``STACK[-2]``."
msgstr""
"原地操作类似于双目操作,但当 ``STACK[-2]`` 支持时,操作将在原地进行。 结果 ``STACK[-1]`` 可能(但不一定)是原先 "
"``STACK[-2]`` 的值。"
#:../../library/dis.rst:663
msgid""
"Implements the binary and in-place operators (depending on the value of "
"*op*)::"
msgstr"实现双目和原地操作运算符(取决于 *op* 的值):"
#:../../library/dis.rst:666
msgid""
"rhs = STACK.pop()\n"
"lhs = STACK.pop()\n"
"STACK.append(lhs op rhs)"
msgstr""
"rhs = STACK.pop()\n"
"lhs = STACK.pop()\n"
"STACK.append(lhs op rhs)"
#:../../library/dis.rst:675../../library/dis.rst:684
#:../../library/dis.rst:694../../library/dis.rst:702
#:../../library/dis.rst:714../../library/dis.rst:802
#:../../library/dis.rst:812../../library/dis.rst:822
#:../../library/dis.rst:1046../../library/dis.rst:1057
#:../../library/dis.rst:1161../../library/dis.rst:1173
#:../../library/dis.rst:1185
msgid"Implements::"
msgstr"实现:"
#:../../library/dis.rst:677
msgid""
"key = STACK.pop()\n"
"container = STACK.pop()\n"
"STACK.append(container[key])"
msgstr""
"key = STACK.pop()\n"
"container = STACK.pop()\n"
"STACK.append(container[key])"
#:../../library/dis.rst:686
msgid""
"key = STACK.pop()\n"
"container = STACK.pop()\n"
"value = STACK.pop()\n"
"container[key] = value"
msgstr""
"key = STACK.pop()\n"
"container = STACK.pop()\n"
"value = STACK.pop()\n"
"container[key] = value"
#:../../library/dis.rst:696
msgid""
"key = STACK.pop()\n"
"container = STACK.pop()\n"
"del container[key]"
msgstr""
"key = STACK.pop()\n"
"container = STACK.pop()\n"
"del container[key]"
#:../../library/dis.rst:704
msgid""
"end = STACK.pop()\n"
"start = STACK.pop()\n"
"container = STACK.pop()\n"
"STACK.append(container[start:end])"
msgstr""
"end = STACK.pop()\n"
"start = STACK.pop()\n"
"container = STACK.pop()\n"
"STACK.append(container[start:end])"
#:../../library/dis.rst:716
msgid""
"end = STACK.pop()\n"
"start = STACK.pop()\n"
"container = STACK.pop()\n"
"values = STACK.pop()\n"
"container[start:end] = value"
msgstr""
"end = STACK.pop()\n"
"start = STACK.pop()\n"
"container = STACK.pop()\n"
"values = STACK.pop()\n"
"container[start:end] = value"
#:../../library/dis.rst:725
msgid"**Coroutine opcodes**"
msgstr"**协程操作码**"
#:../../library/dis.rst:729
msgid""
"Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where "
"``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a "
"generator object with the :data:`~inspect.CO_ITERABLE_COROUTINE` flag, or "
"resolves ``o.__await__``."
msgstr""
"实现 ``STACK[-1] = get_awaitable(STACK[-1])`` 。其中对于 ``get_awaitable(o)`` ,当 "
"``o`` 是一个有 :data:`~inspect.CO_ITERABLE_COROUTINE` 旗标的协程对象或生成器对象时,返回 "
"``o``,否则解析 ``o.__await__`` 。"
#:../../library/dis.rst:734
msgid""
"If the ``where`` operand is nonzero, it indicates where the instruction "
"occurs:"
msgstr"如果 ``where`` 操作数为非零值,则表示指令所在的位置:"
#:../../library/dis.rst:737
msgid"``1``: After a call to ``__aenter__``"
msgstr"``1``:在调用 ``__aenter__`` 之后"
#:../../library/dis.rst:738
msgid"``2``: After a call to ``__aexit__``"
msgstr"``2``:在调用 ``__aexit__`` 之后"
#:../../library/dis.rst:742
msgid"Previously, this instruction did not have an oparg."
msgstr"在之前版本中,该指令没有 oparg。"
#:../../library/dis.rst:748
msgid"Implements ``STACK[-1] = STACK[-1].__aiter__()``."
msgstr"实现 ``STACK[-1] = STACK[-1].__aiter__()``。"
#:../../library/dis.rst:751
msgid"Returning awaitable objects from ``__aiter__`` is no longer supported."
msgstr"已经不再支持从 ``__aiter__`` 返回可等待对象。"
#:../../library/dis.rst:758
msgid""
"Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the "
"stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``."
msgstr""
"对堆栈实现 ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` 。 关于 "
"``get_awaitable`` 的细节,见 ``GET_AWAITABLE`` 。"
#:../../library/dis.rst:766
msgid""
"Terminates an :keyword:`async for` loop. Handles an exception raised when "
"awaiting a next item. The stack contains the async iterable in ``STACK[-2]``"
" and the raised exception in ``STACK[-1]``. Both are popped. If the "
"exception is not :exc:`StopAsyncIteration`, it is re-raised."
msgstr""
"终结一个 :keyword:`async for` 循环。 在等待下一项时处理被引发的异常。 栈包含了 ``STACK[-2]`` 中的异步可迭代对象和"
" ``STACK[-1]`` 中的已引发异常。 两者都将被弹出。 如果异常不是 :exc:`StopAsyncIteration`,它会被重新引发。"
#:../../library/dis.rst:773../../library/dis.rst:881
#:../../library/dis.rst:892
msgid""
"Exception representation on the stack now consist of one, not three, items."
msgstr"栈中的异常表示形式现在将由一个而不是三个条目组成。"
#:../../library/dis.rst:779
msgid""
"Handles an exception raised during a :meth:`~generator.throw` or "
":meth:`~generator.close` call through the current frame. If ``STACK[-1]`` "
"is an instance of :exc:`StopIteration`, pop three values from the stack and "
"push its ``value`` member. Otherwise, re-raise ``STACK[-1]``."
msgstr""
"处理当前帧中由调用 :meth:`~generator.throw` 或 :meth:`~generator.close` 引发的异常。 如果 "
"``STACK[-1]`` 是 :exc:`StopIteration` 的实例,则从栈中弹出三个值,并将其成员 ``value`` "
"的值推入栈中,否则重新引发 ``STACK[-1]`` 异常。"
#:../../library/dis.rst:789
msgid""
"Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes "
"``__aexit__`` and result of ``__aenter__()`` to the stack::"
msgstr""
"从 ``STACK[-1]`` 解析 ``__aenter__`` 和 ``__aexit__`` 。 将 ``__aexit__`` 和 "
"``__aenter__()`` 的结果推入栈中:"
#:../../library/dis.rst:792
msgid"STACK.extend((__aexit__, __aenter__())"
msgstr"STACK.extend((__aexit__, __aenter__())"
#:../../library/dis.rst:798
msgid"**Miscellaneous opcodes**"
msgstr"**其他操作码**"
#:../../library/dis.rst:804
msgid""
"item = STACK.pop()\n"
"set.add(STACK[-i], item)"
msgstr""
"item = STACK.pop()\n"