summaryrefslogtreecommitdiff
path: root/Python/ceval.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix a ssize_t issueNeal Norwitz2006-03-231-1/+1
|
* Um, I thought I'd already checked this in.Guido van Rossum2006-03-101-22/+25
| | | | | | | Anyway, this is the changes to the with-statement so that __exit__ must return a true value in order for a pending exception to be ignored. The PEP (343) is already updated.
* Checking in the code for PEP 357.Guido van Rossum2006-03-071-46/+22
| | | | | | This was mostly written by Travis Oliphant. I've inspected it all; Neal Norwitz and MvL have also looked at it (in an earlier incarnation).
* SF #1444030: Fix several potential defects found by Coverity.Hye-Shik Chang2006-03-071-1/+4
| | | | (reviewed by Neal Norwitz)
* Use Py_ssize_t since we are working with list size belowNeal Norwitz2006-03-021-1/+1
|
* Put back the essence of Jeremy's original XXX comment.Thomas Wouters2006-03-011-1/+3
|
* PEP 352 implementation. Creates a new base class, BaseException, which has anBrett Cannon2006-03-011-5/+5
| | | | | | | | | added message attribute compared to the previous version of Exception. It is also a new-style class, making all exceptions now new-style. KeyboardInterrupt and SystemExit inherit from BaseException directly. String exceptions now raise DeprecationWarning. Applies patch 1104669, and closes bugs 1012952 and 518846.
* Updates to the with-statement:Guido van Rossum2006-02-281-6/+20
| | | | | | | | | | | | | | | | - New semantics for __exit__() -- it must re-raise the exception if type is not None; the with-statement itself doesn't do this. (See the updated PEP for motivation.) - Added context managers to: - file - thread.LockType - threading.{Lock,RLock,Condition,Semaphore,BoundedSemaphore} - decimal.Context - Added contextlib.py, which defines @contextmanager, nested(), closing(). - Unit tests all around; bot no docs yet.
* SF patch #1438387, PEP 328: relative and absolute imports.Thomas Wouters2006-02-281-6/+17
| | | | | | | | | | | | | | | | | | | | | | | - IMPORT_NAME takes an extra argument from the stack: the relativeness of the import. Only passed to __import__ when it's not -1. - __import__() takes an optional 5th argument for the same thing; it __defaults to -1 (old semantics: try relative, then absolute) - 'from . import name' imports name (be it module or regular attribute) from the current module's *package*. Likewise, 'from .module import name' will import name from a sibling to the current module. - Importing from outside a package is not allowed; 'from . import sys' in a toplevel module will not work, nor will 'from .. import sys' in a (single-level) package. - 'from __future__ import absolute_import' will turn on the new semantics for import and from-import: imports will be absolute, except for from-import with dots. Includes tests for regular imports and importhooks, parser changes and a NEWS item, but no compiler-package changes or documentation changes.
* Check the return code for PyErr_Warn() when warning about raising stringBrett Cannon2006-02-271-4/+5
| | | | | exceptions. This was triggered when 'warnings' had a filter set to "error" that caught the string exception deprecation warning.
* PEP 343 -- the with-statement.Guido van Rossum2006-02-271-7/+42
| | | | | | | | | | | | | This was started by Mike Bland and completed by Guido (with help from Neal). This still needs a __future__ statement added; Thomas is working on Michael's patch for that aspect. There's a small amount of code cleanup and refactoring in ast.c, compile.c and ceval.c (I fixed the lltrace behavior when EXT_POP is used -- however I had to make lltrace a static global).
* Bug #801349: document that start/stop/step slice arguments can be NoneGeorg Brandl2006-02-191-1/+1
|
* Remove size constraints in SLICE opcodes.Martin v. Löwis2006-02-171-16/+11
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-5/+8
|
* Explain the clearing of the stack in a comment in Python/ceval.c'sThomas Wouters2006-02-101-1/+2
| | | | | call_function(), rather than commenting on the lack of an explanation in a comment.
* Add const to several API functions that take char *.Jeremy Hylton2005-12-101-2/+2
| | | | | | | | | | | | | | | | | | | In C++, it's an error to pass a string literal to a char* function without a const_cast(). Rather than require every C++ extension module to put a cast around string literals, fix the API to state the const-ness. I focused on parts of the API where people usually pass literals: PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type slots, etc. Predictably, there were a large set of functions that needed to be fixed as a result of these changes. The most pervasive change was to make the keyword args list passed to PyArg_ParseTupleAndKewords() to be a const char *kwlist[]. One cast was required as a result of the changes: A type object mallocs the memory for its tp_doc slot and later frees it. PyTypeObject says that tp_doc is const char *; but if the type was created by type_new(), we know it is safe to cast to char *.
* Fix some mods that got dropped from the AST mergeNeal Norwitz2005-10-211-2/+2
|
* Merge ast-branch to headJeremy Hylton2005-10-201-30/+15
| | | | | | | | | | This change implements a new bytecode compiler, based on a transformation of the parse tree to an abstract syntax defined in Parser/Python.asdl. The compiler implementation is not complete, but it is in stable enough shape to run the entire test suite excepting two disabled tests.
* clean-up tracing of C functions. In particular, don't call the trace funcArmin Rigo2005-09-201-26/+31
| | | | with an exception currently set!
* Port from the Python 2.4 branch, patches for SF bug # 900092,Barry Warsaw2005-08-151-8/+14
| | | | hotshot.stats.load.
* PEP 342 implementation. Per Guido's comments, the generator throw()Phillip J. Eby2005-08-021-3/+15
| | | | | method still needs to support string exceptions, and allow None for the third argument. Documentation updates are needed, too.
* Fix signedness of various char variables to stop causing a warning under gcc 4.Brett Cannon2005-06-251-1/+1
|
* Add comments about PyThreadState and the usage of its fields.Brett Cannon2005-06-251-0/+4
|
* Make a handy macro, Py_DEFAULT_RECURSION_LIMIT to allow to defineHye-Shik Chang2005-04-041-2/+5
| | | | | a default value of recursion limit from build systems. 1000 levels are still too high for some 64bit systems.
* Change the name of the macro used by --with-tsc builds to the lessMichael W. Hudson2005-01-181-29/+32
| | | | inscrutable READ_TIMESTAMP.
* comment tweakSkip Montanaro2005-01-081-1/+1
|
* Hye-Shik Chang's fix for Bug 875692.Kurt B. Kaiser2004-11-231-0/+6
| | | | | | | | | Improve signal handling, especially when using threads, by forcing an early re-execution of PyEval_EvalFrame() "periodic" code when things_to_do is not cleared by Py_MakePendingCalls(). M Misc/NEWS M Python/ceval.c
* SF patch 1044089: New C API function PyEval_ThreadsInitialized(), by NickTim Peters2004-10-111-3/+6
| | | | | Coghlan, for determining whether PyEval_InitThreads() has been called. Also purged the undocumented+unused _PyThread_Started int.
* SF bug #1014215: Unspecific errors with metaclassRaymond Hettinger2004-09-161-4/+16
| | | | | | | | | | | | | | High level error message was stomping useful detailed messages from lower level routines. The new approach is to augment string error messages returned by the low level routines. The provides both high and low level information. If the exception value is not a string, no changes are made. To see the improved messages in action, type: import random class R(random): pass class B(bool): pass
* Centralize WITH_TSC processing.Martin v. Löwis2004-08-291-37/+3
|
* This is my patch:Michael W. Hudson2004-08-121-1/+33
| | | | | | [ 1005891 ] support --with-tsc on PPC plus a trivial change to settscdump's docstring and a Misc/NEWS entry.
* This was quite a dark bug in my recent in-place string concatenationArmin Rigo2004-08-071-1/+1
| | | | | | hack: it would resize *interned* strings in-place! This occurred because their reference counts do not have their expected value -- stringobject.c hacks them. Mea culpa.
* SF patch #980695: efficient string concatenationRaymond Hettinger2004-08-061-2/+91
| | | | (Original patch by Armin Rigo).
* Fix for the unfortunate fact that PyDict_GetItem and PyObject_GetItemMichael W. Hudson2004-08-021-2/+4
| | | | | | | have differing refcount semantics. If anyone sees a prettier way to acheive the same ends, then please go for it. I think this is the first time I've ever used Py_XINCREF.
* Completed the patch for Bug #215126.Raymond Hettinger2004-08-021-3/+3
| | | | | | | * Fixes an incorrect variable in a PyDict_CheckExact. * Allow general mapping locals arguments for the execfile() function and exec statement. * Add tests.
* Remove unused macros in .c filesNeal Norwitz2004-07-081-3/+0
|
* This closes patch:Michael W. Hudson2004-07-071-1/+1
| | | | | | | | | | | | | | | | | [ 960406 ] unblock signals in threads although the changes do not correspond exactly to any patch attached to that report. Non-main threads no longer have all signals masked. A different interface to readline is used. The handling of signals inside calls to PyOS_Readline is now rather different. These changes are all a bit scary! Review and cross-platform testing much appreciated.
* SF Bug #215126: Over restricted type checking on eval() functionRaymond Hettinger2004-07-021-4/+16
| | | | | | The builtin eval() function now accepts any mapping for the locals argument. Time sensitive steps guarded by PyDict_CheckExact() to keep from slowing down the normal case. My timings so no measurable impact.
* Patch #966493: Cleanup generator/eval_frame exposure.Martin v. Löwis2004-06-271-14/+6
|
* Get ceval.c to compile again by moving declarations before other statments.Raymond Hettinger2004-06-261-1/+2
|
* Massive performance improvement for C extension and builtin tracing codeNicholas Bastin2004-06-251-51/+27
|
* Less ugly #ifdefs for C profiling fixNicholas Bastin2004-06-221-12/+5
|
* One forgotten C profiling #ifdefNicholas Bastin2004-06-221-1/+2
|
* Making C profiling a configure option (at least temporarily)Nicholas Bastin2004-06-221-0/+12
|
* Install two code generation optimizations that depend on NOP.Raymond Hettinger2004-06-211-0/+3
| | | | Reduces the cost of "not" to almost zero.
* Performance tweak: allow stack_pointer and oparg to be register variables.Armin Rigo2004-06-171-7/+16
| | | | SF patch #943898
* Patch #510695: Add TSC profiling for the VM.Martin v. Löwis2004-06-081-2/+150
|
* SF bug #963956: Bad error mesage when subclassing a moduleRaymond Hettinger2004-06-051-0/+9
| | | | | | Add a more informative message for the common user mistake of subclassing from a module name rather than another class (i.e. random instead of random.random).
* Patch #957398: Add public API for Generator Object/Type.Martin v. Löwis2004-06-011-138/+8
|
* Some (but not all) of the why code bitfield tests ran faster asRaymond Hettinger2004-04-111-3/+4
| | | | separate equality tests. Now, all are set to their best timing.