diff options
author | Georg Brandl <georg@python.org> | 2009-04-10 09:03:43 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-04-10 09:03:43 (GMT) |
commit | c2a4f4fb67a76cb04731beebc515878f9b91674c (patch) | |
tree | 35fe3ee01b0b32931f4beb11ebcc4553d0f34f3a /Doc/library/dis.rst | |
parent | 388faac8cb5be6ad1ad474bae237b71bd00a1900 (diff) | |
download | cpython-c2a4f4fb67a76cb04731beebc515878f9b91674c.zip cpython-c2a4f4fb67a76cb04731beebc515878f9b91674c.tar.gz cpython-c2a4f4fb67a76cb04731beebc515878f9b91674c.tar.bz2 |
Update signature style for optional arguments, part 3.
Diffstat (limited to 'Doc/library/dis.rst')
-rw-r--r-- | Doc/library/dis.rst | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 856a9e4..c5a7ea8 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -30,22 +30,23 @@ the following command can be used to get the disassembly of :func:`myfunc`:: The :mod:`dis` module defines the following functions and constants: -.. function:: dis([bytesource]) +.. function:: dis(x=None) - Disassemble the *bytesource* object. *bytesource* can denote either a module, a + Disassemble the *x* object. *x* 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. -.. function:: distb([tb]) +.. function:: distb(tb=None) Disassembles the top-of-stack function of a traceback, using the last traceback if none was passed. The instruction causing the exception is indicated. -.. function:: disassemble(code[, lasti]) +.. function:: disassemble(code, lasti=-1) + disco(code, lasti=-1) Disassembles a code object, indicating the last instruction if *lasti* was provided. The output is divided in the following columns: @@ -62,12 +63,6 @@ The :mod:`dis` module defines the following functions and constants: constant values, branch targets, and compare operators. -.. function:: disco(code[, lasti]) - - A synonym for :func:`disassemble`. It is more convenient to type, and kept - for compatibility with earlier Python releases. - - .. function:: findlinestarts(code) This generator function uses the ``co_firstlineno`` and ``co_lnotab`` |