Linux ip-148-66-134-25.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els11.x86_64 #1 SMP Sun Nov 3 09:06:59 UTC 2024 x86_64
Apache
: 148.66.134.25 | : 3.137.173.98
66 Domain
8.0.30
amvm
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
python-docs-2.7.5 /
html /
library /
[ HOME SHELL ]
Name
Size
Permission
Action
2to3.html
49.27
KB
-rw-r--r--
__builtin__.html
10.26
KB
-rw-r--r--
__future__.html
13.79
KB
-rw-r--r--
__main__.html
7.05
KB
-rw-r--r--
_winreg.html
59.21
KB
-rw-r--r--
abc.html
23.9
KB
-rw-r--r--
aepack.html
13.16
KB
-rw-r--r--
aetools.html
14.91
KB
-rw-r--r--
aetypes.html
18.88
KB
-rw-r--r--
aifc.html
22.4
KB
-rw-r--r--
al.html
17.34
KB
-rw-r--r--
allos.html
33.72
KB
-rw-r--r--
anydbm.html
16.33
KB
-rw-r--r--
archiving.html
9.26
KB
-rw-r--r--
argparse.html
237.62
KB
-rw-r--r--
array.html
29.29
KB
-rw-r--r--
ast.html
34.98
KB
-rw-r--r--
asynchat.html
31.43
KB
-rw-r--r--
asyncore.html
36.51
KB
-rw-r--r--
atexit.html
16.8
KB
-rw-r--r--
audioop.html
31.36
KB
-rw-r--r--
autogil.html
8.19
KB
-rw-r--r--
base64.html
19.67
KB
-rw-r--r--
basehttpserver.html
34.04
KB
-rw-r--r--
bastion.html
11.04
KB
-rw-r--r--
bdb.html
36.68
KB
-rw-r--r--
binascii.html
20.67
KB
-rw-r--r--
binhex.html
10.58
KB
-rw-r--r--
bisect.html
23.24
KB
-rw-r--r--
bsddb.html
26.43
KB
-rw-r--r--
bz2.html
26.08
KB
-rw-r--r--
calendar.html
37.79
KB
-rw-r--r--
carbon.html
48.94
KB
-rw-r--r--
cd.html
27.96
KB
-rw-r--r--
cgi.html
49.92
KB
-rw-r--r--
cgihttpserver.html
13.1
KB
-rw-r--r--
cgitb.html
11.41
KB
-rw-r--r--
chunk.html
14.66
KB
-rw-r--r--
cmath.html
25.63
KB
-rw-r--r--
cmd.html
26.09
KB
-rw-r--r--
code.html
24.58
KB
-rw-r--r--
codecs.html
100.64
KB
-rw-r--r--
codeop.html
14.84
KB
-rw-r--r--
collections.html
133.96
KB
-rw-r--r--
colorpicker.html
7.52
KB
-rw-r--r--
colorsys.html
11.04
KB
-rw-r--r--
commands.html
14.36
KB
-rw-r--r--
compileall.html
16.83
KB
-rw-r--r--
compiler.html
67.75
KB
-rw-r--r--
configparser.html
62.13
KB
-rw-r--r--
constants.html
12.83
KB
-rw-r--r--
contextlib.html
19.39
KB
-rw-r--r--
cookie.html
39.07
KB
-rw-r--r--
cookielib.html
83.82
KB
-rw-r--r--
copy.html
12.19
KB
-rw-r--r--
copy_reg.html
13.76
KB
-rw-r--r--
crypt.html
10.04
KB
-rw-r--r--
crypto.html
7.59
KB
-rw-r--r--
csv.html
67.37
KB
-rw-r--r--
ctypes.html
238.78
KB
-rw-r--r--
curses.ascii.html
22.29
KB
-rw-r--r--
curses.html
146.63
KB
-rw-r--r--
curses.panel.html
14.39
KB
-rw-r--r--
custominterp.html
7.62
KB
-rw-r--r--
datatypes.html
16.84
KB
-rw-r--r--
datetime.html
226.59
KB
-rw-r--r--
dbhash.html
15.48
KB
-rw-r--r--
dbm.html
12.07
KB
-rw-r--r--
debug.html
10.15
KB
-rw-r--r--
decimal.html
194.44
KB
-rw-r--r--
development.html
14.17
KB
-rw-r--r--
difflib.html
84.83
KB
-rw-r--r--
dircache.html
11.41
KB
-rw-r--r--
dis.html
69.95
KB
-rw-r--r--
distutils.html
8.05
KB
-rw-r--r--
dl.html
16.33
KB
-rw-r--r--
doctest.html
165.54
KB
-rw-r--r--
docxmlrpcserver.html
16.43
KB
-rw-r--r--
dumbdbm.html
14.02
KB
-rw-r--r--
dummy_thread.html
9.43
KB
-rw-r--r--
dummy_threading.html
8.37
KB
-rw-r--r--
easydialogs.html
30.55
KB
-rw-r--r--
email-examples.html
45.65
KB
-rw-r--r--
email.charset.html
26.8
KB
-rw-r--r--
email.encoders.html
11.86
KB
-rw-r--r--
email.errors.html
15.77
KB
-rw-r--r--
email.generator.html
20.77
KB
-rw-r--r--
email.header.html
26.92
KB
-rw-r--r--
email.html
44.24
KB
-rw-r--r--
email.iterators.html
11.52
KB
-rw-r--r--
email.message.html
63.16
KB
-rw-r--r--
email.mime.html
27.93
KB
-rw-r--r--
email.parser.html
30.45
KB
-rw-r--r--
email.util.html
24.46
KB
-rw-r--r--
errno.html
37.99
KB
-rw-r--r--
exceptions.html
56.13
KB
-rw-r--r--
fcntl.html
22.67
KB
-rw-r--r--
filecmp.html
22.3
KB
-rw-r--r--
fileformats.html
9.14
KB
-rw-r--r--
fileinput.html
24.28
KB
-rw-r--r--
filesys.html
10.2
KB
-rw-r--r--
fl.html
49.92
KB
-rw-r--r--
fm.html
11.91
KB
-rw-r--r--
fnmatch.html
14.58
KB
-rw-r--r--
formatter.html
34.06
KB
-rw-r--r--
fpectl.html
16.01
KB
-rw-r--r--
fpformat.html
10.59
KB
-rw-r--r--
fractions.html
22.61
KB
-rw-r--r--
framework.html
33.34
KB
-rw-r--r--
frameworks.html
7.14
KB
-rw-r--r--
ftplib.html
43.99
KB
-rw-r--r--
functions.html
183.14
KB
-rw-r--r--
functools.html
27.17
KB
-rw-r--r--
future_builtins.html
13.04
KB
-rw-r--r--
gc.html
25.75
KB
-rw-r--r--
gdbm.html
15.96
KB
-rw-r--r--
gensuitemodule.html
11.51
KB
-rw-r--r--
getopt.html
23.66
KB
-rw-r--r--
getpass.html
10.65
KB
-rw-r--r--
gettext.html
78.76
KB
-rw-r--r--
gl.html
22.09
KB
-rw-r--r--
glob.html
13.26
KB
-rw-r--r--
grp.html
10.49
KB
-rw-r--r--
gzip.html
18.99
KB
-rw-r--r--
hashlib.html
18.2
KB
-rw-r--r--
heapq.html
31.61
KB
-rw-r--r--
hmac.html
10.46
KB
-rw-r--r--
hotshot.html
18.65
KB
-rw-r--r--
htmllib.html
25.32
KB
-rw-r--r--
htmlparser.html
39.11
KB
-rw-r--r--
httplib.html
62.95
KB
-rw-r--r--
i18n.html
9.52
KB
-rw-r--r--
ic.html
17.17
KB
-rw-r--r--
idle.html
20.9
KB
-rw-r--r--
imageop.html
14.76
KB
-rw-r--r--
imaplib.html
51.99
KB
-rw-r--r--
imgfile.html
11.71
KB
-rw-r--r--
imghdr.html
11.3
KB
-rw-r--r--
imp.html
34.34
KB
-rw-r--r--
importlib.html
8.26
KB
-rw-r--r--
imputil.html
31.81
KB
-rw-r--r--
index.html
72.78
KB
-rw-r--r--
inspect.html
50.71
KB
-rw-r--r--
internet.html
24.87
KB
-rw-r--r--
intro.html
8.93
KB
-rw-r--r--
io.html
98.13
KB
-rw-r--r--
ipc.html
13.41
KB
-rw-r--r--
itertools.html
115.91
KB
-rw-r--r--
jpeg.html
12.74
KB
-rw-r--r--
json.html
67.04
KB
-rw-r--r--
keyword.html
7.68
KB
-rw-r--r--
language.html
11.03
KB
-rw-r--r--
linecache.html
10.59
KB
-rw-r--r--
locale.html
55.14
KB
-rw-r--r--
logging.config.html
63.36
KB
-rw-r--r--
logging.handlers.html
69.64
KB
-rw-r--r--
logging.html
95.64
KB
-rw-r--r--
mac.html
21.79
KB
-rw-r--r--
macos.html
14.76
KB
-rw-r--r--
macosa.html
12.96
KB
-rw-r--r--
macostools.html
15.52
KB
-rw-r--r--
macpath.html
7.76
KB
-rw-r--r--
mailbox.html
156.75
KB
-rw-r--r--
mailcap.html
13.21
KB
-rw-r--r--
markup.html
18.77
KB
-rw-r--r--
marshal.html
17.98
KB
-rw-r--r--
math.html
39.24
KB
-rw-r--r--
md5.html
13.97
KB
-rw-r--r--
mhlib.html
21.54
KB
-rw-r--r--
mimetools.html
19.25
KB
-rw-r--r--
mimetypes.html
28.39
KB
-rw-r--r--
mimewriter.html
15.02
KB
-rw-r--r--
mimify.html
13.36
KB
-rw-r--r--
miniaeframe.html
12.2
KB
-rw-r--r--
misc.html
6.87
KB
-rw-r--r--
mm.html
9.03
KB
-rw-r--r--
mmap.html
28.36
KB
-rw-r--r--
modulefinder.html
15.31
KB
-rw-r--r--
modules.html
8.46
KB
-rw-r--r--
msilib.html
52.43
KB
-rw-r--r--
msvcrt.html
19.37
KB
-rw-r--r--
multifile.html
24.3
KB
-rw-r--r--
multiprocessing.html
365.71
KB
-rw-r--r--
mutex.html
11.23
KB
-rw-r--r--
netdata.html
16.98
KB
-rw-r--r--
netrc.html
12.3
KB
-rw-r--r--
new.html
12.12
KB
-rw-r--r--
nis.html
10.64
KB
-rw-r--r--
nntplib.html
41.92
KB
-rw-r--r--
numbers.html
37.75
KB
-rw-r--r--
numeric.html
13.55
KB
-rw-r--r--
operator.html
82
KB
-rw-r--r--
optparse.html
222.56
KB
-rw-r--r--
os.html
214.25
KB
-rw-r--r--
os.path.html
38.34
KB
-rw-r--r--
ossaudiodev.html
41.5
KB
-rw-r--r--
othergui.html
9.08
KB
-rw-r--r--
parser.html
39.36
KB
-rw-r--r--
pdb.html
33.96
KB
-rw-r--r--
persistence.html
14.87
KB
-rw-r--r--
pickle.html
102.27
KB
-rw-r--r--
pickletools.html
10.63
KB
-rw-r--r--
pipes.html
18.01
KB
-rw-r--r--
pkgutil.html
25.11
KB
-rw-r--r--
platform.html
28.37
KB
-rw-r--r--
plistlib.html
17.03
KB
-rw-r--r--
popen2.html
25.43
KB
-rw-r--r--
poplib.html
22.32
KB
-rw-r--r--
posix.html
14.41
KB
-rw-r--r--
posixfile.html
19.76
KB
-rw-r--r--
pprint.html
29.92
KB
-rw-r--r--
profile.html
63.56
KB
-rw-r--r--
pty.html
9.48
KB
-rw-r--r--
pwd.html
11.43
KB
-rw-r--r--
py_compile.html
11.12
KB
-rw-r--r--
pyclbr.html
14.71
KB
-rw-r--r--
pydoc.html
11.48
KB
-rw-r--r--
pyexpat.html
71.53
KB
-rw-r--r--
python.html
12.27
KB
-rw-r--r--
queue.html
24.22
KB
-rw-r--r--
quopri.html
11.9
KB
-rw-r--r--
random.html
37.83
KB
-rw-r--r--
re.html
134.74
KB
-rw-r--r--
readline.html
28.24
KB
-rw-r--r--
repr.html
20.43
KB
-rw-r--r--
resource.html
26.48
KB
-rw-r--r--
restricted.html
11.65
KB
-rw-r--r--
rexec.html
37.41
KB
-rw-r--r--
rfc822.html
42.22
KB
-rw-r--r--
rlcompleter.html
13.51
KB
-rw-r--r--
robotparser.html
12.27
KB
-rw-r--r--
runpy.html
19.34
KB
-rw-r--r--
sched.html
18.54
KB
-rw-r--r--
scrolledtext.html
9.32
KB
-rw-r--r--
select.html
39.67
KB
-rw-r--r--
sets.html
36.92
KB
-rw-r--r--
sgi.html
9.71
KB
-rw-r--r--
sgmllib.html
30.77
KB
-rw-r--r--
sha.html
12.09
KB
-rw-r--r--
shelve.html
27.02
KB
-rw-r--r--
shlex.html
32.1
KB
-rw-r--r--
shutil.html
40.22
KB
-rw-r--r--
signal.html
31.14
KB
-rw-r--r--
simplehttpserver.html
18.41
KB
-rw-r--r--
simplexmlrpcserver.html
31.39
KB
-rw-r--r--
site.html
23.64
KB
-rw-r--r--
smtpd.html
12.46
KB
-rw-r--r--
smtplib.html
42.13
KB
-rw-r--r--
sndhdr.html
10.02
KB
-rw-r--r--
socket.html
106.34
KB
-rw-r--r--
socketserver.html
59.83
KB
-rw-r--r--
someos.html
15.11
KB
-rw-r--r--
spwd.html
10.33
KB
-rw-r--r--
sqlite3.html
139.5
KB
-rw-r--r--
ssl.html
65.62
KB
-rw-r--r--
stat.html
32.31
KB
-rw-r--r--
statvfs.html
10.6
KB
-rw-r--r--
stdtypes.html
260.4
KB
-rw-r--r--
string.html
106.65
KB
-rw-r--r--
stringio.html
18.81
KB
-rw-r--r--
stringprep.html
16.13
KB
-rw-r--r--
strings.html
14.93
KB
-rw-r--r--
struct.html
40.88
KB
-rw-r--r--
subprocess.html
84.91
KB
-rw-r--r--
sun.html
6.84
KB
-rw-r--r--
sunau.html
27.1
KB
-rw-r--r--
sunaudio.html
17.79
KB
-rw-r--r--
symbol.html
7.66
KB
-rw-r--r--
symtable.html
22.94
KB
-rw-r--r--
sys.html
98.7
KB
-rw-r--r--
sysconfig.html
23.84
KB
-rw-r--r--
syslog.html
17.92
KB
-rw-r--r--
tabnanny.html
10.63
KB
-rw-r--r--
tarfile.html
78.68
KB
-rw-r--r--
telnetlib.html
25.48
KB
-rw-r--r--
tempfile.html
29.42
KB
-rw-r--r--
termios.html
16.01
KB
-rw-r--r--
test.html
52.62
KB
-rw-r--r--
textwrap.html
27.25
KB
-rw-r--r--
thread.html
20.47
KB
-rw-r--r--
threading.html
76.69
KB
-rw-r--r--
time.html
56.93
KB
-rw-r--r--
timeit.html
36.27
KB
-rw-r--r--
tix.html
46.96
KB
-rw-r--r--
tk.html
23.64
KB
-rw-r--r--
tkinter.html
67.67
KB
-rw-r--r--
token.html
19.62
KB
-rw-r--r--
tokenize.html
18.45
KB
-rw-r--r--
trace.html
25.54
KB
-rw-r--r--
traceback.html
33.44
KB
-rw-r--r--
ttk.html
101.75
KB
-rw-r--r--
tty.html
9.06
KB
-rw-r--r--
turtle.html
211.74
KB
-rw-r--r--
types.html
27.59
KB
-rw-r--r--
undoc.html
23.16
KB
-rw-r--r--
unicodedata.html
18.55
KB
-rw-r--r--
unittest.html
202.85
KB
-rw-r--r--
unix.html
10.55
KB
-rw-r--r--
urllib.html
58.68
KB
-rw-r--r--
urllib2.html
100.58
KB
-rw-r--r--
urlparse.html
40.41
KB
-rw-r--r--
user.html
11.83
KB
-rw-r--r--
userdict.html
29.73
KB
-rw-r--r--
uu.html
11.03
KB
-rw-r--r--
uuid.html
28.19
KB
-rw-r--r--
warnings.html
46.6
KB
-rw-r--r--
wave.html
22.22
KB
-rw-r--r--
weakref.html
36.52
KB
-rw-r--r--
webbrowser.html
23.07
KB
-rw-r--r--
whichdb.html
8.85
KB
-rw-r--r--
windows.html
9.33
KB
-rw-r--r--
winsound.html
18.75
KB
-rw-r--r--
wsgiref.html
81.04
KB
-rw-r--r--
xdrlib.html
29.94
KB
-rw-r--r--
xml.dom.html
89.04
KB
-rw-r--r--
xml.dom.minidom.html
40.42
KB
-rw-r--r--
xml.dom.pulldom.html
12.71
KB
-rw-r--r--
xml.etree.elementtree.html
93.22
KB
-rw-r--r--
xml.html
16.49
KB
-rw-r--r--
xml.sax.handler.html
38.63
KB
-rw-r--r--
xml.sax.html
20.22
KB
-rw-r--r--
xml.sax.reader.html
39.09
KB
-rw-r--r--
xml.sax.utils.html
14.26
KB
-rw-r--r--
xmlrpclib.html
60.79
KB
-rw-r--r--
zipfile.html
53.14
KB
-rw-r--r--
zipimport.html
20.42
KB
-rw-r--r--
zlib.html
25.46
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : dis.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>31.12. dis — Disassembler for Python bytecode — Python 2.7.5 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '2.7.5', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/sidebar.js"></script> <link rel="search" type="application/opensearchdescription+xml" title="Search within Python 2.7.5 documentation" href="../_static/opensearch.xml"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="copyright" title="Copyright" href="../copyright.html" /> <link rel="top" title="Python 2.7.5 documentation" href="../index.html" /> <link rel="up" title="31. Python Language Services" href="language.html" /> <link rel="next" title="31.13. pickletools — Tools for pickle developers" href="pickletools.html" /> <link rel="prev" title="31.11. compileall — Byte-compile Python libraries" href="compileall.html" /> <link rel="shortcut icon" type="image/png" href="../_static/py.png" /> <script type="text/javascript" src="../_static/copybutton.js"></script> </head> <body> <div class="related"> <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="31.13. pickletools — Tools for pickle developers" accesskey="N">next</a> |</li> <li class="right" > <a href="compileall.html" title="31.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="http://www.python.org/">Python</a> »</li> <li> <a href="../index.html">Python 2.7.5 documentation</a> » </li> <li><a href="index.html" >The Python Standard Library</a> »</li> <li><a href="language.html" accesskey="U">31. Python Language Services</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="module-dis"> <span id="dis-disassembler-for-python-bytecode"></span><h1>31.12. <a class="reference internal" href="#module-dis" title="dis: Disassembler for Python bytecode."><tt class="xref py py-mod docutils literal"><span class="pre">dis</span></tt></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="http://hg.python.org/cpython/file/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."><tt class="xref py py-mod docutils literal"><span class="pre">dis</span></tt></a> module supports the analysis of CPython <a class="reference internal" href="../glossary.html#term-bytecode"><em class="xref std std-term">bytecode</em></a> by disassembling it. The CPython bytecode which this module takes as an input is defined in the file <tt class="file docutils literal"><span class="pre">Include/opcode.h</span></tt> 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 <tt class="xref py py-func docutils literal"><span class="pre">myfunc()</span></tt>:</p> <div class="highlight-python"><div class="highlight"><pre><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 <tt class="xref py py-func docutils literal"><span class="pre">myfunc()</span></tt>:</p> <div class="highlight-python"><div class="highlight"><pre><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."><tt class="xref py py-mod docutils literal"><span class="pre">dis</span></tt></a> module defines the following functions and constants:</p> <dl class="function"> <dt id="dis.dis"> <tt class="descclassname">dis.</tt><tt class="descname">dis</tt><big>(</big><span class="optional">[</span><em>bytesource</em><span class="optional">]</span><big>)</big><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="function"> <dt id="dis.distb"> <tt class="descclassname">dis.</tt><tt class="descname">distb</tt><big>(</big><span class="optional">[</span><em>tb</em><span class="optional">]</span><big>)</big><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="function"> <dt id="dis.disassemble"> <tt class="descclassname">dis.</tt><tt class="descname">disassemble</tt><big>(</big><em>code</em><span class="optional">[</span>, <em>lasti</em><span class="optional">]</span><big>)</big><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>the line number, for the first instruction of each line</li> <li>the current instruction, indicated as <tt class="docutils literal"><span class="pre">--></span></tt>,</li> <li>a labelled instruction, indicated with <tt class="docutils literal"><span class="pre">>></span></tt>,</li> <li>the address of the instruction,</li> <li>the operation code name,</li> <li>operation parameters, and</li> <li>interpretation of the parameters in parentheses.</li> </ol> <p>The parameter interpretation recognizes local and global variable names, constant values, branch targets, and compare operators.</p> </dd></dl> <dl class="function"> <dt id="dis.disco"> <tt class="descclassname">dis.</tt><tt class="descname">disco</tt><big>(</big><em>code</em><span class="optional">[</span>, <em>lasti</em><span class="optional">]</span><big>)</big><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"><tt class="xref py py-func docutils literal"><span class="pre">disassemble()</span></tt></a>. It is more convenient to type, and kept for compatibility with earlier Python releases.</p> </dd></dl> <dl class="function"> <dt id="dis.findlinestarts"> <tt class="descclassname">dis.</tt><tt class="descname">findlinestarts</tt><big>(</big><em>code</em><big>)</big><a class="headerlink" href="#dis.findlinestarts" title="Permalink to this definition">¶</a></dt> <dd><p>This generator function uses the <tt class="docutils literal"><span class="pre">co_firstlineno</span></tt> and <tt class="docutils literal"><span class="pre">co_lnotab</span></tt> 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 <tt class="docutils literal"><span class="pre">(offset,</span> <span class="pre">lineno)</span></tt> pairs.</p> </dd></dl> <dl class="function"> <dt id="dis.findlabels"> <tt class="descclassname">dis.</tt><tt class="descname">findlabels</tt><big>(</big><em>code</em><big>)</big><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="data"> <dt id="dis.opname"> <tt class="descclassname">dis.</tt><tt class="descname">opname</tt><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="data"> <dt id="dis.opmap"> <tt class="descclassname">dis.</tt><tt class="descname">opmap</tt><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="data"> <dt id="dis.cmp_op"> <tt class="descclassname">dis.</tt><tt class="descname">cmp_op</tt><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="data"> <dt id="dis.hasconst"> <tt class="descclassname">dis.</tt><tt class="descname">hasconst</tt><a class="headerlink" href="#dis.hasconst" title="Permalink to this definition">¶</a></dt> <dd><p>Sequence of bytecodes that have a constant parameter.</p> </dd></dl> <dl class="data"> <dt id="dis.hasfree"> <tt class="descclassname">dis.</tt><tt class="descname">hasfree</tt><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="data"> <dt id="dis.hasname"> <tt class="descclassname">dis.</tt><tt class="descname">hasname</tt><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="data"> <dt id="dis.hasjrel"> <tt class="descclassname">dis.</tt><tt class="descname">hasjrel</tt><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="data"> <dt id="dis.hasjabs"> <tt class="descclassname">dis.</tt><tt class="descname">hasjabs</tt><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="data"> <dt id="dis.haslocal"> <tt class="descclassname">dis.</tt><tt class="descname">haslocal</tt><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="data"> <dt id="dis.hascompare"> <tt class="descclassname">dis.</tt><tt class="descname">hascompare</tt><a class="headerlink" href="#dis.hascompare" title="Permalink to this definition">¶</a></dt> <dd><p>Sequence of bytecodes of Boolean operations.</p> </dd></dl> <div class="section" id="python-bytecode-instructions"> <span id="bytecodes"></span><h2>31.12.1. 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="opcode"> <dt id="opcode-STOP_CODE"> <tt class="descname">STOP_CODE</tt><big>(</big><em></em><big>)</big><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="opcode"> <dt id="opcode-NOP"> <tt class="descname">NOP</tt><big>(</big><em></em><big>)</big><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="opcode"> <dt id="opcode-POP_TOP"> <tt class="descname">POP_TOP</tt><big>(</big><em></em><big>)</big><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="opcode"> <dt id="opcode-ROT_TWO"> <tt class="descname">ROT_TWO</tt><big>(</big><em></em><big>)</big><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="opcode"> <dt id="opcode-ROT_THREE"> <tt class="descname">ROT_THREE</tt><big>(</big><em></em><big>)</big><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="opcode"> <dt id="opcode-ROT_FOUR"> <tt class="descname">ROT_FOUR</tt><big>(</big><em></em><big>)</big><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="opcode"> <dt id="opcode-DUP_TOP"> <tt class="descname">DUP_TOP</tt><big>(</big><em></em><big>)</big><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="opcode"> <dt id="opcode-UNARY_POSITIVE"> <tt class="descname">UNARY_POSITIVE</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-UNARY_POSITIVE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">+TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-UNARY_NEGATIVE"> <tt class="descname">UNARY_NEGATIVE</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-UNARY_NEGATIVE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">-TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-UNARY_NOT"> <tt class="descname">UNARY_NOT</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-UNARY_NOT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">not</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-UNARY_CONVERT"> <tt class="descname">UNARY_CONVERT</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-UNARY_CONVERT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">`TOS`</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-UNARY_INVERT"> <tt class="descname">UNARY_INVERT</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-UNARY_INVERT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">~TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-GET_ITER"> <tt class="descname">GET_ITER</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-GET_ITER" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">iter(TOS)</span></tt>.</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="opcode"> <dt id="opcode-BINARY_POWER"> <tt class="descname">BINARY_POWER</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_POWER" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">**</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_MULTIPLY"> <tt class="descname">BINARY_MULTIPLY</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_MULTIPLY" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">*</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_DIVIDE"> <tt class="descname">BINARY_DIVIDE</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_DIVIDE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">/</span> <span class="pre">TOS</span></tt> when <tt class="docutils literal"><span class="pre">from</span> <span class="pre">__future__</span> <span class="pre">import</span> <span class="pre">division</span></tt> is not in effect.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_FLOOR_DIVIDE"> <tt class="descname">BINARY_FLOOR_DIVIDE</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_FLOOR_DIVIDE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">//</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_TRUE_DIVIDE"> <tt class="descname">BINARY_TRUE_DIVIDE</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_TRUE_DIVIDE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">/</span> <span class="pre">TOS</span></tt> when <tt class="docutils literal"><span class="pre">from</span> <span class="pre">__future__</span> <span class="pre">import</span> <span class="pre">division</span></tt> is in effect.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_MODULO"> <tt class="descname">BINARY_MODULO</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_MODULO" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">%</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_ADD"> <tt class="descname">BINARY_ADD</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_ADD" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">+</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_SUBTRACT"> <tt class="descname">BINARY_SUBTRACT</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_SUBTRACT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">-</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_SUBSCR"> <tt class="descname">BINARY_SUBSCR</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_SUBSCR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1[TOS]</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_LSHIFT"> <tt class="descname">BINARY_LSHIFT</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_LSHIFT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre"><<</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_RSHIFT"> <tt class="descname">BINARY_RSHIFT</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_RSHIFT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">>></span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_AND"> <tt class="descname">BINARY_AND</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_AND" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">&</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_XOR"> <tt class="descname">BINARY_XOR</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_XOR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">^</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BINARY_OR"> <tt class="descname">BINARY_OR</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-BINARY_OR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">|</span> <span class="pre">TOS</span></tt>.</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="opcode"> <dt id="opcode-INPLACE_POWER"> <tt class="descname">INPLACE_POWER</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_POWER" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">**</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-INPLACE_MULTIPLY"> <tt class="descname">INPLACE_MULTIPLY</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_MULTIPLY" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">*</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-INPLACE_DIVIDE"> <tt class="descname">INPLACE_DIVIDE</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_DIVIDE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">/</span> <span class="pre">TOS</span></tt> when <tt class="docutils literal"><span class="pre">from</span> <span class="pre">__future__</span> <span class="pre">import</span> <span class="pre">division</span></tt> is not in effect.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-INPLACE_FLOOR_DIVIDE"> <tt class="descname">INPLACE_FLOOR_DIVIDE</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_FLOOR_DIVIDE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">//</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-INPLACE_TRUE_DIVIDE"> <tt class="descname">INPLACE_TRUE_DIVIDE</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_TRUE_DIVIDE" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">/</span> <span class="pre">TOS</span></tt> when <tt class="docutils literal"><span class="pre">from</span> <span class="pre">__future__</span> <span class="pre">import</span> <span class="pre">division</span></tt> is in effect.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-INPLACE_MODULO"> <tt class="descname">INPLACE_MODULO</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_MODULO" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">%</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-INPLACE_ADD"> <tt class="descname">INPLACE_ADD</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_ADD" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">+</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-INPLACE_SUBTRACT"> <tt class="descname">INPLACE_SUBTRACT</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_SUBTRACT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">-</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-INPLACE_LSHIFT"> <tt class="descname">INPLACE_LSHIFT</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_LSHIFT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre"><<</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-INPLACE_RSHIFT"> <tt class="descname">INPLACE_RSHIFT</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_RSHIFT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">>></span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-INPLACE_AND"> <tt class="descname">INPLACE_AND</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_AND" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">&</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-INPLACE_XOR"> <tt class="descname">INPLACE_XOR</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_XOR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">^</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-INPLACE_OR"> <tt class="descname">INPLACE_OR</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-INPLACE_OR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements in-place <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1</span> <span class="pre">|</span> <span class="pre">TOS</span></tt>.</p> </dd></dl> <p>The slice opcodes take up to three parameters.</p> <dl class="opcode"> <dt id="opcode-SLICE+0"> <tt class="descname">SLICE+0</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-SLICE+0" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS[:]</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-SLICE+1"> <tt class="descname">SLICE+1</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-SLICE+1" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1[TOS:]</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-SLICE+2"> <tt class="descname">SLICE+2</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-SLICE+2" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS1[:TOS]</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-SLICE+3"> <tt class="descname">SLICE+3</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-SLICE+3" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS</span> <span class="pre">=</span> <span class="pre">TOS2[TOS1:TOS]</span></tt>.</p> </dd></dl> <p>Slice assignment needs even an additional parameter. As any statement, they put nothing on the stack.</p> <dl class="opcode"> <dt id="opcode-STORE_SLICE+0"> <tt class="descname">STORE_SLICE+0</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-STORE_SLICE+0" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS[:]</span> <span class="pre">=</span> <span class="pre">TOS1</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-STORE_SLICE+1"> <tt class="descname">STORE_SLICE+1</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-STORE_SLICE+1" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS1[TOS:]</span> <span class="pre">=</span> <span class="pre">TOS2</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-STORE_SLICE+2"> <tt class="descname">STORE_SLICE+2</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-STORE_SLICE+2" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS1[:TOS]</span> <span class="pre">=</span> <span class="pre">TOS2</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-STORE_SLICE+3"> <tt class="descname">STORE_SLICE+3</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-STORE_SLICE+3" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS2[TOS1:TOS]</span> <span class="pre">=</span> <span class="pre">TOS3</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-DELETE_SLICE+0"> <tt class="descname">DELETE_SLICE+0</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-DELETE_SLICE+0" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">del</span> <span class="pre">TOS[:]</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-DELETE_SLICE+1"> <tt class="descname">DELETE_SLICE+1</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-DELETE_SLICE+1" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">del</span> <span class="pre">TOS1[TOS:]</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-DELETE_SLICE+2"> <tt class="descname">DELETE_SLICE+2</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-DELETE_SLICE+2" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">del</span> <span class="pre">TOS1[:TOS]</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-DELETE_SLICE+3"> <tt class="descname">DELETE_SLICE+3</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-DELETE_SLICE+3" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">del</span> <span class="pre">TOS2[TOS1:TOS]</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-STORE_SUBSCR"> <tt class="descname">STORE_SUBSCR</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-STORE_SUBSCR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS1[TOS]</span> <span class="pre">=</span> <span class="pre">TOS2</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-DELETE_SUBSCR"> <tt class="descname">DELETE_SUBSCR</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-DELETE_SUBSCR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">del</span> <span class="pre">TOS1[TOS]</span></tt>.</p> </dd></dl> <p>Miscellaneous opcodes.</p> <dl class="opcode"> <dt id="opcode-PRINT_EXPR"> <tt class="descname">PRINT_EXPR</tt><big>(</big><em></em><big>)</big><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 <tt class="docutils literal"><span class="pre">POP_STACK</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-PRINT_ITEM"> <tt class="descname">PRINT_ITEM</tt><big>(</big><em></em><big>)</big><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 <tt class="docutils literal"><span class="pre">sys.stdout</span></tt>. There is one such instruction for each item in the <a class="reference internal" href="../reference/simple_stmts.html#print"><tt class="xref std std-keyword docutils literal"><span class="pre">print</span></tt></a> statement.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-PRINT_ITEM_TO"> <tt class="descname">PRINT_ITEM_TO</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-PRINT_ITEM_TO" title="Permalink to this definition">¶</a></dt> <dd><p>Like <tt class="docutils literal"><span class="pre">PRINT_ITEM</span></tt>, 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="opcode"> <dt id="opcode-PRINT_NEWLINE"> <tt class="descname">PRINT_NEWLINE</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-PRINT_NEWLINE" title="Permalink to this definition">¶</a></dt> <dd><p>Prints a new line on <tt class="docutils literal"><span class="pre">sys.stdout</span></tt>. This is generated as the last operation of a <a class="reference internal" href="../reference/simple_stmts.html#print"><tt class="xref std std-keyword docutils literal"><span class="pre">print</span></tt></a> statement, unless the statement ends with a comma.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-PRINT_NEWLINE_TO"> <tt class="descname">PRINT_NEWLINE_TO</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-PRINT_NEWLINE_TO" title="Permalink to this definition">¶</a></dt> <dd><p>Like <tt class="docutils literal"><span class="pre">PRINT_NEWLINE</span></tt>, 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="opcode"> <dt id="opcode-BREAK_LOOP"> <tt class="descname">BREAK_LOOP</tt><big>(</big><em></em><big>)</big><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"><tt class="xref std std-keyword docutils literal"><span class="pre">break</span></tt></a> statement.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-CONTINUE_LOOP"> <tt class="descname">CONTINUE_LOOP</tt><big>(</big><em>target</em><big>)</big><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"><tt class="xref std std-keyword docutils literal"><span class="pre">continue</span></tt></a> statement. <em>target</em> is the address to jump to (which should be a <tt class="docutils literal"><span class="pre">FOR_ITER</span></tt> instruction).</p> </dd></dl> <dl class="opcode"> <dt id="opcode-LIST_APPEND"> <tt class="descname">LIST_APPEND</tt><big>(</big><em>i</em><big>)</big><a class="headerlink" href="#opcode-LIST_APPEND" title="Permalink to this definition">¶</a></dt> <dd><p>Calls <tt class="docutils literal"><span class="pre">list.append(TOS[-i],</span> <span class="pre">TOS)</span></tt>. 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="opcode"> <dt id="opcode-LOAD_LOCALS"> <tt class="descname">LOAD_LOCALS</tt><big>(</big><em></em><big>)</big><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="opcode"> <dt id="opcode-RETURN_VALUE"> <tt class="descname">RETURN_VALUE</tt><big>(</big><em></em><big>)</big><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="opcode"> <dt id="opcode-YIELD_VALUE"> <tt class="descname">YIELD_VALUE</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-YIELD_VALUE" title="Permalink to this definition">¶</a></dt> <dd><p>Pops <tt class="docutils literal"><span class="pre">TOS</span></tt> and yields it from a <a class="reference internal" href="../glossary.html#term-generator"><em class="xref std std-term">generator</em></a>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-IMPORT_STAR"> <tt class="descname">IMPORT_STAR</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-IMPORT_STAR" title="Permalink to this definition">¶</a></dt> <dd><p>Loads all symbols not starting with <tt class="docutils literal"><span class="pre">'_'</span></tt> directly from the module TOS to the local namespace. The module is popped after loading all names. This opcode implements <tt class="docutils literal"><span class="pre">from</span> <span class="pre">module</span> <span class="pre">import</span> <span class="pre">*</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-EXEC_STMT"> <tt class="descname">EXEC_STMT</tt><big>(</big><em></em><big>)</big><a class="headerlink" href="#opcode-EXEC_STMT" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">exec</span> <span class="pre">TOS2,TOS1,TOS</span></tt>. The compiler fills missing optional parameters with <tt class="docutils literal"><span class="pre">None</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-POP_BLOCK"> <tt class="descname">POP_BLOCK</tt><big>(</big><em></em><big>)</big><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="opcode"> <dt id="opcode-END_FINALLY"> <tt class="descname">END_FINALLY</tt><big>(</big><em></em><big>)</big><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"><tt class="xref std std-keyword docutils literal"><span class="pre">finally</span></tt></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="opcode"> <dt id="opcode-BUILD_CLASS"> <tt class="descname">BUILD_CLASS</tt><big>(</big><em></em><big>)</big><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="opcode"> <dt id="opcode-SETUP_WITH"> <tt class="descname">SETUP_WITH</tt><big>(</big><em>delta</em><big>)</big><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__"><tt class="xref py py-meth docutils literal"><span class="pre">__exit__()</span></tt></a> from the context manager and pushes it onto the stack for later use by <a class="reference internal" href="#opcode-WITH_CLEANUP"><tt class="xref std std-opcode docutils literal"><span class="pre">WITH_CLEANUP</span></tt></a>. Then, <a class="reference internal" href="../reference/datamodel.html#object.__enter__" title="object.__enter__"><tt class="xref py py-meth docutils literal"><span class="pre">__enter__()</span></tt></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"><tt class="xref std std-opcode docutils literal"><span class="pre">POP_TOP</span></tt></a>), or store it in (a) variable(s) (<a class="reference internal" href="#opcode-STORE_FAST"><tt class="xref std std-opcode docutils literal"><span class="pre">STORE_FAST</span></tt></a>, <a class="reference internal" href="#opcode-STORE_NAME"><tt class="xref std std-opcode docutils literal"><span class="pre">STORE_NAME</span></tt></a>, or <a class="reference internal" href="#opcode-UNPACK_SEQUENCE"><tt class="xref std std-opcode docutils literal"><span class="pre">UNPACK_SEQUENCE</span></tt></a>).</p> </dd></dl> <dl class="opcode"> <dt id="opcode-WITH_CLEANUP"> <tt class="descname">WITH_CLEANUP</tt><big>(</big><em></em><big>)</big><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"><tt class="xref std std-keyword docutils literal"><span class="pre">with</span></tt></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>TOP = <tt class="docutils literal"><span class="pre">None</span></tt></li> <li>(TOP, SECOND) = (<tt class="docutils literal"><span class="pre">WHY_{RETURN,CONTINUE}</span></tt>), retval</li> <li>TOP = <tt class="docutils literal"><span class="pre">WHY_*</span></tt>; no retval below it</li> <li>(TOP, SECOND, THIRD) = exc_info()</li> </ul> <p>Under them is EXIT, the context manager’s <a class="reference internal" href="../reference/datamodel.html#object.__exit__" title="object.__exit__"><tt class="xref py py-meth docutils literal"><span class="pre">__exit__()</span></tt></a> bound method.</p> <p>In the last case, <tt class="docutils literal"><span class="pre">EXIT(TOP,</span> <span class="pre">SECOND,</span> <span class="pre">THIRD)</span></tt> is called, otherwise <tt class="docutils literal"><span class="pre">EXIT(None,</span> <span class="pre">None,</span> <span class="pre">None)</span></tt>.</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 <tt class="docutils literal"><span class="pre">END_FINALLY</span></tt> 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="opcode"> <dt id="opcode-STORE_NAME"> <tt class="descname">STORE_NAME</tt><big>(</big><em>namei</em><big>)</big><a class="headerlink" href="#opcode-STORE_NAME" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">name</span> <span class="pre">=</span> <span class="pre">TOS</span></tt>. <em>namei</em> is the index of <em>name</em> in the attribute <tt class="xref py py-attr docutils literal"><span class="pre">co_names</span></tt> of the code object. The compiler tries to use <tt class="docutils literal"><span class="pre">STORE_FAST</span></tt> or <tt class="docutils literal"><span class="pre">STORE_GLOBAL</span></tt> if possible.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-DELETE_NAME"> <tt class="descname">DELETE_NAME</tt><big>(</big><em>namei</em><big>)</big><a class="headerlink" href="#opcode-DELETE_NAME" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">del</span> <span class="pre">name</span></tt>, where <em>namei</em> is the index into <tt class="xref py py-attr docutils literal"><span class="pre">co_names</span></tt> attribute of the code object.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-UNPACK_SEQUENCE"> <tt class="descname">UNPACK_SEQUENCE</tt><big>(</big><em>count</em><big>)</big><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="opcode"> <dt id="opcode-DUP_TOPX"> <tt class="descname">DUP_TOPX</tt><big>(</big><em>count</em><big>)</big><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="opcode"> <dt id="opcode-STORE_ATTR"> <tt class="descname">STORE_ATTR</tt><big>(</big><em>namei</em><big>)</big><a class="headerlink" href="#opcode-STORE_ATTR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">TOS.name</span> <span class="pre">=</span> <span class="pre">TOS1</span></tt>, where <em>namei</em> is the index of name in <tt class="xref py py-attr docutils literal"><span class="pre">co_names</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-DELETE_ATTR"> <tt class="descname">DELETE_ATTR</tt><big>(</big><em>namei</em><big>)</big><a class="headerlink" href="#opcode-DELETE_ATTR" title="Permalink to this definition">¶</a></dt> <dd><p>Implements <tt class="docutils literal"><span class="pre">del</span> <span class="pre">TOS.name</span></tt>, using <em>namei</em> as index into <tt class="xref py py-attr docutils literal"><span class="pre">co_names</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-STORE_GLOBAL"> <tt class="descname">STORE_GLOBAL</tt><big>(</big><em>namei</em><big>)</big><a class="headerlink" href="#opcode-STORE_GLOBAL" title="Permalink to this definition">¶</a></dt> <dd><p>Works as <tt class="docutils literal"><span class="pre">STORE_NAME</span></tt>, but stores the name as a global.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-DELETE_GLOBAL"> <tt class="descname">DELETE_GLOBAL</tt><big>(</big><em>namei</em><big>)</big><a class="headerlink" href="#opcode-DELETE_GLOBAL" title="Permalink to this definition">¶</a></dt> <dd><p>Works as <tt class="docutils literal"><span class="pre">DELETE_NAME</span></tt>, but deletes a global name.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-LOAD_CONST"> <tt class="descname">LOAD_CONST</tt><big>(</big><em>consti</em><big>)</big><a class="headerlink" href="#opcode-LOAD_CONST" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes <tt class="docutils literal"><span class="pre">co_consts[consti]</span></tt> onto the stack.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-LOAD_NAME"> <tt class="descname">LOAD_NAME</tt><big>(</big><em>namei</em><big>)</big><a class="headerlink" href="#opcode-LOAD_NAME" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes the value associated with <tt class="docutils literal"><span class="pre">co_names[namei]</span></tt> onto the stack.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BUILD_TUPLE"> <tt class="descname">BUILD_TUPLE</tt><big>(</big><em>count</em><big>)</big><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="opcode"> <dt id="opcode-BUILD_LIST"> <tt class="descname">BUILD_LIST</tt><big>(</big><em>count</em><big>)</big><a class="headerlink" href="#opcode-BUILD_LIST" title="Permalink to this definition">¶</a></dt> <dd><p>Works as <tt class="docutils literal"><span class="pre">BUILD_TUPLE</span></tt>, but creates a list.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-BUILD_MAP"> <tt class="descname">BUILD_MAP</tt><big>(</big><em>count</em><big>)</big><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="opcode"> <dt id="opcode-LOAD_ATTR"> <tt class="descname">LOAD_ATTR</tt><big>(</big><em>namei</em><big>)</big><a class="headerlink" href="#opcode-LOAD_ATTR" title="Permalink to this definition">¶</a></dt> <dd><p>Replaces TOS with <tt class="docutils literal"><span class="pre">getattr(TOS,</span> <span class="pre">co_names[namei])</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-COMPARE_OP"> <tt class="descname">COMPARE_OP</tt><big>(</big><em>opname</em><big>)</big><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 <tt class="docutils literal"><span class="pre">cmp_op[opname]</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-IMPORT_NAME"> <tt class="descname">IMPORT_NAME</tt><big>(</big><em>namei</em><big>)</big><a class="headerlink" href="#opcode-IMPORT_NAME" title="Permalink to this definition">¶</a></dt> <dd><p>Imports the module <tt class="docutils literal"><span class="pre">co_names[namei]</span></tt>. 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__"><tt class="xref py py-func docutils literal"><span class="pre">__import__()</span></tt></a>. The module object is pushed onto the stack. The current namespace is not affected: for a proper import statement, a subsequent <tt class="docutils literal"><span class="pre">STORE_FAST</span></tt> instruction modifies the namespace.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-IMPORT_FROM"> <tt class="descname">IMPORT_FROM</tt><big>(</big><em>namei</em><big>)</big><a class="headerlink" href="#opcode-IMPORT_FROM" title="Permalink to this definition">¶</a></dt> <dd><p>Loads the attribute <tt class="docutils literal"><span class="pre">co_names[namei]</span></tt> from the module found in TOS. The resulting object is pushed onto the stack, to be subsequently stored by a <tt class="docutils literal"><span class="pre">STORE_FAST</span></tt> instruction.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-JUMP_FORWARD"> <tt class="descname">JUMP_FORWARD</tt><big>(</big><em>delta</em><big>)</big><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="opcode"> <dt id="opcode-POP_JUMP_IF_TRUE"> <tt class="descname">POP_JUMP_IF_TRUE</tt><big>(</big><em>target</em><big>)</big><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="opcode"> <dt id="opcode-POP_JUMP_IF_FALSE"> <tt class="descname">POP_JUMP_IF_FALSE</tt><big>(</big><em>target</em><big>)</big><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="opcode"> <dt id="opcode-JUMP_IF_TRUE_OR_POP"> <tt class="descname">JUMP_IF_TRUE_OR_POP</tt><big>(</big><em>target</em><big>)</big><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="opcode"> <dt id="opcode-JUMP_IF_FALSE_OR_POP"> <tt class="descname">JUMP_IF_FALSE_OR_POP</tt><big>(</big><em>target</em><big>)</big><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="opcode"> <dt id="opcode-JUMP_ABSOLUTE"> <tt class="descname">JUMP_ABSOLUTE</tt><big>(</big><em>target</em><big>)</big><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="opcode"> <dt id="opcode-FOR_ITER"> <tt class="descname">FOR_ITER</tt><big>(</big><em>delta</em><big>)</big><a class="headerlink" href="#opcode-FOR_ITER" title="Permalink to this definition">¶</a></dt> <dd><p><tt class="docutils literal"><span class="pre">TOS</span></tt> is an <a class="reference internal" href="../glossary.html#term-iterator"><em class="xref std std-term">iterator</em></a>. Call its <tt class="xref py py-meth docutils literal"><span class="pre">next()</span></tt> method. If this yields a new value, push it on the stack (leaving the iterator below it). If the iterator indicates it is exhausted <tt class="docutils literal"><span class="pre">TOS</span></tt> is popped, and the bytecode counter is incremented by <em>delta</em>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-LOAD_GLOBAL"> <tt class="descname">LOAD_GLOBAL</tt><big>(</big><em>namei</em><big>)</big><a class="headerlink" href="#opcode-LOAD_GLOBAL" title="Permalink to this definition">¶</a></dt> <dd><p>Loads the global named <tt class="docutils literal"><span class="pre">co_names[namei]</span></tt> onto the stack.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-SETUP_LOOP"> <tt class="descname">SETUP_LOOP</tt><big>(</big><em>delta</em><big>)</big><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="opcode"> <dt id="opcode-SETUP_EXCEPT"> <tt class="descname">SETUP_EXCEPT</tt><big>(</big><em>delta</em><big>)</big><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="opcode"> <dt id="opcode-SETUP_FINALLY"> <tt class="descname">SETUP_FINALLY</tt><big>(</big><em>delta</em><big>)</big><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="opcode"> <dt id="opcode-STORE_MAP"> <tt class="descname">STORE_MAP</tt><big>(</big><em></em><big>)</big><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="opcode"> <dt id="opcode-LOAD_FAST"> <tt class="descname">LOAD_FAST</tt><big>(</big><em>var_num</em><big>)</big><a class="headerlink" href="#opcode-LOAD_FAST" title="Permalink to this definition">¶</a></dt> <dd><p>Pushes a reference to the local <tt class="docutils literal"><span class="pre">co_varnames[var_num]</span></tt> onto the stack.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-STORE_FAST"> <tt class="descname">STORE_FAST</tt><big>(</big><em>var_num</em><big>)</big><a class="headerlink" href="#opcode-STORE_FAST" title="Permalink to this definition">¶</a></dt> <dd><p>Stores TOS into the local <tt class="docutils literal"><span class="pre">co_varnames[var_num]</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-DELETE_FAST"> <tt class="descname">DELETE_FAST</tt><big>(</big><em>var_num</em><big>)</big><a class="headerlink" href="#opcode-DELETE_FAST" title="Permalink to this definition">¶</a></dt> <dd><p>Deletes local <tt class="docutils literal"><span class="pre">co_varnames[var_num]</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-LOAD_CLOSURE"> <tt class="descname">LOAD_CLOSURE</tt><big>(</big><em>i</em><big>)</big><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 <tt class="docutils literal"><span class="pre">co_cellvars[i]</span></tt> if <em>i</em> is less than the length of <em>co_cellvars</em>. Otherwise it is <tt class="docutils literal"><span class="pre">co_freevars[i</span> <span class="pre">-</span> <span class="pre">len(co_cellvars)]</span></tt>.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-LOAD_DEREF"> <tt class="descname">LOAD_DEREF</tt><big>(</big><em>i</em><big>)</big><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="opcode"> <dt id="opcode-STORE_DEREF"> <tt class="descname">STORE_DEREF</tt><big>(</big><em>i</em><big>)</big><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="opcode"> <dt id="opcode-SET_LINENO"> <tt class="descname">SET_LINENO</tt><big>(</big><em>lineno</em><big>)</big><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="opcode"> <dt id="opcode-RAISE_VARARGS"> <tt class="descname">RAISE_VARARGS</tt><big>(</big><em>argc</em><big>)</big><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 parameters 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="opcode"> <dt id="opcode-CALL_FUNCTION"> <tt class="descname">CALL_FUNCTION</tt><big>(</big><em>argc</em><big>)</big><a class="headerlink" href="#opcode-CALL_FUNCTION" title="Permalink to this definition">¶</a></dt> <dd><p>Calls a function. The low byte of <em>argc</em> indicates the number of positional parameters, the high byte the number of keyword parameters. On the stack, the opcode finds the keyword parameters first. For each keyword argument, the value is on top of the key. Below the keyword parameters, the positional parameters are on the stack, with the right-most parameter on top. Below the parameters, the function object to call is on the stack. Pops all function arguments, and the function itself off the stack, and pushes the return value.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-MAKE_FUNCTION"> <tt class="descname">MAKE_FUNCTION</tt><big>(</big><em>argc</em><big>)</big><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="opcode"> <dt id="opcode-MAKE_CLOSURE"> <tt class="descname">MAKE_CLOSURE</tt><big>(</big><em>argc</em><big>)</big><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="opcode"> <dt id="opcode-BUILD_SLICE"> <tt class="descname">BUILD_SLICE</tt><big>(</big><em>argc</em><big>)</big><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, <tt class="docutils literal"><span class="pre">slice(TOS1,</span> <span class="pre">TOS)</span></tt> is pushed; if it is 3, <tt class="docutils literal"><span class="pre">slice(TOS2,</span> <span class="pre">TOS1,</span> <span class="pre">TOS)</span></tt> is pushed. See the <a class="reference internal" href="functions.html#slice" title="slice"><tt class="xref py py-func docutils literal"><span class="pre">slice()</span></tt></a> built-in function for more information.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-EXTENDED_ARG"> <tt class="descname">EXTENDED_ARG</tt><big>(</big><em>ext</em><big>)</big><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="opcode"> <dt id="opcode-CALL_FUNCTION_VAR"> <tt class="descname">CALL_FUNCTION_VAR</tt><big>(</big><em>argc</em><big>)</big><a class="headerlink" href="#opcode-CALL_FUNCTION_VAR" title="Permalink to this definition">¶</a></dt> <dd><p>Calls a function. <em>argc</em> is interpreted as in <tt class="docutils literal"><span class="pre">CALL_FUNCTION</span></tt>. The top element on the stack contains the variable argument list, followed by keyword and positional arguments.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-CALL_FUNCTION_KW"> <tt class="descname">CALL_FUNCTION_KW</tt><big>(</big><em>argc</em><big>)</big><a class="headerlink" href="#opcode-CALL_FUNCTION_KW" title="Permalink to this definition">¶</a></dt> <dd><p>Calls a function. <em>argc</em> is interpreted as in <tt class="docutils literal"><span class="pre">CALL_FUNCTION</span></tt>. The top element on the stack contains the keyword arguments dictionary, followed by explicit keyword and positional arguments.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-CALL_FUNCTION_VAR_KW"> <tt class="descname">CALL_FUNCTION_VAR_KW</tt><big>(</big><em>argc</em><big>)</big><a class="headerlink" href="#opcode-CALL_FUNCTION_VAR_KW" title="Permalink to this definition">¶</a></dt> <dd><p>Calls a function. <em>argc</em> is interpreted as in <tt class="docutils literal"><span class="pre">CALL_FUNCTION</span></tt>. The top element on the stack contains the keyword arguments dictionary, followed by the variable-arguments tuple, followed by explicit keyword and positional arguments.</p> </dd></dl> <dl class="opcode"> <dt id="opcode-HAVE_ARGUMENT"> <tt class="descname">HAVE_ARGUMENT</tt><big>(</big><em></em><big>)</big><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 <tt class="docutils literal"><span class="pre"><</span> <span class="pre">HAVE_ARGUMENT</span></tt> and those which do <tt class="docutils literal"><span class="pre">>=</span> <span class="pre">HAVE_ARGUMENT</span></tt>.</p> </dd></dl> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../contents.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">31.12. <tt class="docutils literal"><span class="pre">dis</span></tt> — Disassembler for Python bytecode</a><ul> <li><a class="reference internal" href="#python-bytecode-instructions">31.12.1. Python Bytecode Instructions</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="compileall.html" title="previous chapter">31.11. <tt class="docutils literal"><span class="pre">compileall</span></tt> — Byte-compile Python libraries</a></p> <h4>Next topic</h4> <p class="topless"><a href="pickletools.html" title="next chapter">31.13. <tt class="docutils literal"><span class="pre">pickletools</span></tt> — Tools for pickle developers</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../bugs.html">Report a Bug</a></li> <li><a href="../_sources/library/dis.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <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="31.13. pickletools — Tools for pickle developers" >next</a> |</li> <li class="right" > <a href="compileall.html" title="31.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="http://www.python.org/">Python</a> »</li> <li> <a href="../index.html">Python 2.7.5 documentation</a> » </li> <li><a href="index.html" >The Python Standard Library</a> »</li> <li><a href="language.html" >31. Python Language Services</a> »</li> </ul> </div> <div class="footer"> © <a href="../copyright.html">Copyright</a> 1990-2019, Python Software Foundation. <br /> The Python Software Foundation is a non-profit corporation. <a href="http://www.python.org/psf/donations/">Please donate.</a> <br /> Last updated on Jul 03, 2019. <a href="../bugs.html">Found a bug</a>? <br /> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. </div> </body> </html>
Close