summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* avoid resize of 0-length tupleGuido van Rossum1995-08-041-0/+5
|
* be more suspicious of getlocals()Guido van Rossum1995-07-261-2/+8
|
* keyword arguments and faster callsGuido van Rossum1995-07-181-6/+10
|
* rename arglist to alist (conflict with new grammar symbol)Guido van Rossum1995-07-101-16/+16
|
* added locals() and globals(); [raw_]input() uses readline()Guido van Rossum1995-07-071-1/+67
|
* fix bogus test for negative floatGuido van Rossum1995-02-181-3/+3
|
* call __import__() with 4 args instead of 1Guido van Rossum1995-02-141-1/+5
|
* test for float to the float power hereGuido van Rossum1995-02-101-0/+5
|
* moved callable() to object.cGuido van Rossum1995-01-261-29/+0
|
* fix import related leaksGuido van Rossum1995-01-201-5/+1
|
* fix Alpha bug in (x)range; different __builtins__ initializationGuido van Rossum1995-01-171-8/+14
|
* fix subtle refcount big in filter() -- Tim MacKenzieGuido van Rossum1995-01-101-3/+6
|
* move coerce() from bltinmodule.c to object.c and implement builtin_coerce() ↵Guido van Rossum1995-01-101-50/+7
| | | | differently
* fix globals/locals defaults for eval/execfileGuido van Rossum1995-01-101-10/+10
|
* __builtins__ mods (and sys_checkinterval for ceval.c)Guido van Rossum1995-01-091-19/+32
|
* * Python/bltinmodule.c: restructured coerce(), divmod(), pow() toGuido van Rossum1995-01-071-52/+80
| | | | use new instancebinop interface
* Added 1995 to copyright message.Guido van Rossum1995-01-041-9/+24
| | | | | | 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().
* Lots of changes, most minor (fatal() instead of abort(), use ofGuido van Rossum1995-01-021-301/+310
| | | | | | 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.
* fix pow() core dumpGuido van Rossum1994-11-101-1/+1
|
* * Python/ceval.c, Include/ceval.h: promote MakePendingCalls toGuido van Rossum1994-09-291-6/+15
| | | | | | | | | | 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)
* * Python/getmtime.c: Remove mac specifics (Mac subdirectory hasGuido van Rossum1994-08-301-13/+2
| | | | | | its own version now) * Python/bltinmodule.c (builtin_tuple): use pre-existing listtuple(v) for lists
* Added delattr()Guido van Rossum1994-08-291-0/+16
|
* * Python/bltinmodule.c: added tuple() builtinGuido van Rossum1994-08-291-0/+71
|
* Python/bltinmodule.c: mods by Andrew Kuchling to implementGuido van Rossum1994-08-291-5/+18
| | | | pow(x,y,z) == pow(x,y)%z, but without incurring overflow
* * Python/bltinmodule.c (builtin_vars): correct typo in error msgGuido van Rossum1994-08-291-101/+211
|
* * rangeobject.[ch], bltinmodule.c: incorporate new version of rangeGuido van Rossum1993-12-211-1/+1
| | | | object (unchanged from source except "range" -> "xrange").
* * import.c (get_module): pass .py filename to parse_file, not .pyc filename!Guido van Rossum1993-11-301-44/+3
| | | | | | | | | | | * 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.
* * mpzmodule.c: removed redundant mpz_print function.Guido van Rossum1993-11-051-6/+1
| | | | | | | | | | | | | | * 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!)
* * nismodule.c: database keys and values can contain null bytes. be moreGuido van Rossum1993-11-031-5/+5
| | | | | | | | | | careful about these. * arraymodule.c: added 8 byte swap; added 'i' format character; added reverse() method; rename read/write to fromfile/tofile. * config.c: Set version to 0.9.9++. * rotormodule.c (r_rand): declare k1..k5 as unsigned longs so the shifts will have a well-defined effect independent of word size. * bltinmodule.c: renamed bagof() to filter().
* * rangeobject.{c,h}, bltinmodule.c: removed non-essential ops from rangeGuido van Rossum1993-11-011-40/+13
| | | | object.
* Fixed bugs in resizetuple and extended the interface.Sjoerd Mullender1993-11-011-1/+1
| | | | | 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-182/+123
| | | | | | 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-261-2/+579
| | | | | | | | | | * 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!!!)
* * import.c (MAGIC): Changed magic word to avoid confusion about execGuido van Rossum1993-10-221-1/+1
| | | | | | | function vs. exec statement * bltinmodule.c: renamed the module to __builtin__. * posixmodule.c (posix_execv): renamed exec --> execv since it is now a reserved word.
* * bltinmodule.c: removed exec() built-in function.Guido van Rossum1993-10-181-9/+0
| | | | | | | * 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.
* * Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.Guido van Rossum1993-06-171-1/+0
| | | | | | | | | | 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().
* Access checks now work, at least for instance data (not for methodsGuido van Rossum1993-05-201-1/+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.
* Several changes in one:Guido van Rossum1993-05-191-0/+4
| | | | | | | | | | | | | | | | (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.)
* * Fixed some subtleties with fastlocals. You can no longer accessGuido van Rossum1993-03-301-5/+46
| | | | | | | | | | | | | | | | | | 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.]
* * Changed all copyright messages to include 1993.Guido van Rossum1993-03-291-6/+41
| | | | | | | | | | | | | | | | | * 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-2/+2
| | | | | | | | | | * 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.
* bltinmodule.c: added round(x, [n]); coerce() of two class instancesGuido van Rossum1993-02-121-1/+30
| | | | | | will try to coerce anyway. classobject.c: instance 'nonzero' should first try __nonzero__ only then __len__.
* * 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).
* * config.c: Added audioop to lists.Guido van Rossum1992-11-261-1/+32
| | | | | | | | | * Makefile: change default source directory * socketmodule.c: added getsockname and getpeername * bltinmodule.c: corrected typo in type() error message * Added new built-in functions str() and repr(): repr(x) == `x`; str(x) == x if x is a string, otherwise str(x) == repr(x). * Added joinfields to stropmodule.c (string.join calls joinfields now)
* * bltinmodule.c: added built-in function cmp(a, b)Guido van Rossum1992-10-181-0/+12
| | | | | | | | | | | | | | | * 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-19/+14
| | | | | | 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.
* Made builtins int(), long(), float(), oct() and hex() more generic.Guido van Rossum1992-09-121-91/+40
|
* fix *serious* (new) bug in evalfile: forgot to initialize s!!!Guido van Rossum1992-08-191-0/+1
|
* use getargs() in more cases;Guido van Rossum1992-08-141-63/+48
| | | | oct(0) should return '0', not '00'
* * classobject.[ch], {float,long,int}object.c, bltinmodule.c:Guido van Rossum1992-08-141-29/+13
| | | | | | 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.