summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* * 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.
* Changes so that user-defined classes can implement operations invokedGuido van Rossum1992-08-121-1/+34
| | | | | by special syntax: you can now define your own numbers, sequences and mappings.
* * Makefile: cosmeticsGuido van Rossum1992-08-051-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Copyright for 1992 addedGuido van Rossum1992-04-051-1/+1
|
* lintGuido van Rossum1992-03-271-2/+0
|
* Strip leading whitespace from input().Guido van Rossum1992-03-121-0/+4
|
* Skip leading whitespace of eval() string argument.Guido van Rossum1992-03-041-1/+7
|
* Added execfile().Guido van Rossum1992-02-251-0/+37
|
* Get rid of comment about open().Guido van Rossum1992-02-051-1/+1
|
* Added getattr and setattr built-in functions.Guido van Rossum1992-01-271-0/+36
|
* long_format() is now declared in longobject.h.Guido van Rossum1992-01-191-5/+2
|
* Added SystemExit.Guido van Rossum1991-12-311-0/+2
|
* Sorted exceptions; added ImportError.Guido van Rossum1991-12-241-9/+11
|
* Regularize exceptions.Guido van Rossum1991-12-161-36/+27
|
* Added "apply"; added "SyntaxError"; changed table lay-out.Guido van Rossum1991-12-161-23/+42
|
* Added new exceptions.Guido van Rossum1991-12-101-4/+25
|
* Made dir() more robust.Guido van Rossum1991-10-241-6/+57
| | | | Added hex() and oct().
* Protect dir() against non-directory __dict__ attributes.Guido van Rossum1991-10-201-7/+14
|
* Change getbuiltin interface to get the name as an object;Guido van Rossum1991-08-161-2/+2
| | | | call dict2lookup insteead of dictlookup.
* Add and use coerce() routine for mixed mode arithmeticGuido van Rossum1991-07-011-17/+76
|
* printobject now returns an error codeGuido van Rossum1991-06-071-4/+8
|
* Fix conversion of double to long; stylistic changes.Guido van Rossum1991-06-031-3/+3
|
* Added long() and support for longs in int() and float();Guido van Rossum1991-05-051-58/+72
| | | | | turned abs() and divmod() into generic versions; added pow().
* Use fileobject's filegetline() to implement unlimited raw_input().Guido van Rossum1991-04-041-19/+1
|
* Added copyright notice.Guido van Rossum1991-02-191-0/+24
|
* Reversed min and max (to alphabetical order).Guido van Rossum1991-02-191-1/+1
|
* File name shortening.Guido van Rossum1991-01-211-1/+1
|
* "Compiling" versionGuido van Rossum1990-12-201-0/+535