summaryrefslogtreecommitdiffstats
path: root/Lib/dis.py
Commit message (Collapse)AuthorAgeFilesLines
* fix dis on new style classes #8310Benjamin Peterson2010-04-041-4/+4
|
* use isinstanceBenjamin Peterson2009-05-101-5/+5
|
* #4222: document dis.findlabels() and dis.findlinestarts() andGeorg Brandl2009-01-011-1/+2
| | | | put them into dis.__all__.
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-121-8/+8
| | | | From SF patch #852334.
* Fixed dis.disassemble_string().Armin Rigo2003-10-281-28/+24
| | | | | Added dis.findlinestarts(). SF bug 811294
* Whitespace normalization.Tim Peters2003-03-071-39/+39
|
* * separate opcode definitions into opcode.pySkip Montanaro2003-02-271-178/+51
| | | | | * add disassemble_string * allow classes and strings containing bytecode to be disassembled
* Further SET_LINENO reomval fixes. See comments in patch #587933.Michael W. Hudson2002-08-301-1/+0
| | | | | | | | | | Use a slightly different strategy to determine when not to call the line trace function. This removes the need for the RETURN_NONE opcode, so that's gone again. Update docs and comments to match. Thanks to Neal and Armin! Also add a test suite. This should have come with the original patch...
* Whitespace normalization.Tim Peters2002-08-231-1/+1
|
* This is my patchMichael W. Hudson2002-08-151-4/+32
| | | | | | | | [ 587993 ] SET_LINENO killer Remove SET_LINENO. Tracing is now supported by inspecting co_lnotab. Many sundry changes to document and adapt to this change.
* The opcode FOR_LOOP no longer exists.Guido van Rossum2002-06-131-1/+0
|
* The opcode YIELD_STMT was accidentally called YIELD_VALUE here.Guido van Rossum2002-06-111-1/+1
|
* Replaced boolean test with 'is None'Raymond Hettinger2002-06-011-4/+4
|
* SF #515009, delete global variable that was apparently used onlyNeal Norwitz2002-02-111-0/+1
| | | | in a for loop.
* Add opcodes for floor division and true division (PEP 238)Jeremy Hylton2001-08-291-0/+4
|
* FOR_ITER is a jrel_op() not a plain old def_op()Jeremy Hylton2001-08-281-1/+1
|
* Merging the gen-branch into the main line, at Guido's direction. Yay!Tim Peters2001-06-181-0/+1
| | | | | Bugfix candidate in inspect.py: it was referencing "self" outside of a method.
* Iterators phase 1. This comprises:Guido van Rossum2001-04-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | new slot tp_iter in type object, plus new flag Py_TPFLAGS_HAVE_ITER new C API PyObject_GetIter(), calls tp_iter new builtin iter(), with two forms: iter(obj), and iter(function, sentinel) new internal object types iterobject and calliterobject new exception StopIteration new opcodes for "for" loops, GET_ITER and FOR_ITER (also supported by dis.py) new magic number for .pyc files new special method for instances: __iter__() returns an iterator iteration over dictionaries: "for x in dict" iterates over the keys iteration over files: "for x in file" iterates over lines TODO: documentation test suite decide whether to use a different way to spell iter(function, sentinal) decide whether "for key in dict" is a good idea use iterators in map/filter/reduce, min/max, and elsewhere (in/not in?) speed tuning (make next() a slot tp_next???)
* String method conversion.Eric S. Raymond2001-02-091-4/+3
|
* Allow 'continue' inside 'try' clauseJeremy Hylton2001-02-011-0/+1
| | | | SF patch 102989 by Thomas Wouters
* PEP 227 implementationJeremy Hylton2001-01-251-1/+15
| | | | | Track changes to new opcodes. Add hasfree list that applies to all ops that use the closure.
* added __all__ lists to a number of Python modulesSkip Montanaro2001-01-201-0/+4
| | | | | | | | added test script and expected output file as well this closes patch 103297. __all__ attributes will be added to other modules without first submitting a patch, just adding the necessary line to the test script to verify more-or-less correct implementation.
* Checking in a slight variation of Barry's patch 103303.Guido van Rossum2001-01-191-10/+9
|
* Whitespace normalization.Tim Peters2001-01-141-164/+164
|
* Add missing opcodes. Thanx to jeremy for reminding me ;)Thomas Wouters2000-08-241-1/+2
|
* Support for augmented assignment in the UserList, UserDict, UserString andThomas Wouters2000-08-241-1/+11
| | | | | | rfc822 (Addresslist) modules. Also a preliminary testcase for augmented assignment, which should actually be merged with the test_class testcase I added last week.
* Charles G. Waldman <cgw@fnal.gov>:Fred Drake2000-08-241-1/+7
| | | | | | | | | Add the EXTENDED_ARG opcode to the virtual machine, allowing 32-bit arguments to opcodes instead of being forced to stick to the 16-bit limit. This is especially useful for machine-generated code, which can be too long for the SET_LINENO parameter to fit into 16 bits. This closes the implementation portion of SourceForge patch #100893.
* Add the new PRINT_ITEM_TO and PRINT_NEWLINE_TO opcodes.Barry Warsaw2000-08-211-0/+2
|
* Apply SF patch #101135, adding 'import module as m' and 'from module importThomas Wouters2000-08-171-1/+1
| | | | | | | | name as n'. By doing some twists and turns, "as" is not a reserved word. There is a slight change in semantics for 'from module import name' (it will now honour the 'global' keyword) but only in cases that are explicitly undocumented.
* Merge UNPACK_LIST and UNPACK_TUPLE into a single UNPACK_SEQUENCE, since theyThomas Wouters2000-08-111-2/+2
| | | | | | | did the same anyway. I'm not sure what to do with Tools/compiler/compiler/* -- that isn't part of distutils, is it ? Should it try to be compatible with old bytecode version ?
* Michael Hudson: With the (cool!) new call syntax, the longest opcodeGuido van Rossum2000-03-301-1/+1
| | | | | name is much longer, which fouls up dis's formatting slightly; this is a "fix" for that.
* slightly modified version of Greg Ewing's extended call syntax patchJeremy Hylton2000-03-281-4/+8
| | | | | | | | | | | | | | | | | | | | | | | executive summary: Instead of typing 'apply(f, args, kwargs)' you can type 'f(*arg, **kwargs)'. Some file-by-file details follow. Grammar/Grammar: simplify varargslist, replacing '*' '*' with '**' add * & ** options to arglist Include/opcode.h & Lib/dis.py: define three new opcodes CALL_FUNCTION_VAR CALL_FUNCTION_KW CALL_FUNCTION_VAR_KW Python/ceval.c: extend TypeError "keyword parameter redefined" message to include the name of the offending keyword reindent CALL_FUNCTION using four spaces add handling of sequences and dictionaries using extend calls fix function import_from to use PyErr_Format
* Added a simple test program to disassemble a file, invoked as __main__.Guido van Rossum2000-02-041-0/+27
|
* Clarify why we define disco. Suggested by Andrew Dalke.Guido van Rossum1999-05-031-1/+1
|
* Get rid of some obsolete opcodes.Guido van Rossum1998-07-071-5/+0
|
* Added docstrings (contributed by Martin von Loewis).Guido van Rossum1997-11-181-1/+13
|
* Modernized for 1.5Guido van Rossum1997-05-091-5/+8
|
* Support disassembly of a variety of objects through dis.dis().Guido van Rossum1997-03-141-0/+17
|
* Of course, when the type of the argument to dis() is unsupported, itGuido van Rossum1997-01-171-1/+1
| | | | should raise TypeError, not ValueError...
* More user friedly interface:Guido van Rossum1997-01-171-10/+25
| | | | | | | | | | | dis() still disassembles the last frame of the lats stack trace. dis(x) disassembles x, which may be a code object, function, or method. disassemble(co, [lasti]) disassembles a code object; the lasti argument is now optional. disco(...) is an alias for disassemble(...), for backward compatibility.
* Merge several mods:Guido van Rossum1997-01-161-2/+12
| | | | | | | | - add opcodes BINARY_LSHIFT ... BINARY_OR - remove RESERVE_FAST - Skip M's suggestion for displaying which comparison operator is meant
* Show names of locals in disco (Ka-Ping Yee)Guido van Rossum1996-09-121-0/+6
|
* Zapped obsolete opcode LOAD_GLOBALS.Guido van Rossum1996-09-101-1/+0
|
* Added BUILD_SLICE opcode.Guido van Rossum1996-07-301-0/+1
|
* New opcodes BINARY_POWER, RAISE_VARARGS, CALL_FUNCTION, MAKE_FUNCTIONGuido van Rossum1996-07-211-0/+5
|
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-011-1/+3
|
* * string.py: added rindex(), rfind(); changed index() to interpretGuido van Rossum1993-11-081-2/+2
| | | | | | | | | | | negative start indices starting from the right. * ftplib.py: debug() -> set_debuglevel(); change demo to use __init__(). * os.py: added execl, execlp, and execvp. * lambda.py: removed (now that we have built-in map, reduce, bagof, lambda) * test_b{1,2}.py, testall.out: added tests for bagof, lambda, map, reduce * commands.py: use os, not posix * test_grammar.py: make it easy to disable non-portable int overflow tests * dis.py: don't abuse range()
* Updated because of new opcodes introduced for "fast" local variables.Guido van Rossum1993-03-301-2/+9
|
* New == syntaxGuido van Rossum1992-01-011-2/+2
|
* New opcodes: UNPACK_ARG, STORE_GLOBAL, DELETE_GLOBAL, LOAD_LOCAL, LOAD_GLOBALGuido van Rossum1991-12-161-2/+7
|