| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Support for the new -U command line option option:
with the option enabled the Python compiler
interprets all "..." strings as u"..." (same with r"..." and
ur"...").
|
|
|
|
|
|
|
|
| |
Follow a suggestion in an /*XXX*/ comment [in com_add()] to speed up
compilation by using supplemental dictionaries to keep track of names
and constants, eliminating quadratic behavior. With this patch in
place, the time to import a 5000-line file with lots of constants [at
the global level] is reduced from 20 seconds to under 3 on my system.
|
|
|
|
|
| |
Fixed problem with Unicode string concatenation:
u = (u"abc" u"abc") previously dumped core.
|
|
|
|
|
|
|
| |
comparing code objects. This give sless surprising results in
-Optimized code. It also sorts code objects by name, now.
[I changed the patch to hash() slightly to touch fewer lines.]
|
|
|
|
|
| |
representation of code objects when optimization is on (python -O). It
was always reported as -1 instead of the real lineno.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
c_varnames, not c_lnotab.
|
|
|
|
|
|
|
|
| |
For a long time I've seen absurd tracebacks under -O (e.g., negative
line numbers), but very rarely. Since I was looking at tracebacks
anyway, thought I'd track it down. Turns out to be Guido's only
predictable blind spot <wink -- "char" is signed on some non-GvR
systems>. Patch follows.
|
|
|
|
| |
Marc-Andre Lemburg.
|
| |
|
| |
|
|
|
|
|
| |
as the code string of code objects, as long as they support
the (readonly) buffer interface. By Greg Stein.
|
|
|
|
| |
"non-default argument follows default argument".
|
|
|
|
| |
instead of silently supplying a default of None fore c.
|
|
|
|
|
|
|
|
| |
happen when you use a non-keyword argument after a keyword argument,
and in this case you also get a syntax error. I fully suspect that
the underflow is caused by the code that stops generating code when it
detects the syntax error, but I can't find the culprit right now. I
know, I know.)
|
|
|
|
| |
need to call PyErr_Clear() when it returns NULL.
|
| |
|
| |
|
| |
|
|
|
|
| |
of co/cp mixup.
|
|
|
|
|
|
| |
order of the variables in the declarations).
Also removed an entry in the TODO list that's done.
|
|
|
|
|
|
| |
have a unique name, otherwise they get squished by locals2fast (or
fast2locals, I dunno) when the debugger is invoked before they have
been transferred to real locals.
|
| |
|
| |
|
| |
|
|
|
|
| |
symbols is needed, define these in Python.h with a Py_ prefix.
|
| |
|
| |
|
|
|
|
| |
In interactive mode, do generate code for single-string statements.
|
| |
|
| |
|
|
|
|
|
| |
Add prototypes for parsestr() and parsestrplus() (unrelated, but
seemed to make sense.)
|
|
|
|
|
|
|
|
|
|
|
| |
recognized by the code generator and code generation for the test and
the subsequent suite is suppressed.
One must write *exactly* ``if __debug__:'' or ``elif __debug__:'' --
no parentheses or operators must be present, or the optimization is
not carried through. Whitespace doesn't matter. Other uses of
__debug__ will find __debug__ defined as 0 or 1 in the __builtin__
module.
|
|
|
|
| |
nonzero.
|
|
|
|
|
| |
New file pyfpe.c and exception FloatingPointError.
Surround some f.p. operations with PyFPE macro brackets.
|
|
|
|
|
|
| |
table which is incorporated in the code object. This way, the runtime
overhead to keep track of line numbers is only incurred when an
exception has to be reported.
|
| |
|
|
|
|
|
| |
literals that look like identifiers. Also intern all strings used as
names during the compilation.
|
|
|
|
|
|
|
|
|
|
|
|
| |
to PyCode_New() argument list. Move MAXBLOCKS constant to conpile.h.
Added accurate calculation of the actual stack size needed by the
generated code.
Also commented out all fprintf statements (except for a new one to
diagnose stack underflow, and one in #ifdef'ed out code), and added
some new TO DO suggestions (now that the stacksize is taken of the TO
DO list).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
be Ellipsis!).
Bumped the API version because a linker-visible symbol is affected.
Old C code will still compile -- there's a b/w compat macro.
Similarly, old Python code will still run, builtin exports both
Ellipses and Ellipsis.
|
| |
|
|
|
|
| |
so __spam becomes _ClassName__spam.
|
| |
|
| |
|
| |
|