Commit Graph

185 Commits

Author SHA1 Message Date
Guido van Rossum cd649654d7 Reverse the search order for the Don Beaudry hook so that the first
class wins.  Makes more sense.
1997-08-22 16:56:16 +00:00
Guido van Rossum f9c90c533e Renamed a local label that was accidentally grandly renamed to
'Py_Cleanup' back to 'cleanup'.
1997-08-05 02:18:01 +00:00
Guido van Rossum 25ce566661 The last of the mass checkins for separate (sub)interpreters.
Everything should now work again.

See the comments for the .h files mass checkin (e.g. pystate.h) for
more detail.
1997-08-02 03:10:38 +00:00
Guido van Rossum 55b9ab5bdb Extend the "Don Beaudry hack" with "Guido's corollary" -- if the base
class has a __class__ attribute, call that to create the new class.
This allows us to write metaclasses purely in C!
1997-07-31 03:54:02 +00:00
Guido van Rossum 9cc8a20cd2 Moved PyEval_{Acquire,Release}Thread() to within the same #ifdef
WITH_THREAD as PyEval_InitThreads().

Removed use of Py_SuppressPrintingFlag.
1997-07-19 19:55:50 +00:00
Guido van Rossum 2fca21f762 PyEval_SaveThread() and PyEval_RestoreThread() now return/take a
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.
1997-07-18 23:56:58 +00:00
Guido van Rossum c12da6980f Huge speedup by inlining some common integer operations:
int+int, int-int, int <compareop> int, and list[int].
(Unfortunately, int*int is way too much code to inline.)

Also corrected a NULL that should have been a zero.
1997-07-17 23:12:42 +00:00
Guido van Rossum c8b6df9004 PyObject_Compare can raise an exception now. 1997-05-23 00:06:51 +00:00
Guido van Rossum be27026c09 Py_FlushLine and PyFile_WriteString now return error indicators
instead of calling PyErr_Clear().  Add checking of those errors.
1997-05-22 22:26:18 +00:00
Guido van Rossum df4c308f5a Plug leak of stack frame object in exception handling code.
Also delay DECREF calls until after the structures have been updated
(for reentrancy awareness).
1997-05-20 17:06:11 +00:00
Guido van Rossum df0d00e29b Logic for enabling mac-specific signal handling fixed (Jack) 1997-05-20 15:57:49 +00:00
Guido van Rossum 5f15b96c36 (int) cast for strlen() to keep picky compilers happy. 1997-05-13 17:50:01 +00:00
Guido van Rossum b05a5c7698 Instead of importing graminit.h whenever one of the three grammar 'root'
symbols is needed, define these in Python.h with a Py_ prefix.
1997-05-07 17:46:13 +00:00
Guido van Rossum fc49073cd0 Used operators from abstract.h where possible (arithmetic operators,
get/set/del item).  This removes a pile of duplication.  There's no
abstract operator for 'not' but I removed the function call for it
anyway -- it's a little faster in-line.
1997-05-06 15:06:49 +00:00
Guido van Rossum a027efa5bf Massive changes for separate thread state management.
All per-thread globals are moved into a struct which is manipulated
separately.
1997-05-05 20:56:21 +00:00
Guido van Rossum b209a116cf Quickly renamed. 1997-04-29 18:18:01 +00:00
Guido van Rossum c43b685054 Clarify error message for unexpected keyword parameter. 1997-03-10 22:58:23 +00:00
Guido van Rossum 0d85be19e2 *Don't* kill all local variables on function exit. This will be done
by the frameobject dealloc when it is time for the locals to go.  When
there's still a traceback object referencing this stack frame, we
don't want the local variables to disappear yet.

(Hmm...  Shouldn't they be copied to the f_locals dictionary?)
1997-02-14 16:32:14 +00:00
Guido van Rossum deb0c5e66c Two small changes:
- Use co->... instead of f->f_code->...; save an extra lookup of what
we already have in a local variable).

- Remove test for nlocals > 0 before setting fastlocals to
f->f_localsplus; 0 is a rare case and the assignment is safe even
then.
1997-01-27 23:42:36 +00:00
Guido van Rossum d0eb429b88 Plug a leak with calling something other than a function or method is
called with keyword arguments -- the keyword and value were leaked.
This affected for instance with a __call__() method.

Bug reported and fix supplied by Jim Fulton.
1997-01-27 21:30:09 +00:00
Guido van Rossum 950361c6ca Patches for (two forms of) optional dynamic execution profiling --
i.e., counting opcode frequencies, or (with DXPAIRS defined) opcode
pair frequencies.  Define DYNAMIC_EXECUTION_PROFILE on the command
line (for this file and for sysmodule.c) to enable.
1997-01-24 13:49:28 +00:00
Guido van Rossum 8c5df06ec7 Change the control flow for error handling in the function prelude to
jump to the "Kill locals" section at the end.  Add #ifdef macintosh
bandaid to make sure we call sigcheck() on the Mac.
1997-01-24 04:19:24 +00:00
Guido van Rossum a4240132ec Kill all local variables on function return. This closes a gigantic
leak of memory and file descriptors (thanks for Roj for reporting
that!).  Alas, the speed goes down by 5%. :-(
1997-01-21 21:18:36 +00:00
Guido van Rossum 70d44787a3 Only call sigcheck() at the ticker code if we don't have true signals.
This is safe now that both intrcheck() and signalmodule.c schedule a
sigcheck() call via Py_AddPendingCall().

This gives another 7% speedup (never run such a test twice ;-).
1997-01-21 06:15:24 +00:00
Guido van Rossum 1aa14838d2 Cleanup:
- fix bug in Py_MakePendingCalls() with threading
- fix return type of do_raise
- remove build_slice (same as PySlice_New)
- remove code inside #if 0
- remove code inside #ifdef CHECK_STACK
- remove code inside #ifdef SUPPORT_OBSOLETE_ACCESS
- comment about newimp.py should refer to ni.py
1997-01-21 05:34:20 +00:00
Guido van Rossum 768360243a Changes for frame object speedup:
- get fastlocals differently
- call newframeobject() with fewer arguments
- toss getowner(), which was unused anyway
1997-01-20 04:26:20 +00:00
Guido van Rossum 3dfd53b4c8 Add "if (x != NULL) continue;" (or similar for err==0) before the
break to most cases, as suggested by Tim Peters.  This gives another
8-10% speedup.
1997-01-18 02:46:13 +00:00
Guido van Rossum 62f7d15d0b Use the stack size from the code object and the CO_MAXBLOCKS constant
from compile.h.  Remove all eval stack overflow checks.
1997-01-17 21:05:28 +00:00
Guido van Rossum 408027ea46 Rename DEBUG macro to Py_DEBUG 1996-12-30 16:17:54 +00:00
Guido van Rossum 0aa9ee65ab Moved the raise logic out of the main interpreter loop to a separate function.
The raise logic has one additional feature: if you raise <class>,
<value> where <value> is not an instance, it will construct an
instance using <value> as argument.  If <value> is None, <class> is
instantiated without arguments.  If <value> is a tuple, it is used as
the argument list.

This feature is intended to make it easier to upgrade code from using
string exceptions to using class exceptions; without this feature,
you'd have to change every raise statement from ``raise X'' to ``raise
X()'' and from ``raise X, y'' to ``raise X(y)''.  The latter is still
the recommended form (because it has no ambiguities about the number
of arguments), but this change makes the transition less painful.
1996-12-10 18:07:35 +00:00
Guido van Rossum 150b2df682 Change the Don Beaudry hack into the Don B + Jim F hack; now, if *any*
base class is special it gets invoked.

Make gcc -Wall happy.
1996-12-05 23:17:11 +00:00
Guido van Rossum d266eb460e New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
Guido van Rossum 6d43c5de5a Raise TypeError, not KeyError, on unknown keyword argument. 1996-08-19 22:09:16 +00:00
Guido van Rossum bf51afa049 Don't test here for negative number to float power; that belongs in
floatobject.c.
1996-08-16 20:49:17 +00:00
Guido van Rossum 0dfcf753ad Disable support for access statement 1996-08-12 22:00:53 +00:00
Guido van Rossum 3b9c6677f8 Better error message if stride used on normal sequence object 1996-07-30 18:40:29 +00:00
Guido van Rossum 8861b74445 Changes for slice and ellipses 1996-07-30 16:49:37 +00:00
Guido van Rossum 3b4da59cd6 Renamed static pow() to powerop() to avoid name conflict in some compilers. 1996-06-19 21:49:17 +00:00
Guido van Rossum 8c1e150215 Removed some done "to do" items.
Changed #ifdef DEBUG slightly.
1996-05-24 20:49:24 +00:00
Guido van Rossum 5e3e426961 removed sime redundant header includes and decls. 1996-05-23 22:49:38 +00:00
Guido van Rossum 50564e8dae changes for complex and power (**) operator 1996-01-12 01:13:16 +00:00
Guido van Rossum 72b56e831f don't return from main loop when error occurs 1995-12-10 04:57:42 +00:00
Guido van Rossum 9d78d8d2fb spell TraceBack with capital B 1995-09-18 21:29:36 +00:00
Guido van Rossum e3e61c1642 empty kw dict is ok for builtins 1995-08-04 04:14:47 +00:00
Guido van Rossum 0db1ef96ac fix bogus DECREF in finally clause 1995-07-28 23:06:00 +00:00
Guido van Rossum ff8b494cf0 changes for keyword args to built-in functions and classes 1995-07-26 18:16:42 +00:00
Guido van Rossum 681d79aaf3 keyword arguments and faster calls 1995-07-18 14:51:37 +00:00
Guido van Rossum f10570b9eb 3rd arg for raise; INCOMPLETE keyword parameter passing (currently f(kw=value) is seen as f('kw', value)) 1995-07-07 22:53:21 +00:00
Guido van Rossum 6f9e433ab3 fix dusty debugging macros 1995-03-29 16:57:48 +00:00
Guido van Rossum 684ed9891b remove unused code for tp_call 1995-03-22 10:09:02 +00:00
Guido van Rossum 8d617a60b1 various tuple related optimizations; remove unused b/w compat code from ceval.c 1995-03-09 12:12:11 +00:00
Guido van Rossum 1d339e8c35 fix bug in try-finally with class exceptions; declare different func pointers for different uses 1995-02-17 15:04:21 +00:00
Guido van Rossum 24c137432c call __import__() with 4 args instead of 1 1995-02-14 09:42:43 +00:00
Guido van Rossum 7f7f274839 use Py_CHARMASK 1995-02-10 17:01:56 +00:00
Guido van Rossum 6b6e0aafe5 DECREF result of run_string 1995-02-07 15:36:56 +00:00
Guido van Rossum a715299a14 remove unused variable 1995-01-30 12:53:21 +00:00
Guido van Rossum 8bf7c484c1 allow classes as exceptions 1995-01-26 00:41:04 +00:00
Guido van Rossum 1919ca7b28 add missing INCREF in RAISE_EXCEPTION 1995-01-20 16:55:14 +00:00
Guido van Rossum b4e7e25fe6 different init for __builtins__ 1995-01-17 16:27:25 +00:00
Guido van Rossum 94390ec2a6 use getbuiltins() everywhere, it defaults to getbuiltidict() 1995-01-12 11:37:57 +00:00
Guido van Rossum 6135a87f2b __builtins__ mods (and sys_checkinterval for ceval.c) 1995-01-09 17:53:26 +00:00
Guido van Rossum 06186519e5 Use new instancebinop interface 1995-01-07 12:40:10 +00:00
Guido van Rossum 6d023c98b0 Added 1995 to copyright message.
bltinmodule.c: fixed coerce() nightmare in ternary pow().
modsupport.c (initmodule2): pass METH_FREENAME flag to newmethodobject().
pythonrun.c: move flushline() into and around print_error().
1995-01-04 19:12:13 +00:00
Guido van Rossum 1ae940a587 Lots of changes, most minor (fatal() instead of abort(), use of
err_fetch/err_restore and so on).  But...
NOTE: import.c has been rewritten and all the DL stuff is now in the
new file importdl.c.
1995-01-02 19:04:15 +00:00
Guido van Rossum 69d9eb9f56 replace abort() calls by fatal() 1994-11-10 22:41:15 +00:00
Guido van Rossum 180d7b4d55 * Python/ceval.c, Include/ceval.h: promote MakePendingCalls to
global: Py_MakePendingCalls.  Also guard against recursive calls

	* Include/classobject.h, Objects/classobject.c,
	Python/{ceval.c,bltinmodule.c}: entirely redone operator
	overloading.  The rules for class instances are now much more
	relaxed than for other built-in types
	(whose coerce must still return two objects of the same type)
1994-09-29 09:45:57 +00:00
Guido van Rossum a96720907a * Python/ceval.c (eval_code): added registry of pending functions
(to be used by functions that are called asynchronously, like
	UNIX signal handlers or Mac I/O completion routines)
1994-09-14 13:31:22 +00:00
Guido van Rossum e59214ed91 call_object: print message before abort() 1994-08-30 08:01:59 +00:00
Guido van Rossum 67a5fdbcc2 * mpzmodule.c: cast some methods to the proper type.
* traceback.c (tb_print): use sys.tracebacklimit as a maximum number of
  traceback entries to print (default 1000).
* ceval.c (printtraceback): Don't print stack trace header -- this is now
  done by tb_print().
1993-12-17 12:09:14 +00:00
Guido van Rossum c600411755 * mpzmodule.c: removed redundant mpz_print function.
* object.[ch], bltinmodule.c, fileobject.c: changed str() to call
  strobject() which calls an object's __str__ method if it has one.
  strobject() is also called by writeobject() when PRINT_RAW is passed.
* ceval.c: rationalize code for PRINT_ITEM (no change in function!)
* funcobject.c, codeobject.c: added compare and hash functionality.
  Functions with identical code objects and the same global dictionary are
  equal.  Code objects are equal when their code, constants list and names
  list are identical (i.e. the filename and code name don't count).
  (hash doesn't work yet since the constants are in a list and lists can't
  be hashed -- suppose this should really be done with a tuple now we have
  resizetuple!)
1993-11-05 10:22:19 +00:00
Guido van Rossum b73cc04e62 * ceval.c, longobject.c, methodobject.c, listnode.c, arraymodule.c,
pythonrun.c: added static forward declarations
* pythonrun.h, ceval.h, longobject.h, node.h: removed declarations of
  static routines
1993-11-01 16:28:59 +00:00
Sjoerd Mullender 3bb8a05947 Several optimizations and speed improvements.
cstubs: Use Matrix type instead of float[4][4].
1993-10-22 12:04:32 +00:00
Guido van Rossum db3165e655 * bltinmodule.c: removed exec() built-in function.
* Grammar: add exec statement; allow testlist in expr statement.
* ceval.c, compile.c, opcode.h: support exec statement;
  avoid optimizing locals when it is used
* fileobject.{c,h}: add getfilename() internal function.
1993-10-18 17:06:59 +00:00
Guido van Rossum f1dc566328 * Makefile: added all: and default: targets.
* many files: made some functions static; removed "extern int errno;".
* frozenmain.c: fixed bugs introduced on 24 June...
* flmodule.c: remove 1.5 bw compat hacks, add new functions in 2.2a
  (and some old functions that were omitted).
* timemodule.c: added MSDOS floatsleep version .
* pgenmain.c: changed exit() to goaway() and added defn of goaway().
* intrcheck.c: add hack (to UNIX only) so interrupting 3 times
  will exit from a hanging program.  The second interrupt prints
  a message explaining this to the user.
1993-07-05 10:31:29 +00:00
Guido van Rossum 9e90a672b4 * pythonmain.c: -k option, usage message, more environment flags.
(the latter also in frozenmain.c)
* ceval.c: global 'killprint' flag raises exception when printing an
  expression statement's value (useful for finding stray output)
* timemodule.c: add asctime() and ctime().  Change julian date to
  1-based origin (as intended and documented).
* Removed unused DO_TIMES stuff from timemodule.c.  Added 'epoch' and
  'day0' globals (year where time.time() == 0 and day of the week the
  epoch started).
1993-06-24 11:10:19 +00:00
Guido van Rossum 234f942aef * Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Added $(SYSDEF) to its build rule in Makefile.
* cgensupport.[ch], modsupport.[ch]: removed some old stuff.  Also
  changed files that still used it...  And made several things static
  that weren't but should have been...  And other minor cleanups...
* listobject.[ch]: add external interfaces {set,get}listslice
* socketmodule.c: fix bugs in new send() argument parsing.
* sunaudiodevmodule.c: added flush() and close().
1993-06-17 12:35:49 +00:00
Guido van Rossum eb6b33a837 * classobject.c: in instance_getattr, don't make a method out of a
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.)
1993-05-25 09:38:27 +00:00
Guido van Rossum b3f7258f14 * Lots of small changes related to access.
* Added "access *: ...", made access work for class methods.
* Introduced subclass check: make sure that when calling
  ClassName.methodname(instance, ...), the instance is an instance of
  ClassName or of a subclass thereof (this might break some old code!)
1993-05-21 19:56:10 +00:00
Guido van Rossum 81daa32c15 Access checks now work, at least for instance data (not for methods
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.
1993-05-20 14:24:46 +00:00
Guido van Rossum 25831652fd Several changes in one:
(1) dictionaries/mappings now have attributes values() and items() as
well as keys(); at the C level, use the new function mappinggetnext()
to iterate over a dictionary.

(2) "class C(): ..." is now illegal; you must write "class C: ...".

(3) Class objects now know their own name (finally!); and minor
improvements to the way how classes, functions and methods are
represented as strings.

(4) Added an "access" statement and semantics.  (This is still
experimental -- as long as you don't use the keyword 'access' nothing
should be changed.)
1993-05-19 14:50:45 +00:00
Guido van Rossum 6ac258d381 * pythonrun.c: Print exception type+arg *after* stack trace instead of
before it.
* ceval.c, object.c: moved testbool() to object.c (now extern visible)
* stringobject.c: fix bugs in and rationalize string resize in formatstring()
* tokenizer.[ch]: fix non-working code for lines longer than BUFSIZ
1993-05-12 08:24:20 +00:00
Guido van Rossum acbe8da4f8 (I suggest a recompile after getting this, the ceval.c bugfix may be crucial!)
* 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.
1993-04-15 15:33:52 +00:00
Guido van Rossum 9575a44575 * Microscopic corrections to make things compile on the Cray APP.
* Removed one use of $> in Makefile and warned about others.
  Added configurable lines in Makefile to change CC and AR.
1993-04-07 14:06:14 +00:00
Guido van Rossum 5b7221849e * Fixed some subtleties with fastlocals. You can no longer access
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.]
1993-03-30 17:46:03 +00:00
Guido van Rossum 8b17d6bd89 Changes to speed up local variables enormously, by avoiding dictionary
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.
1993-03-30 13:18:41 +00:00
Guido van Rossum 9bfef44d97 * Changed all copyright messages to include 1993.
* 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
1993-03-29 10:43:31 +00:00
Guido van Rossum e537240c25 * Changed many files to use mkvalue() instead of newtupleobject().
* 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.
1993-03-16 12:15:04 +00:00
Guido van Rossum 6f5afc9a73 * ceval.c: ifdef out the last argument passing compat hack.
* 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
1993-02-05 09:46:15 +00:00
Guido van Rossum 34679b7661 * Added Fixcprt.py: script to fix copyright message.
* 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
1993-01-26 13:33:44 +00:00
Guido van Rossum 775f4dacbc * Makefile: use cp -r to install the library
* 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().
1993-01-09 17:18:52 +00:00
Sjoerd Mullender ed59d205a9 Various changes.
* 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.
1993-01-06 13:36:38 +00:00
Guido van Rossum 5f59d6018e * mymalloc.h: always allocate one extra byte, since some malloc's
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().
1992-12-14 16:59:51 +00:00
Guido van Rossum d014ea6b5e * classobject.c: in instance_lenth, test result of call_object
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).
1992-11-26 10:30:26 +00:00
Guido van Rossum a9e7dc1081 * bltinmodule.c: added built-in function cmp(a, b)
* 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.)
1992-10-18 18:53:57 +00:00
Guido van Rossum 3165fe6a56 Modified most (but not yet all) I/O to always go through sys.stdout or
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.
1992-09-25 21:59:05 +00:00
Guido van Rossum 99bec95482 Add some debugging features if DEBUG defined
(fetch the filename as a string so I can see it with dbx, and set f_lineno);
call abort() when detecting an "undetected" error.
1992-09-03 20:29:45 +00:00
Guido van Rossum f9a2d33f01 fix *serious* (new) bug in testbool: by default objects should test
true, not false!!!
1992-08-19 16:41:45 +00:00
Guido van Rossum e6eefc2231 * classobject.[ch], {float,long,int}object.c, bltinmodule.c:
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.
1992-08-14 12:06:52 +00:00
Guido van Rossum 04691fc1c1 Changes so that user-defined classes can implement operations invoked
by special syntax: you can now define your own numbers, sequences and
mappings.
1992-08-12 15:35:34 +00:00
Guido van Rossum ff4949eeee * Makefile: cosmetics
* 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
1992-08-05 19:58:53 +00:00