summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Misc changes.Guido van Rossum1993-12-241-27/+33
|
* New files.Guido van Rossum1993-12-244-0/+279
|
* * rangeobject.[ch], bltinmodule.c: incorporate new version of rangeGuido van Rossum1993-12-211-1/+1
| | | | object (unchanged from source except "range" -> "xrange").
* New fileGuido van Rossum1993-12-201-0/+75
|
* * mpzmodule.c: cast some methods to the proper type.Guido van Rossum1993-12-172-6/+23
| | | | | | | * 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().
* Port to Solaris 2.3.Sjoerd Mullender1993-12-031-39/+164
|
* change syntactical position of lambdef (was an atom, now is a test)Guido van Rossum1993-11-302-98/+109
|
* * import.c (get_module): pass .py filename to parse_file, not .pyc filename!Guido van Rossum1993-11-304-713/+682
| | | | | | | | | | | * 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.
* * timemodule.c: Add hack for Solaris 2.Guido van Rossum1993-11-232-2/+2
| | | | | | | | | | | | | | | * 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-172/+185
| | | | | | | | | | | | | 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].
* * posixmodule.c: added set{uid,gid}.Guido van Rossum1993-11-101-1/+1
| | | | | | * {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-12/+8
| | | | | | | | | | | | | | * 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/+31
| | | | (Also hash, but it doesn't work yet.)
* Must initialize 'inspect' flagGuido van Rossum1993-11-051-1/+2
|
* * 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().
* * ceval.c, longobject.c, methodobject.c, listnode.c, arraymodule.c,Guido van Rossum1993-11-012-1/+9
| | | | | | pythonrun.c: added static forward declarations * pythonrun.h, ceval.h, longobject.h, node.h: removed declarations of static routines
* * 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.
* Committing the correct graminit.c; also changed confusing comments in Grammar.Guido van Rossum1993-10-271-717/+700
|
* * compile.[ch]: support for lambda()Guido van Rossum1993-10-263-690/+1326
| | | | | | | | | | * 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!!!)
* Changes to accept double-quoted strings on input.Guido van Rossum1993-10-261-2/+4
|
* * filemodule.c: added writelines() -- analogous to readlines()Guido van Rossum1993-10-251-1/+2
| | | | * 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-26/+31
| | | | | file. object.c: Write allocation statistics to stderr.
* * import.c (MAGIC): Changed magic word to avoid confusion about execGuido van Rossum1993-10-222-2/+2
| | | | | | | 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.
* Several optimizations and speed improvements.Sjoerd Mullender1993-10-221-7/+5
| | | | cstubs: Use Matrix type instead of float[4][4].
* * bltinmodule.c: removed exec() built-in function.Guido van Rossum1993-10-184-408/+538
| | | | | | | * 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.
* * stdwinmodule.c (stdwin_done): interface to shutdown stdwin (now this isGuido van Rossum1993-10-181-6/+8
| | | | | | | | | no longer done by config.c). * stdwinmodule.c (initstdwin), config.c (initall): get command line arguments from sys.argv instead of special-casing stdwin in config.c * import.c (get_module): fix core dump when foomodule.o does not define initfoo(). * ChangeLog: documented changes by Sjoerd.
* Makefile, import.c: Lance's alternative module search (allow .pyc fileGuido van Rossum1993-10-151-98/+112
| | | | | | | | | | 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.
* Added widget methods {Height,Width}{,MM}OfScreen.Sjoerd Mullender1993-10-121-1/+1
|
* * Extended X interface: pixmap objects, colormap objects visual objects,Sjoerd Mullender1993-10-111-0/+8
| | | | | | | | 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.
* * Makefile: added all: and default: targets.Guido van Rossum1993-07-059-20/+13
| | | | | | | | | | | | * 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.
* * pythonmain.c: -k option, usage message, more environment flags.Guido van Rossum1993-06-243-8/+57
| | | | | | | | | | | (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).
* * Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.Guido van Rossum1993-06-174-28/+27
| | | | | | | | | | 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().
* * classobject.c: in instance_getattr, don't make a method out of aGuido van Rossum1993-05-252-21/+33
| | | | | | | | | | 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.)
* * Lots of small changes related to access.Guido van Rossum1993-05-211-8/+49
| | | | | | | * 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!)
* Access checks now work, at least for instance data (not for methodsGuido van Rossum1993-05-205-59/+82
| | | | | | | 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-196-649/+745
| | | | | | | | | | | | | | | | (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.)
* * pythonrun.c: Print exception type+arg *after* stack trace instead ofGuido van Rossum1993-05-122-25/+1
| | | | | | | 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
* (I suggest a recompile after getting this, the ceval.c bugfix may be crucial!)Guido van Rossum1993-04-151-5/+14
| | | | | | | * 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.
* * Microscopic corrections to make things compile on the Cray APP.Guido van Rossum1993-04-071-2/+1
| | | | | * Removed one use of $> in Makefile and warned about others. Added configurable lines in Makefile to change CC and AR.
* Support for frozen scripts; added -i option.Guido van Rossum1993-04-014-4/+130
|
* * Fixed some subtleties with fastlocals. You can no longer accessGuido van Rossum1993-03-303-35/+114
| | | | | | | | | | | | | | | | | | 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.]
* Changes to speed up local variables enormously, by avoiding dictionaryGuido van Rossum1993-03-304-63/+221
| | | | | | 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.
* * Changed all copyright messages to include 1993.Guido van Rossum1993-03-2913-44/+118
| | | | | | | | | | | | | | | | | * 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-164-39/+32
| | | | | | | | | | * 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__.
* * stdwinmodule.c: various new commands: setwin{pos,size},Guido van Rossum1993-02-081-8/+18
| | | | | | | | | | listfontnames, bitmap ops. * listobject.c: use mkvalue() when possible; avoid weird error when calling append() without args. * modsupport.c: new feature in getargs(): if the format string contains a semicolor the string after that is used as the error message instead of "bad argument list (format %s)" when there's an error.
* * ceval.c: ifdef out the last argument passing compat hack.Guido van Rossum1993-02-051-8/+6
| | | | | * 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
* * Added Fixcprt.py: script to fix copyright message.Guido van Rossum1993-01-265-17/+53
| | | | | | | | | | | * 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