Commit Graph

1417 Commits

Author SHA1 Message Date
Guido van Rossum ae3b3a33d8 * test_*.py: new lambda syntax (also affects tests for filter, map,
reduce)
* ftplib.py: added default callback for retrlines; added dir() method
* ftplib.py: don't return self in self.connect(); added hack so that if
  'CDUP' is not understood, 'CWD ..' is tried.
* ftplib.py: second method called init() should have been called
  connect(); if __init__ sees more than one argument, it will also try to
  login().
1993-11-30 13:43:54 +00:00
Guido van Rossum 590baa4a7a * import.c (get_module): pass .py filename to parse_file, not .pyc filename!
* 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.
1993-11-30 13:40:46 +00:00
Guido van Rossum 8732d6aeea Fix lay-out of previous fix. 1993-11-23 17:54:03 +00:00
Guido van Rossum b376a4ad18 * timemodule.c: Add hack for Solaris 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.
1993-11-23 17:53:17 +00:00
Guido van Rossum 83eb962528 * {lib,ref,ext,tut}.tex: added explicit \date{<date> \\ <release>}.
* lib2.tex: change bogus \\var to \var.
1993-11-23 16:28:45 +00:00
Guido van Rossum 6f0132f490 * text2latex.py: call main() instead of always processing ext.tex.
* Makefile: added 'ext' to 'all' target
* ext.tex: more changes towards a readable text
* lib4.tex (posix): added set{uid,gid}
* lib2.tex (array): restored doc for typecode and itemsize (which were
  there but not visible for dir())
1993-11-19 13:13:22 +00:00
Guido van Rossum c45611d0e3 * import.c (get_module): total rewrite, to ensure proper search order: for
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].
1993-11-17 22:58:56 +00:00
Guido van Rossum 71e57d090d Fix the fix :-( 1993-11-11 15:03:51 +00:00
Guido van Rossum 6938a297da Three micro fixes to formatstring 1993-11-11 14:51:57 +00:00
Guido van Rossum b31c7f732a * test_select.py: (some) tests for built-in select module
* test_grammar.py, testall.out: added test for funny things in string literals
* token.py, symbol.py: definitions used with built-in parser module.
* tokenize.py: added double-quote recognition
1993-11-11 10:31:23 +00:00
Guido van Rossum 52f2c05401 * parsermodule.c, Makefile, config.c: rudimentary interface to the Python
parser.
* mappingobject.c (lookmapping): 'freeslot' was never used due to a bug in
  the code.
1993-11-10 12:53:24 +00:00
Guido van Rossum a3d78fb268 * posixmodule.c: added set{uid,gid}.
* {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
1993-11-10 09:23:53 +00:00
Sjoerd Mullender b2e358d433 Use __init__ instead of init.
Also use CDDB_PATH and CDDB_WRITE_DIR environment variables in cddb.py.
1993-11-08 15:10:43 +00:00
Guido van Rossum e65cce5eec * string.py: added rindex(), rfind(); changed index() to interpret
negative start indices starting from the right.
* ftplib.py: debug() -> set_debuglevel(); change demo to use __init__().
* os.py: added execl, execlp, and execvp.
* lambda.py: removed (now that we have built-in map, reduce, bagof, lambda)
* test_b{1,2}.py, testall.out: added tests for bagof, lambda, map, reduce
* commands.py: use os, not posix
* test_grammar.py: make it easy to disable non-portable int overflow tests
* dis.py: don't abuse range()
1993-11-08 15:05:21 +00:00
Guido van Rossum db65a6ce55 * ext.tex: did most of the tedious changes from plain ASCII text to LaTeX.
* text2latex.py: automatically put function names in \code{}.
* lib.tex, ref.tex, ext.tex, qua.tex, tut.tex: use new P.O.Box number in
  address.
1993-11-05 17:11:16 +00:00
Guido van Rossum 7a2dba2a00 * ext.tex: documentation for extending, reference counts, and embedding
(formerly ../misc/{EXTENDING,REFCNT,EMBEDDING}).  Also affects Makefile.
* text2latex.py: script to do part of the conversion from an plain ASCI
  text file (in my particular style) to LaTeX.
  (Chapter/section/subsection headers, and verbatim sections.)
* partparse.py, texipre.dat, fix.el, Makefile: Minor cleanup of latex ->
  info conversion process (at least it works again, and with less
  debugging output).  Removed fix.sh.
* lib1.tex (section{Built-in Functions}): adapt description of str() and
  repr() to new situation.
* lib3.tex (Module os): added exec*() variants.
* lib3.tex (Module posix): added execve().
* lib2.tex (Module array): documented reality; remove typecode and
itemsize, add byteswap, rename read/write to fromfile/tofile, and
re-alphabetized.
* lib1.tex (Built-in Functions): renamed bagof() to filter().
1993-11-05 14:45:11 +00:00
Guido van Rossum c600411755 * mpzmodule.c: removed redundant mpz_print function.
* 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!)
1993-11-05 10:22:19 +00:00
Guido van Rossum 2e8f8a398e Added compare operations for functions and code objects.
(Also hash, but it doesn't work yet.)
1993-11-05 10:20:10 +00:00
Guido van Rossum 4199facacd Added getmappingsize(). (Needed by previous checkin of posixmodule.c) 1993-11-05 10:18:44 +00:00
Guido van Rossum 32be3a7a88 Fix stupib bug in concatenation 1993-11-05 10:16:27 +00:00
Guido van Rossum 094885b0f0 Must initialize 'inspect' flag 1993-11-05 10:16:09 +00:00
Guido van Rossum c6dcc9f407 Added execve; change getstrarg into getargs with "s" format 1993-11-05 10:15:19 +00:00
Guido van Rossum 572d2d994d Fix memory leaks in join & joinfields 1993-11-05 10:14:49 +00:00
Guido van Rossum e77a757094 * nismodule.c: database keys and values can contain null bytes. be more
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().
1993-11-03 15:01:26 +00:00
Sjoerd Mullender 78ed420314 Fixed a couple of bugs: getargs doesn't use % escapes, and seconds
must be set after timeout is initialized.
1993-11-02 15:34:23 +00:00
Guido van Rossum b73cc04e62 * ceval.c, longobject.c, methodobject.c, listnode.c, arraymodule.c,
pythonrun.c: added static forward declarations
* pythonrun.h, ceval.h, longobject.h, node.h: removed declarations of
  static routines
1993-11-01 16:28:59 +00:00
Guido van Rossum c7a22703e7 * selectmodule.c (select_select): timeout argument may be None with same
meaning as no 4th argument
1993-11-01 16:27:16 +00:00
Guido van Rossum 82d410e733 * fileobject.c (softspace): fix bug if called with NULL file. 1993-11-01 16:26:16 +00:00
Guido van Rossum c70b61fe6d Hacks for NEXTSTEP. 1993-11-01 16:23:18 +00:00
Guido van Rossum 2586bf0a34 * rangeobject.{c,h}, bltinmodule.c: removed non-essential ops from range
object.
1993-11-01 16:21:44 +00:00
Guido van Rossum 0667626694 Replace <<-13 by >>13. Leave old code in #ifdef BUGGY_CODE_BW_COMPAT. 1993-11-01 16:20:18 +00:00
Guido van Rossum 13ecc7a1a2 Simplify life for md5: include (slightly modified) md5.h and md5c.c
from RFC 1321 here, and point to that RFC instead of a non-existant
incompatible file on rsa.com.
1993-11-01 16:19:05 +00:00
Guido van Rossum 74901d589d Restructured main loop. Etc. 1993-11-01 14:50:59 +00:00
Guido van Rossum e36f735616 Major rewrite with new read_* interfaces 1993-11-01 14:49:37 +00:00
Guido van Rossum 0b26a19a4f Fix bug in backup inside esc sequence. 1993-11-01 14:49:04 +00:00
Guido van Rossum b71f879baf Changed redraw policy. 1993-11-01 14:48:37 +00:00
Sjoerd Mullender 615194a352 Fixed bugs in resizetuple and extended the interface.
Added ifdefs in stringobject.c for shared strings of length 1.
Renamed free_list in tupleobject.c to free_tuples.
1993-11-01 13:46:50 +00:00
Guido van Rossum 0a2fa75a9c Added Dates.py and Rev.py 1993-10-30 12:39:49 +00:00
Guido van Rossum 102ababef9 Initial revision 1993-10-30 12:38:16 +00:00
Guido van Rossum becec31f17 Fix bug and use __init__ 1993-10-30 12:38:16 +00:00
Guido van Rossum 74b3f8a9e3 Initial revision 1993-10-28 09:53:13 +00:00
Guido van Rossum dc4b93db70 * listobject.c (list_ass_slice): XDECREF instead of DECREF so
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.
1993-10-27 14:56:44 +00:00
Guido van Rossum 4bd023f882 * lib3.tex (module string): added rindex().
* lib1.tex (section{Built-in Functions}): added bagof(), lambda(), map()
  and reduce().  Repharased apply().  Removed or rephrased references to
  exec() (now the exec stmt).
* lib4.tex: posix.exec --> posix.execv
* ref4.tex, ref8.tex, tut.tex: builtin --> __builtin__
* lib3.tex (module string): added atof() and atol(), and ato[fl]_error.
1993-10-27 13:49:20 +00:00
Guido van Rossum 3b716046a0 Committing the correct graminit.c; also changed confusing comments in Grammar. 1993-10-27 13:25:30 +00:00
Guido van Rossum ed49c5e3f8 *** empty log message *** 1993-10-27 09:29:01 +00:00
Guido van Rossum f1bbf9c308 Add coercions 1993-10-27 09:28:23 +00:00
Guido van Rossum b6957e434f Initial revision 1993-10-27 09:27:13 +00:00
Guido van Rossum 12d12c5faf * compile.[ch]: support for lambda()
* 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!!!)
1993-10-26 17:58:25 +00:00
Guido van Rossum 444fc7c90c Add some necessary casts; use double quotes to represent strings in
some cases.
1993-10-26 15:25:16 +00:00
Guido van Rossum ee9012f58f Added rindex(). index() and rindex() interpret negative start index
as normal indexing does.
1993-10-26 15:23:55 +00:00