Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
python3.10 /
html /
library /
[ HOME SHELL ]
Name
Size
Permission
Action
2to3.html
70.96
KB
-rw-r--r--
__future__.html
20.75
KB
-rw-r--r--
__main__.html
44.87
KB
-rw-r--r--
_thread.html
30.39
KB
-rw-r--r--
abc.html
46.87
KB
-rw-r--r--
aifc.html
35.56
KB
-rw-r--r--
allos.html
34.33
KB
-rw-r--r--
archiving.html
17
KB
-rw-r--r--
argparse.html
300.89
KB
-rw-r--r--
array.html
37.28
KB
-rw-r--r--
ast.html
293.08
KB
-rw-r--r--
asynchat.html
37.41
KB
-rw-r--r--
asyncio-api-index.html
27.68
KB
-rw-r--r--
asyncio-dev.html
36.1
KB
-rw-r--r--
asyncio-eventloop.html
204.43
KB
-rw-r--r--
asyncio-exceptions.html
17.11
KB
-rw-r--r--
asyncio-future.html
38.23
KB
-rw-r--r--
asyncio-llapi-index.html
61.97
KB
-rw-r--r--
asyncio-platforms.html
21.77
KB
-rw-r--r--
asyncio-policy.html
39.56
KB
-rw-r--r--
asyncio-protocol.html
118.33
KB
-rw-r--r--
asyncio-queue.html
31.86
KB
-rw-r--r--
asyncio-stream.html
69.98
KB
-rw-r--r--
asyncio-subprocess.html
49.25
KB
-rw-r--r--
asyncio-sync.html
42.79
KB
-rw-r--r--
asyncio-task.html
109.14
KB
-rw-r--r--
asyncio.html
17.31
KB
-rw-r--r--
asyncore.html
49.36
KB
-rw-r--r--
atexit.html
22.87
KB
-rw-r--r--
audioop.html
46
KB
-rw-r--r--
audit_events.html
72.85
KB
-rw-r--r--
base64.html
48.09
KB
-rw-r--r--
bdb.html
66
KB
-rw-r--r--
binary.html
15.97
KB
-rw-r--r--
binascii.html
36.3
KB
-rw-r--r--
binhex.html
15.97
KB
-rw-r--r--
bisect.html
43.38
KB
-rw-r--r--
builtins.html
14.87
KB
-rw-r--r--
bz2.html
50.68
KB
-rw-r--r--
calendar.html
69.35
KB
-rw-r--r--
cgi.html
59.95
KB
-rw-r--r--
cgitb.html
19.96
KB
-rw-r--r--
chunk.html
22.21
KB
-rw-r--r--
cmath.html
43.89
KB
-rw-r--r--
cmd.html
50.42
KB
-rw-r--r--
code.html
35.38
KB
-rw-r--r--
codecs.html
157.96
KB
-rw-r--r--
codeop.html
18.26
KB
-rw-r--r--
collections.abc.html
79.17
KB
-rw-r--r--
collections.html
189.43
KB
-rw-r--r--
colorsys.html
17.31
KB
-rw-r--r--
compileall.html
50.68
KB
-rw-r--r--
concurrency.html
24.15
KB
-rw-r--r--
concurrent.futures.html
79.03
KB
-rw-r--r--
concurrent.html
11.56
KB
-rw-r--r--
configparser.html
159.4
KB
-rw-r--r--
constants.html
22.41
KB
-rw-r--r--
contextlib.html
117.2
KB
-rw-r--r--
contextvars.html
38.38
KB
-rw-r--r--
copy.html
17.92
KB
-rw-r--r--
copyreg.html
18.63
KB
-rw-r--r--
crypt.html
28.29
KB
-rw-r--r--
crypto.html
13.93
KB
-rw-r--r--
csv.html
82.89
KB
-rw-r--r--
ctypes.html
295.49
KB
-rw-r--r--
curses.ascii.html
32.04
KB
-rw-r--r--
curses.html
221.24
KB
-rw-r--r--
curses.panel.html
22.16
KB
-rw-r--r--
custominterp.html
11.85
KB
-rw-r--r--
dataclasses.html
113.16
KB
-rw-r--r--
datatypes.html
31.82
KB
-rw-r--r--
datetime.html
374.92
KB
-rw-r--r--
dbm.html
51.16
KB
-rw-r--r--
debug.html
17
KB
-rw-r--r--
decimal.html
270.12
KB
-rw-r--r--
development.html
32.34
KB
-rw-r--r--
devmode.html
31.72
KB
-rw-r--r--
dialog.html
43.03
KB
-rw-r--r--
difflib.html
111.99
KB
-rw-r--r--
dis.html
136.07
KB
-rw-r--r--
distribution.html
13.67
KB
-rw-r--r--
distutils.html
14.73
KB
-rw-r--r--
doctest.html
199.32
KB
-rw-r--r--
email.charset.html
31.92
KB
-rw-r--r--
email.compat32-message.html
97.74
KB
-rw-r--r--
email.contentmanager.html
37.02
KB
-rw-r--r--
email.encoders.html
18.47
KB
-rw-r--r--
email.errors.html
24.45
KB
-rw-r--r--
email.examples.html
60.49
KB
-rw-r--r--
email.generator.html
48.79
KB
-rw-r--r--
email.header.html
37.61
KB
-rw-r--r--
email.headerregistry.html
66.26
KB
-rw-r--r--
email.html
30.75
KB
-rw-r--r--
email.iterators.html
18.23
KB
-rw-r--r--
email.message.html
99.75
KB
-rw-r--r--
email.mime.html
44.89
KB
-rw-r--r--
email.parser.html
57.39
KB
-rw-r--r--
email.policy.html
84.24
KB
-rw-r--r--
email.utils.html
42.57
KB
-rw-r--r--
ensurepip.html
23.9
KB
-rw-r--r--
enum.html
151
KB
-rw-r--r--
errno.html
60.17
KB
-rw-r--r--
exceptions.html
108.44
KB
-rw-r--r--
faulthandler.html
31.5
KB
-rw-r--r--
fcntl.html
36.67
KB
-rw-r--r--
filecmp.html
32.08
KB
-rw-r--r--
fileformats.html
13.52
KB
-rw-r--r--
fileinput.html
40.37
KB
-rw-r--r--
filesys.html
16.78
KB
-rw-r--r--
fnmatch.html
21.02
KB
-rw-r--r--
fractions.html
35.29
KB
-rw-r--r--
frameworks.html
16.15
KB
-rw-r--r--
ftplib.html
71.97
KB
-rw-r--r--
functional.html
12.19
KB
-rw-r--r--
functions.html
260.33
KB
-rw-r--r--
functools.html
92.96
KB
-rw-r--r--
gc.html
40.97
KB
-rw-r--r--
getopt.html
29.4
KB
-rw-r--r--
getpass.html
16.01
KB
-rw-r--r--
gettext.html
98.02
KB
-rw-r--r--
glob.html
27.2
KB
-rw-r--r--
graphlib.html
34.82
KB
-rw-r--r--
grp.html
16.03
KB
-rw-r--r--
gzip.html
45.65
KB
-rw-r--r--
hashlib.html
93.19
KB
-rw-r--r--
heapq.html
42.43
KB
-rw-r--r--
hmac.html
24.74
KB
-rw-r--r--
html.entities.html
14.91
KB
-rw-r--r--
html.html
14.81
KB
-rw-r--r--
html.parser.html
47.7
KB
-rw-r--r--
http.client.html
85.63
KB
-rw-r--r--
http.cookiejar.html
113.94
KB
-rw-r--r--
http.cookies.html
47.64
KB
-rw-r--r--
http.html
45.52
KB
-rw-r--r--
http.server.html
73.05
KB
-rw-r--r--
i18n.html
13.44
KB
-rw-r--r--
idle.html
77.18
KB
-rw-r--r--
imaplib.html
87.08
KB
-rw-r--r--
imghdr.html
17.94
KB
-rw-r--r--
imp.html
54.32
KB
-rw-r--r--
importlib.html
239.96
KB
-rw-r--r--
importlib.metadata.html
43.14
KB
-rw-r--r--
index.html
75.06
KB
-rw-r--r--
inspect.html
168.74
KB
-rw-r--r--
internet.html
29.89
KB
-rw-r--r--
intro.html
13.81
KB
-rw-r--r--
io.html
154.15
KB
-rw-r--r--
ipaddress.html
137.75
KB
-rw-r--r--
ipc.html
12.6
KB
-rw-r--r--
itertools.html
153.27
KB
-rw-r--r--
json.html
98.9
KB
-rw-r--r--
keyword.html
14.88
KB
-rw-r--r--
language.html
16.71
KB
-rw-r--r--
linecache.html
18.09
KB
-rw-r--r--
locale.html
77.35
KB
-rw-r--r--
logging.config.html
100.3
KB
-rw-r--r--
logging.handlers.html
146.28
KB
-rw-r--r--
logging.html
169.67
KB
-rw-r--r--
lzma.html
66.89
KB
-rw-r--r--
mailbox.html
176.34
KB
-rw-r--r--
mailcap.html
20.86
KB
-rw-r--r--
markup.html
22.31
KB
-rw-r--r--
marshal.html
24.43
KB
-rw-r--r--
math.html
85.82
KB
-rw-r--r--
mimetypes.html
40.27
KB
-rw-r--r--
mm.html
11.16
KB
-rw-r--r--
mmap.html
55.53
KB
-rw-r--r--
modulefinder.html
23.67
KB
-rw-r--r--
modules.html
15.88
KB
-rw-r--r--
msilib.html
78.38
KB
-rw-r--r--
msvcrt.html
29.22
KB
-rw-r--r--
multiprocessing.html
405.24
KB
-rw-r--r--
multiprocessing.shared_memory....
60
KB
-rw-r--r--
netdata.html
20.24
KB
-rw-r--r--
netrc.html
20.39
KB
-rw-r--r--
nis.html
16.76
KB
-rw-r--r--
nntplib.html
84.93
KB
-rw-r--r--
numbers.html
45.67
KB
-rw-r--r--
numeric.html
19.29
KB
-rw-r--r--
operator.html
107.32
KB
-rw-r--r--
optparse.html
256.96
KB
-rw-r--r--
os.html
594.39
KB
-rw-r--r--
os.path.html
65.54
KB
-rw-r--r--
ossaudiodev.html
56.35
KB
-rw-r--r--
pathlib.html
170.01
KB
-rw-r--r--
pdb.html
68.67
KB
-rw-r--r--
persistence.html
19.13
KB
-rw-r--r--
pickle.html
154.45
KB
-rw-r--r--
pickletools.html
22.92
KB
-rw-r--r--
pipes.html
21.7
KB
-rw-r--r--
pkgutil.html
42.76
KB
-rw-r--r--
platform.html
45.08
KB
-rw-r--r--
plistlib.html
30.06
KB
-rw-r--r--
poplib.html
41.42
KB
-rw-r--r--
posix.html
20.96
KB
-rw-r--r--
pprint.html
55.35
KB
-rw-r--r--
profile.html
84.63
KB
-rw-r--r--
pty.html
23.7
KB
-rw-r--r--
pwd.html
16.84
KB
-rw-r--r--
py_compile.html
29
KB
-rw-r--r--
pyclbr.html
24.06
KB
-rw-r--r--
pydoc.html
19.59
KB
-rw-r--r--
pyexpat.html
104.38
KB
-rw-r--r--
python.html
22.46
KB
-rw-r--r--
queue.html
43.39
KB
-rw-r--r--
quopri.html
18.64
KB
-rw-r--r--
random.html
86.31
KB
-rw-r--r--
re.html
214.24
KB
-rw-r--r--
readline.html
50.19
KB
-rw-r--r--
reprlib.html
30.85
KB
-rw-r--r--
resource.html
48.26
KB
-rw-r--r--
rlcompleter.html
18.06
KB
-rw-r--r--
runpy.html
30.99
KB
-rw-r--r--
sched.html
27.04
KB
-rw-r--r--
secrets.html
30.2
KB
-rw-r--r--
security_warnings.html
16.21
KB
-rw-r--r--
select.html
74.58
KB
-rw-r--r--
selectors.html
41.91
KB
-rw-r--r--
shelve.html
36.54
KB
-rw-r--r--
shlex.html
61.03
KB
-rw-r--r--
shutil.html
100.13
KB
-rw-r--r--
signal.html
95.39
KB
-rw-r--r--
site.html
38.16
KB
-rw-r--r--
smtpd.html
44.09
KB
-rw-r--r--
smtplib.html
81.4
KB
-rw-r--r--
sndhdr.html
16.4
KB
-rw-r--r--
socket.html
256.95
KB
-rw-r--r--
socketserver.html
91.95
KB
-rw-r--r--
spwd.html
16.71
KB
-rw-r--r--
sqlite3.html
225.51
KB
-rw-r--r--
ssl.html
328.83
KB
-rw-r--r--
stat.html
57.79
KB
-rw-r--r--
statistics.html
123.22
KB
-rw-r--r--
stdtypes.html
615.43
KB
-rw-r--r--
string.html
108.03
KB
-rw-r--r--
stringprep.html
24.94
KB
-rw-r--r--
struct.html
70.58
KB
-rw-r--r--
subprocess.html
199.03
KB
-rw-r--r--
sunau.html
39.84
KB
-rw-r--r--
superseded.html
26.21
KB
-rw-r--r--
symtable.html
33.26
KB
-rw-r--r--
sys.html
198.83
KB
-rw-r--r--
sysconfig.html
39.81
KB
-rw-r--r--
syslog.html
27.36
KB
-rw-r--r--
tabnanny.html
16.18
KB
-rw-r--r--
tarfile.html
161.92
KB
-rw-r--r--
telnetlib.html
38.21
KB
-rw-r--r--
tempfile.html
58.39
KB
-rw-r--r--
termios.html
22.86
KB
-rw-r--r--
test.html
222.85
KB
-rw-r--r--
text.html
16.8
KB
-rw-r--r--
textwrap.html
48.83
KB
-rw-r--r--
threading.html
128.33
KB
-rw-r--r--
time.html
107.46
KB
-rw-r--r--
timeit.html
52.63
KB
-rw-r--r--
tk.html
28.08
KB
-rw-r--r--
tkinter.colorchooser.html
14.49
KB
-rw-r--r--
tkinter.dnd.html
17.09
KB
-rw-r--r--
tkinter.font.html
22.21
KB
-rw-r--r--
tkinter.html
106.85
KB
-rw-r--r--
tkinter.messagebox.html
20.09
KB
-rw-r--r--
tkinter.scrolledtext.html
14.52
KB
-rw-r--r--
tkinter.tix.html
59.69
KB
-rw-r--r--
tkinter.ttk.html
138.37
KB
-rw-r--r--
token.html
45.73
KB
-rw-r--r--
tokenize.html
39.86
KB
-rw-r--r--
trace.html
38.85
KB
-rw-r--r--
traceback.html
75.61
KB
-rw-r--r--
tracemalloc.html
122.33
KB
-rw-r--r--
tty.html
14.46
KB
-rw-r--r--
turtle.html
271.71
KB
-rw-r--r--
types.html
64.85
KB
-rw-r--r--
typing.html
315.69
KB
-rw-r--r--
unicodedata.html
27.3
KB
-rw-r--r--
unittest.html
310.01
KB
-rw-r--r--
unittest.mock-examples.html
177.75
KB
-rw-r--r--
unittest.mock.html
363.51
KB
-rw-r--r--
unix.html
13.46
KB
-rw-r--r--
urllib.error.html
18.56
KB
-rw-r--r--
urllib.html
12.92
KB
-rw-r--r--
urllib.parse.html
104.65
KB
-rw-r--r--
urllib.request.html
208.87
KB
-rw-r--r--
urllib.robotparser.html
22.63
KB
-rw-r--r--
uu.html
18.2
KB
-rw-r--r--
uuid.html
42.88
KB
-rw-r--r--
venv.html
90.43
KB
-rw-r--r--
warnings.html
69.13
KB
-rw-r--r--
wave.html
36.12
KB
-rw-r--r--
weakref.html
73.36
KB
-rw-r--r--
webbrowser.html
33.98
KB
-rw-r--r--
windows.html
12.32
KB
-rw-r--r--
winreg.html
89.48
KB
-rw-r--r--
winsound.html
26.3
KB
-rw-r--r--
wsgiref.html
111.52
KB
-rw-r--r--
xdrlib.html
42.07
KB
-rw-r--r--
xml.dom.html
114.66
KB
-rw-r--r--
xml.dom.minidom.html
49.6
KB
-rw-r--r--
xml.dom.pulldom.html
30.06
KB
-rw-r--r--
xml.etree.elementtree.html
186.49
KB
-rw-r--r--
xml.html
22.34
KB
-rw-r--r--
xml.sax.handler.html
55.78
KB
-rw-r--r--
xml.sax.html
31.74
KB
-rw-r--r--
xml.sax.reader.html
56.23
KB
-rw-r--r--
xml.sax.utils.html
22.28
KB
-rw-r--r--
xmlrpc.client.html
79.73
KB
-rw-r--r--
xmlrpc.html
11.9
KB
-rw-r--r--
xmlrpc.server.html
63.56
KB
-rw-r--r--
zipapp.html
52.45
KB
-rw-r--r--
zipfile.html
116.59
KB
-rw-r--r--
zipimport.html
33.76
KB
-rw-r--r--
zlib.html
42.29
KB
-rw-r--r--
zoneinfo.html
57.25
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : dis.html
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> <title>dis — Disassembler for Python bytecode — Python 3.10.12 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="../_static/pygments.css" /> <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?2022.1" /> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script src="../_static/sidebar.js"></script> <link rel="search" type="application/opensearchdescription+xml" title="Search within Python 3.10.12 documentation" href="../_static/opensearch.xml"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="copyright" title="Copyright" href="../copyright.html" /> <link rel="next" title="pickletools — Tools for pickle developers" href="pickletools.html" /> <link rel="prev" title="compileall — Byte-compile Python libraries" href="compileall.html" /> <link rel="canonical" href="file:///usr/share/doc/python3.10/html/library/dis.html" /> <style> @media only screen { table.full-width-table { width: 100%; } } </style> <link rel="shortcut icon" type="image/png" href="../_static/py.svg" /> <script type="text/javascript" src="../_static/copybutton.js"></script> <script type="text/javascript" src="../_static/menu.js"></script> </head> <body> <div class="mobile-nav"> <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation" aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" /> <label for="menuToggler" class="toggler__label"> <span></span> </label> <nav class="nav-content" role="navigation"> <a href="https://www.python.org/" class="nav-logo"> <img src="../_static/py.svg" alt="Logo"/> </a> <div class="version_switcher_placeholder"></div> <form role="search" class="search" action="../search.html" method="get"> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon"> <path fill-rule="nonzero" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" fill="#444"></path> </svg> <input type="text" name="q" aria-label="Quick search"/> <input type="submit" value="Go"/> </form> </nav> <div class="menu-wrapper"> <nav class="menu" role="navigation" aria-label="main navigation"> <div class="language_switcher_placeholder"></div> <h3><a href="../contents.html">Table of Contents</a></h3> <ul> <li><a class="reference internal" href="#"><code class="xref py py-mod docutils literal notranslate"><span class="pre">dis</span></code> — Disassembler for Python bytecode</a><ul> <li><a class="reference internal" href="#bytecode-analysis">Bytecode analysis</a></li> <li><a class="reference internal" href="#analysis-functions">Analysis functions</a></li> <li><a class="reference internal" href="#python-bytecode-instructions">Python Bytecode Instructions</a></li> <li><a class="reference internal" href="#opcode-collections">Opcode collections</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="compileall.html" title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">compileall</span></code> — Byte-compile Python libraries</a></p> <h4>Next topic</h4> <p class="topless"><a href="pickletools.html" title="next chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pickletools</span></code> — Tools for pickle developers</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../bugs.html">Report a Bug</a></li> <li> <a href="https://github.com/python/cpython/blob/3.10/Doc/library/dis.rst" rel="nofollow">Show Source </a> </li> </ul> </div> </nav> </div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="pickletools.html" title="pickletools — Tools for pickle developers" accesskey="N">next</a> |</li> <li class="right" > <a href="compileall.html" title="compileall — Byte-compile Python libraries" accesskey="P">previous</a> |</li> <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="https://www.python.org/">Python</a> »</li> <li class="switchers"> <div class="language_switcher_placeholder"></div> <div class="version_switcher_placeholder"></div> </li> <li> </li> <li id="cpython-language-and-version"> <a href="../index.html">3.10.12 Documentation</a> » </li> <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li> <li class="nav-item nav-item-2"><a href="language.html" accesskey="U">Python Language Services</a> »</li> <li class="nav-item nav-item-this"><a href=""><code class="xref py py-mod docutils literal notranslate"><span class="pre">dis</span></code> — Disassembler for Python bytecode</a></li> <li class="right"> <div class="inline-search" role="search"> <form class="inline-search" action="../search.html" method="get"> <input placeholder="Quick search" aria-label="Quick search" type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> | </li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <section id="module-dis"> <span id="dis-disassembler-for-python-bytecode"></span><h1><a class="reference internal" href="#module-dis" title="dis: Disassembler for Python bytecode."><code class="xref py py-mod docutils literal notranslate"><span class="pre">dis</span></code></a> — Disassembler for Python bytecode<a class="headerlink" href="#module-dis" title="Permalink to this headline">¶</a></h1> <p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/3.10/Lib/dis.py">Lib/dis.py</a></p> <hr class="docutils" /> <p>The <a class="reference internal" href="#module-dis" title="dis: Disassembler for Python bytecode."><code class="xref py py-mod docutils literal notranslate"><span class="pre">dis</span></code></a> module supports the analysis of CPython <a class="reference internal" href="../glossary.html#term-bytecode"><span class="xref std std-term">bytecode</span></a> by disassembling it. The CPython bytecode which this module takes as an input is defined in the file <code class="file docutils literal notranslate"><span class="pre">Include/opcode.h</span></code> and used by the compiler and the interpreter.</p> <div class="impl-detail compound"> <p class="compound-first"><strong>CPython implementation detail:</strong> 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.</p> <div class="compound-middle versionchanged"> <p><span class="versionmodified changed">Changed in version 3.6: </span>Use 2 bytes for each instruction. Previously the number of bytes varied by instruction.</p> </div> <div class="compound-last versionchanged"> <p><span class="versionmodified changed">Changed in version 3.10: </span>The argument of jump, exception handling and loop instructions is now the instruction offset rather than the byte offset.</p> </div> </div> <p>Example: Given the function <code class="xref py py-func docutils literal notranslate"><span class="pre">myfunc()</span></code>:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">myfunc</span><span class="p">(</span><span class="n">alist</span><span class="p">):</span> <span class="k">return</span> <span class="nb">len</span><span class="p">(</span><span class="n">alist</span><span class="p">)</span> </pre></div> </div> <p>the following command can be used to display the disassembly of <code class="xref py py-func docutils literal notranslate"><span class="pre">myfunc()</span></code>:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">dis</span><span class="o">.</span><span class="n">dis</span><span class="p">(</span><span class="n">myfunc</span><span class="p">)</span> <span class="go"> 2 0 LOAD_GLOBAL 0 (len)</span> <span class="go"> 2 LOAD_FAST 0 (alist)</span> <span class="go"> 4 CALL_FUNCTION 1</span> <span class="go"> 6 RETURN_VALUE</span> </pre></div> </div> <p>(The “2” is a line number).</p> <section id="bytecode-analysis"> <h2>Bytecode analysis<a class="headerlink" href="#bytecode-analysis" title="Permalink to this headline">¶</a></h2> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.4.</span></p> </div> <p>The bytecode analysis API allows pieces of Python code to be wrapped in a <a class="reference internal" href="#dis.Bytecode" title="dis.Bytecode"><code class="xref py py-class docutils literal notranslate"><span class="pre">Bytecode</span></code></a> object that provides easy access to details of the compiled code.</p> <dl class="py class"> <dt class="sig sig-object py" id="dis.Bytecode"> <em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">Bytecode</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">first_line</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">current_offset</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dis.Bytecode" title="Permalink to this definition">¶</a></dt> <dd><p>Analyse the bytecode corresponding to a function, generator, asynchronous generator, coroutine, method, string of source code, or a code object (as returned by <a class="reference internal" href="functions.html#compile" title="compile"><code class="xref py py-func docutils literal notranslate"><span class="pre">compile()</span></code></a>).</p> <p>This is a convenience wrapper around many of the functions listed below, most notably <a class="reference internal" href="#dis.get_instructions" title="dis.get_instructions"><code class="xref py py-func docutils literal notranslate"><span class="pre">get_instructions()</span></code></a>, as iterating over a <a class="reference internal" href="#dis.Bytecode" title="dis.Bytecode"><code class="xref py py-class docutils literal notranslate"><span class="pre">Bytecode</span></code></a> instance yields the bytecode operations as <a class="reference internal" href="#dis.Instruction" title="dis.Instruction"><code class="xref py py-class docutils literal notranslate"><span class="pre">Instruction</span></code></a> instances.</p> <p>If <em>first_line</em> is not <code class="docutils literal notranslate"><span class="pre">None</span></code>, 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.</p> <p>If <em>current_offset</em> is not <code class="docutils literal notranslate"><span class="pre">None</span></code>, it refers to an instruction offset in the disassembled code. Setting this means <a class="reference internal" href="#dis.Bytecode.dis" title="dis.Bytecode.dis"><code class="xref py py-meth docutils literal notranslate"><span class="pre">dis()</span></code></a> will display a “current instruction” marker against the specified opcode.</p> <dl class="py method"> <dt class="sig sig-object py" id="dis.Bytecode.from_traceback"> <em class="property"><span class="pre">classmethod</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_traceback</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tb</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dis.Bytecode.from_traceback" title="Permalink to this definition">¶</a></dt> <dd><p>Construct a <a class="reference internal" href="#dis.Bytecode" title="dis.Bytecode"><code class="xref py py-class docutils literal notranslate"><span class="pre">Bytecode</span></code></a> instance from the given traceback, setting <em>current_offset</em> to the instruction responsible for the exception.</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.Bytecode.codeobj"> <span class="sig-name descname"><span class="pre">codeobj</span></span><a class="headerlink" href="#dis.Bytecode.codeobj" title="Permalink to this definition">¶</a></dt> <dd><p>The compiled code object.</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.Bytecode.first_line"> <span class="sig-name descname"><span class="pre">first_line</span></span><a class="headerlink" href="#dis.Bytecode.first_line" title="Permalink to this definition">¶</a></dt> <dd><p>The first source line of the code object (if available)</p> </dd></dl> <dl class="py method"> <dt class="sig sig-object py" id="dis.Bytecode.dis"> <span class="sig-name descname"><span class="pre">dis</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#dis.Bytecode.dis" title="Permalink to this definition">¶</a></dt> <dd><p>Return a formatted view of the bytecode operations (the same as printed by <a class="reference internal" href="#dis.dis" title="dis.dis"><code class="xref py py-func docutils literal notranslate"><span class="pre">dis.dis()</span></code></a>, but returned as a multi-line string).</p> </dd></dl> <dl class="py method"> <dt class="sig sig-object py" id="dis.Bytecode.info"> <span class="sig-name descname"><span class="pre">info</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#dis.Bytecode.info" title="Permalink to this definition">¶</a></dt> <dd><p>Return a formatted multi-line string with detailed information about the code object, like <a class="reference internal" href="#dis.code_info" title="dis.code_info"><code class="xref py py-func docutils literal notranslate"><span class="pre">code_info()</span></code></a>.</p> </dd></dl> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.7: </span>This can now handle coroutine and asynchronous generator objects.</p> </div> </dd></dl> <p>Example:</p> <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">bytecode</span> <span class="o">=</span> <span class="n">dis</span><span class="o">.</span><span class="n">Bytecode</span><span class="p">(</span><span class="n">myfunc</span><span class="p">)</span> <span class="gp">>>> </span><span class="k">for</span> <span class="n">instr</span> <span class="ow">in</span> <span class="n">bytecode</span><span class="p">:</span> <span class="gp">... </span> <span class="nb">print</span><span class="p">(</span><span class="n">instr</span><span class="o">.</span><span class="n">opname</span><span class="p">)</span> <span class="gp">...</span> <span class="go">LOAD_GLOBAL</span> <span class="go">LOAD_FAST</span> <span class="go">CALL_FUNCTION</span> <span class="go">RETURN_VALUE</span> </pre></div> </div> </section> <section id="analysis-functions"> <h2>Analysis functions<a class="headerlink" href="#analysis-functions" title="Permalink to this headline">¶</a></h2> <p>The <a class="reference internal" href="#module-dis" title="dis: Disassembler for Python bytecode."><code class="xref py py-mod docutils literal notranslate"><span class="pre">dis</span></code></a> 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:</p> <dl class="py function"> <dt class="sig sig-object py" id="dis.code_info"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">code_info</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dis.code_info" title="Permalink to this definition">¶</a></dt> <dd><p>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.</p> <p>Note that the exact contents of code info strings are highly implementation dependent and they may change arbitrarily across Python VMs or Python releases.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2.</span></p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.7: </span>This can now handle coroutine and asynchronous generator objects.</p> </div> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="dis.show_code"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">show_code</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">file</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dis.show_code" title="Permalink to this definition">¶</a></dt> <dd><p>Print detailed code object information for the supplied function, method, source code string or code object to <em>file</em> (or <code class="docutils literal notranslate"><span class="pre">sys.stdout</span></code> if <em>file</em> is not specified).</p> <p>This is a convenient shorthand for <code class="docutils literal notranslate"><span class="pre">print(code_info(x),</span> <span class="pre">file=file)</span></code>, intended for interactive exploration at the interpreter prompt.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2.</span></p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.4: </span>Added <em>file</em> parameter.</p> </div> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="dis.dis"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">dis</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">file</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">depth</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dis.dis" title="Permalink to this definition">¶</a></dt> <dd><p>Disassemble the <em>x</em> object. <em>x</em> 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 (the code of comprehensions, generator expressions and nested functions, and the code used for building nested classes). Strings are first compiled to code objects with the <a class="reference internal" href="functions.html#compile" title="compile"><code class="xref py py-func docutils literal notranslate"><span class="pre">compile()</span></code></a> built-in function before being disassembled. If no object is provided, this function disassembles the last traceback.</p> <p>The disassembly is written as text to the supplied <em>file</em> argument if provided and to <code class="docutils literal notranslate"><span class="pre">sys.stdout</span></code> otherwise.</p> <p>The maximal depth of recursion is limited by <em>depth</em> unless it is <code class="docutils literal notranslate"><span class="pre">None</span></code>. <code class="docutils literal notranslate"><span class="pre">depth=0</span></code> means no recursion.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.4: </span>Added <em>file</em> parameter.</p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.7: </span>Implemented recursive disassembling and added <em>depth</em> parameter.</p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.7: </span>This can now handle coroutine and asynchronous generator objects.</p> </div> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="dis.distb"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">distb</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tb</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">file</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dis.distb" title="Permalink to this definition">¶</a></dt> <dd><p>Disassemble the top-of-stack function of a traceback, using the last traceback if none was passed. The instruction causing the exception is indicated.</p> <p>The disassembly is written as text to the supplied <em>file</em> argument if provided and to <code class="docutils literal notranslate"><span class="pre">sys.stdout</span></code> otherwise.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.4: </span>Added <em>file</em> parameter.</p> </div> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="dis.disassemble"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">disassemble</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lasti</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">file</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dis.disassemble" title="Permalink to this definition">¶</a></dt> <dt class="sig sig-object py" id="dis.disco"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">disco</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lasti</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">file</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dis.disco" title="Permalink to this definition">¶</a></dt> <dd><p>Disassemble a code object, indicating the last instruction if <em>lasti</em> was provided. The output is divided in the following columns:</p> <ol class="arabic simple"> <li><p>the line number, for the first instruction of each line</p></li> <li><p>the current instruction, indicated as <code class="docutils literal notranslate"><span class="pre">--></span></code>,</p></li> <li><p>a labelled instruction, indicated with <code class="docutils literal notranslate"><span class="pre">>></span></code>,</p></li> <li><p>the address of the instruction,</p></li> <li><p>the operation code name,</p></li> <li><p>operation parameters, and</p></li> <li><p>interpretation of the parameters in parentheses.</p></li> </ol> <p>The parameter interpretation recognizes local and global variable names, constant values, branch targets, and compare operators.</p> <p>The disassembly is written as text to the supplied <em>file</em> argument if provided and to <code class="docutils literal notranslate"><span class="pre">sys.stdout</span></code> otherwise.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.4: </span>Added <em>file</em> parameter.</p> </div> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="dis.get_instructions"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">get_instructions</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">first_line</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dis.get_instructions" title="Permalink to this definition">¶</a></dt> <dd><p>Return an iterator over the instructions in the supplied function, method, source code string or code object.</p> <p>The iterator generates a series of <a class="reference internal" href="#dis.Instruction" title="dis.Instruction"><code class="xref py py-class docutils literal notranslate"><span class="pre">Instruction</span></code></a> named tuples giving the details of each operation in the supplied code.</p> <p>If <em>first_line</em> is not <code class="docutils literal notranslate"><span class="pre">None</span></code>, 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.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.4.</span></p> </div> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="dis.findlinestarts"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">findlinestarts</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dis.findlinestarts" title="Permalink to this definition">¶</a></dt> <dd><p>This generator function uses the <code class="docutils literal notranslate"><span class="pre">co_lines</span></code> method of the code object <em>code</em> to find the offsets which are starts of lines in the source code. They are generated as <code class="docutils literal notranslate"><span class="pre">(offset,</span> <span class="pre">lineno)</span></code> pairs.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.6: </span>Line numbers can be decreasing. Before, they were always increasing.</p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.10: </span>The <span class="target" id="index-0"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0626"><strong>PEP 626</strong></a> <code class="docutils literal notranslate"><span class="pre">co_lines</span></code> method is used instead of the <code class="docutils literal notranslate"><span class="pre">co_firstlineno</span></code> and <code class="docutils literal notranslate"><span class="pre">co_lnotab</span></code> attributes of the code object.</p> </div> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="dis.findlabels"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">findlabels</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dis.findlabels" title="Permalink to this definition">¶</a></dt> <dd><p>Detect all offsets in the raw compiled bytecode string <em>code</em> which are jump targets, and return a list of these offsets.</p> </dd></dl> <dl class="py function"> <dt class="sig sig-object py" id="dis.stack_effect"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">stack_effect</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opcode</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">oparg</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">jump</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dis.stack_effect" title="Permalink to this definition">¶</a></dt> <dd><p>Compute the stack effect of <em>opcode</em> with argument <em>oparg</em>.</p> <p>If the code has a jump target and <em>jump</em> is <code class="docutils literal notranslate"><span class="pre">True</span></code>, <a class="reference internal" href="#dis.stack_effect" title="dis.stack_effect"><code class="xref py py-func docutils literal notranslate"><span class="pre">stack_effect()</span></code></a> will return the stack effect of jumping. If <em>jump</em> is <code class="docutils literal notranslate"><span class="pre">False</span></code>, it will return the stack effect of not jumping. And if <em>jump</em> is <code class="docutils literal notranslate"><span class="pre">None</span></code> (default), it will return the maximal stack effect of both cases.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.4.</span></p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.8: </span>Added <em>jump</em> parameter.</p> </div> </dd></dl> </section> <section id="python-bytecode-instructions"> <span id="bytecodes"></span><h2>Python Bytecode Instructions<a class="headerlink" href="#python-bytecode-instructions" title="Permalink to this headline">¶</a></h2> <p>The <a class="reference internal" href="#dis.get_instructions" title="dis.get_instructions"><code class="xref py py-func docutils literal notranslate"><span class="pre">get_instructions()</span></code></a> function and <a class="reference internal" href="#dis.Bytecode" title="dis.Bytecode"><code class="xref py py-class docutils literal notranslate"><span class="pre">Bytecode</span></code></a> class provide details of bytecode instructions as <a class="reference internal" href="#dis.Instruction" title="dis.Instruction"><code class="xref py py-class docutils literal notranslate"><span class="pre">Instruction</span></code></a> instances:</p> <dl class="py class"> <dt class="sig sig-object py" id="dis.Instruction"> <em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">Instruction</span></span><a class="headerlink" href="#dis.Instruction" title="Permalink to this definition">¶</a></dt> <dd><p>Details for a bytecode operation</p> <dl class="py data"> <dt class="sig sig-object py" id="dis.Instruction.opcode"> <span class="sig-name descname"><span class="pre">opcode</span></span><a class="headerlink" href="#dis.Instruction.opcode" title="Permalink to this definition">¶</a></dt> <dd><p>numeric code for operation, corresponding to the opcode values listed below and the bytecode values in the <a class="reference internal" href="#opcode-collections"><span class="std std-ref">Opcode collections</span></a>.</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.Instruction.opname"> <span class="sig-name descname"><span class="pre">opname</span></span><a class="headerlink" href="#dis.Instruction.opname" title="Permalink to this definition">¶</a></dt> <dd><p>human readable name for operation</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.Instruction.arg"> <span class="sig-name descname"><span class="pre">arg</span></span><a class="headerlink" href="#dis.Instruction.arg" title="Permalink to this definition">¶</a></dt> <dd><p>numeric argument to operation (if any), otherwise <code class="docutils literal notranslate"><span class="pre">None</span></code></p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.Instruction.argval"> <span class="sig-name descname"><span class="pre">argval</span></span><a class="headerlink" href="#dis.Instruction.argval" title="Permalink to this definition">¶</a></dt> <dd><p>resolved arg value (if known), otherwise same as arg</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.Instruction.argrepr"> <span class="sig-name descname"><span class="pre">argrepr</span></span><a class="headerlink" href="#dis.Instruction.argrepr" title="Permalink to this definition">¶</a></dt> <dd><p>human readable description of operation argument</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.Instruction.offset"> <span class="sig-name descname"><span class="pre">offset</span></span><a class="headerlink" href="#dis.Instruction.offset" title="Permalink to this definition">¶</a></dt> <dd><p>start index of operation within bytecode sequence</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.Instruction.starts_line"> <span class="sig-name descname"><span class="pre">starts_line</span></span><a class="headerlink" href="#dis.Instruction.starts_line" title="Permalink to this definition">¶</a></dt> <dd><p>line started by this opcode (if any), otherwise <code class="docutils literal notranslate"><span class="pre">None</span></code></p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.Instruction.is_jump_target"> <span class="sig-name descname"><span class="pre">is_jump_target</span></span><a class="headerlink" href="#dis.Instruction.is_jump_target" title="Permalink to this definition">¶</a></dt> <dd><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if other code jumps to here, otherwise <code class="docutils literal notranslate"><span class="pre">False</span></code></p> </dd></dl> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.4.</span></p> </div> </dd></dl> <p>The Python compiler currently generates the following bytecode instructions.</p> <p><strong>General instructions</strong></p> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-NOP"> <span class="sig-name descname"><span class="pre">NOP</span></span><a class="headerlink" href="#opcode-NOP" title="Permalink to this definition">¶</a></dt> <dd><p>Do nothing code. Used as a placeholder by the bytecode optimizer.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-POP_TOP"> <span class="sig-name descname"><span class="pre">POP_TOP</span></span><a class="headerlink" href="#opcode-POP_TOP" title="Permalink to this definition">¶</a></dt> <dd><p>Removes the top-of-stack (TOS) item.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-ROT_TWO"> <span class="sig-name descname"><span class="pre">ROT_TWO</span></span><a class="headerlink" href="#opcode-ROT_TWO" title="Permalink to this definition">¶</a></dt> <dd><p>Swaps the two top-most stack items.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-ROT_THREE"> <span class="sig-name descname"><span class="pre">ROT_THREE</span></span><a class="headerlink" href="#opcode-ROT_THREE" title="Permalink to this definition">¶</a></dt> <dd><p>Lifts second and third stack item one position up, moves top down to position three.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-ROT_FOUR"> <span class="sig-name descname"><span class="pre">ROT_FOUR</span></span><a class="headerlink" href="#opcode-ROT_FOUR" title="Permalink to this definition">¶</a></dt> <dd><p>Lifts second, third and fourth stack items one position up, moves top down to position four.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.8.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DUP_TOP"> <span class="sig-name descname"><span class="pre">DUP_TOP</span></span><a class="headerlink" href="#opcode-DUP_TOP" title="Permalink to this definition">¶</a></dt> <dd><p>Duplicates the reference on top of the stack.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DUP_TOP_TWO"> <span class="sig-name descname"><span class="pre">DUP_TOP_TWO</span></span><a class="headerlink" href="#opcode-DUP_TOP_TWO" title="Permalink to this definition">¶</a></dt> <dd><p>Duplicates the two references on top of the stack, leaving them in the same order.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2.</span></p> </div> </dd></dl> <p><strong>Unary operations</strong></p> <p>Unary operations take the top of the stack, apply the operation, and push the result back on the stack.</p> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-UNARY_POSITIVE"> <span class="sig-name descname"><span class="pre">UNARY_POSITIVE</span></span><a class="headerlink" href="#opcode-UNARY_POSITIVE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">+TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-UNARY_NEGATIVE"> <span class="sig-name descname"><span class="pre">UNARY_NEGATIVE</span></span><a class="headerlink" href="#opcode-UNARY_NEGATIVE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">-TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-UNARY_NOT"> <span class="sig-name descname"><span class="pre">UNARY_NOT</span></span><a class="headerlink" href="#opcode-UNARY_NOT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">not</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-UNARY_INVERT"> <span class="sig-name descname"><span class="pre">UNARY_INVERT</span></span><a class="headerlink" href="#opcode-UNARY_INVERT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">~TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-GET_ITER"> <span class="sig-name descname"><span class="pre">GET_ITER</span></span><a class="headerlink" href="#opcode-GET_ITER" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">iter(TOS)</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-GET_YIELD_FROM_ITER"> <span class="sig-name descname"><span class="pre">GET_YIELD_FROM_ITER</span></span><a class="headerlink" href="#opcode-GET_YIELD_FROM_ITER" title="Permalink to this definition">¶</a></dt> <dd><p>If <code class="docutils literal notranslate"><span class="pre">TOS</span></code> is a <a class="reference internal" href="../glossary.html#term-generator-iterator"><span class="xref std std-term">generator iterator</span></a> or <a class="reference internal" href="../glossary.html#term-coroutine"><span class="xref std std-term">coroutine</span></a> object it is left as is. Otherwise, implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">iter(TOS)</span></code>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.5.</span></p> </div> </dd></dl> <p><strong>Binary operations</strong></p> <p>Binary operations remove the top of the stack (TOS) and the second top-most stack item (TOS1) from the stack. They perform the operation, and put the result back on the stack.</p> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_POWER"> <span class="sig-name descname"><span class="pre">BINARY_POWER</span></span><a class="headerlink" href="#opcode-BINARY_POWER" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">**</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_MULTIPLY"> <span class="sig-name descname"><span class="pre">BINARY_MULTIPLY</span></span><a class="headerlink" href="#opcode-BINARY_MULTIPLY" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">*</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_MATRIX_MULTIPLY"> <span class="sig-name descname"><span class="pre">BINARY_MATRIX_MULTIPLY</span></span><a class="headerlink" href="#opcode-BINARY_MATRIX_MULTIPLY" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">@</span> <span class="pre">TOS</span></code>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.5.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_FLOOR_DIVIDE"> <span class="sig-name descname"><span class="pre">BINARY_FLOOR_DIVIDE</span></span><a class="headerlink" href="#opcode-BINARY_FLOOR_DIVIDE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">//</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_TRUE_DIVIDE"> <span class="sig-name descname"><span class="pre">BINARY_TRUE_DIVIDE</span></span><a class="headerlink" href="#opcode-BINARY_TRUE_DIVIDE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">/</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_MODULO"> <span class="sig-name descname"><span class="pre">BINARY_MODULO</span></span><a class="headerlink" href="#opcode-BINARY_MODULO" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">%</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_ADD"> <span class="sig-name descname"><span class="pre">BINARY_ADD</span></span><a class="headerlink" href="#opcode-BINARY_ADD" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">+</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_SUBTRACT"> <span class="sig-name descname"><span class="pre">BINARY_SUBTRACT</span></span><a class="headerlink" href="#opcode-BINARY_SUBTRACT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">-</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_SUBSCR"> <span class="sig-name descname"><span class="pre">BINARY_SUBSCR</span></span><a class="headerlink" href="#opcode-BINARY_SUBSCR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1[TOS]</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_LSHIFT"> <span class="sig-name descname"><span class="pre">BINARY_LSHIFT</span></span><a class="headerlink" href="#opcode-BINARY_LSHIFT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre"><<</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_RSHIFT"> <span class="sig-name descname"><span class="pre">BINARY_RSHIFT</span></span><a class="headerlink" href="#opcode-BINARY_RSHIFT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">>></span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_AND"> <span class="sig-name descname"><span class="pre">BINARY_AND</span></span><a class="headerlink" href="#opcode-BINARY_AND" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">&</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_XOR"> <span class="sig-name descname"><span class="pre">BINARY_XOR</span></span><a class="headerlink" href="#opcode-BINARY_XOR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">^</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BINARY_OR"> <span class="sig-name descname"><span class="pre">BINARY_OR</span></span><a class="headerlink" href="#opcode-BINARY_OR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">|</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <p><strong>In-place operations</strong></p> <p>In-place operations are like binary operations, in that they remove TOS and TOS1, and push the result back on the stack, but the operation is done in-place when TOS1 supports it, and the resulting TOS may be (but does not have to be) the original TOS1.</p> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_POWER"> <span class="sig-name descname"><span class="pre">INPLACE_POWER</span></span><a class="headerlink" href="#opcode-INPLACE_POWER" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">**</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_MULTIPLY"> <span class="sig-name descname"><span class="pre">INPLACE_MULTIPLY</span></span><a class="headerlink" href="#opcode-INPLACE_MULTIPLY" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">*</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_MATRIX_MULTIPLY"> <span class="sig-name descname"><span class="pre">INPLACE_MATRIX_MULTIPLY</span></span><a class="headerlink" href="#opcode-INPLACE_MATRIX_MULTIPLY" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">@</span> <span class="pre">TOS</span></code>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.5.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_FLOOR_DIVIDE"> <span class="sig-name descname"><span class="pre">INPLACE_FLOOR_DIVIDE</span></span><a class="headerlink" href="#opcode-INPLACE_FLOOR_DIVIDE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">//</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_TRUE_DIVIDE"> <span class="sig-name descname"><span class="pre">INPLACE_TRUE_DIVIDE</span></span><a class="headerlink" href="#opcode-INPLACE_TRUE_DIVIDE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">/</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_MODULO"> <span class="sig-name descname"><span class="pre">INPLACE_MODULO</span></span><a class="headerlink" href="#opcode-INPLACE_MODULO" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">%</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_ADD"> <span class="sig-name descname"><span class="pre">INPLACE_ADD</span></span><a class="headerlink" href="#opcode-INPLACE_ADD" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">+</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_SUBTRACT"> <span class="sig-name descname"><span class="pre">INPLACE_SUBTRACT</span></span><a class="headerlink" href="#opcode-INPLACE_SUBTRACT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">-</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_LSHIFT"> <span class="sig-name descname"><span class="pre">INPLACE_LSHIFT</span></span><a class="headerlink" href="#opcode-INPLACE_LSHIFT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre"><<</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_RSHIFT"> <span class="sig-name descname"><span class="pre">INPLACE_RSHIFT</span></span><a class="headerlink" href="#opcode-INPLACE_RSHIFT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">>></span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_AND"> <span class="sig-name descname"><span class="pre">INPLACE_AND</span></span><a class="headerlink" href="#opcode-INPLACE_AND" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">&</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_XOR"> <span class="sig-name descname"><span class="pre">INPLACE_XOR</span></span><a class="headerlink" href="#opcode-INPLACE_XOR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">^</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-INPLACE_OR"> <span class="sig-name descname"><span class="pre">INPLACE_OR</span></span><a class="headerlink" href="#opcode-INPLACE_OR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">|</span> <span class="pre">TOS</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-STORE_SUBSCR"> <span class="sig-name descname"><span class="pre">STORE_SUBSCR</span></span><a class="headerlink" href="#opcode-STORE_SUBSCR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS1[TOS]</span> <span class="pre">=</span> <span class="pre">TOS2</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DELETE_SUBSCR"> <span class="sig-name descname"><span class="pre">DELETE_SUBSCR</span></span><a class="headerlink" href="#opcode-DELETE_SUBSCR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">del</span> <span class="pre">TOS1[TOS]</span></code>.</p> </dd></dl> <p><strong>Coroutine opcodes</strong></p> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-GET_AWAITABLE"> <span class="sig-name descname"><span class="pre">GET_AWAITABLE</span></span><a class="headerlink" href="#opcode-GET_AWAITABLE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">get_awaitable(TOS)</span></code>, where <code class="docutils literal notranslate"><span class="pre">get_awaitable(o)</span></code> returns <code class="docutils literal notranslate"><span class="pre">o</span></code> if <code class="docutils literal notranslate"><span class="pre">o</span></code> is a coroutine object or a generator object with the CO_ITERABLE_COROUTINE flag, or resolves <code class="docutils literal notranslate"><span class="pre">o.__await__</span></code>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.5.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-GET_AITER"> <span class="sig-name descname"><span class="pre">GET_AITER</span></span><a class="headerlink" href="#opcode-GET_AITER" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS.__aiter__()</span></code>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.5.</span></p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.7: </span>Returning awaitable objects from <code class="docutils literal notranslate"><span class="pre">__aiter__</span></code> is no longer supported.</p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-GET_ANEXT"> <span class="sig-name descname"><span class="pre">GET_ANEXT</span></span><a class="headerlink" href="#opcode-GET_ANEXT" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes <code class="docutils literal notranslate"><span class="pre">get_awaitable(TOS.__anext__())</span></code> to the stack. See <code class="docutils literal notranslate"><span class="pre">GET_AWAITABLE</span></code> for details about <code class="docutils literal notranslate"><span class="pre">get_awaitable</span></code>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.5.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-END_ASYNC_FOR"> <span class="sig-name descname"><span class="pre">END_ASYNC_FOR</span></span><a class="headerlink" href="#opcode-END_ASYNC_FOR" title="Permalink to this definition">¶</a></dt> <dd><p>Terminates an <a class="reference internal" href="../reference/compound_stmts.html#async-for"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">async</span> <span class="pre">for</span></code></a> loop. Handles an exception raised when awaiting a next item. If TOS is <a class="reference internal" href="exceptions.html#StopAsyncIteration" title="StopAsyncIteration"><code class="xref py py-exc docutils literal notranslate"><span class="pre">StopAsyncIteration</span></code></a> pop 7 values from the stack and restore the exception state using the second three of them. Otherwise re-raise the exception using the three values from the stack. An exception handler block is removed from the block stack.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.8.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BEFORE_ASYNC_WITH"> <span class="sig-name descname"><span class="pre">BEFORE_ASYNC_WITH</span></span><a class="headerlink" href="#opcode-BEFORE_ASYNC_WITH" title="Permalink to this definition">¶</a></dt> <dd><p>Resolves <code class="docutils literal notranslate"><span class="pre">__aenter__</span></code> and <code class="docutils literal notranslate"><span class="pre">__aexit__</span></code> from the object on top of the stack. Pushes <code class="docutils literal notranslate"><span class="pre">__aexit__</span></code> and result of <code class="docutils literal notranslate"><span class="pre">__aenter__()</span></code> to the stack.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.5.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-SETUP_ASYNC_WITH"> <span class="sig-name descname"><span class="pre">SETUP_ASYNC_WITH</span></span><a class="headerlink" href="#opcode-SETUP_ASYNC_WITH" title="Permalink to this definition">¶</a></dt> <dd><p>Creates a new frame object.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.5.</span></p> </div> </dd></dl> <p><strong>Miscellaneous opcodes</strong></p> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-PRINT_EXPR"> <span class="sig-name descname"><span class="pre">PRINT_EXPR</span></span><a class="headerlink" href="#opcode-PRINT_EXPR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements the expression statement for the interactive mode. TOS is removed from the stack and printed. In non-interactive mode, an expression statement is terminated with <a class="reference internal" href="#opcode-POP_TOP"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">POP_TOP</span></code></a>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-SET_ADD"> <span class="sig-name descname"><span class="pre">SET_ADD</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">i</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-SET_ADD" title="Permalink to this definition">¶</a></dt> <dd><p>Calls <code class="docutils literal notranslate"><span class="pre">set.add(TOS1[-i],</span> <span class="pre">TOS)</span></code>. Used to implement set comprehensions.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LIST_APPEND"> <span class="sig-name descname"><span class="pre">LIST_APPEND</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">i</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-LIST_APPEND" title="Permalink to this definition">¶</a></dt> <dd><p>Calls <code class="docutils literal notranslate"><span class="pre">list.append(TOS1[-i],</span> <span class="pre">TOS)</span></code>. Used to implement list comprehensions.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-MAP_ADD"> <span class="sig-name descname"><span class="pre">MAP_ADD</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">i</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-MAP_ADD" title="Permalink to this definition">¶</a></dt> <dd><p>Calls <code class="docutils literal notranslate"><span class="pre">dict.__setitem__(TOS1[-i],</span> <span class="pre">TOS1,</span> <span class="pre">TOS)</span></code>. Used to implement dict comprehensions.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.1.</span></p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.8: </span>Map value is TOS and map key is TOS1. Before, those were reversed.</p> </div> </dd></dl> <p>For all of the <a class="reference internal" href="#opcode-SET_ADD"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">SET_ADD</span></code></a>, <a class="reference internal" href="#opcode-LIST_APPEND"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">LIST_APPEND</span></code></a> and <a class="reference internal" href="#opcode-MAP_ADD"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">MAP_ADD</span></code></a> instructions, while the added value or key/value pair is popped off, the container object remains on the stack so that it is available for further iterations of the loop.</p> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-RETURN_VALUE"> <span class="sig-name descname"><span class="pre">RETURN_VALUE</span></span><a class="headerlink" href="#opcode-RETURN_VALUE" title="Permalink to this definition">¶</a></dt> <dd><p>Returns with TOS to the caller of the function.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-YIELD_VALUE"> <span class="sig-name descname"><span class="pre">YIELD_VALUE</span></span><a class="headerlink" href="#opcode-YIELD_VALUE" title="Permalink to this definition">¶</a></dt> <dd><p>Pops TOS and yields it from a <a class="reference internal" href="../glossary.html#term-generator"><span class="xref std std-term">generator</span></a>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-YIELD_FROM"> <span class="sig-name descname"><span class="pre">YIELD_FROM</span></span><a class="headerlink" href="#opcode-YIELD_FROM" title="Permalink to this definition">¶</a></dt> <dd><p>Pops TOS and delegates to it as a subiterator from a <a class="reference internal" href="../glossary.html#term-generator"><span class="xref std std-term">generator</span></a>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.3.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-SETUP_ANNOTATIONS"> <span class="sig-name descname"><span class="pre">SETUP_ANNOTATIONS</span></span><a class="headerlink" href="#opcode-SETUP_ANNOTATIONS" title="Permalink to this definition">¶</a></dt> <dd><p>Checks whether <code class="docutils literal notranslate"><span class="pre">__annotations__</span></code> is defined in <code class="docutils literal notranslate"><span class="pre">locals()</span></code>, if not it is set up to an empty <code class="docutils literal notranslate"><span class="pre">dict</span></code>. This opcode is only emitted if a class or module body contains <a class="reference internal" href="../glossary.html#term-variable-annotation"><span class="xref std std-term">variable annotations</span></a> statically.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.6.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-IMPORT_STAR"> <span class="sig-name descname"><span class="pre">IMPORT_STAR</span></span><a class="headerlink" href="#opcode-IMPORT_STAR" title="Permalink to this definition">¶</a></dt> <dd><p>Loads all symbols not starting with <code class="docutils literal notranslate"><span class="pre">'_'</span></code> directly from the module TOS to the local namespace. The module is popped after loading all names. This opcode implements <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">module</span> <span class="pre">import</span> <span class="pre">*</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-POP_BLOCK"> <span class="sig-name descname"><span class="pre">POP_BLOCK</span></span><a class="headerlink" href="#opcode-POP_BLOCK" title="Permalink to this definition">¶</a></dt> <dd><p>Removes one block from the block stack. Per frame, there is a stack of blocks, denoting <a class="reference internal" href="../reference/compound_stmts.html#try"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">try</span></code></a> statements, and such.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-POP_EXCEPT"> <span class="sig-name descname"><span class="pre">POP_EXCEPT</span></span><a class="headerlink" href="#opcode-POP_EXCEPT" title="Permalink to this definition">¶</a></dt> <dd><p>Removes one block from the block stack. The popped block must be an exception handler block, as implicitly created when entering an except handler. In addition to popping extraneous values from the frame stack, the last three popped values are used to restore the exception state.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-RERAISE"> <span class="sig-name descname"><span class="pre">RERAISE</span></span><a class="headerlink" href="#opcode-RERAISE" title="Permalink to this definition">¶</a></dt> <dd><p>Re-raises the exception currently on top of the stack. If oparg is non-zero, restores <code class="docutils literal notranslate"><span class="pre">f_lasti</span></code> of the current frame to its value when the exception was raised.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-WITH_EXCEPT_START"> <span class="sig-name descname"><span class="pre">WITH_EXCEPT_START</span></span><a class="headerlink" href="#opcode-WITH_EXCEPT_START" title="Permalink to this definition">¶</a></dt> <dd><p>Calls the function in position 7 on the stack with the top three items on the stack as arguments. Used to implement the call <code class="docutils literal notranslate"><span class="pre">context_manager.__exit__(*exc_info())</span></code> when an exception has occurred in a <a class="reference internal" href="../reference/compound_stmts.html#with"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">with</span></code></a> statement.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LOAD_ASSERTION_ERROR"> <span class="sig-name descname"><span class="pre">LOAD_ASSERTION_ERROR</span></span><a class="headerlink" href="#opcode-LOAD_ASSERTION_ERROR" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes <a class="reference internal" href="exceptions.html#AssertionError" title="AssertionError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">AssertionError</span></code></a> onto the stack. Used by the <a class="reference internal" href="../reference/simple_stmts.html#assert"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">assert</span></code></a> statement.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LOAD_BUILD_CLASS"> <span class="sig-name descname"><span class="pre">LOAD_BUILD_CLASS</span></span><a class="headerlink" href="#opcode-LOAD_BUILD_CLASS" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes <code class="xref py py-func docutils literal notranslate"><span class="pre">builtins.__build_class__()</span></code> onto the stack. It is later called by <a class="reference internal" href="#opcode-CALL_FUNCTION"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">CALL_FUNCTION</span></code></a> to construct a class.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-SETUP_WITH"> <span class="sig-name descname"><span class="pre">SETUP_WITH</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">delta</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-SETUP_WITH" title="Permalink to this definition">¶</a></dt> <dd><p>This opcode performs several operations before a with block starts. First, it loads <a class="reference internal" href="../reference/datamodel.html#object.__exit__" title="object.__exit__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__exit__()</span></code></a> from the context manager and pushes it onto the stack for later use by <a class="reference internal" href="#opcode-WITH_EXCEPT_START"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">WITH_EXCEPT_START</span></code></a>. Then, <a class="reference internal" href="../reference/datamodel.html#object.__enter__" title="object.__enter__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__enter__()</span></code></a> is called, and a finally block pointing to <em>delta</em> is pushed. Finally, the result of calling the <code class="docutils literal notranslate"><span class="pre">__enter__()</span></code> method is pushed onto the stack. The next opcode will either ignore it (<a class="reference internal" href="#opcode-POP_TOP"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">POP_TOP</span></code></a>), or store it in (a) variable(s) (<a class="reference internal" href="#opcode-STORE_FAST"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">STORE_FAST</span></code></a>, <a class="reference internal" href="#opcode-STORE_NAME"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">STORE_NAME</span></code></a>, or <a class="reference internal" href="#opcode-UNPACK_SEQUENCE"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">UNPACK_SEQUENCE</span></code></a>).</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-COPY_DICT_WITHOUT_KEYS"> <span class="sig-name descname"><span class="pre">COPY_DICT_WITHOUT_KEYS</span></span><a class="headerlink" href="#opcode-COPY_DICT_WITHOUT_KEYS" title="Permalink to this definition">¶</a></dt> <dd><p>TOS is a tuple of mapping keys, and TOS1 is the match subject. Replace TOS with a <a class="reference internal" href="stdtypes.html#dict" title="dict"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a> formed from the items of TOS1, but without any of the keys in TOS.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-GET_LEN"> <span class="sig-name descname"><span class="pre">GET_LEN</span></span><a class="headerlink" href="#opcode-GET_LEN" title="Permalink to this definition">¶</a></dt> <dd><p>Push <code class="docutils literal notranslate"><span class="pre">len(TOS)</span></code> onto the stack.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-MATCH_MAPPING"> <span class="sig-name descname"><span class="pre">MATCH_MAPPING</span></span><a class="headerlink" href="#opcode-MATCH_MAPPING" title="Permalink to this definition">¶</a></dt> <dd><p>If TOS is an instance of <a class="reference internal" href="collections.abc.html#collections.abc.Mapping" title="collections.abc.Mapping"><code class="xref py py-class docutils literal notranslate"><span class="pre">collections.abc.Mapping</span></code></a> (or, more technically: if it has the <a class="reference internal" href="../c-api/typeobj.html#Py_TPFLAGS_MAPPING" title="Py_TPFLAGS_MAPPING"><code class="xref py py-const docutils literal notranslate"><span class="pre">Py_TPFLAGS_MAPPING</span></code></a> flag set in its <a class="reference internal" href="../c-api/typeobj.html#c.PyTypeObject.tp_flags" title="PyTypeObject.tp_flags"><code class="xref c c-member docutils literal notranslate"><span class="pre">tp_flags</span></code></a>), push <code class="docutils literal notranslate"><span class="pre">True</span></code> onto the stack. Otherwise, push <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-MATCH_SEQUENCE"> <span class="sig-name descname"><span class="pre">MATCH_SEQUENCE</span></span><a class="headerlink" href="#opcode-MATCH_SEQUENCE" title="Permalink to this definition">¶</a></dt> <dd><p>If TOS is an instance of <a class="reference internal" href="collections.abc.html#collections.abc.Sequence" title="collections.abc.Sequence"><code class="xref py py-class docutils literal notranslate"><span class="pre">collections.abc.Sequence</span></code></a> and is <em>not</em> an instance of <a class="reference internal" href="stdtypes.html#str" title="str"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>/<a class="reference internal" href="stdtypes.html#bytes" title="bytes"><code class="xref py py-class docutils literal notranslate"><span class="pre">bytes</span></code></a>/<a class="reference internal" href="stdtypes.html#bytearray" title="bytearray"><code class="xref py py-class docutils literal notranslate"><span class="pre">bytearray</span></code></a> (or, more technically: if it has the <a class="reference internal" href="../c-api/typeobj.html#Py_TPFLAGS_SEQUENCE" title="Py_TPFLAGS_SEQUENCE"><code class="xref py py-const docutils literal notranslate"><span class="pre">Py_TPFLAGS_SEQUENCE</span></code></a> flag set in its <a class="reference internal" href="../c-api/typeobj.html#c.PyTypeObject.tp_flags" title="PyTypeObject.tp_flags"><code class="xref c c-member docutils literal notranslate"><span class="pre">tp_flags</span></code></a>), push <code class="docutils literal notranslate"><span class="pre">True</span></code> onto the stack. Otherwise, push <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-MATCH_KEYS"> <span class="sig-name descname"><span class="pre">MATCH_KEYS</span></span><a class="headerlink" href="#opcode-MATCH_KEYS" title="Permalink to this definition">¶</a></dt> <dd><p>TOS is a tuple of mapping keys, and TOS1 is the match subject. If TOS1 contains all of the keys in TOS, push a <a class="reference internal" href="stdtypes.html#tuple" title="tuple"><code class="xref py py-class docutils literal notranslate"><span class="pre">tuple</span></code></a> containing the corresponding values, followed by <code class="docutils literal notranslate"><span class="pre">True</span></code>. Otherwise, push <code class="docutils literal notranslate"><span class="pre">None</span></code>, followed by <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.</span></p> </div> </dd></dl> <p>All of the following opcodes use their arguments.</p> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-STORE_NAME"> <span class="sig-name descname"><span class="pre">STORE_NAME</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">namei</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-STORE_NAME" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">name</span> <span class="pre">=</span> <span class="pre">TOS</span></code>. <em>namei</em> is the index of <em>name</em> in the attribute <code class="xref py py-attr docutils literal notranslate"><span class="pre">co_names</span></code> of the code object. The compiler tries to use <a class="reference internal" href="#opcode-STORE_FAST"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">STORE_FAST</span></code></a> or <a class="reference internal" href="#opcode-STORE_GLOBAL"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">STORE_GLOBAL</span></code></a> if possible.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DELETE_NAME"> <span class="sig-name descname"><span class="pre">DELETE_NAME</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">namei</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-DELETE_NAME" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">del</span> <span class="pre">name</span></code>, where <em>namei</em> is the index into <code class="xref py py-attr docutils literal notranslate"><span class="pre">co_names</span></code> attribute of the code object.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-UNPACK_SEQUENCE"> <span class="sig-name descname"><span class="pre">UNPACK_SEQUENCE</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">count</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-UNPACK_SEQUENCE" title="Permalink to this definition">¶</a></dt> <dd><p>Unpacks TOS into <em>count</em> individual values, which are put onto the stack right-to-left.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-UNPACK_EX"> <span class="sig-name descname"><span class="pre">UNPACK_EX</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">counts</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-UNPACK_EX" title="Permalink to this definition">¶</a></dt> <dd><p>Implements assignment with a starred target: Unpacks an iterable in TOS into individual values, where the total number of values can be smaller than the number of items in the iterable: one of the new values will be a list of all leftover items.</p> <p>The low byte of <em>counts</em> is the number of values before the list value, the high byte of <em>counts</em> the number of values after it. The resulting values are put onto the stack right-to-left.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-STORE_ATTR"> <span class="sig-name descname"><span class="pre">STORE_ATTR</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">namei</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-STORE_ATTR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS.name</span> <span class="pre">=</span> <span class="pre">TOS1</span></code>, where <em>namei</em> is the index of name in <code class="xref py py-attr docutils literal notranslate"><span class="pre">co_names</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DELETE_ATTR"> <span class="sig-name descname"><span class="pre">DELETE_ATTR</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">namei</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-DELETE_ATTR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">del</span> <span class="pre">TOS.name</span></code>, using <em>namei</em> as index into <code class="xref py py-attr docutils literal notranslate"><span class="pre">co_names</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-STORE_GLOBAL"> <span class="sig-name descname"><span class="pre">STORE_GLOBAL</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">namei</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-STORE_GLOBAL" title="Permalink to this definition">¶</a></dt> <dd><p>Works as <a class="reference internal" href="#opcode-STORE_NAME"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">STORE_NAME</span></code></a>, but stores the name as a global.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DELETE_GLOBAL"> <span class="sig-name descname"><span class="pre">DELETE_GLOBAL</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">namei</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-DELETE_GLOBAL" title="Permalink to this definition">¶</a></dt> <dd><p>Works as <a class="reference internal" href="#opcode-DELETE_NAME"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">DELETE_NAME</span></code></a>, but deletes a global name.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LOAD_CONST"> <span class="sig-name descname"><span class="pre">LOAD_CONST</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">consti</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-LOAD_CONST" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes <code class="docutils literal notranslate"><span class="pre">co_consts[consti]</span></code> onto the stack.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LOAD_NAME"> <span class="sig-name descname"><span class="pre">LOAD_NAME</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">namei</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-LOAD_NAME" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes the value associated with <code class="docutils literal notranslate"><span class="pre">co_names[namei]</span></code> onto the stack.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BUILD_TUPLE"> <span class="sig-name descname"><span class="pre">BUILD_TUPLE</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">count</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-BUILD_TUPLE" title="Permalink to this definition">¶</a></dt> <dd><p>Creates a tuple consuming <em>count</em> items from the stack, and pushes the resulting tuple onto the stack.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BUILD_LIST"> <span class="sig-name descname"><span class="pre">BUILD_LIST</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">count</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-BUILD_LIST" title="Permalink to this definition">¶</a></dt> <dd><p>Works as <a class="reference internal" href="#opcode-BUILD_TUPLE"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">BUILD_TUPLE</span></code></a>, but creates a list.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BUILD_SET"> <span class="sig-name descname"><span class="pre">BUILD_SET</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">count</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-BUILD_SET" title="Permalink to this definition">¶</a></dt> <dd><p>Works as <a class="reference internal" href="#opcode-BUILD_TUPLE"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">BUILD_TUPLE</span></code></a>, but creates a set.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BUILD_MAP"> <span class="sig-name descname"><span class="pre">BUILD_MAP</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">count</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-BUILD_MAP" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes a new dictionary object onto the stack. Pops <code class="docutils literal notranslate"><span class="pre">2</span> <span class="pre">*</span> <span class="pre">count</span></code> items so that the dictionary holds <em>count</em> entries: <code class="docutils literal notranslate"><span class="pre">{...,</span> <span class="pre">TOS3:</span> <span class="pre">TOS2,</span> <span class="pre">TOS1:</span> <span class="pre">TOS}</span></code>.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.5: </span>The dictionary is created from stack items instead of creating an empty dictionary pre-sized to hold <em>count</em> items.</p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BUILD_CONST_KEY_MAP"> <span class="sig-name descname"><span class="pre">BUILD_CONST_KEY_MAP</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">count</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-BUILD_CONST_KEY_MAP" title="Permalink to this definition">¶</a></dt> <dd><p>The version of <a class="reference internal" href="#opcode-BUILD_MAP"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">BUILD_MAP</span></code></a> specialized for constant keys. Pops the top element on the stack which contains a tuple of keys, then starting from <code class="docutils literal notranslate"><span class="pre">TOS1</span></code>, pops <em>count</em> values to form values in the built dictionary.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.6.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BUILD_STRING"> <span class="sig-name descname"><span class="pre">BUILD_STRING</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">count</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-BUILD_STRING" title="Permalink to this definition">¶</a></dt> <dd><p>Concatenates <em>count</em> strings from the stack and pushes the resulting string onto the stack.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.6.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LIST_TO_TUPLE"> <span class="sig-name descname"><span class="pre">LIST_TO_TUPLE</span></span><a class="headerlink" href="#opcode-LIST_TO_TUPLE" title="Permalink to this definition">¶</a></dt> <dd><p>Pops a list from the stack and pushes a tuple containing the same values.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LIST_EXTEND"> <span class="sig-name descname"><span class="pre">LIST_EXTEND</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">i</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-LIST_EXTEND" title="Permalink to this definition">¶</a></dt> <dd><p>Calls <code class="docutils literal notranslate"><span class="pre">list.extend(TOS1[-i],</span> <span class="pre">TOS)</span></code>. Used to build lists.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-SET_UPDATE"> <span class="sig-name descname"><span class="pre">SET_UPDATE</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">i</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-SET_UPDATE" title="Permalink to this definition">¶</a></dt> <dd><p>Calls <code class="docutils literal notranslate"><span class="pre">set.update(TOS1[-i],</span> <span class="pre">TOS)</span></code>. Used to build sets.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DICT_UPDATE"> <span class="sig-name descname"><span class="pre">DICT_UPDATE</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">i</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-DICT_UPDATE" title="Permalink to this definition">¶</a></dt> <dd><p>Calls <code class="docutils literal notranslate"><span class="pre">dict.update(TOS1[-i],</span> <span class="pre">TOS)</span></code>. Used to build dicts.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DICT_MERGE"> <span class="sig-name descname"><span class="pre">DICT_MERGE</span></span><a class="headerlink" href="#opcode-DICT_MERGE" title="Permalink to this definition">¶</a></dt> <dd><p>Like <a class="reference internal" href="#opcode-DICT_UPDATE"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">DICT_UPDATE</span></code></a> but raises an exception for duplicate keys.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LOAD_ATTR"> <span class="sig-name descname"><span class="pre">LOAD_ATTR</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">namei</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-LOAD_ATTR" title="Permalink to this definition">¶</a></dt> <dd><p>Replaces TOS with <code class="docutils literal notranslate"><span class="pre">getattr(TOS,</span> <span class="pre">co_names[namei])</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-COMPARE_OP"> <span class="sig-name descname"><span class="pre">COMPARE_OP</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">opname</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-COMPARE_OP" title="Permalink to this definition">¶</a></dt> <dd><p>Performs a Boolean operation. The operation name can be found in <code class="docutils literal notranslate"><span class="pre">cmp_op[opname]</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-IS_OP"> <span class="sig-name descname"><span class="pre">IS_OP</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">invert</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-IS_OP" title="Permalink to this definition">¶</a></dt> <dd><p>Performs <code class="docutils literal notranslate"><span class="pre">is</span></code> comparison, or <code class="docutils literal notranslate"><span class="pre">is</span> <span class="pre">not</span></code> if <code class="docutils literal notranslate"><span class="pre">invert</span></code> is 1.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-CONTAINS_OP"> <span class="sig-name descname"><span class="pre">CONTAINS_OP</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">invert</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-CONTAINS_OP" title="Permalink to this definition">¶</a></dt> <dd><p>Performs <code class="docutils literal notranslate"><span class="pre">in</span></code> comparison, or <code class="docutils literal notranslate"><span class="pre">not</span> <span class="pre">in</span></code> if <code class="docutils literal notranslate"><span class="pre">invert</span></code> is 1.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-IMPORT_NAME"> <span class="sig-name descname"><span class="pre">IMPORT_NAME</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">namei</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-IMPORT_NAME" title="Permalink to this definition">¶</a></dt> <dd><p>Imports the module <code class="docutils literal notranslate"><span class="pre">co_names[namei]</span></code>. TOS and TOS1 are popped and provide the <em>fromlist</em> and <em>level</em> arguments of <a class="reference internal" href="functions.html#import__" title="__import__"><code class="xref py py-func docutils literal notranslate"><span class="pre">__import__()</span></code></a>. The module object is pushed onto the stack. The current namespace is not affected: for a proper import statement, a subsequent <a class="reference internal" href="#opcode-STORE_FAST"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">STORE_FAST</span></code></a> instruction modifies the namespace.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-IMPORT_FROM"> <span class="sig-name descname"><span class="pre">IMPORT_FROM</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">namei</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-IMPORT_FROM" title="Permalink to this definition">¶</a></dt> <dd><p>Loads the attribute <code class="docutils literal notranslate"><span class="pre">co_names[namei]</span></code> from the module found in TOS. The resulting object is pushed onto the stack, to be subsequently stored by a <a class="reference internal" href="#opcode-STORE_FAST"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">STORE_FAST</span></code></a> instruction.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-JUMP_FORWARD"> <span class="sig-name descname"><span class="pre">JUMP_FORWARD</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">delta</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-JUMP_FORWARD" title="Permalink to this definition">¶</a></dt> <dd><p>Increments bytecode counter by <em>delta</em>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-POP_JUMP_IF_TRUE"> <span class="sig-name descname"><span class="pre">POP_JUMP_IF_TRUE</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">target</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-POP_JUMP_IF_TRUE" title="Permalink to this definition">¶</a></dt> <dd><p>If TOS is true, sets the bytecode counter to <em>target</em>. TOS is popped.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.1.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-POP_JUMP_IF_FALSE"> <span class="sig-name descname"><span class="pre">POP_JUMP_IF_FALSE</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">target</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-POP_JUMP_IF_FALSE" title="Permalink to this definition">¶</a></dt> <dd><p>If TOS is false, sets the bytecode counter to <em>target</em>. TOS is popped.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.1.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-JUMP_IF_NOT_EXC_MATCH"> <span class="sig-name descname"><span class="pre">JUMP_IF_NOT_EXC_MATCH</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">target</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-JUMP_IF_NOT_EXC_MATCH" title="Permalink to this definition">¶</a></dt> <dd><p>Tests whether the second value on the stack is an exception matching TOS, and jumps if it is not. Pops two values from the stack.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-JUMP_IF_TRUE_OR_POP"> <span class="sig-name descname"><span class="pre">JUMP_IF_TRUE_OR_POP</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">target</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-JUMP_IF_TRUE_OR_POP" title="Permalink to this definition">¶</a></dt> <dd><p>If TOS is true, sets the bytecode counter to <em>target</em> and leaves TOS on the stack. Otherwise (TOS is false), TOS is popped.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.1.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-JUMP_IF_FALSE_OR_POP"> <span class="sig-name descname"><span class="pre">JUMP_IF_FALSE_OR_POP</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">target</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-JUMP_IF_FALSE_OR_POP" title="Permalink to this definition">¶</a></dt> <dd><p>If TOS is false, sets the bytecode counter to <em>target</em> and leaves TOS on the stack. Otherwise (TOS is true), TOS is popped.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.1.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-JUMP_ABSOLUTE"> <span class="sig-name descname"><span class="pre">JUMP_ABSOLUTE</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">target</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-JUMP_ABSOLUTE" title="Permalink to this definition">¶</a></dt> <dd><p>Set bytecode counter to <em>target</em>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-FOR_ITER"> <span class="sig-name descname"><span class="pre">FOR_ITER</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">delta</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-FOR_ITER" title="Permalink to this definition">¶</a></dt> <dd><p>TOS is an <a class="reference internal" href="../glossary.html#term-iterator"><span class="xref std std-term">iterator</span></a>. Call its <a class="reference internal" href="stdtypes.html#iterator.__next__" title="iterator.__next__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__next__()</span></code></a> method. If this yields a new value, push it on the stack (leaving the iterator below it). If the iterator indicates it is exhausted, TOS is popped, and the byte code counter is incremented by <em>delta</em>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LOAD_GLOBAL"> <span class="sig-name descname"><span class="pre">LOAD_GLOBAL</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">namei</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-LOAD_GLOBAL" title="Permalink to this definition">¶</a></dt> <dd><p>Loads the global named <code class="docutils literal notranslate"><span class="pre">co_names[namei]</span></code> onto the stack.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-SETUP_FINALLY"> <span class="sig-name descname"><span class="pre">SETUP_FINALLY</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">delta</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-SETUP_FINALLY" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes a try block from a try-finally or try-except clause onto the block stack. <em>delta</em> points to the finally block or the first except block.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LOAD_FAST"> <span class="sig-name descname"><span class="pre">LOAD_FAST</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">var_num</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-LOAD_FAST" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes a reference to the local <code class="docutils literal notranslate"><span class="pre">co_varnames[var_num]</span></code> onto the stack.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-STORE_FAST"> <span class="sig-name descname"><span class="pre">STORE_FAST</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">var_num</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-STORE_FAST" title="Permalink to this definition">¶</a></dt> <dd><p>Stores TOS into the local <code class="docutils literal notranslate"><span class="pre">co_varnames[var_num]</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DELETE_FAST"> <span class="sig-name descname"><span class="pre">DELETE_FAST</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">var_num</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-DELETE_FAST" title="Permalink to this definition">¶</a></dt> <dd><p>Deletes local <code class="docutils literal notranslate"><span class="pre">co_varnames[var_num]</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LOAD_CLOSURE"> <span class="sig-name descname"><span class="pre">LOAD_CLOSURE</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">i</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-LOAD_CLOSURE" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes a reference to the cell contained in slot <em>i</em> of the cell and free variable storage. The name of the variable is <code class="docutils literal notranslate"><span class="pre">co_cellvars[i]</span></code> if <em>i</em> is less than the length of <em>co_cellvars</em>. Otherwise it is <code class="docutils literal notranslate"><span class="pre">co_freevars[i</span> <span class="pre">-</span> <span class="pre">len(co_cellvars)]</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LOAD_DEREF"> <span class="sig-name descname"><span class="pre">LOAD_DEREF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">i</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-LOAD_DEREF" title="Permalink to this definition">¶</a></dt> <dd><p>Loads the cell contained in slot <em>i</em> of the cell and free variable storage. Pushes a reference to the object the cell contains on the stack.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LOAD_CLASSDEREF"> <span class="sig-name descname"><span class="pre">LOAD_CLASSDEREF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">i</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-LOAD_CLASSDEREF" title="Permalink to this definition">¶</a></dt> <dd><p>Much like <a class="reference internal" href="#opcode-LOAD_DEREF"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">LOAD_DEREF</span></code></a> but first checks the locals dictionary before consulting the cell. This is used for loading free variables in class bodies.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.4.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-STORE_DEREF"> <span class="sig-name descname"><span class="pre">STORE_DEREF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">i</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-STORE_DEREF" title="Permalink to this definition">¶</a></dt> <dd><p>Stores TOS into the cell contained in slot <em>i</em> of the cell and free variable storage.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DELETE_DEREF"> <span class="sig-name descname"><span class="pre">DELETE_DEREF</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">i</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-DELETE_DEREF" title="Permalink to this definition">¶</a></dt> <dd><p>Empties the cell contained in slot <em>i</em> of the cell and free variable storage. Used by the <a class="reference internal" href="../reference/simple_stmts.html#del"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">del</span></code></a> statement.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-RAISE_VARARGS"> <span class="sig-name descname"><span class="pre">RAISE_VARARGS</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">argc</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-RAISE_VARARGS" title="Permalink to this definition">¶</a></dt> <dd><p>Raises an exception using one of the 3 forms of the <code class="docutils literal notranslate"><span class="pre">raise</span></code> statement, depending on the value of <em>argc</em>:</p> <ul class="simple"> <li><p>0: <code class="docutils literal notranslate"><span class="pre">raise</span></code> (re-raise previous exception)</p></li> <li><p>1: <code class="docutils literal notranslate"><span class="pre">raise</span> <span class="pre">TOS</span></code> (raise exception instance or type at <code class="docutils literal notranslate"><span class="pre">TOS</span></code>)</p></li> <li><p>2: <code class="docutils literal notranslate"><span class="pre">raise</span> <span class="pre">TOS1</span> <span class="pre">from</span> <span class="pre">TOS</span></code> (raise exception instance or type at <code class="docutils literal notranslate"><span class="pre">TOS1</span></code> with <code class="docutils literal notranslate"><span class="pre">__cause__</span></code> set to <code class="docutils literal notranslate"><span class="pre">TOS</span></code>)</p></li> </ul> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-CALL_FUNCTION"> <span class="sig-name descname"><span class="pre">CALL_FUNCTION</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">argc</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-CALL_FUNCTION" title="Permalink to this definition">¶</a></dt> <dd><p>Calls a callable object with positional arguments. <em>argc</em> indicates the number of positional arguments. The top of the stack contains positional arguments, with the right-most argument on top. Below the arguments is a callable object to call. <code class="docutils literal notranslate"><span class="pre">CALL_FUNCTION</span></code> pops all arguments and the callable object off the stack, calls the callable object with those arguments, and pushes the return value returned by the callable object.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.6: </span>This opcode is used only for calls with positional arguments.</p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-CALL_FUNCTION_KW"> <span class="sig-name descname"><span class="pre">CALL_FUNCTION_KW</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">argc</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-CALL_FUNCTION_KW" title="Permalink to this definition">¶</a></dt> <dd><p>Calls a callable object with positional (if any) and keyword arguments. <em>argc</em> indicates the total number of positional and keyword arguments. The top element on the stack contains a tuple with the names of the keyword arguments, which must be strings. Below that are the values for the keyword arguments, in the order corresponding to the tuple. Below that are positional arguments, with the right-most parameter on top. Below the arguments is a callable object to call. <code class="docutils literal notranslate"><span class="pre">CALL_FUNCTION_KW</span></code> pops all arguments and the callable object off the stack, calls the callable object with those arguments, and pushes the return value returned by the callable object.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.6: </span>Keyword arguments are packed in a tuple instead of a dictionary, <em>argc</em> indicates the total number of arguments.</p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-CALL_FUNCTION_EX"> <span class="sig-name descname"><span class="pre">CALL_FUNCTION_EX</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">flags</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-CALL_FUNCTION_EX" title="Permalink to this definition">¶</a></dt> <dd><p>Calls a callable object with variable set of positional and keyword arguments. If the lowest bit of <em>flags</em> is set, the top of the stack contains a mapping object containing additional keyword arguments. Before the callable is called, the mapping object and iterable object are each “unpacked” and their contents passed in as keyword and positional arguments respectively. <code class="docutils literal notranslate"><span class="pre">CALL_FUNCTION_EX</span></code> pops all arguments and the callable object off the stack, calls the callable object with those arguments, and pushes the return value returned by the callable object.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.6.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LOAD_METHOD"> <span class="sig-name descname"><span class="pre">LOAD_METHOD</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">namei</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-LOAD_METHOD" title="Permalink to this definition">¶</a></dt> <dd><p>Loads a method named <code class="docutils literal notranslate"><span class="pre">co_names[namei]</span></code> from the TOS object. TOS is popped. This bytecode distinguishes two cases: if TOS has a method with the correct name, the bytecode pushes the unbound method and TOS. TOS will be used as the first argument (<code class="docutils literal notranslate"><span class="pre">self</span></code>) by <a class="reference internal" href="#opcode-CALL_METHOD"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">CALL_METHOD</span></code></a> when calling the unbound method. Otherwise, <code class="docutils literal notranslate"><span class="pre">NULL</span></code> and the object return by the attribute lookup are pushed.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.7.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-CALL_METHOD"> <span class="sig-name descname"><span class="pre">CALL_METHOD</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">argc</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-CALL_METHOD" title="Permalink to this definition">¶</a></dt> <dd><p>Calls a method. <em>argc</em> is the number of positional arguments. Keyword arguments are not supported. This opcode is designed to be used with <a class="reference internal" href="#opcode-LOAD_METHOD"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">LOAD_METHOD</span></code></a>. Positional arguments are on top of the stack. Below them, the two items described in <a class="reference internal" href="#opcode-LOAD_METHOD"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">LOAD_METHOD</span></code></a> are on the stack (either <code class="docutils literal notranslate"><span class="pre">self</span></code> and an unbound method object or <code class="docutils literal notranslate"><span class="pre">NULL</span></code> and an arbitrary callable). All of them are popped and the return value is pushed.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.7.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-MAKE_FUNCTION"> <span class="sig-name descname"><span class="pre">MAKE_FUNCTION</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">flags</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-MAKE_FUNCTION" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes a new function object on the stack. From bottom to top, the consumed stack must consist of values if the argument carries a specified flag value</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">0x01</span></code> a tuple of default values for positional-only and positional-or-keyword parameters in positional order</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">0x02</span></code> a dictionary of keyword-only parameters’ default values</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">0x04</span></code> a tuple of strings containing parameters’ annotations</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">0x08</span></code> a tuple containing cells for free variables, making a closure</p></li> <li><p>the code associated with the function (at TOS1)</p></li> <li><p>the <a class="reference internal" href="../glossary.html#term-qualified-name"><span class="xref std std-term">qualified name</span></a> of the function (at TOS)</p></li> </ul> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.10: </span>Flag value <code class="docutils literal notranslate"><span class="pre">0x04</span></code> is a tuple of strings instead of dictionary</p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BUILD_SLICE"> <span class="sig-name descname"><span class="pre">BUILD_SLICE</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">argc</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-BUILD_SLICE" title="Permalink to this definition">¶</a></dt> <dd><p id="index-1">Pushes a slice object on the stack. <em>argc</em> must be 2 or 3. If it is 2, <code class="docutils literal notranslate"><span class="pre">slice(TOS1,</span> <span class="pre">TOS)</span></code> is pushed; if it is 3, <code class="docutils literal notranslate"><span class="pre">slice(TOS2,</span> <span class="pre">TOS1,</span> <span class="pre">TOS)</span></code> is pushed. See the <a class="reference internal" href="functions.html#slice" title="slice"><code class="xref py py-func docutils literal notranslate"><span class="pre">slice()</span></code></a> built-in function for more information.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-EXTENDED_ARG"> <span class="sig-name descname"><span class="pre">EXTENDED_ARG</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">ext</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-EXTENDED_ARG" title="Permalink to this definition">¶</a></dt> <dd><p>Prefixes any opcode which has an argument too big to fit into the default one byte. <em>ext</em> holds an additional byte which act as higher bits in the argument. For each opcode, at most three prefixal <code class="docutils literal notranslate"><span class="pre">EXTENDED_ARG</span></code> are allowed, forming an argument from two-byte to four-byte.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-FORMAT_VALUE"> <span class="sig-name descname"><span class="pre">FORMAT_VALUE</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">flags</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-FORMAT_VALUE" title="Permalink to this definition">¶</a></dt> <dd><p>Used for implementing formatted literal strings (f-strings). Pops an optional <em>fmt_spec</em> from the stack, then a required <em>value</em>. <em>flags</em> is interpreted as follows:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">(flags</span> <span class="pre">&</span> <span class="pre">0x03)</span> <span class="pre">==</span> <span class="pre">0x00</span></code>: <em>value</em> is formatted as-is.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">(flags</span> <span class="pre">&</span> <span class="pre">0x03)</span> <span class="pre">==</span> <span class="pre">0x01</span></code>: call <a class="reference internal" href="stdtypes.html#str" title="str"><code class="xref py py-func docutils literal notranslate"><span class="pre">str()</span></code></a> on <em>value</em> before formatting it.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">(flags</span> <span class="pre">&</span> <span class="pre">0x03)</span> <span class="pre">==</span> <span class="pre">0x02</span></code>: call <a class="reference internal" href="functions.html#repr" title="repr"><code class="xref py py-func docutils literal notranslate"><span class="pre">repr()</span></code></a> on <em>value</em> before formatting it.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">(flags</span> <span class="pre">&</span> <span class="pre">0x03)</span> <span class="pre">==</span> <span class="pre">0x03</span></code>: call <a class="reference internal" href="functions.html#ascii" title="ascii"><code class="xref py py-func docutils literal notranslate"><span class="pre">ascii()</span></code></a> on <em>value</em> before formatting it.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">(flags</span> <span class="pre">&</span> <span class="pre">0x04)</span> <span class="pre">==</span> <span class="pre">0x04</span></code>: pop <em>fmt_spec</em> from the stack and use it, else use an empty <em>fmt_spec</em>.</p></li> </ul> <p>Formatting is performed using <a class="reference internal" href="../c-api/object.html#c.PyObject_Format" title="PyObject_Format"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyObject_Format()</span></code></a>. The result is pushed on the stack.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.6.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-MATCH_CLASS"> <span class="sig-name descname"><span class="pre">MATCH_CLASS</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">count</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-MATCH_CLASS" title="Permalink to this definition">¶</a></dt> <dd><p>TOS is a tuple of keyword attribute names, TOS1 is the class being matched against, and TOS2 is the match subject. <em>count</em> is the number of positional sub-patterns.</p> <p>Pop TOS. If TOS2 is an instance of TOS1 and has the positional and keyword attributes required by <em>count</em> and TOS, set TOS to <code class="docutils literal notranslate"><span class="pre">True</span></code> and TOS1 to a tuple of extracted attributes. Otherwise, set TOS to <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-GEN_START"> <span class="sig-name descname"><span class="pre">GEN_START</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">kind</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-GEN_START" title="Permalink to this definition">¶</a></dt> <dd><blockquote> <div><p>Pops TOS. The <code class="docutils literal notranslate"><span class="pre">kind</span></code> operand corresponds to the type of generator or coroutine. The legal kinds are 0 for generator, 1 for coroutine, and 2 for async generator.</p> </div></blockquote> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-ROT_N"> <span class="sig-name descname"><span class="pre">ROT_N</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">count</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-ROT_N" title="Permalink to this definition">¶</a></dt> <dd><p>Lift the top <em>count</em> stack items one position up, and move TOS down to position <em>count</em>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.</span></p> </div> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-HAVE_ARGUMENT"> <span class="sig-name descname"><span class="pre">HAVE_ARGUMENT</span></span><a class="headerlink" href="#opcode-HAVE_ARGUMENT" title="Permalink to this definition">¶</a></dt> <dd><p>This is not really an opcode. It identifies the dividing line between opcodes which don’t use their argument and those that do (<code class="docutils literal notranslate"><span class="pre"><</span> <span class="pre">HAVE_ARGUMENT</span></code> and <code class="docutils literal notranslate"><span class="pre">>=</span> <span class="pre">HAVE_ARGUMENT</span></code>, respectively).</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.6: </span>Now every instruction has an argument, but opcodes <code class="docutils literal notranslate"><span class="pre"><</span> <span class="pre">HAVE_ARGUMENT</span></code> ignore it. Before, only opcodes <code class="docutils literal notranslate"><span class="pre">>=</span> <span class="pre">HAVE_ARGUMENT</span></code> had an argument.</p> </div> </dd></dl> </section> <section id="opcode-collections"> <span id="id1"></span><h2>Opcode collections<a class="headerlink" href="#opcode-collections" title="Permalink to this headline">¶</a></h2> <p>These collections are provided for automatic introspection of bytecode instructions:</p> <dl class="py data"> <dt class="sig sig-object py" id="dis.opname"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">opname</span></span><a class="headerlink" href="#dis.opname" title="Permalink to this definition">¶</a></dt> <dd><p>Sequence of operation names, indexable using the bytecode.</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.opmap"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">opmap</span></span><a class="headerlink" href="#dis.opmap" title="Permalink to this definition">¶</a></dt> <dd><p>Dictionary mapping operation names to bytecodes.</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.cmp_op"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">cmp_op</span></span><a class="headerlink" href="#dis.cmp_op" title="Permalink to this definition">¶</a></dt> <dd><p>Sequence of all compare operation names.</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.hasconst"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">hasconst</span></span><a class="headerlink" href="#dis.hasconst" title="Permalink to this definition">¶</a></dt> <dd><p>Sequence of bytecodes that access a constant.</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.hasfree"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">hasfree</span></span><a class="headerlink" href="#dis.hasfree" title="Permalink to this definition">¶</a></dt> <dd><p>Sequence of bytecodes that access a free variable (note that ‘free’ in this context refers to names in the current scope that are referenced by inner scopes or names in outer scopes that are referenced from this scope. It does <em>not</em> include references to global or builtin scopes).</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.hasname"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">hasname</span></span><a class="headerlink" href="#dis.hasname" title="Permalink to this definition">¶</a></dt> <dd><p>Sequence of bytecodes that access an attribute by name.</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.hasjrel"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">hasjrel</span></span><a class="headerlink" href="#dis.hasjrel" title="Permalink to this definition">¶</a></dt> <dd><p>Sequence of bytecodes that have a relative jump target.</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.hasjabs"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">hasjabs</span></span><a class="headerlink" href="#dis.hasjabs" title="Permalink to this definition">¶</a></dt> <dd><p>Sequence of bytecodes that have an absolute jump target.</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.haslocal"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">haslocal</span></span><a class="headerlink" href="#dis.haslocal" title="Permalink to this definition">¶</a></dt> <dd><p>Sequence of bytecodes that access a local variable.</p> </dd></dl> <dl class="py data"> <dt class="sig sig-object py" id="dis.hascompare"> <span class="sig-prename descclassname"><span class="pre">dis.</span></span><span class="sig-name descname"><span class="pre">hascompare</span></span><a class="headerlink" href="#dis.hascompare" title="Permalink to this definition">¶</a></dt> <dd><p>Sequence of bytecodes of Boolean operations.</p> </dd></dl> </section> </section> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h3><a href="../contents.html">Table of Contents</a></h3> <ul> <li><a class="reference internal" href="#"><code class="xref py py-mod docutils literal notranslate"><span class="pre">dis</span></code> — Disassembler for Python bytecode</a><ul> <li><a class="reference internal" href="#bytecode-analysis">Bytecode analysis</a></li> <li><a class="reference internal" href="#analysis-functions">Analysis functions</a></li> <li><a class="reference internal" href="#python-bytecode-instructions">Python Bytecode Instructions</a></li> <li><a class="reference internal" href="#opcode-collections">Opcode collections</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="compileall.html" title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">compileall</span></code> — Byte-compile Python libraries</a></p> <h4>Next topic</h4> <p class="topless"><a href="pickletools.html" title="next chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pickletools</span></code> — Tools for pickle developers</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../bugs.html">Report a Bug</a></li> <li> <a href="https://github.com/python/cpython/blob/3.10/Doc/library/dis.rst" rel="nofollow">Show Source </a> </li> </ul> </div> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="pickletools.html" title="pickletools — Tools for pickle developers" >next</a> |</li> <li class="right" > <a href="compileall.html" title="compileall — Byte-compile Python libraries" >previous</a> |</li> <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="https://www.python.org/">Python</a> »</li> <li class="switchers"> <div class="language_switcher_placeholder"></div> <div class="version_switcher_placeholder"></div> </li> <li> </li> <li id="cpython-language-and-version"> <a href="../index.html">3.10.12 Documentation</a> » </li> <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li> <li class="nav-item nav-item-2"><a href="language.html" >Python Language Services</a> »</li> <li class="nav-item nav-item-this"><a href=""><code class="xref py py-mod docutils literal notranslate"><span class="pre">dis</span></code> — Disassembler for Python bytecode</a></li> <li class="right"> <div class="inline-search" role="search"> <form class="inline-search" action="../search.html" method="get"> <input placeholder="Quick search" aria-label="Quick search" type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> | </li> </ul> </div> <div class="footer"> © <a href="../copyright.html">Copyright</a> 2001-2026, Python Software Foundation. <br /> This page is licensed under the Python Software Foundation License Version 2. <br /> Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. <br /> See <a href="/license.html">History and License</a> for more information.<br /> <br /> The Python Software Foundation is a non-profit corporation. <a href="https://www.python.org/psf/donations/">Please donate.</a> <br /> <br /> Last updated on January 26, 2026. <a href="/bugs.html">Found a bug</a>? <br /> Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2. </div> </body> </html>
Close