summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Added 1995 to copyright message.Guido van Rossum1995-01-0419-47/+50
| | | | | floatobject.c: fix hash(). methodobject.c: support METH_FREENAME flag bit.
* * Objects/mappingobject.c (mappingremove): don't callGuido van Rossum1995-01-022-0/+6
| | | | lookmapping() for empty dictionary
* Lots of minor changes. Note for mappingobject.c: the hash table pointerGuido van Rossum1995-01-0212-96/+170
| | | | can now be NULL.
* fix comparison of instances without _-cmp__Guido van Rossum1994-11-101-3/+3
|
* Comparison of two class instances without __cmp__ or __rcmp__ methodsSjoerd Mullender1994-10-191-2/+5
| | | | was broken.
* * Include/classobject.h, Objects/classobject.c, Python/ceval.c:Guido van Rossum1994-09-286-204/+219
| | | | | | | | | | | | | | | | | | 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) * Objects/floatobject.c: add overflow check when converting float to int and implement truncation towards zero using ceil/float * Objects/longobject.c: change ValueError to OverflowError when converting to int * Objects/rangeobject.c: modernized * Objects/stringobject.c: use HAVE_LIMITS instead of __STDC__ * Objects/xxobject.c: changed to use new style (not finished?)
* rearranged code in debugging version of DELREF to avoid touching dataGuido van Rossum1994-09-071-1/+2
| | | | after it has been freed.
* Yet another version (by me) of __getattr__ etc.Guido van Rossum1994-09-051-174/+51
|
* Mods (really diffs to 2.29) by Michael Scharf for alternative __getattr__ etc.Guido van Rossum1994-09-051-105/+204
|
* Merge back to main trunkGuido van Rossum1994-08-309-128/+258
|
* fix nasty bug in resizing (formatstring)Guido van Rossum1994-08-301-18/+98
|
* mods by Andrew Kuchling to implementGuido van Rossum1994-08-291-41/+240
| | | | | pow(x,y,z) == pow(x,y)%z, but without incurring overflow Correct problems found by THINK C 6.0
* New patches by Andrew to fix various problemsGuido van Rossum1994-08-291-33/+67
| | | | Add cast for Lance
* Correct problems found by THINK C 6.0Guido van Rossum1994-08-291-44/+67
|
* * configure.in, */Makefile*.in: OPT can now be specified in theGuido van Rossum1994-08-231-1/+2
| | | | | | env at configure time and will then be put in all Makefiles as default * */Makefile*.in: remove lib*.a before adding to it
* If an attribute is deleted, __setattr__ is called with 2 instead of 3Guido van Rossum1994-08-161-1/+5
| | | | arguments (adding __delattr__ was deemed too much overhead)
* New patches by Andrew to fix various problemsGuido van Rossum1994-08-121-5/+24
|
* * Objects/classobject.c, Include/classobject.h: added __getattr__Guido van Rossum1994-08-121-17/+99
| | | | | | | | and __setattr__ support to override getattr(x, name) and setattr(x, name, value) for class instances. This uses a special hack whereby the class is supposed to be static: the __getattr__ and __setattr__ methods are looked up only once and saved in the instance structure for speed
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-016-122/+229
|
* Added getmaxint() so sys can initialize sys.maxint.Guido van Rossum1993-12-242-9/+17
| | | | Added Makefile.in.
* * rangeobject.[ch], bltinmodule.c: incorporate new version of rangeGuido van Rossum1993-12-211-23/+127
| | | | object (unchanged from source except "range" -> "xrange").
* New fileGuido van Rossum1993-12-201-0/+66
|
* * import.c (get_module): pass .py filename to parse_file, not .pyc filename!Guido van Rossum1993-11-301-3/+6
| | | | | | | | | | | * funcobject.c (func_repr): don't call getstringvalue(None) for anonymous functions. * bltinmodule.c: removed lambda (which is now a built-in function); removed implied lambda for string arg to filter/map/reduce. * Grammar, graminit.[ch], compile.[ch]: replaced lambda as built-in function by lambda as grammar entity: instead of "lambda('x: x+1')" you write "lambda x: x+1". * Xtmodule.c (checkargdict): return 0, not NULL, for error.
* Fix lay-out of previous fix.Guido van Rossum1993-11-232-4/+8
|
* * timemodule.c: Add hack for Solaris 2.Guido van Rossum1993-11-234-16/+12
| | | | | | | | | | | | | | | * posixmodule.c: don't prototype getcwd() -- it's not portable... * mappingobject.c: double-check validity of last_name_char in dict{lookup,insert,remove}. * arraymodule.c: need memmove only for non-STDC Suns. * Makefile: comment out HTML_LIBS and XT_USE by default * pythonmain.c: don't prototype getopt() -- it's not standardized * socketmodule.c: cast flags arg to {get,set}sockopt() and addrbuf arg to recvfrom() to (ANY*). * pythonrun.c (initsigs): fix prototype, make it static * intobject.c (LONG_BIT): only #define it if not already defined * classobject.[ch]: remove all references to unused instance_convert() * mappingobject.c (getmappingsize): Don't return NULL in int function.
* * import.c (get_module): total rewrite, to ensure proper search order: forGuido van Rossum1993-11-171-21/+30
| | | | | | | | | | | | | each dir in sys.path, try each possible extension. (Note: C extensions are loaded before Python modules in the same directory, to allow having a C version used when dynamic loading is supported and a Python version as a back-up.) * import.c (reload_module): test for error from getmodulename() * moduleobject.c: implement module name as dict entry '__name__' instead of special-casing it in module_getattr(); this way a module (or function!) can access its own module name, and programs that know what they are doing can rename modules. * stdwinmodule.c (initstdwin): strip ".py" suffix of argv[0].
* Fix the fix :-(Guido van Rossum1993-11-111-1/+3
|
* Three micro fixes to formatstringGuido van Rossum1993-11-111-5/+4
|
* * parsermodule.c, Makefile, config.c: rudimentary interface to the PythonGuido van Rossum1993-11-102-2/+2
| | | | | | parser. * mappingobject.c (lookmapping): 'freeslot' was never used due to a bug in the code.
* * posixmodule.c: added set{uid,gid}.Guido van Rossum1993-11-104-6/+6
| | | | | | * {tuple,list,mapping,array}object.c: call printobject with 0 for flags * compile.c (parsestr): use quote instead of '\'' at one crucial point * arraymodule.c (array_getattr): Added __members__ attribute
* * mpzmodule.c: removed redundant mpz_print function.Guido van Rossum1993-11-052-10/+41
| | | | | | | | | | | | | | * 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!)
* Added compare operations for functions and code objects.Guido van Rossum1993-11-051-1/+26
| | | | (Also hash, but it doesn't work yet.)
* Added getmappingsize(). (Needed by previous checkin of posixmodule.c)Guido van Rossum1993-11-052-0/+22
|
* * ceval.c, longobject.c, methodobject.c, listnode.c, arraymodule.c,Guido van Rossum1993-11-012-1/+2
| | | | | | pythonrun.c: added static forward declarations * pythonrun.h, ceval.h, longobject.h, node.h: removed declarations of static routines
* * fileobject.c (softspace): fix bug if called with NULL file.Guido van Rossum1993-11-011-1/+1
|
* * rangeobject.{c,h}, bltinmodule.c: removed non-essential ops from rangeGuido van Rossum1993-11-011-80/+28
| | | | object.
* Fixed bugs in resizetuple and extended the interface.Sjoerd Mullender1993-11-012-16/+57
| | | | | Added ifdefs in stringobject.c for shared strings of length 1. Renamed free_list in tupleobject.c to free_tuples.
* * listobject.c (list_ass_slice): XDECREF instead of DECREF soGuido van Rossum1993-10-271-5/+5
| | | | | | setlistslice() can be used to cut the unused part out of a freshly made slice (as done by bagof()). [needed by the next mod!] * structural changes to bagof(), map() etc.
* * compile.[ch]: support for lambda()Guido van Rossum1993-10-262-12/+250
| | | | | | | | | | * PROTO.h, mymalloc.h: added #ifdefs for TURBOC and GNUC. * allobjects.h: added #include "rangeobject.h" * Grammar: added lambda_input; relaxed syntax for exec. * bltinmodule.c: added bagof, map, reduce, lambda, xrange. * tupleobject.[ch]: added resizetuple(). * rangeobject.[ch]: new object type to speed up range operations (not convinced this is needed!!!)
* Add some necessary casts; use double quotes to represent strings inGuido van Rossum1993-10-261-14/+27
| | | | some cases.
* Changes to make range checks portable to 64-bit machines.Guido van Rossum1993-10-261-3/+21
|
* * filemodule.c: added writelines() -- analogous to readlines()Guido van Rossum1993-10-251-0/+42
| | | | * import.c: fixed core dump when out-of-date .pyc file encountered (again!)
* 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-226-31/+176
| | | | cstubs: Use Matrix type instead of float[4][4].
* * bltinmodule.c: removed exec() built-in function.Guido van Rossum1993-10-181-0/+10
| | | | | | | * 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.
* intobject.c: Save references to small integers, so that they can beSjoerd Mullender1993-10-153-7/+95
| | | | | | | | | | | | | | | | 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.
* Makefile, import.c: Lance's alternative module search (allow .pyc fileGuido van Rossum1993-10-151-5/+18
| | | | | | | | | | without .py file); Bill's dynamic loading for SunOS using shared libraries. pwdmodule.c (mkgrent): remove DECREF of uninitialized variable. classobject.c (instance_getattr): Fix case when class lookup returns unbound method instead of function.
* * Extended X interface: pixmap objects, colormap objects visual objects,Sjoerd Mullender1993-10-116-11/+47
| | | | | | | | 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.
* * clmodule.c (doParams): free PVbuffer in error condition.Sjoerd Mullender1993-08-031-0/+1
| | | | | * frameobject.c (newframeobject): initialize ob_type if taking entry from the free list, since it is zeroed out when DEBUG is defined.
* Minor fixes / changes for Mac compatibility.Guido van Rossum1993-07-293-5/+5
|