Linux cpanel.rrshost.in 5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022 x86_64
Apache
: 109.123.238.221 | : 172.69.17.165
128 Domain
8.2.28
aev999
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
python2.7 /
html /
library /
[ HOME SHELL ]
Name
Size
Permission
Action
2to3.html
63.71
KB
-rw-r--r--
__builtin__.html
11.79
KB
-rw-r--r--
__future__.html
15.58
KB
-rw-r--r--
__main__.html
8.33
KB
-rw-r--r--
_winreg.html
73.99
KB
-rw-r--r--
abc.html
26.82
KB
-rw-r--r--
aepack.html
15.47
KB
-rw-r--r--
aetools.html
18.79
KB
-rw-r--r--
aetypes.html
27.08
KB
-rw-r--r--
aifc.html
29.59
KB
-rw-r--r--
al.html
22.13
KB
-rw-r--r--
allos.html
35.48
KB
-rw-r--r--
anydbm.html
19.31
KB
-rw-r--r--
archiving.html
10.64
KB
-rw-r--r--
argparse.html
269.59
KB
-rw-r--r--
array.html
35.35
KB
-rw-r--r--
ast.html
42.42
KB
-rw-r--r--
asynchat.html
35.84
KB
-rw-r--r--
asyncore.html
43.22
KB
-rw-r--r--
atexit.html
19.23
KB
-rw-r--r--
audioop.html
41.32
KB
-rw-r--r--
autogil.html
9.77
KB
-rw-r--r--
base64.html
24.8
KB
-rw-r--r--
basehttpserver.html
40.6
KB
-rw-r--r--
bastion.html
13.02
KB
-rw-r--r--
bdb.html
50.06
KB
-rw-r--r--
binascii.html
26.64
KB
-rw-r--r--
binhex.html
12.66
KB
-rw-r--r--
bisect.html
28.52
KB
-rw-r--r--
bsddb.html
32.02
KB
-rw-r--r--
bz2.html
31.92
KB
-rw-r--r--
calendar.html
50.16
KB
-rw-r--r--
carbon.html
54.14
KB
-rw-r--r--
cd.html
35.24
KB
-rw-r--r--
cgi.html
58.4
KB
-rw-r--r--
cgihttpserver.html
15.12
KB
-rw-r--r--
cgitb.html
13.5
KB
-rw-r--r--
chunk.html
17.41
KB
-rw-r--r--
cmath.html
32.41
KB
-rw-r--r--
cmd.html
32.69
KB
-rw-r--r--
code.html
28.92
KB
-rw-r--r--
codecs.html
125.92
KB
-rw-r--r--
codeop.html
16.42
KB
-rw-r--r--
collections.html
150.36
KB
-rw-r--r--
colorpicker.html
9.02
KB
-rw-r--r--
colorsys.html
14.38
KB
-rw-r--r--
commands.html
16.63
KB
-rw-r--r--
compileall.html
21.18
KB
-rw-r--r--
compiler.html
78.14
KB
-rw-r--r--
configparser.html
73.92
KB
-rw-r--r--
constants.html
14.68
KB
-rw-r--r--
contextlib.html
22.91
KB
-rw-r--r--
cookie.html
45.38
KB
-rw-r--r--
cookielib.html
102.78
KB
-rw-r--r--
copy.html
14.21
KB
-rw-r--r--
copy_reg.html
15.82
KB
-rw-r--r--
crypt.html
11.62
KB
-rw-r--r--
crypto.html
8.35
KB
-rw-r--r--
csv.html
82.79
KB
-rw-r--r--
ctypes.html
280.57
KB
-rw-r--r--
curses.ascii.html
28.97
KB
-rw-r--r--
curses.html
200.94
KB
-rw-r--r--
curses.panel.html
18.43
KB
-rw-r--r--
custominterp.html
8.59
KB
-rw-r--r--
datatypes.html
18.84
KB
-rw-r--r--
datetime.html
261.02
KB
-rw-r--r--
dbhash.html
18.4
KB
-rw-r--r--
dbm.html
14.75
KB
-rw-r--r--
debug.html
11.28
KB
-rw-r--r--
decimal.html
239.14
KB
-rw-r--r--
development.html
15.27
KB
-rw-r--r--
difflib.html
96.93
KB
-rw-r--r--
dircache.html
13.66
KB
-rw-r--r--
dis.html
96.52
KB
-rw-r--r--
distribution.html
8.27
KB
-rw-r--r--
distutils.html
10.97
KB
-rw-r--r--
dl.html
19.27
KB
-rw-r--r--
doctest.html
193.18
KB
-rw-r--r--
docxmlrpcserver.html
20.02
KB
-rw-r--r--
dumbdbm.html
16.74
KB
-rw-r--r--
dummy_thread.html
11.04
KB
-rw-r--r--
dummy_threading.html
9.96
KB
-rw-r--r--
easydialogs.html
38.83
KB
-rw-r--r--
email-examples.html
47.2
KB
-rw-r--r--
email.charset.html
32.45
KB
-rw-r--r--
email.encoders.html
14.09
KB
-rw-r--r--
email.errors.html
19.2
KB
-rw-r--r--
email.generator.html
24.78
KB
-rw-r--r--
email.header.html
31.12
KB
-rw-r--r--
email.html
55.3
KB
-rw-r--r--
email.iterators.html
14.22
KB
-rw-r--r--
email.message.html
74.91
KB
-rw-r--r--
email.mime.html
34.51
KB
-rw-r--r--
email.parser.html
37.09
KB
-rw-r--r--
email.utils.html
30.04
KB
-rw-r--r--
ensurepip.html
20.21
KB
-rw-r--r--
errno.html
52.31
KB
-rw-r--r--
exceptions.html
73.4
KB
-rw-r--r--
fcntl.html
27.85
KB
-rw-r--r--
filecmp.html
26.49
KB
-rw-r--r--
fileformats.html
10.21
KB
-rw-r--r--
fileinput.html
29.36
KB
-rw-r--r--
filesys.html
11.55
KB
-rw-r--r--
fl.html
71.58
KB
-rw-r--r--
fm.html
15
KB
-rw-r--r--
fnmatch.html
17.78
KB
-rw-r--r--
formatter.html
43.91
KB
-rw-r--r--
fpectl.html
17.84
KB
-rw-r--r--
fpformat.html
12.65
KB
-rw-r--r--
fractions.html
27.17
KB
-rw-r--r--
framework.html
44.24
KB
-rw-r--r--
frameworks.html
8.11
KB
-rw-r--r--
ftplib.html
56.56
KB
-rw-r--r--
functions.html
216.84
KB
-rw-r--r--
functools.html
31.06
KB
-rw-r--r--
future_builtins.html
15.9
KB
-rw-r--r--
gc.html
30.74
KB
-rw-r--r--
gdbm.html
19.35
KB
-rw-r--r--
gensuitemodule.html
14.54
KB
-rw-r--r--
getopt.html
26.56
KB
-rw-r--r--
getpass.html
12.5
KB
-rw-r--r--
gettext.html
91.32
KB
-rw-r--r--
gl.html
26.71
KB
-rw-r--r--
glob.html
15.42
KB
-rw-r--r--
grp.html
12.33
KB
-rw-r--r--
gzip.html
21.95
KB
-rw-r--r--
hashlib.html
27.4
KB
-rw-r--r--
heapq.html
36.72
KB
-rw-r--r--
hmac.html
15.97
KB
-rw-r--r--
hotshot.html
22.69
KB
-rw-r--r--
htmllib.html
29.9
KB
-rw-r--r--
htmlparser.html
45.11
KB
-rw-r--r--
httplib.html
78.55
KB
-rw-r--r--
i18n.html
10.61
KB
-rw-r--r--
ic.html
22.03
KB
-rw-r--r--
idle.html
45.74
KB
-rw-r--r--
imageop.html
20.94
KB
-rw-r--r--
imaplib.html
69.9
KB
-rw-r--r--
imgfile.html
14.91
KB
-rw-r--r--
imghdr.html
13.43
KB
-rw-r--r--
imp.html
41.48
KB
-rw-r--r--
importlib.html
10.27
KB
-rw-r--r--
imputil.html
36.11
KB
-rw-r--r--
index.html
82.54
KB
-rw-r--r--
inspect.html
64.31
KB
-rw-r--r--
internet.html
26.77
KB
-rw-r--r--
intro.html
9.76
KB
-rw-r--r--
io.html
122.3
KB
-rw-r--r--
ipc.html
17.18
KB
-rw-r--r--
itertools.html
129.91
KB
-rw-r--r--
jpeg.html
15.36
KB
-rw-r--r--
json.html
79.09
KB
-rw-r--r--
keyword.html
9.27
KB
-rw-r--r--
language.html
12.35
KB
-rw-r--r--
linecache.html
12.7
KB
-rw-r--r--
locale.html
68.54
KB
-rw-r--r--
logging.config.html
82.23
KB
-rw-r--r--
logging.handlers.html
91.96
KB
-rw-r--r--
logging.html
123.15
KB
-rw-r--r--
mac.html
24.49
KB
-rw-r--r--
macos.html
18.51
KB
-rw-r--r--
macosa.html
14.55
KB
-rw-r--r--
macostools.html
19.67
KB
-rw-r--r--
macpath.html
9.19
KB
-rw-r--r--
mailbox.html
185.53
KB
-rw-r--r--
mailcap.html
15.3
KB
-rw-r--r--
markup.html
20.37
KB
-rw-r--r--
marshal.html
19.88
KB
-rw-r--r--
math.html
50.52
KB
-rw-r--r--
md5.html
16.65
KB
-rw-r--r--
mhlib.html
30.04
KB
-rw-r--r--
mimetools.html
23.84
KB
-rw-r--r--
mimetypes.html
35.82
KB
-rw-r--r--
mimewriter.html
18.19
KB
-rw-r--r--
mimify.html
16.96
KB
-rw-r--r--
miniaeframe.html
14.5
KB
-rw-r--r--
misc.html
7.77
KB
-rw-r--r--
mm.html
10.19
KB
-rw-r--r--
mmap.html
33.52
KB
-rw-r--r--
modulefinder.html
19.85
KB
-rw-r--r--
modules.html
9.68
KB
-rw-r--r--
msilib.html
72.78
KB
-rw-r--r--
msvcrt.html
24.1
KB
-rw-r--r--
multifile.html
28.82
KB
-rw-r--r--
multiprocessing.html
423.97
KB
-rw-r--r--
mutex.html
13.56
KB
-rw-r--r--
netdata.html
19.28
KB
-rw-r--r--
netrc.html
15.51
KB
-rw-r--r--
new.html
16.1
KB
-rw-r--r--
nis.html
13.19
KB
-rw-r--r--
nntplib.html
51.08
KB
-rw-r--r--
numbers.html
40.91
KB
-rw-r--r--
numeric.html
14.85
KB
-rw-r--r--
operator.html
118.32
KB
-rw-r--r--
optparse.html
251.08
KB
-rw-r--r--
os.html
270.49
KB
-rw-r--r--
os.path.html
48.87
KB
-rw-r--r--
ossaudiodev.html
49.79
KB
-rw-r--r--
othergui.html
9.98
KB
-rw-r--r--
parser.html
44.52
KB
-rw-r--r--
pdb.html
41.44
KB
-rw-r--r--
persistence.html
16.25
KB
-rw-r--r--
pickle.html
107.94
KB
-rw-r--r--
pickletools.html
13.21
KB
-rw-r--r--
pipes.html
21.85
KB
-rw-r--r--
pkgutil.html
30.59
KB
-rw-r--r--
platform.html
40.14
KB
-rw-r--r--
plistlib.html
20.96
KB
-rw-r--r--
popen2.html
30.13
KB
-rw-r--r--
poplib.html
27.93
KB
-rw-r--r--
posix.html
17.27
KB
-rw-r--r--
posixfile.html
23.68
KB
-rw-r--r--
pprint.html
36.42
KB
-rw-r--r--
profile.html
76.65
KB
-rw-r--r--
pty.html
11.42
KB
-rw-r--r--
pwd.html
13.53
KB
-rw-r--r--
py_compile.html
13.33
KB
-rw-r--r--
pyclbr.html
18.14
KB
-rw-r--r--
pydoc.html
14.33
KB
-rw-r--r--
pyexpat.html
93.28
KB
-rw-r--r--
python.html
13.53
KB
-rw-r--r--
queue.html
29.64
KB
-rw-r--r--
quopri.html
14.5
KB
-rw-r--r--
random.html
47.78
KB
-rw-r--r--
re.html
163.11
KB
-rw-r--r--
readline.html
41.2
KB
-rw-r--r--
repr.html
24.57
KB
-rw-r--r--
resource.html
30.86
KB
-rw-r--r--
restricted.html
12.69
KB
-rw-r--r--
rexec.html
43.59
KB
-rw-r--r--
rfc822.html
51.25
KB
-rw-r--r--
rlcompleter.html
15.29
KB
-rw-r--r--
robotparser.html
15.01
KB
-rw-r--r--
runpy.html
23.55
KB
-rw-r--r--
sched.html
21.76
KB
-rw-r--r--
scrolledtext.html
10.67
KB
-rw-r--r--
select.html
50.17
KB
-rw-r--r--
sets.html
39.92
KB
-rw-r--r--
sgi.html
11.09
KB
-rw-r--r--
sgmllib.html
38.77
KB
-rw-r--r--
sha.html
14.55
KB
-rw-r--r--
shelve.html
32.93
KB
-rw-r--r--
shlex.html
38.43
KB
-rw-r--r--
shutil.html
49.49
KB
-rw-r--r--
signal.html
36.52
KB
-rw-r--r--
simplehttpserver.html
21.57
KB
-rw-r--r--
simplexmlrpcserver.html
40.41
KB
-rw-r--r--
site.html
29
KB
-rw-r--r--
smtpd.html
15.64
KB
-rw-r--r--
smtplib.html
51.86
KB
-rw-r--r--
sndhdr.html
12.05
KB
-rw-r--r--
socket.html
126.94
KB
-rw-r--r--
socketserver.html
81.38
KB
-rw-r--r--
someos.html
17.09
KB
-rw-r--r--
spwd.html
12.25
KB
-rw-r--r--
sqlite3.html
154.12
KB
-rw-r--r--
ssl.html
214.5
KB
-rw-r--r--
stat.html
41.11
KB
-rw-r--r--
statvfs.html
13.24
KB
-rw-r--r--
stdtypes.html
309.83
KB
-rw-r--r--
string.html
129.58
KB
-rw-r--r--
stringio.html
21.1
KB
-rw-r--r--
stringprep.html
21.4
KB
-rw-r--r--
strings.html
16.42
KB
-rw-r--r--
struct.html
47.68
KB
-rw-r--r--
subprocess.html
117
KB
-rw-r--r--
sun.html
7.83
KB
-rw-r--r--
sunau.html
35.43
KB
-rw-r--r--
sunaudio.html
21.05
KB
-rw-r--r--
symbol.html
9.06
KB
-rw-r--r--
symtable.html
29.03
KB
-rw-r--r--
sys.html
118.12
KB
-rw-r--r--
sysconfig.html
28.8
KB
-rw-r--r--
syslog.html
21.29
KB
-rw-r--r--
tabnanny.html
12.78
KB
-rw-r--r--
tarfile.html
99.54
KB
-rw-r--r--
telnetlib.html
30.46
KB
-rw-r--r--
tempfile.html
35.02
KB
-rw-r--r--
termios.html
19.22
KB
-rw-r--r--
test.html
61.42
KB
-rw-r--r--
textwrap.html
32.28
KB
-rw-r--r--
thread.html
22.67
KB
-rw-r--r--
threading.html
92.04
KB
-rw-r--r--
time.html
65.55
KB
-rw-r--r--
timeit.html
44.38
KB
-rw-r--r--
tix.html
56.73
KB
-rw-r--r--
tk.html
26.76
KB
-rw-r--r--
tkinter.html
86.67
KB
-rw-r--r--
token.html
27.31
KB
-rw-r--r--
tokenize.html
21.69
KB
-rw-r--r--
trace.html
33.91
KB
-rw-r--r--
traceback.html
44.22
KB
-rw-r--r--
ttk.html
123.83
KB
-rw-r--r--
tty.html
10.95
KB
-rw-r--r--
turtle.html
246.17
KB
-rw-r--r--
types.html
33.66
KB
-rw-r--r--
undoc.html
25.54
KB
-rw-r--r--
unicodedata.html
22.64
KB
-rw-r--r--
unittest.html
246.75
KB
-rw-r--r--
unix.html
11.9
KB
-rw-r--r--
urllib.html
71.61
KB
-rw-r--r--
urllib2.html
128.77
KB
-rw-r--r--
urlparse.html
49.04
KB
-rw-r--r--
user.html
13.41
KB
-rw-r--r--
userdict.html
32.96
KB
-rw-r--r--
uu.html
13.25
KB
-rw-r--r--
uuid.html
33.55
KB
-rw-r--r--
warnings.html
51.86
KB
-rw-r--r--
wave.html
29.08
KB
-rw-r--r--
weakref.html
41.14
KB
-rw-r--r--
webbrowser.html
29.53
KB
-rw-r--r--
whichdb.html
10.44
KB
-rw-r--r--
windows.html
10.37
KB
-rw-r--r--
winsound.html
22.56
KB
-rw-r--r--
wsgiref.html
94.38
KB
-rw-r--r--
xdrlib.html
38.05
KB
-rw-r--r--
xml.dom.html
110.39
KB
-rw-r--r--
xml.dom.minidom.html
45.23
KB
-rw-r--r--
xml.dom.pulldom.html
16.32
KB
-rw-r--r--
xml.etree.elementtree.html
124.2
KB
-rw-r--r--
xml.html
18.76
KB
-rw-r--r--
xml.sax.handler.html
47.5
KB
-rw-r--r--
xml.sax.html
26.04
KB
-rw-r--r--
xml.sax.reader.html
51.4
KB
-rw-r--r--
xml.sax.utils.html
18.11
KB
-rw-r--r--
xmlrpclib.html
71.79
KB
-rw-r--r--
zipfile.html
67.26
KB
-rw-r--r--
zipimport.html
24.32
KB
-rw-r--r--
zlib.html
34.41
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>32.12. dis — Disassembler for Python bytecode — Python 2.7.18 documentation</title> <link rel="stylesheet" type="text/css" href="../_static/pygments.css" /> <link rel="stylesheet" type="text/css" href="../_static/classic.css" /> <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 2.7.18 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="32.13. pickletools — Tools for pickle developers" href="pickletools.html" /> <link rel="prev" title="32.11. compileall — Byte-compile Python libraries" href="compileall.html" /> <link rel="shortcut icon" type="image/png" href="../_static/py.png" /> <link rel="canonical" href="file:///usr/share/doc/python2.7/html/library/dis.html" /> <script type="text/javascript" src="../_static/copybutton.js"></script> </head><body> <div id="outdated-warning" style="padding: .5em; text-align: center; background-color: #FFBABA; color: #6A0E0E;"> This document is for an old version of Python that is <a href="https://devguide.python.org/devcycle/#end-of-life-branches">no longer supported</a>. You should install the python3 and python3-doc packages and read the <a href="file:///usr/share/doc/python3-doc/html/library/dis.html"> Python documentation for the Python3 version packaged in this release</a>. </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="32.13. pickletools — Tools for pickle developers" accesskey="N">next</a> |</li> <li class="right" > <a href="compileall.html" title="32.11. compileall — Byte-compile Python libraries" accesskey="P">previous</a> |</li> <li><img src="../_static/py.png" alt="" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="https://www.python.org/">Python</a> »</li> <li> <a href="../index.html">Python 2.7.18 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"><span class="section-number">32. </span>Python Language Services</a> »</li> <li class="nav-item nav-item-this"><a href=""><span class="section-number">32.12. </span><code class="xref py py-mod docutils literal notranslate"><span class="pre">dis</span></code> — Disassembler for Python bytecode</a></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><span class="section-number">32.12. </span><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/2.7/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><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> <p>Example: Given the function <code class="xref py py-func docutils literal notranslate"><span class="pre">myfunc()</span></code>:</p> <div class="highlight-default 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 get the disassembly of <code class="xref py py-func docutils literal notranslate"><span class="pre">myfunc()</span></code>:</p> <div class="highlight-default 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"> 3 LOAD_FAST 0 (alist)</span> <span class="go"> 6 CALL_FUNCTION 1</span> <span class="go"> 9 RETURN_VALUE</span> </pre></div> </div> <p>(The “2” is a line number).</p> <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 defines the following functions and constants:</p> <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><span class="optional">[</span><em class="sig-param"><span class="n"><span class="pre">bytesource</span></span></em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#dis.dis" title="Permalink to this definition">¶</a></dt> <dd><p>Disassemble the <em>bytesource</em> object. <em>bytesource</em> can denote either a module, a class, a method, a function, or a code object. For a module, it disassembles all functions. For a class, it disassembles all methods. For a single code sequence, it prints one line per bytecode instruction. If no object is provided, it disassembles the last traceback.</p> </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><span class="optional">[</span><em class="sig-param"><span class="n"><span class="pre">tb</span></span></em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#dis.distb" title="Permalink to this definition">¶</a></dt> <dd><p>Disassembles the top-of-stack function of a traceback, using the last traceback if none was passed. The instruction causing the exception is indicated.</p> </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><span class="optional">[</span>, <em class="sig-param"><span class="n"><span class="pre">lasti</span></span></em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#dis.disassemble" title="Permalink to this definition">¶</a></dt> <dd><p>Disassembles 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> </dd></dl> <dl class="py function"> <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><span class="optional">[</span>, <em class="sig-param"><span class="n"><span class="pre">lasti</span></span></em><span class="optional">]</span><span class="sig-paren">)</span><a class="headerlink" href="#dis.disco" title="Permalink to this definition">¶</a></dt> <dd><p>A synonym for <a class="reference internal" href="#dis.disassemble" title="dis.disassemble"><code class="xref py py-func docutils literal notranslate"><span class="pre">disassemble()</span></code></a>. It is more convenient to type, and kept for compatibility with earlier Python releases.</p> </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_firstlineno</span></code> and <code class="docutils literal notranslate"><span class="pre">co_lnotab</span></code> attributes 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> </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 code object <em>code</em> which are jump targets, and return a list of these offsets.</p> </dd></dl> <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.</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 id="python-bytecode-instructions"> <span id="bytecodes"></span><h2><span class="section-number">32.12.1. </span>Python Bytecode Instructions<a class="headerlink" href="#python-bytecode-instructions" title="Permalink to this headline">¶</a></h2> <p>The Python compiler currently generates the following bytecode instructions.</p> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-STOP_CODE"> <span class="sig-name descname"><span class="pre">STOP_CODE</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-STOP_CODE" title="Permalink to this definition">¶</a></dt> <dd><p>Indicates end-of-code to the compiler, not used by the interpreter.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-NOP"> <span class="sig-name descname"><span class="pre">NOP</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-ROT_FOUR" title="Permalink to this definition">¶</a></dt> <dd><p>Lifts second, third and forth stack item one position up, moves top down to position four.</p> </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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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> </dd></dl> <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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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_CONVERT"> <span class="sig-name descname"><span class="pre">UNARY_CONVERT</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-UNARY_CONVERT" 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_INVERT"> <span class="sig-name descname"><span class="pre">UNARY_INVERT</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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> <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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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_DIVIDE"> <span class="sig-name descname"><span class="pre">BINARY_DIVIDE</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-BINARY_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> when <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">__future__</span> <span class="pre">import</span> <span class="pre">division</span></code> is not in effect.</p> </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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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> when <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">__future__</span> <span class="pre">import</span> <span class="pre">division</span></code> is in effect.</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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>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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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_DIVIDE"> <span class="sig-name descname"><span class="pre">INPLACE_DIVIDE</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-INPLACE_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> when <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">__future__</span> <span class="pre">import</span> <span class="pre">division</span></code> is not in effect.</p> </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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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> when <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">__future__</span> <span class="pre">import</span> <span class="pre">division</span></code> is in effect.</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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> <p>The slice opcodes take up to three parameters.</p> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-SLICE-0"> <span id="opcode-SLICE+0"></span><span class="sig-name descname"><span class="pre">SLICE+0</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-SLICE-0" 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-SLICE-1"> <span id="opcode-SLICE+1"></span><span class="sig-name descname"><span class="pre">SLICE+1</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-SLICE-1" 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-SLICE-2"> <span id="opcode-SLICE+2"></span><span class="sig-name descname"><span class="pre">SLICE+2</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-SLICE-2" 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-SLICE-3"> <span id="opcode-SLICE+3"></span><span class="sig-name descname"><span class="pre">SLICE+3</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-SLICE-3" 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">TOS2[TOS1:TOS]</span></code>.</p> </dd></dl> <p>Slice assignment needs even an additional parameter. As any statement, they put nothing on the stack.</p> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-STORE_SLICE-0"> <span id="opcode-STORE_SLICE+0"></span><span class="sig-name descname"><span class="pre">STORE_SLICE+0</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-STORE_SLICE-0" 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></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-STORE_SLICE-1"> <span id="opcode-STORE_SLICE+1"></span><span class="sig-name descname"><span class="pre">STORE_SLICE+1</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-STORE_SLICE-1" 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-STORE_SLICE-2"> <span id="opcode-STORE_SLICE+2"></span><span class="sig-name descname"><span class="pre">STORE_SLICE+2</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-STORE_SLICE-2" 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-STORE_SLICE-3"> <span id="opcode-STORE_SLICE+3"></span><span class="sig-name descname"><span class="pre">STORE_SLICE+3</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-STORE_SLICE-3" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">TOS2[TOS1:TOS]</span> <span class="pre">=</span> <span class="pre">TOS3</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DELETE_SLICE-0"> <span id="opcode-DELETE_SLICE+0"></span><span class="sig-name descname"><span class="pre">DELETE_SLICE+0</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-DELETE_SLICE-0" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">del</span> <span class="pre">TOS[:]</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DELETE_SLICE-1"> <span id="opcode-DELETE_SLICE+1"></span><span class="sig-name descname"><span class="pre">DELETE_SLICE+1</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-DELETE_SLICE-1" 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> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DELETE_SLICE-2"> <span id="opcode-DELETE_SLICE+2"></span><span class="sig-name descname"><span class="pre">DELETE_SLICE+2</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-DELETE_SLICE-2" 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> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-DELETE_SLICE-3"> <span id="opcode-DELETE_SLICE+3"></span><span class="sig-name descname"><span class="pre">DELETE_SLICE+3</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-DELETE_SLICE-3" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">del</span> <span class="pre">TOS2[TOS1: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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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>Miscellaneous opcodes.</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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-PRINT_ITEM"> <span class="sig-name descname"><span class="pre">PRINT_ITEM</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-PRINT_ITEM" title="Permalink to this definition">¶</a></dt> <dd><p>Prints TOS to the file-like object bound to <code class="docutils literal notranslate"><span class="pre">sys.stdout</span></code>. There is one such instruction for each item in the <a class="reference internal" href="../reference/simple_stmts.html#print"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">print</span></code></a> statement.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-PRINT_ITEM_TO"> <span class="sig-name descname"><span class="pre">PRINT_ITEM_TO</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-PRINT_ITEM_TO" title="Permalink to this definition">¶</a></dt> <dd><p>Like <code class="docutils literal notranslate"><span class="pre">PRINT_ITEM</span></code>, but prints the item second from TOS to the file-like object at TOS. This is used by the extended print statement.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-PRINT_NEWLINE"> <span class="sig-name descname"><span class="pre">PRINT_NEWLINE</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-PRINT_NEWLINE" title="Permalink to this definition">¶</a></dt> <dd><p>Prints a new line on <code class="docutils literal notranslate"><span class="pre">sys.stdout</span></code>. This is generated as the last operation of a <a class="reference internal" href="../reference/simple_stmts.html#print"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">print</span></code></a> statement, unless the statement ends with a comma.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-PRINT_NEWLINE_TO"> <span class="sig-name descname"><span class="pre">PRINT_NEWLINE_TO</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-PRINT_NEWLINE_TO" title="Permalink to this definition">¶</a></dt> <dd><p>Like <code class="docutils literal notranslate"><span class="pre">PRINT_NEWLINE</span></code>, but prints the new line on the file-like object on the TOS. This is used by the extended print statement.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BREAK_LOOP"> <span class="sig-name descname"><span class="pre">BREAK_LOOP</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-BREAK_LOOP" title="Permalink to this definition">¶</a></dt> <dd><p>Terminates a loop due to a <a class="reference internal" href="../reference/simple_stmts.html#break"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">break</span></code></a> statement.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-CONTINUE_LOOP"> <span class="sig-name descname"><span class="pre">CONTINUE_LOOP</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-CONTINUE_LOOP" title="Permalink to this definition">¶</a></dt> <dd><p>Continues a loop due to a <a class="reference internal" href="../reference/simple_stmts.html#continue"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">continue</span></code></a> statement. <em>target</em> is the address to jump to (which should be a <a class="reference internal" href="#opcode-FOR_ITER"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">FOR_ITER</span></code></a> instruction).</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(TOS[-i],</span> <span class="pre">TOS)</span></code>. Used to implement list comprehensions. While the appended value is popped off, the list object remains on the stack so that it is available for further iterations of the loop.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-LOAD_LOCALS"> <span class="sig-name descname"><span class="pre">LOAD_LOCALS</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-LOAD_LOCALS" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes a reference to the locals of the current scope on the stack. This is used in the code for a class definition: After the class body is evaluated, the locals are passed to the class definition.</p> </dd></dl> <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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-YIELD_VALUE" title="Permalink to this definition">¶</a></dt> <dd><p>Pops <code class="docutils literal notranslate"><span class="pre">TOS</span></code> 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-IMPORT_STAR"> <span class="sig-name descname"><span class="pre">IMPORT_STAR</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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-EXEC_STMT"> <span class="sig-name descname"><span class="pre">EXEC_STMT</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-EXEC_STMT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <code class="docutils literal notranslate"><span class="pre">exec</span> <span class="pre">TOS2,TOS1,TOS</span></code>. The compiler fills missing optional parameters with <code class="docutils literal notranslate"><span class="pre">None</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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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 nested loops, try statements, and such.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-END_FINALLY"> <span class="sig-name descname"><span class="pre">END_FINALLY</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-END_FINALLY" title="Permalink to this definition">¶</a></dt> <dd><p>Terminates a <a class="reference internal" href="../reference/compound_stmts.html#finally"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">finally</span></code></a> clause. The interpreter recalls whether the exception has to be re-raised, or whether the function returns, and continues with the outer-next block.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-BUILD_CLASS"> <span class="sig-name descname"><span class="pre">BUILD_CLASS</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-BUILD_CLASS" title="Permalink to this definition">¶</a></dt> <dd><p>Creates a new class object. TOS is the methods dictionary, TOS1 the tuple of the names of the base classes, and TOS2 the class name.</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_CLEANUP"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">WITH_CLEANUP</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 enter 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> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-WITH_CLEANUP"> <span class="sig-name descname"><span class="pre">WITH_CLEANUP</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-WITH_CLEANUP" title="Permalink to this definition">¶</a></dt> <dd><p>Cleans up the stack when 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 block exits. On top of the stack are 1–3 values indicating how/why the finally clause was entered:</p> <ul class="simple"> <li><p>TOP = <code class="docutils literal notranslate"><span class="pre">None</span></code></p></li> <li><p>(TOP, SECOND) = (<code class="docutils literal notranslate"><span class="pre">WHY_{RETURN,CONTINUE}</span></code>), retval</p></li> <li><p>TOP = <code class="docutils literal notranslate"><span class="pre">WHY_*</span></code>; no retval below it</p></li> <li><p>(TOP, SECOND, THIRD) = exc_info()</p></li> </ul> <p>Under them is EXIT, the context manager’s <code class="xref py py-meth docutils literal notranslate"><span class="pre">__exit__()</span></code> bound method.</p> <p>In the last case, <code class="docutils literal notranslate"><span class="pre">EXIT(TOP,</span> <span class="pre">SECOND,</span> <span class="pre">THIRD)</span></code> is called, otherwise <code class="docutils literal notranslate"><span class="pre">EXIT(None,</span> <span class="pre">None,</span> <span class="pre">None)</span></code>.</p> <p>EXIT is removed from the stack, leaving the values above it in the same order. In addition, if the stack represents an exception, <em>and</em> the function call returns a ‘true’ value, this information is “zapped”, to prevent <code class="docutils literal notranslate"><span class="pre">END_FINALLY</span></code> from re-raising the exception. (But non-local gotos should still be resumed.)</p> </dd></dl> <p>All of the following opcodes expect arguments. An argument is two bytes, with the more significant byte last.</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 <code class="docutils literal notranslate"><span class="pre">STORE_FAST</span></code> or <code class="docutils literal notranslate"><span class="pre">STORE_GLOBAL</span></code> 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-DUP_TOPX"> <span class="sig-name descname"><span class="pre">DUP_TOPX</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-DUP_TOPX" title="Permalink to this definition">¶</a></dt> <dd><p>Duplicate <em>count</em> items, keeping them in the same order. Due to implementation limits, <em>count</em> should be between 1 and 5 inclusive.</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 <code class="docutils literal notranslate"><span class="pre">STORE_NAME</span></code>, 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 <code class="docutils literal notranslate"><span class="pre">DELETE_NAME</span></code>, 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 <code class="docutils literal notranslate"><span class="pre">BUILD_TUPLE</span></code>, 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 <code class="docutils literal notranslate"><span class="pre">BUILD_TUPLE</span></code>, but creates a set.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 2.7.</span></p> </div> </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. The dictionary is pre-sized to hold <em>count</em> entries.</p> </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-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 <code class="docutils literal notranslate"><span class="pre">STORE_FAST</span></code> 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 <code class="docutils literal notranslate"><span class="pre">STORE_FAST</span></code> 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> </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> </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> </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> </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><code class="docutils literal notranslate"><span class="pre">TOS</span></code> is an <a class="reference internal" href="../glossary.html#term-iterator"><span class="xref std std-term">iterator</span></a>. Call its <code class="xref py py-meth docutils literal notranslate"><span class="pre">next()</span></code> method. If this yields a new value, push it on the stack (leaving the iterator below it). If the iterator indicates it is exhausted <code class="docutils literal notranslate"><span class="pre">TOS</span></code> is popped, and the bytecode 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_LOOP"> <span class="sig-name descname"><span class="pre">SETUP_LOOP</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_LOOP" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes a block for a loop onto the block stack. The block spans from the current instruction with a size of <em>delta</em> bytes.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-SETUP_EXCEPT"> <span class="sig-name descname"><span class="pre">SETUP_EXCEPT</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_EXCEPT" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes a try block from a try-except clause onto the block stack. <em>delta</em> points to the first except block.</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-except clause onto the block stack. <em>delta</em> points to the finally block.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-STORE_MAP"> <span class="sig-name descname"><span class="pre">STORE_MAP</span></span><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-STORE_MAP" title="Permalink to this definition">¶</a></dt> <dd><p>Store a key and value pair in a dictionary. Pops the key and value while leaving the dictionary on the stack.</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-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-SET_LINENO"> <span class="sig-name descname"><span class="pre">SET_LINENO</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">lineno</span></em><span class="sig-paren">)</span><a class="headerlink" href="#opcode-SET_LINENO" title="Permalink to this definition">¶</a></dt> <dd><p>This opcode is obsolete.</p> </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. <em>argc</em> indicates the number of arguments to the raise statement, ranging from 0 to 3. The handler will find the traceback as TOS2, the parameter as TOS1, and the exception as TOS.</p> </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. The low byte of <em>argc</em> indicates the number of positional arguments, the high byte the number of keyword arguments. The stack contains keyword arguments on top (if any), then the positional arguments below that (if any), then the callable object to call below that. Each keyword argument is represented with two values on the stack: the argument’s name, and its value, with the argument’s value above the name on the stack. The positional arguments are pushed in the order that they are passed in to the callable object, with the right-most positional argument on top. <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> </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">argc</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. TOS is the code associated with the function. The function object is defined to have <em>argc</em> default parameters, which are found below TOS.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-MAKE_CLOSURE"> <span class="sig-name descname"><span class="pre">MAKE_CLOSURE</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-MAKE_CLOSURE" title="Permalink to this definition">¶</a></dt> <dd><p>Creates a new function object, sets its <em>func_closure</em> slot, and pushes it on the stack. TOS is the code associated with the function, TOS1 the tuple containing cells for the closure’s free variables. The function also has <em>argc</em> default parameters, which are found below the cells.</p> </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-0">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 two bytes. <em>ext</em> holds two additional bytes which, taken together with the subsequent opcode’s argument, comprise a four-byte argument, <em>ext</em> being the two most-significant bytes.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-CALL_FUNCTION_VAR"> <span class="sig-name descname"><span class="pre">CALL_FUNCTION_VAR</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_VAR" title="Permalink to this definition">¶</a></dt> <dd><p>Calls a callable object, similarly to <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>. <em>argc</em> represents the number of keyword and positional arguments, identically to <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>. The top of the stack contains an iterable object containing additional positional arguments. Below that are keyword arguments (if any), positional arguments (if any) and a callable object, identically to <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>. Before the callable object is called, the iterable object is “unpacked” and its contents are appended to the positional arguments passed in. The iterable object is ignored when computing the value of <code class="docutils literal notranslate"><span class="pre">argc</span></code>.</p> </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, similarly to <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>. <em>argc</em> represents the number of keyword and positional arguments, identically to <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>. The top of the stack contains a mapping object containing additional keyword arguments. Below that are keyword arguments (if any), positional arguments (if any) and a callable object, identically to <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>. Before the callable is called, the mapping object at the top of the stack is “unpacked” and its contents are appended to the keyword arguments passed in. The mapping object at the top of the stack is ignored when computing the value of <code class="docutils literal notranslate"><span class="pre">argc</span></code>.</p> </dd></dl> <dl class="std opcode"> <dt class="sig sig-object std" id="opcode-CALL_FUNCTION_VAR_KW"> <span class="sig-name descname"><span class="pre">CALL_FUNCTION_VAR_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_VAR_KW" title="Permalink to this definition">¶</a></dt> <dd><p>Calls a callable object, similarly to <a class="reference internal" href="#opcode-CALL_FUNCTION_VAR"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">CALL_FUNCTION_VAR</span></code></a> and <a class="reference internal" href="#opcode-CALL_FUNCTION_KW"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">CALL_FUNCTION_KW</span></code></a>. <em>argc</em> represents the number of keyword and positional arguments, identically to <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>. The top of the stack contains a mapping object, as per <a class="reference internal" href="#opcode-CALL_FUNCTION_KW"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">CALL_FUNCTION_KW</span></code></a>. Below that is an iterable object, as per <a class="reference internal" href="#opcode-CALL_FUNCTION_VAR"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">CALL_FUNCTION_VAR</span></code></a>. Below that are keyword arguments (if any), positional arguments (if any) and a callable object, identically to <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>. 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, identically to <a class="reference internal" href="#opcode-CALL_FUNCTION_VAR"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">CALL_FUNCTION_VAR</span></code></a> and <a class="reference internal" href="#opcode-CALL_FUNCTION_KW"><code class="xref std std-opcode docutils literal notranslate"><span class="pre">CALL_FUNCTION_KW</span></code></a>. The mapping object and iterable object are both ignored when computing the value of <code class="docutils literal notranslate"><span class="pre">argc</span></code>.</p> </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><span class="sig-paren">(</span><em class="sig-param"></em><span class="sig-paren">)</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 take arguments <code class="docutils literal notranslate"><span class="pre"><</span> <span class="pre">HAVE_ARGUMENT</span></code> and those which do <code class="docutils literal notranslate"><span class="pre">>=</span> <span class="pre">HAVE_ARGUMENT</span></code>.</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="#">32.12. <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="#python-bytecode-instructions">32.12.1. Python Bytecode Instructions</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="compileall.html" title="previous chapter"><span class="section-number">32.11. </span><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"><span class="section-number">32.13. </span><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="../_sources/library/dis.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> <input type="submit" value="Go" /> </form> </div> </div> <script>$('#searchbox').show(0);</script> </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="32.13. pickletools — Tools for pickle developers" >next</a> |</li> <li class="right" > <a href="compileall.html" title="32.11. compileall — Byte-compile Python libraries" >previous</a> |</li> <li><img src="../_static/py.png" alt="" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="https://www.python.org/">Python</a> »</li> <li> <a href="../index.html">Python 2.7.18 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" ><span class="section-number">32. </span>Python Language Services</a> »</li> <li class="nav-item nav-item-this"><a href=""><span class="section-number">32.12. </span><code class="xref py py-mod docutils literal notranslate"><span class="pre">dis</span></code> — Disassembler for Python bytecode</a></li> </ul> </div> <div class="footer"> © <a href="../copyright.html">Copyright</a> 1990-2024, Python Software Foundation. <br /> The Python Software Foundation is a non-profit corporation. <a href="https://www.python.org/psf/donations/">Please donate.</a> <br /> Last updated on December 09, 2024. <a href="../bugs.html">Found a bug</a>? <br /> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 4.3.2. </div> </body> </html>
Close