summaryrefslogtreecommitdiffstats
path: root/Include/ceval.h
Commit message (Collapse)AuthorAgeFilesLines
* Add const to several API functions that take char *.Jeremy Hylton2005-12-101-4/+6
| | | | | | | | | | | | | | | | | | | 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 *.
* PEP 342 implementation. Per Guido's comments, the generator throw()Phillip J. Eby2005-08-021-0/+1
| | | | | method still needs to support string exceptions, and allow None for the third argument. Documentation updates are needed, too.
* SF patch 1044089: New C API function PyEval_ThreadsInitialized(), by NickTim Peters2004-10-111-0/+1
| | | | | Coghlan, for determining whether PyEval_InitThreads() has been called. Also purged the undocumented+unused _PyThread_Started int.
* Patch #966493: Cleanup generator/eval_frame exposure.Martin v. Löwis2004-06-271-1/+1
|
* Patch #957398: Add public API for Generator Object/Type.Martin v. Löwis2004-06-011-0/+1
|
* Deleting cyclic object comparison.Armin Rigo2003-10-281-0/+14
| | | | | SF patch 825639 http://mail.python.org/pipermail/python-dev/2003-October/039445.html
* As far as I can tell PyEval_GetOwner was removed in 1997 (when it wasMichael W. Hudson2003-02-201-1/+0
| | | | | called something else!). I can't imagine removing the prototype is going to hurt, but put it back if *you* can.
* - PyEval_GetFrame() is now declared to return a PyFrameObject *Guido van Rossum2003-02-191-1/+3
| | | | instead of a plain PyObject *. (SF patch #686601 by Ben Laurie.)
* Small function call optimization and special build option for call stats.Jeremy Hylton2003-02-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | -DCALL_PROFILE: Count the number of function calls executed. When this symbol is defined, the ceval mainloop and helper functions count the number of function calls made. It keeps detailed statistics about what kind of object was called and whether the call hit any of the special fast paths in the code. Optimization: When we take the fast_function() path, which seems to be taken for most function calls, and there is minimal frame setup to do, avoid call PyEval_EvalCodeEx(). The eval code ex function does a lot of work to handle keywords args and star args, free variables, generators, etc. The inlined version simply allocates the frame and copies the arguments values into the frame. The optimization gets a little help from compile.c which adds a CO_NOFREE flag to code objects that don't have free variables or cell variables. This change allows fast_function() to get into the fast path with fewer tests. I measure a couple of percent speedup in pystone with this change, but there's surely more that can be done.
* replace thread state objects' ticker and checkinterval fields with twoSkip Montanaro2002-09-031-0/+4
| | | | | | | | | | globals, _Py_Ticker and _Py_CheckInterval. This also implements Jeremy's shortcut in Py_AddPendingCall that zeroes out _Py_Ticker. This allows the test in the main loop to only test a single value. The gory details are at http://python.org/sf/602191
* Excise DL_EXPORT from Include.Mark Hammond2002-08-121-30/+30
| | | | Thanks to Skip Montanaro and Kalle Svensson for the patches.
* Merge of descr-branch back into trunk.Tim Peters2001-08-021-0/+3
|
* Part way to allowing "from __future__ import generators" to communicateTim Peters2001-07-161-1/+5
| | | | | | | | | | that info to code dynamically compiled *by* code compiled with generators enabled. Doesn't yet work because there's still no way to tell the parser that "yield" is OK (unlike nested_scopes, the parser has its fingers in this too). Replaced PyEval_GetNestedScopes by a more-general PyEval_MergeCompilerFlags. Perhaps I should not have? I doubted it was *intended* to be part of the public API, so just did.
* Revise the interface to the profiling and tracing support for theFred Drake2001-06-271-0/+3
| | | | | | | | | | | | | | | Python interpreter. This change adds two new C-level APIs: PyEval_SetProfile() and PyEval_SetTrace(). These can be used to install profile and trace functions implemented in C, which can operate at much higher speeds than Python-based functions. The overhead for calling a C-based profile function is a very small fraction of a percent of the overhead involved in calling a Python-based function. The machinery required to call a Python-based profile or trace function been moved to sysmodule.c, where sys.setprofile() and sys.setprofile() simply become users of the new interface.
* If a code object is compiled with nested scopes, define the CO_NESTED flag.Jeremy Hylton2001-03-221-0/+1
| | | | | Add PyEval_GetNestedScopes() which returns a non-zero value if the code for the current interpreter frame has CO_NESTED defined.
* RET_SAVE references should be Py_BLOCK_THREADS referencesSkip Montanaro2000-09-151-2/+2
|
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Supply missing prototypes for new Py_{Get,Set}RecursionLimit; fixes compiler ↵Tim Peters2000-09-011-0/+2
| | | | | | | wngs; un-analize Get's definition ("void" is needed only in declarations, not defns, & is generally considered bad style in the latter).
* The new PyEval_ReInitThreads wasn't declared in ceval.h; compiler wngs.Tim Peters2000-08-271-0/+1
|
* Use 'void' directly instead of the ANY #define, now that all code is ANSI C.Thomas Wouters2000-07-251-1/+1
| | | | Leave the actual #define in for API compatibility.
* ANSIfications: fix empty arglists, and remove the checks forThomas Wouters2000-07-221-6/+0
| | | | 'HAVE_STDARG_PROTOTYPES' (consider it true, remove false branch)
* ANSI-fication and Py_PROTO extermination.Fred Drake2000-07-081-22/+22
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Trent Mick:Guido van Rossum2000-05-081-0/+3
| | | | Add declaration of PyEval_SliceIndex().
* Add DLL level b/w compat for PySequence_In and PyEval_CallObjectGuido van Rossum1999-03-171-0/+4
|
* Add DL_IMPORT(returntype) for all officially exported functions.Guido van Rossum1998-12-041-21/+21
|
* Add missing prototypes for PyEval_CallFunction() and PyEval_CallMethod().Guido van Rossum1998-08-081-0/+10
|
* Inline PyObject_CallObject (Marc-Andre Lemburg).Guido van Rossum1997-08-301-1/+4
|
* Mass checkin (more to follow for other directories).Guido van Rossum1997-08-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce truly separate (sub)interpreter objects. For now, these must be used by separate threads, created from C. See Demo/pysvr for an example of how to use this. This also rationalizes Python's initialization and finalization behavior: Py_Initialize() -- initialize the whole interpreter Py_Finalize() -- finalize the whole interpreter tstate = Py_NewInterpreter() -- create a new (sub)interpreter Py_EndInterpreter(tstate) -- delete a new (sub)interpreter There are also new interfaces relating to threads and the interpreter lock, which can be used to create new threads, and sometimes have to be used to manipulate the interpreter lock when creating or deleting sub-interpreters. These are only defined when WITH_THREAD is defined: PyEval_AcquireLock() -- acquire the interpreter lock PyEval_ReleaseLock() -- release the interpreter lock PyEval_AcquireThread(tstate) -- acquire the lock and make the thread current PyEval_ReleaseThread(tstate) -- release the lock and make NULL current Other administrative changes: - The header file bltinmodule.h is deleted. - The init functions for Import, Sys and Builtin are now internal and declared in pythonrun.h. - Py_Setup() and Py_Cleanup() are no longer declared. - The interpreter state and thread state structures are now linked together in a chain (the chain of interpreters is a static variable in pythonrun.c). - Some members of the interpreter and thread structures have new, shorter, more consistent, names. - Added declarations for _PyImport_{Find,Fixup}Extension() to import.h.
* Moved PyEval_InitThreads to inside WITH_THREAD, where it belongs.Guido van Rossum1997-07-191-1/+1
|
* PyEval_SaveThread() and PyEval_RestoreThread() now return/take aGuido van Rossum1997-07-181-3/+6
| | | | | | | | | | | | | | | | PyThreadState pointer instead of a (frame) PyObject pointer. This makes much more sense. It is backward incompatible, but that's no problem, because (a) the heaviest users are the Py_{BEGIN,END}_ ALLOW_THREADS macros here, which have been fixed too; (b) there are very few direct users; (c) those who use it are there will probably appreciate the change. Also, added new functions PyEval_AcquireThread() and PyEval_ReleaseThread() which allows the threads created by the thread module as well threads created by others (!) to set/reset the current thread, and at the same time acquire/release the interpreter lock. Much saner.
* flushline and writestring can now return an errorGuido van Rossum1997-05-221-1/+1
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* keyword arguments and faster function callsGuido van Rossum1995-07-181-0/+2
|
* The great renaming, phase two: all header files have been updated toGuido van Rossum1995-01-121-34/+36
| | | | | | | use the new names exclusively, and the linker will see the new names. Files that import "Python.h" also only see the new names. Files that import "allobjects.h" will continue to be able to use the old names, due to the inclusion (in allobjects.h) of "rename2.h".
* __builtins__ mods (and sys_checkinterval for ceval.c)Guido van Rossum1995-01-091-0/+2
|
* Added 1995 copyright.Guido van Rossum1995-01-041-2/+2
| | | | | | object.h: made sizes and refcnts signed ints. stringobject.h: make getstrsize() signed int. methodobject.h: add METH_VARARGS and METH_FREENAME flag bit definitions.
* Lots of small things, see ChangeLogGuido van Rossum1994-12-301-2/+1
|
* ceval.h: added Py_MakePendingCalls()Guido van Rossum1994-09-281-0/+1
| | | | | | classobject.h: added instancebinop() modsupport.h: added newgetargs() rename1.h: removed Py_FPROTO
* pythonrun.h: added run_pyc_fileGuido van Rossum1994-09-141-0/+2
| | | | | ceval.h: added Py_AddPendingCall rest: modules using the new naming scheme must now include Python.h
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-011-4/+5
|
* * ceval.c, longobject.c, methodobject.c, listnode.c, arraymodule.c,Guido van Rossum1993-11-011-1/+0
| | | | | | pythonrun.c: added static forward declarations * pythonrun.h, ceval.h, longobject.h, node.h: removed declarations of static routines
* * Added support for X11 modules.Guido van Rossum1993-07-281-0/+11
| | | | | | | * Makefile: change location of FORMS library. * posixmodule.c: turn #if 0 into #ifdef MSDOS (stuff in unistd.h or not) * Almost all .h files: added CPP magic to avoid duplicate inclusions and to support inclusion from C++.
* * classobject.c: in instance_getattr, don't make a method out of aGuido van Rossum1993-05-251-1/+1
| | | | | | | | | | function found as instance data. * socketmodule.c: added 'flags' argument sendto/recvfrom, rewrite argument parsing in send/recv. * More changes related to access (terminology change: owner instead of class; allow any object as owner; local/global variables are owned by their dictionary, only class/instance data is owned by the class; "from...import *" now only imports objects with public access; etc.)
* Access checks now work, at least for instance data (not for methodsGuido van Rossum1993-05-201-0/+1
| | | | | | | yet). The class is now passed to eval_code and stored in the current frame. It is also stored in instance method objects. An "unbound" instance method is now returned when a function is retrieved through "classname.funcname", which when called passes the class to eval_code.
* Changes to speed up local variables enormously, by avoiding dictionaryGuido van Rossum1993-03-301-0/+1
| | | | | | lookup (opcode.h, ceval.[ch], compile.c, frameobject.[ch], pythonrun.c, import.c). The .pyc MAGIC number is changed again. Added get_menu_text to flmodule.
* * Changed all copyright messages to include 1993.Guido van Rossum1993-03-291-2/+2
| | | | | | | | | | | | | | | | | * Stubs for faster implementation of local variables (not yet finished) * Added function name to code object. Print it for code and function objects. THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version number has changed accordingly) * Print address of self for built-in methods * New internal functions getattro and setattro (getattr/setattr with string object arg) * Replaced "dictobject" with more powerful "mappingobject" * New per-type functio tp_hash to implement arbitrary object hashing, and hashobject() to interface to it * Added built-in functions hash(v) and hasattr(v, 'name') * classobject: made some functions static that accidentally weren't; added __hash__ special instance method to implement hash() * Added proper comparison for built-in methods and functions
* Modified most (but not yet all) I/O to always go through sys.stdout orGuido van Rossum1992-09-251-1/+1
| | | | | | sys.stderr or sys.stdin, and to work with any object as long as it has a write() (respectively readline()) methods. Some functions that took a FILE* argument now take an object* argument.
* Changes so that user-defined classes can implement operations invokedGuido van Rossum1992-08-121-3/+3
| | | | | by special syntax: you can now define your own numbers, sequences and mappings.