summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
Commit message (Collapse)AuthorAgeFilesLines
* (I suggest a recompile after getting this, the ceval.c bugfix may be crucial!)Guido van Rossum1993-04-151-5/+14
| | | | | | | * Makefile: removed superfluous AR=ar, fixed misleading comment. * ceval.c: fixed debugging code; save/restore errors in locals_2_fast. * intrcheck.c: for SunOS etc., turn off syscall resumption. * regexpr.h: bump number of registers to 100.
* * Microscopic corrections to make things compile on the Cray APP.Guido van Rossum1993-04-071-2/+1
| | | | | * Removed one use of $> in Makefile and warned about others. Added configurable lines in Makefile to change CC and AR.
* * Fixed some subtleties with fastlocals. You can no longer accessGuido van Rossum1993-03-301-9/+44
| | | | | | | | | | | | | | | | | | f_fastlocals in a traceback object (this is a core dump hazard if there are <nil> entries), but instead eval_code() merges the fast locals back into the locals dictionary if it looks like the local variables will be retained. Also, the merge routines save exceptions since this is sometimes needed (alas!). * Added id() to bltinmodule.c, which returns an object's address (identity). Useful to walk arbitrary data structures containing cycles. * Added compile() to bltinmodule.c and compile_string() to pythonrun.[ch]: support to exec/eval arbitrary code objects. The code that defaults globals and locals is moved from run_node in pythonrun.c (which is now identical to eval_node) to eval_code in ceval.c. [XXX For elegance a clean-up session is necessary.]
* Changes to speed up local variables enormously, by avoiding dictionaryGuido van Rossum1993-03-301-11/+125
| | | | | | 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-7/+25
| | | | | | | | | | | | | | | | | * 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
* * Changed many files to use mkvalue() instead of newtupleobject().Guido van Rossum1993-03-161-0/+3
| | | | | | | | | | * Fixcprt.py: added [-y file] option, do only files younger than file. * modsupport.[ch]: added vmkvalue(). * intobject.c: use mkvalue(). * stringobject.c: added "formatstring"; renamed string* to string_*; ceval.c: call formatstring for string % value. * longobject.c: close memory leak in divmod. * parsetok.c: set result node to NULL when returning an error.
* * ceval.c: ifdef out the last argument passing compat hack.Guido van Rossum1993-02-051-8/+6
| | | | | * Fixed memory leaks in socket, select and sv modules: mkvalue("O", v) does INCREF(v) so if v is brand new it should be XDECREF'd
* * Added Fixcprt.py: script to fix copyright message.Guido van Rossum1993-01-261-6/+4
| | | | | | | | | | | * various modules: added 1993 to copyright. * thread.c: added copyright notice. * ceval.c: minor change to error message for "+" * stdwinmodule.c: check for error from wfetchcolor * config.c: MS-DOS fixes (define PYTHONPATH, use DELIM, use osdefs.h) * Add declaration of inittab to import.h * sysmodule.c: added sys.builtin_module_names * xxmodule.c, xxobject.c: fix minor errors
* * Makefile: use cp -r to install the libraryGuido van Rossum1993-01-091-1/+1
| | | | | | | | * ceval.c: use #ifdef COMPAT_HACKS instead of #if 0 * Makefile: fix to make clmodule.c compile; make config.o dependent on libpython.a (so date is always correct) * timemodule.c: now sleep() also takes a float argument. * posixmodule.c: added nice().
* Various changes.Sjoerd Mullender1993-01-061-1/+1
| | | | | | | | | | | | | | | * Makefile: svmodule.c.proto and svgen.py are gone, svmodule.c came in their stead. Also, pass -DUSE_DL flag to thread.c and give the user a possibility to add the -DDEBUG to just thread.c. * ceval.c: init_save_thread() can be called more than once now. * svgen.py, svmodule.c.proto, svmodule.c: Removed prototype file and replaced it by the generated file. * thread.c: Added some more checks; added call to DL library when it is also used to tell it where the shared arena is so that DL can use some other area. * threadmodule.c: Call init_save_thread from another place. Also, added new function getlocklock() which does to lock objects what getfilefile does to file objects.
* * mymalloc.h: always allocate one extra byte, since some malloc'sGuido van Rossum1992-12-141-0/+4
| | | | | | | | | | | | | return NULL for malloc(0) or realloc(p, 0). (This should be done differently than wasting one byte, but alas...) * Moved "add'l libraries" option in Makefile to an earlier place. * Remove argument compatibility hacks (b) and (c). * Add grey2mono, dither2mono and mono2grey to imageop. * Dup the fd in socket.fromfd(). * Added new modules mpz, md5 (by JH, requiring GNU MP 1.2). Affects Makefile and config.c. * socketmodule.c: added socket.fromfd(fd, family, type, [proto]), converted socket() to use of getargs().
* * classobject.c: in instance_lenth, test result of call_objectGuido van Rossum1992-11-261-0/+2
| | | | | | for exception before using it. Fixed a few other places where the outcome of calling sq_length wasn't tested for exceptions (bltinmodule.c, ceval.c).
* * bltinmodule.c: added built-in function cmp(a, b)Guido van Rossum1992-10-181-0/+20
| | | | | | | | | | | | | | | * flmodule.c: added {do,check}_only_forms to fl's list of functions; and don't print a message when an unknown object is returned. * pythonrun.c: catch SIGHUP and SIGTERM to do essential cleanup. * Made jpegmodule.c smaller by using getargs() and mkvalue() consistently. * Increased parser stack size to 500 in parser.h. * Implemented custom allocation of stack frames to frameobject.c and added dynamic stack overflow checks (value stack only) to ceval.c. (There seems to be a bug left: sometimes stack traces don't make sense.)
* Modified most (but not yet all) I/O to always go through sys.stdout orGuido van Rossum1992-09-251-24/+24
| | | | | | 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.
* Add some debugging features if DEBUG definedGuido van Rossum1992-09-031-0/+10
| | | | | (fetch the filename as a string so I can see it with dbx, and set f_lineno); call abort() when detecting an "undetected" error.
* fix *serious* (new) bug in testbool: by default objects should testGuido van Rossum1992-08-191-1/+1
| | | | true, not false!!!
* * classobject.[ch], {float,long,int}object.c, bltinmodule.c:Guido van Rossum1992-08-141-7/+18
| | | | | | coercion is now completely generic. * ceval.c: for instances, don't coerce for + and *; * reverses arguments if left one is non-instance numeric and right one sequence.
* Changes so that user-defined classes can implement operations invokedGuido van Rossum1992-08-121-31/+75
| | | | | by special syntax: you can now define your own numbers, sequences and mappings.
* * Makefile: cosmeticsGuido van Rossum1992-08-051-27/+8
| | | | | | | | | | | | | | | | | | | | | | | | | * socketmodule.c: get rid of makepair(); fix makesocketaddr to fix broken recvfrom() * socketmodule: get rid of getStrarg() * ceval.h: move eval_code() to new file eval.h, so compile.h is no longer needed. * ceval.c: move thread comments to ceval.h; always make save/restore thread functions available (for dynloaded modules) * cdmodule.c, listobject.c: don't include compile.h * flmodule.c: include ceval.h * import.c: include eval.h instead of ceval.h * cgen.py: add forground(); noport(); winopen(""); to initgl(). * bltinmodule.c, socketmodule.c, fileobject.c, posixmodule.c, selectmodule.c: adapt to threads (add BGN/END SAVE macros) * stdwinmodule.c: adapt to threads and use a special stdwin lock. * pythonmain.c: don't include getpythonpath(). * pythonrun.c: use BGN/END SAVE instead of direct calls; also more BGN/END SAVE calls etc. * thread.c: bigger stack size for sun; change exit() to _exit() * threadmodule.c: use BGN/END SAVE macros where possible * timemodule.c: adapt better to threads; use BGN/END SAVE; add longsleep internal function if BSD_TIME; cosmetics
* * Makefile adapted to changes below.Guido van Rossum1992-08-041-3/+93
| | | | | | | | | | | * split pythonmain.c in two: most stuff goes to pythonrun.c, in the library. * new optional built-in threadmodule.c, build upon Sjoerd's thread.{c,h}. * new module from Sjoerd: mmmodule.c (dynamically loaded). * new module from Sjoerd: sv (svgen.py, svmodule.c.proto). * new files thread.{c,h} (from Sjoerd). * new xxmodule.c (example only). * myselect.h: bzero -> memset * select.c: bzero -> memset; removed global variable
* Test for NULL coming out of err_get() in call_exc_trace()Guido van Rossum1992-04-091-0/+4
|
* reverse sense of test for CHECKEXCGuido van Rossum1992-04-081-1/+1
|
* Arg of cmp_outcome becomes an int for portability to the MacGuido van Rossum1992-04-061-3/+3
|
* (Hopefully) fix bug in reference count in call_exc_trace()Guido van Rossum1992-04-051-12/+7
| | | | plus minor rearrangements found during debugging
* lint (added prototypes for all static fns)Guido van Rossum1992-03-271-29/+34
|
* New trace implementation; and profile (in a similat vein).Guido van Rossum1992-03-231-84/+109
|
* Tighten error handling of string printing.Guido van Rossum1992-03-041-1/+5
|
* Use correct prototype for invert().Guido van Rossum1992-02-111-1/+1
|
* Limit length of name passed to sprintf.Guido van Rossum1992-02-051-1/+1
|
* If sys.trace is None, don't trace. For exceptions, only useGuido van Rossum1992-01-191-6/+7
| | | | the local trace function.
* Added UNPACK_VARARG code.Guido van Rossum1992-01-141-0/+36
|
* User trace feature.Guido van Rossum1992-01-121-27/+162
|
* Fix bug in assign_slice for negative index; used length of wrong object!Guido van Rossum1992-01-101-1/+1
|
* Negative subscript are now allowed as in slices.Guido van Rossum1991-12-241-7/+14
| | | | Added ImportError.
* New argument passing mechanism.Guido van Rossum1991-12-161-35/+109
|
* Added STORE_GLOBAL and DELETE_GLOBAL.Guido van Rossum1991-12-101-4/+24
| | | | Exceptions may now also be tuples.
* Added shift and mask ops.Guido van Rossum1991-10-241-0/+170
|
* newclassobject() gets a third argumentGuido van Rossum1991-10-201-1/+1
|
* Changed many calls to dict stufff to dict2 variants.Guido van Rossum1991-08-161-31/+35
| | | | *** Somehow the call to printobject was changed back to fwrite?!?! ***
* Add interface to call a Python function (or other callable) objectGuido van Rossum1991-07-271-0/+13
| | | | from C.
* Call printobject instead of fwrite to print strings.Guido van Rossum1991-07-221-2/+2
|
* Call coerce() in arithmetic operations, to support mixed mode arithmeticGuido van Rossum1991-07-011-12/+46
|
* printobject now returns an error codeGuido van Rossum1991-06-071-3/+4
|
* Remove test for unimplemented sq_repeat method (see tupleobject comments)Guido van Rossum1991-06-041-4/+0
|
* Declare ticker as int; made testbool generic for all numeric typesGuido van Rossum1991-05-141-7/+5
|
* Renamed class methods to instance methods (which they are)Guido van Rossum1991-05-051-5/+5
|
* Moved support functions after main function; added prototypes;Guido van Rossum1991-04-041-572/+617
| | | | | Fixed 'needspace' hack to use a flag in the stdout file object; added local and global variable lookup cases.
* Define and use GETNAMEV macro.Guido van Rossum1991-04-031-2/+3
|
* Added copyright notice.Guido van Rossum1991-02-191-0/+24
|
* File name shortening.Guido van Rossum1991-01-211-1/+1
|