summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
Commit message (Collapse)AuthorAgeFilesLines
* rearranged code in debugging version of DELREF to avoid touching dataGuido van Rossum1994-09-071-1/+2
| | | | after it has been freed.
* Merge back to main trunkGuido van Rossum1994-08-301-8/+4
|
* * mpzmodule.c: removed redundant mpz_print function.Guido van Rossum1993-11-051-1/+35
| | | | | | | | | | | | | | * 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!)
* import.c: When something is wrong with the .pyc, properly open the .pySjoerd Mullender1993-10-251-8/+9
| | | | | file. object.c: Write allocation statistics to stderr.
* Several optimizations and speed improvements.Sjoerd Mullender1993-10-221-0/+2
| | | | cstubs: Use Matrix type instead of float[4][4].
* intobject.c: Save references to small integers, so that they can beSjoerd Mullender1993-10-151-2/+8
| | | | | | | | | | | | | | | | shared. The default is to save references to the integers in the range -1..99. The lower limit can be set by defining NSMALLNEGINTS (absolute value of smallest integer to be saved) and NSMALLPOSINTS (1 more than the largest integer to be saved). tupleobject.c: Save a reference to the empty tuple to be returned whenever a tuple of size 0 is requested. Tuples of size 1 upto, but not including, MAXSAVESIZE (default 20) are put in free lists when deallocated. When MAXSAVESIZE equals 1, only share references to the empty tuple, when MAXSAVESIZE equals 0, don't include the code at all and revert to the old behavior. object.c: Print some more statistics when COUNT_ALLOCS is defined.
* * Extended X interface: pixmap objects, colormap objects visual objects,Sjoerd Mullender1993-10-111-2/+38
| | | | | | | | image objects, and lots of new methods. * Added counting of allocations and deallocations of builtin types if COUNT_ALLOCS is defined. Had to move calls to NEWREF down in some files. * Bug fix in sorting lists.
* * accessobject.c (ownercheck): allow a base class access to protectedGuido van Rossum1993-07-111-0/+14
| | | | | | objects of its derived classes; allow anything that has an attribute named "__privileged__" access to anything. * object.[ch]: added hasattr() -- test whether getattr() will succeed.
* * pythonrun.c: Print exception type+arg *after* stack trace instead ofGuido van Rossum1993-05-121-0/+23
| | | | | | | 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
* * Changed all copyright messages to include 1993.Guido van Rossum1993-03-291-2/+17
| | | | | | | | | | | | | | | | | * 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
* * Makefile: added IMGFILE; moved some stuff around.Guido van Rossum1992-09-171-12/+1
| | | | | | | | * flmodule.c: added some missing functions; changed readonly flags of some data members based upon FORMS documentation. * listobject.c: fixed int/long arg lint bug (bites PC compilers). * several: removed redundant print methods (repr is good enough). * posixmodule.c: added (still experimental) process group functions.
* If a type has a repr function but no print function, printing it nowGuido van Rossum1992-09-031-5/+34
| | | | | | | | calls the repr function. When the refcount is bad, don't print the object at all (chances of crashes). Changes to checking and printing of references: the consistency check is somewhat faster; don't print strings referenced once (most occur in function's name lists).
* Copyright for 1992 addedGuido van Rossum1992-04-051-1/+1
|
* Fix lint bugGuido van Rossum1992-03-271-1/+3
|
* Change error messages for impossible assignment slightly.Guido van Rossum1991-12-241-2/+4
|
* Use IOError.Guido van Rossum1991-12-101-1/+1
|
* Check for write errors after printing a valueGuido van Rossum1991-07-271-2/+10
|
* Change cmpobject() to coerce numerical values before comparing themGuido van Rossum1991-07-011-2/+17
|
* printobject now returns an error codeGuido van Rossum1991-06-071-57/+31
|
* Enabled (and fixed) newvarobject()Guido van Rossum1991-05-051-5/+1
|
* Added copyright notice.Guido van Rossum1991-02-191-0/+24
|
* Return -1 for errors.Guido van Rossum1990-12-201-1/+1
|
* "Compiling" versionGuido van Rossum1990-12-201-26/+95
|
* Removed redundant prototype for err_nomem().Guido van Rossum1990-11-021-2/+4
| | | | Added check for negative refcnt in DELREF.
* Initial revisionGuido van Rossum1990-10-141-0/+195