blob: 0e28df4cb4156e75d3d7de03cbb1c6ec82a69c59 [file] [log] [blame]
Guido van Rossuma7925f11994-01-26 10:20:16 +00001Python history
2--------------
3
4This file contains the release messages for previous Python releases
5(slightly edited to adapt them to the format of this file). As you
6read on you go back to the dark ages of Python's history.
7
Guido van Rossumaa253861994-10-06 17:18:57 +00008
Guido van Rossumc30e95f1996-07-30 18:53:51 +00009=====================================
Guido van Rossum821a5581997-05-23 04:05:31 +000010==> Release 1.4 (October 25 1996) <==
11=====================================
12
13(Starting in reverse chronological order:)
14
15- Changed disclaimer notice.
16
17- Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions
18default to the user's login shell.
19
20- In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text
21widget, and bogus bspace() function.
22
23- In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated
24paragraph.
25
26- Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all
27subprojects, and to remove the (broken) experimental NumPy
28subprojects.
29
30- In Lib/py_compile.py, cast mtime to long() so it will work on Mac
31(where os.stat() returns mtimes as floats.)
32- Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to
33fix POST in CGIHTTPServer.py.
34
35- Version 2.83 of Misc/python-mode.el for Emacs is included.
36
37- In Modules/regexmodule.c, fixed symcomp() to correctly handle a new
38group starting immediately after a group tag.
39
40- In Lib/SocketServer.py, changed the mode for rfile to unbuffered.
41
42- In Objects/stringobject.c, fixed the compare function to do the
43first char comparison in unsigned mode, for consistency with the way
44other characters are compared by memcmp().
45
46- In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats.
47
48- In Lib/urllib.py, fix another case where openedurl wasn't set.
49
50(XXX Sorry, the rest is in totally random order. No time to fix it.)
51
52- SyntaxError exceptions detected during code generation
53(e.g. assignment to an expression) now include a line number.
54
55- Don't leave trailing / or \ in script directory inserted in front of
56sys.path.
57
58- Added a note to Tools/scripts/classfix.py abouts its historical
59importance.
60
61- Added Misc/Makefile.pre.in, a universal Makefile for extensions
62built outside the distribution.
63
64- Rewritten Misc/faq2html.py, by Ka-Ping Yee.
65
66- Install shared modules with mode 555 (needed for performance on some
67platforms).
68
69- Some changes to standard library modules to avoid calling append()
70with more than one argument -- while supported, this should be
71outlawed, and I don't want to set a bad example.
72
73- bdb.py (and hence pdb.py) supports calling run() with a code object
74instead of a code string.
75
76- Fixed an embarrassing bug cgi.py which prevented correct uploading
77of binary files from Netscape (which doesn't distinguish between
78binary and text files). Also added dormant logging support, which
79makes it easier to debug the cgi module itself.
80
81- Added default writer to constructor of NullFormatter class.
82
83- Use binary mode for socket.makefile() calls in ftplib.py.
84
85- The ihooks module no longer "installs" itself upon import -- this
86was an experimental feature that helped ironing out some bugs but that
87slowed down code that imported it without the need to install it
88(e.g. the rexec module). Also close the file in some cases and add
89the __file__ attribute to loaded modules.
90
91- The test program for mailbox.py is now more useful.
92
93- Added getparamnames() to Message class in mimetools.py -- it returns
94the names of parameters to the content-type header.
95
96- Fixed a typo in ni that broke the loop stripping "__." from names.
97
98- Fix sys.path[0] for scripts run via pdb.py's new main program.
99
100- profile.py can now also run a script, like pdb.
101
102- Fix a small bug in pyclbr -- don't add names starting with _ when
103emulating from ... import *.
104
105- Fixed a series of embarrassing typos in rexec's handling of standard
106I/O redirection. Added some more "safe" built-in modules: cmath,
107errno, operator.
108
109- Fixed embarrassing typo in shelve.py.
110
111- Added SliceType and EllipsisType to types.py.
112
113- In urllib.py, added handling for error 301 (same as 302); added
114geturl() method to get the URL after redirection.
115
116- Fixed embarrassing typo in xdrlib.py. Also fixed typo in Setup.in
117for _xdrmodule.c and removed redundant #include from _xdrmodule.c.
118
119- Fixed bsddbmodule.c to add binary mode indicator on platforms that
120have it. This should make it working on Windows NT.
121
122- Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32,
123whatever applies. Also rationalized some other tests for various MS
124platforms.
125
126- Added the sources for the NT installer script used for Python
1271.4beta3. Not tested with this release, but better than nothing.
128
129- A compromise in pickle's defenses against Trojan horses: a
130user-defined function is now okay where a class is expected. A
131built-in function is not okay, to prevent pickling something that
132will execute os.system("rm -f *") when unpickling.
133
134- dis.py will print the name of local variables referenced by local
135load/store/delete instructions.
136
137- Improved portability of SimpleHTTPServer module to non-Unix
138platform.
139
140- The thread.h interface adds an extra argument to down_sema(). This
141only affects other C code that uses thread.c; the Python thread module
142doesn't use semaphores (which aren't provided on all platforms where
143Python threads are supported). Note: on NT, this change is not
144implemented.
145
146- Fixed some typos in abstract.h; corrected signature of
147PyNumber_Coerce, added PyMapping_DelItem. Also fixed a bug in
148abstract.c's PyObject_CallMethod().
149
150- apply(classname, (), {}) now works even if the class has no
151__init__() method.
152
153- Implemented complex remainder and divmod() (these would dump core!).
154Conversion of complex numbers to int, long int or float now raises an
155exception, since there is no meaningful way to do it without losing
156information.
157
158- Fixed bug in built-in complex() function which gave the wrong result
159for two real arguments.
160
161- Change the hash algorithm for strings -- the multiplier is now
1621000003 instead of 3, which gives better spread for short strings.
163
164- New default path for Windows NT, the registry structure now supports
165default paths for different install packages. (Mark Hammond -- the
166next PythonWin release will use this.)
167
168- Added more symbols to the python_nt.def file.
169
170- When using GNU readline, set rl_readline_name to "python".
171
172- The Ellipses built-in name has been renamed to Ellipsis -- this is
173the correct singular form. Thanks to Ka-Ping Yee, who saved us from
174eternal embarrassment.
175
176- Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses ->
177Ellipsis name change.
178
179- Updated the library reference manual. Added documentation of
180restricted mode (rexec, Bastion) and the formatter module (for use
181with the htmllib module). Fixed the documentation of htmllib
182(finally).
183
184- The reference manual is now maintained in FrameMaker.
185
186- Upgraded scripts Doc/partparse.py and Doc/texi2html.py.
187
188- Slight improvements to Doc/Makefile.
189
190- Added fcntl.lockf(). This should be used for Unix file locking
191instead of the posixfile module; lockf() is more portable.
192
193- The getopt module now supports long option names, thanks to Lars
194Wizenius.
195
196- Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake
197and Nils Fischbeck.
198
199- Use more bits of time.time() in whrandom's default seed().
200
201- Performance hack for regex module's regs attribute.
202
203- Don't close already closed socket in socket module.
204
205- Correctly handle separators containing embedded nulls in
206strop.split, strop.find and strop.rfind. Also added more detail to
207error message for strop.atoi and friends.
208
209- Moved fallback definition for hypot() to Python/hypot.c.
210
211- Added fallback definition for strdup, in Python/strdup.c.
212
213- Fixed some bugs where a function would return 0 to indicate an error
214where it should return -1.
215
216- Test for error returned by time.localtime(), and rationalized its MS
217tests.
218
219- Added Modules/Setup.local file, which is processed after Setup.
220
221- Corrected bug in toplevel Makefile.in -- execution of regen script
222would not use the right PATH and PYTHONPATH.
223
224- Various and sundry NeXT configuration changes (sigh).
225
226- Support systems where libreadline needs neither termcap nor curses.
227
228- Improved ld_so_aix script and python.exp file (for AIX).
229
230- More stringent test for working <stdarg.h> in configure script.
231
232- Removed Demo/www subdirectory -- it was totally out of date.
233
234- Improved demos and docs for Fred Drake's parser module; fixed one
235typo in the module itself.
236
237
238=========================================
239==> Release 1.4beta3 (August 26 1996) <==
240=========================================
241
242
243(XXX This is less readable that it should. I promise to restructure
244it for the final 1.4 release.)
245
246
247What's new in 1.4beta3 (since beta2)?
248-------------------------------------
249
250- Name mangling to implement a simple form of class-private variables.
251A name of the form "__spam" can't easily be used outside the class.
252(This was added in 1.4beta3, but left out of the 1.4beta3 release
253message.)
254
255- In urllib.urlopen(): HTTP URLs containing user:passwd@host are now
256handled correctly when using a proxy server.
257
258- In ntpath.normpath(): don't truncate to 8+3 format.
259
260- In mimetools.choose_boundary(): don't die when getuid() or getpid()
261aren't defined.
262
263- Module urllib: some optimizations to (un)quoting.
264
265- New module MimeWriter for writing MIME documents.
266
267- More changes to formatter module.
268
269- The freeze script works once again and is much more robust (using
270sys.prefix etc.). It also supports a -o option to specify an
271output directory.
272
273- New module whichdb recognizes dbm, gdbm and bsddb/dbhash files.
274
275- The Doc/Makefile targets have been reorganized somewhat to remove the
276insistence on always generating PostScript.
277
278- The texinfo to html filter (Doc/texi2html.py) has been improved somewhat.
279
280- "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing
281name conflict on the Mac.
282
283- Linking a module compiled with a different setting for Py_TRACE_REFS now
284generates a linker error rather than a core dump.
285
286- The cgi module has a new convenience function print_exception(), which
287formats a python exception using HTML. It also fixes a bug in the
288compatibility code and adds a dubious feature which makes it possible to
289have two query strings, one in the URL and one in the POST data.
290
291- A subtle change in the unpickling of class instances makes it possible
292to unpickle in restricted execution mode, where the __dict__ attribute is
293not available (but setattr() is).
294
295- Documentation for os.path.splitext() (== posixpath.splitext()) has been
296cleared up. It splits at the *last* dot.
297
298- posixfile locking is now also correctly supported on AIX.
299
300- The tempfile module once again honors an initial setting of tmpdir. It
301now works on Windows, too.
302
303- The traceback module has some new functions to extract, format and print
304the active stack.
305
306- Some translation functions in the urllib module have been made a little
307less sluggish.
308
309- The addtag_* methods for Canvas widgets in Tkinter as well as in the
310separate Canvas class have been fixed so they actually do something
311meaningful.
312
313- A tiny _test() function has been added to Tkinter.py.
314
315- A generic Makefile for dynamically loaded modules is provided in the Misc
316subdirectory (Misc/gMakefile).
317
318- A new version of python-mode.el for Emacs is provided. See
319http://www.python.org/ftp/emacs/pmdetails.html for details. The
320separate file pyimenu.el is no longer needed, imenu support is folded
321into python-mode.el.
322
323- The configure script can finally correctly find the readline library in a
324non-standard location. The LDFLAGS variable is passed on the the Makefiles
325from the configure script.
326
327- Shared libraries are now installed as programs (i.e. with executable
328permission). This is required on HP-UX and won't hurt on other systems.
329
330- The objc.c module is no longer part of the distribution. Objective-C
331support may become available as contributed software on the ftp site.
332
333- The sybase module is no longer part of the distribution. A much
334improved sybase module is available as contributed software from the
335ftp site.
336
337- _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and
338Mac (don't use unpatched Tcl/Tk!). The default line in the Setup.in file
339now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0.
340
341- In Setup, you can now write "*shared*" instead of "*noconfig*", and you
342can use *.so and *.sl as shared libraries.
343
344- Some more fidgeting for AIX shared libraries.
345
346- The mpz module is now compatible with GMP 2.x. (Not tested by me.)
347(Note -- a complete replacement by Niels Mo"ller, called gpmodule, is
348available from the contrib directory on the ftp site.)
349
350- A warning is written to sys.stderr when a __del__ method raises an
351exception (formerly, such exceptions were completely ignored).
352
353- The configure script now defines HAVE_OLD_CPP if the C preprocessor is
354incapable of ANSI style token concatenation and stringification.
355
356- All source files (except a few platform specific modules) are once again
357compatible with K&R C compilers as well as ANSI compilers. In particular,
358ANSI-isms have been removed or made conditional in complexobject.c,
359getargs.c and operator.c.
360
361- The abstract object API has three new functions, PyObject_DelItem,
362PySequence_DelItem, and PySequence_DelSlice.
363
364- The operator module has new functions delitem and delslice, and the
365functions "or" and "and" are renamed to "or_" and "and_" (since "or" and
366"and" are reserved words). ("__or__" and "__and__" are unchanged.)
367
368- The environment module is no longer supported; putenv() is now a function
369in posixmodule (also under NT).
370
371- Error in filter(<function>, "") has been fixed.
372
373- Unrecognized keyword arguments raise TypeError, not KeyError.
374
375- Better portability, fewer bugs and memory leaks, fewer compiler warnings,
376some more documentation.
377
378- Bug in float power boundary case (0.0 to the negative integer power)
379fixed.
380
381- The test of negative number to the float power has been moved from the
382built-in pow() functin to floatobject.c (so complex numbers can yield the
383correct result).
384
385- The bug introduced in beta2 where shared libraries loaded (using
386dlopen()) from the current directory would fail, has been fixed.
387
388- Modules imported as shared libraries now also have a __file__ attribute,
389giving the filename from which they were loaded. The only modules without
390a __file__ attribute now are built-in modules.
391
392- On the Mac, dynamically loaded modules can end in either ".slb" or
393".<platform>.slb" where <platform> is either "CFM68K" or "ppc". The ".slb"
394extension should only be used for "fat" binaries.
395
396- C API addition: marshal.c now supports
397PyMarshal_WriteObjectToString(object).
398
399- C API addition: getargs.c now supports
400PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...)
401to parse keyword arguments.
402
403- The PC versioning scheme (sys.winver) has changed once again. the
404version number is now "<digit>.<digit>.<digit>.<apiversion>", where the
405first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4,
406"1.4.1" for Python 1.4.1 -- the beta level is not included) and
407<apiversion> is the four-digit PYTHON_API_VERSION (currently 1005).
408
409- h2py.py accepts whitespace before the # in CPP directives
410
411- On Solaris 2.5, it should now be possible to use either Posix threads or
412Solaris threads (XXX: how do you select which is used???). (Note: the
413Python pthreads interface doesn't fully support semaphores yet -- anyone
414care to fix this?)
415
416- Thread support should now work on AIX, using either DCE threads or
417pthreads.
418
419- New file Demo/sockets/unicast.py
420
421- Working Mac port, with CFM68K support, with Tk 4.1 support (though not
422both) (XXX)
423
424- New project setup for PC port, now compatible with PythonWin, with
425_tkinter and NumPy support (XXX)
426
427- New module site.py (XXX)
428
429- New module xdrlib.py and optional support module _xdrmodule.c (XXX)
430
431- parser module adapted to new grammar, complete w/ Doc & Demo (XXX)
432
433- regen script fixed (XXX)
434
435- new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX)
436
437- testall now also tests math module (XXX)
438
439- string.atoi c.s. now raise an exception for an empty input string.
440
441- At last, it is no longer necessary to define HAVE_CONFIG_H in order to
442have config.h included at various places.
443
444- Unrecognized keyword arguments now raise TypeError rather than KeyError.
445
446- The makesetup script recognizes files with extension .so or .sl as
447(shared) libraries.
448
449- 'access' is no longer a reserved word, and all code related to its
450implementation is gone (or at least #ifdef'ed out). This should make
451Python a little speedier too!
452
453- Performance enhancements suggested by Sjoerd Mullender. This includes
454the introduction of two new optional function pointers in type object,
455getattro and setattro, which are like getattr and setattr but take a
456string object instead of a C string pointer.
457
458- New operations in string module: lstrip(s) and rstrip(s) strip whitespace
459only on the left or only on the right, A new optional third argument to
460split() specifies the maximum number of separators honored (so
461splitfields(s, sep, n) returns a list of at most n+1 elements). (Since
4621.3, splitfields(s, None) is totally equivalent to split(s).)
463string.capwords() has an optional second argument specifying the
464separator (which is passed to split()).
465
466- regsub.split() has the same addition as string.split(). regsub.splitx(s,
467sep, maxsep) implements the functionality that was regsub.split(s, 1) in
4681.4beta2 (return a list containing the delimiters as well as the words).
469
470- Final touch for AIX loading, rewritten Misc/AIX-NOTES.
471
472- In Modules/_tkinter.c, when using Tk 4.1 or higher, use className
473argument to _tkinter.create() to set Tcl's argv0 variable, so X
474resources use the right resource class again.
475
476- Add #undef fabs to Modules/mathmodule.c for macintosh.
477
478- Added some macro renames for AIX in Modules/operator.c.
479
480- Removed spurious 'E' from Doc/liberrno.tex.
481
482- Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new
483Misc/gMakefile and new version of Misc/python-mode.el.
484
485- Fixed typo in Lib/ntpath.py (islink has "return false" which gives a
486NameError).
487
488- Added missing "from types import *" to Lib/tkinter/Canvas.py.
489
490- Added hint about using default args for __init__ to pickle docs.
491
492- Corrected typo in Inclide/abstract.h: PySequence_Lenth ->
493PySequence_Length.
494
495- Some improvements to Doc/texi2html.py.
496
497- In Python/import.c, Cast unsigned char * in struct _frozen to char *
498in calls to rds_object().
499
500- In doc/ref4.tex, added note about scope of lambda bodies.
501
502What's new in 1.4beta2 (since beta1)?
503-------------------------------------
504
505- Portability bug in the md5.h header solved.
506
507- The PC build procedure now really works, and sets sys.platform to a
508meaningful value (a few things were botched in beta 1). Lib/dos_8x3
509is now a standard part of the distribution (alas).
510
511- More improvements to the installation procedure. Typing "make install"
512now inserts the version number in the pathnames of almost everything
513installed, and creates the machine dependent modules (FCNTL.py etc.) if not
514supplied by the distribution. (XXX There's still a problem with the latter
515because the "regen" script requires that Python is installed. Some manual
516intervention may still be required.) (This has been fixed in 1.4beta3.)
517
518- New modules: errno, operator (XXX).
519
520- Changes for use with Numerical Python: builtin function slice() and
521Ellipses object, and corresponding syntax:
522
523 x[lo:hi:stride] == x[slice(lo, hi, stride)]
524 x[a, ..., z] == x[(a, Ellipses, z)]
525
526- New documentation for errno and cgi mdoules.
527
528- The directory containing the script passed to the interpreter is
529inserted in from of sys.path; "." is no longer a default path
530component.
531
532- Optional third string argument to string.translate() specifies
533characters to delete. New function string.maketrans() creates a
534translation table for translate() or for regex.compile().
535
536- Module posix (and hence module os under Unix) now supports putenv().
537Moreover, module os is enhanced so that if putenv() is supported,
538assignments to os.environ entries make the appropriate putenv() call.
539(XXX the putenv() implementation can leak a small amount of memory per
540call.)
541
542- pdb.py can now be invoked from the command line to debug a script:
543python pdb.py <script> <arg> ...
544
545- Much improved parseaddr() in rfc822.
546
547- In cgi.py, you can now pass an alternative value for environ to
548nearly all functions.
549
550- You can now assign to instance variables whose name begins and ends
551with '__'.
552
553- New version of Fred Drake's parser module and associates (token,
554symbol, AST).
555
556- New PYTHON_API_VERSION value and .pyc file magic number (again!).
557
558- The "complex" internal structure type is now called "Py_complex" to
559avoid name conflicts.
560
561- Numerous small bugs fixed.
562
563- Slight pickle speedups.
564
565- Some slight speedups suggested by Sjoerd (more coming in 1.4 final).
566
567- NeXT portability mods by Bill Bumgarner integrated.
568
569- Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been
570converted to new naming style.
571
572
573What's new in 1.4beta1 (since 1.3)?
574-----------------------------------
575
576- Added sys.platform and sys.exec_platform for Bill Janssen.
577
578- Installation has been completely overhauled. "make install" now installs
579everything, not just the python binary. Installation uses the install-sh
580script (borrowed from X11) to install each file.
581
582- New functions in the posix module: mkfifo, plock, remove (== unlink),
583and ftruncate. More functions are also available under NT.
584
585- New function in the fcntl module: flock.
586
587- Shared library support for FreeBSD.
588
589- The --with-readline option can now be used without a DIRECTORY argument,
590for systems where libreadline.* is in one of the standard places. It is
591also possible for it to be a shared library.
592
593- The extension tkinter has been renamed to _tkinter, to avoid confusion
594with Tkinter.py oncase insensitive file systems. It now supports Tk 4.1 as
595well as 4.0.
596
597- Author's change of address from CWI in Amsterdam, The Netherlands, to
598CNRI in Reston, VA, USA.
599
600- The math.hypot() function is now always available (if it isn't found in
601the C math library, Python provides its own implementation).
602
603- The latex documentation is now compatible with latex2e, thanks to David
604Ascher.
605
606- The expression x**y is now equivalent to pow(x, y).
607
608- The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)].
609
610- Complex numbers are now supported. Imaginary constants are written with
611a 'j' or 'J' prefix, general complex numbers can be formed by adding a real
612part to an imaginary part, like 3+4j. Complex numbers are always stored in
613floating point form, so this is equivalent to 3.0+4.0j. It is also
614possible to create complex numbers with the new built-in function
615complex(re, [im]). For the footprint-conscious, complex number support can
616be disabled by defining the symbol WITHOUT_COMPLEX.
617
618- New built-in function list() is the long-awaited counterpart of tuple().
619
620- There's a new "cmath" module which provides the same functions as the
621"math" library but with complex arguments and results. (There are very
622good reasons why math.sqrt(-1) still raises an exception -- you have to use
623cmath.sqrt(-1) to get 1j for an answer.)
624
625- The Python.h header file (which is really the same as allobjects.h except
626it disables support for old style names) now includes several more files,
627so you have to have fewer #include statements in the average extension.
628
629- The NDEBUG symbol is no longer used. Code that used to be dependent on
630the presence of NDEBUG is now present on the absence of DEBUG. TRACE_REFS
631and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG,
632respectively. At long last, the source actually compiles and links without
633errors when this symbol is defined.
634
635- Several symbols that didn't follow the new naming scheme have been
636renamed (usually by adding to rename2.h) to use a Py or _Py prefix. There
637are no external symbols left without a Py or _Py prefix, not even those
638defined by sources that were incorporated from elsewhere (regexpr.c,
639md5c.c). (Macros are a different story...)
640
641- There are now typedefs for the structures defined in config.c and
642frozen.c.
643
644- New PYTHON_API_VERSION value and .pyc file magic number.
645
646- New module Bastion. (XXX)
647
648- Improved performance of StringIO module.
649
650- UserList module now supports + and * operators.
651
652- The binhex and binascii modules now actually work.
653
654- The cgi module has been almost totally rewritten and documented.
655It now supports file upload and a new data type to handle forms more
656flexibly.
657
658- The formatter module (for use with htmllib) has been overhauled (again).
659
660- The ftplib module now supports passive mode and has doc strings.
661
662- In (ideally) all places where binary files are read or written, the file
663is now correctly opened in binary mode ('rb' or 'wb') so the code will work
664on Mac or PC.
665
666- Dummy versions of os.path.expandvars() and expanduser() are now provided
667on non-Unix platforms.
668
669- Module urllib now has two new functions url2pathname and pathname2url
670which turn local filenames into "file:..." URLs using the same rules as
671Netscape (why be different). it also supports urlretrieve() with a
672pathname parameter, and honors the proxy environment variables (http_proxy
673etc.). The URL parsing has been improved somewhat, too.
674
675- Micro improvements to urlparse. Added urlparse.urldefrag() which
676removes a trailing ``#fragment'' if any.
677
678- The mailbox module now supports MH style message delimiters as well.
679
680- The mhlib module contains some new functionality: setcontext() to set the
681current folder and parsesequence() to parse a sequence as commonly passed
682to MH commands (e.g. 1-10 or last:5).
683
684- New module mimify for conversion to and from MIME format of email
685messages.
686
687- Module ni now automatically installs itself when first imported -- this
688is against the normal rule that modules should define classes and functions
689but not invoke them, but appears more useful in the case that two
690different, independent modules want to use ni's features.
691
692- Some small performance enhancements in module pickle.
693
694- Small interface change to the profile.run*() family of functions -- more
695sensible handling of return values.
696
697- The officially registered Mac creator for Python files is 'Pyth'. This
698replaces 'PYTH' which was used before but never registered.
699
700- Added regsub.capwords(). (XXX)
701
702- Added string.capwords(), string.capitalize() and string.translate().
703(XXX)
704
705- Fixed an interface bug in the rexec module: it was impossible to pass a
706hooks instance to the RExec class. rexec now also supports the dynamic
707loading of modules from shared libraries. Some other interfaces have been
708added too.
709
710- Module rfc822 now caches the headers in a dictionary for more efficient
711lookup.
712
713- The sgmllib module now understands a limited number of SGML "shorthands"
714like <A/.../ for <A>...</A>. (It's not clear that this was a good idea...)
715
716- The tempfile module actually tries a number of different places to find a
717usable temporary directory. (This was prompted by certain Linux
718installations that appear to be missing a /usr/tmp directory.) [A bug in
719the implementation that would ignore a pre-existing tmpdir global has been
720fixed in beta3.]
721
722- Much improved and enhanved FileDialog module for Tkinter.
723
724- Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as
725well as Tk 4.1).
726
727- New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and
728s.dup(). Sockets now work correctly on Windows. On Windows, the built-in
729extension is called _socket and a wrapper module win/socket.py provides
730"makefile()" and "dup()" functionality. On Windows, the select module
731works only with socket objects.
732
733- Bugs in bsddb module fixed (e.g. missing default argument values).
734
735- The curses extension now includes <ncurses.h> when available.
736
737- The gdbm module now supports opening databases in "fast" mode by
738specifying 'f' as the second character or the mode string.
739
740- new variables sys.prefix and sys.exec_prefix pass corresponding
741configuration options / Makefile variables to the Python programmer.
742
743- The ``new'' module now supports creating new user-defined classes as well
744as instances thereof.
745
746- The soundex module now sports get_soundex() to get the soundex value for an
747arbitrary string (formerly it would only do soundex-based string
748comparison) as well as doc strings.
749
750- New object type "cobject" to safely wrap void pointers for passing them
751between various extension modules.
752
753- More efficient computation of float**smallint.
754
755- The mysterious bug whereby "x.x" (two occurrences of the same
756one-character name) typed from the commandline would sometimes fail
757mysteriously.
758
759- The initialization of the readline function can now be invoked by a C
760extension through PyOS_ReadlineInit().
761
762- There's now an externally visible pointer PyImport_FrozenModules which
763can be changed by an embedding application.
764
765- The argument parsing functions now support a new format character 'D' to
766specify complex numbers.
767
768- Various memory leaks plugged and bugs fixed.
769
770- Improved support for posix threads (now that real implementations are
771beginning to apepar). Still no fully functioning semaphores.
772
773- Some various and sundry improvements and new entries in the Tools
774directory.
775
776
777=====================================
Guido van Rossumc30e95f1996-07-30 18:53:51 +0000778==> Release 1.3 (13 October 1995) <==
779=====================================
780
781Major change
782============
783
784Two words: Keyword Arguments. See the first section of Chapter 12 of
785the Tutorial.
786
787(The rest of this file is textually the same as the remaining sections
788of that chapter.)
789
790
791Changes to the WWW and Internet tools
792=====================================
793
794The "htmllib" module has been rewritten in an incompatible fashion.
795The new version is considerably more complete (HTML 2.0 except forms,
796but including all ISO-8859-1 entity definitions), and easy to use.
797Small changes to "sgmllib" have also been made, to better match the
798tokenization of HTML as recognized by other web tools.
799
800A new module "formatter" has been added, for use with the new
801"htmllib" module.
802
803The "urllib"and "httplib" modules have been changed somewhat to allow
804overriding unknown URL types and to support authentication. They now
805use "mimetools.Message" instead of "rfc822.Message" to parse headers.
806The "endrequest()" method has been removed from the HTTP class since
807it breaks the interaction with some servers.
808
809The "rfc822.Message" class has been changed to allow a flag to be
810passed in that says that the file is unseekable.
811
812The "ftplib" module has been fixed to be (hopefully) more robust on
813Linux.
814
815Several new operations that are optionally supported by servers have
816been added to "nntplib": "xover", "xgtitle", "xpath" and "date".
817
818Other Language Changes
819======================
820
821The "raise" statement now takes an optional argument which specifies
822the traceback to be used when printing the exception's stack trace.
823This must be a traceback object, such as found in "sys.exc_traceback".
824When omitted or given as "None", the old behavior (to generate a stack
825trace entry for the current stack frame) is used.
826
827The tokenizer is now more tolerant of alien whitespace. Control-L in
828the leading whitespace of a line resets the column number to zero,
829while Control-R just before the end of the line is ignored.
830
831Changes to Built-in Operations
832==============================
833
834For file objects, "f.read(0)" and "f.readline(0)" now return an empty
835string rather than reading an unlimited number of bytes. For the
836latter, omit the argument altogether or pass a negative value.
837
838A new system variable, "sys.platform", has been added. It specifies
839the current platform, e.g. "sunos5" or "linux1".
840
841The built-in functions "input()" and "raw_input()" now use the GNU
842readline library when it has been configured (formerly, only
843interactive input to the interpreter itself was read using GNU
844readline). The GNU readline library provides elaborate line editing
845and history. The Python debugger ("pdb") is the first beneficiary of
846this change.
847
848Two new built-in functions, "globals()" and "locals()", provide access
849to dictionaries containming current global and local variables,
850respectively. (These augment rather than replace "vars()", which
851returns the current local variables when called without an argument,
852and a module's global variables when called with an argument of type
853module.)
854
855The built-in function "compile()" now takes a third possible value for
856the kind of code to be compiled: specifying "'single'" generates code
857for a single interactive statement, which prints the output of
858expression statements that evaluate to something else than "None".
859
860Library Changes
861===============
862
863There are new module "ni" and "ihooks" that support importing modules
864with hierarchical names such as "A.B.C". This is enabled by writing
865"import ni; ni.ni()" at the very top of the main program. These
866modules are amply documented in the Python source.
867
868The module "rexec" has been rewritten (incompatibly) to define a class
869and to use "ihooks".
870
871The "string.split()" and "string.splitfields()" functions are now the
872same function (the presence or absence of the second argument
873determines which operation is invoked); similar for "string.join()"
874and "string.joinfields()".
875
876The "Tkinter" module and its helper "Dialog" have been revamped to use
877keyword arguments. Tk 4.0 is now the standard. A new module
878"FileDialog" has been added which implements standard file selection
879dialogs.
880
881The optional built-in modules "dbm" and "gdbm" are more coordinated
882--- their "open()" functions now take the same values for their "flag"
883argument, and the "flag" and "mode" argument have default values (to
884open the database for reading only, and to create the database with
885mode "0666" minuse the umask, respectively). The memory leaks have
886finally been fixed.
887
888A new dbm-like module, "bsddb", has been added, which uses the BSD DB
889package's hash method.
890
891A portable (though slow) dbm-clone, implemented in Python, has been
892added for systems where none of the above is provided. It is aptly
893dubbed "dumbdbm".
894
895The module "anydbm" provides a unified interface to "bsddb", "gdbm",
896"dbm", and "dumbdbm", choosing the first one available.
897
898A new extension module, "binascii", provides a variety of operations
899for conversion of text-encoded binary data.
900
901There are three new or rewritten companion modules implemented in
902Python that can encode and decode the most common such formats: "uu"
903(uuencode), "base64" and "binhex".
904
905A module to handle the MIME encoding quoted-printable has also been
906added: "quopri".
907
908The parser module (which provides an interface to the Python parser's
909abstract syntax trees) has been rewritten (incompatibly) by Fred
910Drake. It now lets you change the parse tree and compile the result!
911
912The \code{syslog} module has been upgraded and documented.
913
914Other Changes
915=============
916
917The dynamic module loader recognizes the fact that different filenames
918point to the same shared library and loads the library only once, so
919you can have a single shared library that defines multiple modules.
920(SunOS / SVR4 style shared libraries only.)
921
922Jim Fulton's ``abstract object interface'' has been incorporated into
923the run-time API. For more detailes, read the files
924"Include/abstract.h" and "Objects/abstract.c".
925
926The Macintosh version is much more robust now.
927
928Numerous things I have forgotten or that are so obscure no-one will
929notice them anyway :-)
930
931
Guido van Rossumf456b6d1995-01-04 19:20:37 +0000932===================================
Guido van Rossumd462f3d1995-10-09 21:30:37 +0000933==> Release 1.2 (13 April 1995) <==
934===================================
935
936- Changes to Misc/python-mode.el:
937 - Wrapping and indentation within triple quote strings should work
938 properly now.
939 - `Standard' bug reporting mechanism (use C-c C-b)
940 - py-mark-block was moved to C-c C-m
941 - C-c C-v shows you the python-mode version
942 - a basic python-font-lock-keywords has been added for Emacs 19
943 font-lock colorizations.
944 - proper interaction with pending-del and del-sel modes.
945 - New py-electric-colon (:) command for improved outdenting. Also
946 py-indent-line (TAB) should handle outdented lines better.
947 - New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
948
949- The Library Reference has been restructured, and many new and
950existing modules are now documented, in particular the debugger and
951the profiler, as well as the persistency and the WWW/Internet support
952modules.
953
954- All known bugs have been fixed. For example the pow(2,2,3L) bug on
955Linux has been fixed. Also the re-entrancy problems with __del__ have
956been fixed.
957
958- All known memory leaks have been fixed.
959
960- Phase 2 of the Great Renaming has been executed. The header files
961now use the new names (PyObject instead of object, etc.). The linker
962also sees the new names. Most source files still use the old names,
963by virtue of the rename2.h header file. If you include Python.h, you
964only see the new names. Dynamically linked modules have to be
965recompiled. (Phase 3, fixing the rest of the sources, will be
966executed gradually with the release later versions.)
967
968- The hooks for implementing "safe-python" (better called "restricted
969execution") are in place. Specifically, the import statement is
970implemented by calling the built-in function __import__, and the
971built-in names used in a particular scope are taken from the
972dictionary __builtins__ in that scope's global dictionary. See also
973the new (unsupported, undocumented) module rexec.py.
974
975- The import statement now supports the syntax "import a.b.c" and
976"from a.b.c import name". No officially supported implementation
977exists, but one can be prototyped by replacing the built-in __import__
978function. A proposal by Ken Manheimer is provided as newimp.py.
979
980- All machinery used by the import statement (or the built-in
981__import__ function) is now exposed through the new built-in module
982"imp" (see the library reference manual). All dynamic loading
983machinery is moved to the new file importdl.c.
984
985- Persistent storage is supported through the use of the modules
986"pickle" and "shelve" (implemented in Python). There's also a "copy"
987module implementing deepcopy and normal (shallow) copy operations.
988See the library reference manual.
989
990- Documentation strings for many objects types are accessible through
991the __doc__ attribute. Modules, classes and functions support special
992syntax to initialize the __doc__ attribute: if the first statement
993consists of just a string literal, that string literal becomes the
994value of the __doc__ attribute. The default __doc__ attribute is
995None. Documentation strings are also supported for built-in
996functions, types and modules; however this feature hasn't been widely
997used yet. See the 'new' module for an example. (Basically, the type
998object's tp_doc field contains the doc string for the type, and the
9994th member of the methodlist structure contains the doc string for the
1000method.)
1001
1002- The __coerce__ and __cmp__ methods for user-defined classes once
1003again work as expected. As an example, there's a new standard class
1004Complex in the library.
1005
1006- The functions posix.popen() and posix.fdopen() now have an optional
1007third argument to specify the buffer size, and default their second
1008(mode) argument to 'r' -- in analogy to the builtin open() function.
1009The same applies to posixfile.open() and the socket method makefile().
1010
1011- The thread.exit_thread() function now raises SystemExit so that
1012'finally' clauses are honored and a memory leak is plugged.
1013
1014- Improved X11 and Motif support, by Sjoerd Mullender. This extension
1015is being maintained and distributed separately.
1016
1017- Improved support for the Apple Macintosh, in part by Jack Jansen,
1018e.g. interfaces to (a few) resource mananger functions, get/set file
1019type and creator, gestalt, sound manager, speech manager, MacTCP, comm
1020toolbox, and the think C console library. This is being maintained
1021and distributed separately.
1022
1023- Improved version for Windows NT, by Mark Hammond. This is being
1024maintained and distributed separately.
1025
1026- Used autoconf 2.0 to generate the configure script. Adapted
1027configure.in to use the new features in autoconf 2.0.
1028
1029- It now builds on the NeXT without intervention, even on the 3.3
1030Sparc pre-release.
1031
1032- Characters passed to isspace() and friends are masked to nonnegative
1033values.
1034
1035- Correctly compute pow(-3.0, 3).
1036
1037- Fix portability problems with getopt (configure now checks for a
1038non-GNU getopt).
1039
1040- Don't add frozenmain.o to libPython.a.
1041
1042- Exceptions can now be classes. ALl built-in exceptions are still
1043string objects, but this will change in the future.
1044
1045- The socket module exports a long list of socket related symbols.
1046(More built-in modules will export their symbolic constants instead of
1047relying on a separately generated Python module.)
1048
1049- When a module object is deleted, it clears out its own dictionary.
1050This fixes a circularity in the references between functions and
1051their global dictionary.
1052
1053- Changed the error handling by [new]getargs() e.g. for "O&".
1054
1055- Dynamic loading of modules using shared libraries is supported for
1056several new platforms.
1057
1058- Support "O&", "[...]" and "{...}" in mkvalue().
1059
1060- Extension to findmethod(): findmethodinchain() (where a chain is a
1061linked list of methodlist arrays). The calling interface for
1062findmethod() has changed: it now gets a pointer to the (static!)
1063methodlist structure rather than just to the function name -- this
1064saves copying flags etc. into the (short-lived) method object.
1065
1066- The callable() function is now public.
1067
1068- Object types can define a few new operations by setting function
1069pointers in the type object structure: tp_call defines how an object
1070is called, and tp_str defines how an object's str() is computed.
1071
1072
1073===================================
Guido van Rossumf456b6d1995-01-04 19:20:37 +00001074==> Release 1.1.1 (10 Nov 1994) <==
1075===================================
1076
1077This is a pure bugfix release again. See the ChangeLog file for details.
1078
1079One exception: a few new features were added to tkinter.
1080
1081
1082=================================
1083==> Release 1.1 (11 Oct 1994) <==
1084=================================
1085
1086This release adds several new features, improved configuration and
1087portability, and fixes more bugs than I can list here (including some
1088memory leaks).
1089
1090The source compiles and runs out of the box on more platforms than
1091ever -- including Windows NT. Makefiles or projects for a variety of
1092non-UNIX platforms are provided.
1093
1094APOLOGY: some new features are badly documented or not at all. I had
1095the choice -- postpone the new release indefinitely, or release it
1096now, with working code but some undocumented areas. The problem with
1097postponing the release is that people continue to suffer from existing
1098bugs, and send me patches based on the previous release -- which I
1099can't apply directly because my own source has changed. Also, some
1100new modules (like signal) have been ready for release for quite some
1101time, and people are anxiously waiting for them. In the case of
1102signal, the interface is simple enough to figure out without
1103documentation (if you're anxious enough :-). In this case it was not
1104simple to release the module on its own, since it relies on many small
1105patches elsewhere in the source.
1106
1107For most new Python modules, the source code contains comments that
1108explain how to use them. Documentation for the Tk interface, written
1109by Matt Conway, is available as tkinter-doc.tar.gz from the Python
1110home and mirror ftp sites (see Misc/FAQ for ftp addresses). For the
1111new operator overloading facilities, have a look at Demo/classes:
1112Complex.py and Rat.py show how to implement a numeric type without and
1113with __coerce__ method. Also have a look at the end of the Tutorial
1114document (Doc/tut.tex). If you're still confused: use the newsgroup
1115or mailing list.
1116
1117
1118New language features:
1119
1120 - More flexible operator overloading for user-defined classes
1121 (INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial.
1122
1123 - Classes can define methods named __getattr__, __setattr__ and
1124 __delattr__ to trap attribute accesses. See end of tutorial.
1125
1126 - Classes can define method __call__ so instances can be called
1127 directly. See end of tutorial.
1128
1129
1130New support facilities:
1131
1132 - The Makefiles (for the base interpreter as well as for extensions)
1133 now support creating dynamically loadable modules if the platform
1134 supports shared libraries.
1135
1136 - Passing the interpreter a .pyc file as script argument will execute
1137 the code in that file. (On the Mac such files can be double-clicked!)
1138
1139 - New Freeze script, to create independently distributable "binaries"
1140 of Python programs -- look in Demo/freeze
1141
1142 - Improved h2py script (in Demo/scripts) follows #includes and
1143 supports macros with one argument
1144
1145 - New module compileall generates .pyc files for all modules in a
1146 directory (tree) without also executing them
1147
1148 - Threads should work on more platforms
1149
1150
1151New built-in modules:
1152
1153 - tkinter (support for Tcl's Tk widget set) is now part of the base
1154 distribution
1155
1156 - signal allows catching or ignoring UNIX signals (unfortunately still
1157 undocumented -- any taker?)
1158
1159 - termios provides portable access to POSIX tty settings
1160
1161 - curses provides an interface to the System V curses library
1162
1163 - syslog provides an interface to the (BSD?) syslog daemon
1164
1165 - 'new' provides interfaces to create new built-in object types
1166 (e.g. modules and functions)
1167
1168 - sybase provides an interface to SYBASE database
1169
1170
1171New/obsolete built-in methods:
1172
1173 - callable(x) tests whether x can be called
1174
1175 - sockets now have a setblocking() method
1176
1177 - sockets no longer have an allowbroadcast() method
1178
1179 - socket methods send() and sendto() return byte count
1180
1181
1182New standard library modules:
1183
1184 - types.py defines standard names for built-in types, e.g. StringType
1185
1186 - urlparse.py parses URLs according to the latest Internet draft
1187
1188 - uu.py does uuencode/uudecode (not the fastest in the world, but
1189 quicker than installing uuencode on a non-UNIX machine :-)
1190
1191 - New, faster and more powerful profile module.py
1192
1193 - mhlib.py provides interface to MH folders and messages
1194
1195
1196New facilities for extension writers (unfortunately still
1197undocumented):
1198
1199 - newgetargs() supports optional arguments and improved error messages
1200
1201 - O!, O& O? formats for getargs allow more versatile type checking of
1202 non-standard types
1203
1204 - can register pending asynchronous callback, to be called the next
1205 time the Python VM begins a new instruction (Py_AddPendingCall)
1206
1207 - can register cleanup routines to be called when Python exits
1208 (Py_AtExit)
1209
1210 - makesetup script understands C++ files in Setup file (use file.C
1211 or file.cc)
1212
1213 - Make variable OPT is passed on to sub-Makefiles
1214
1215 - An init<module>() routine may signal an error by not entering
1216 the module in the module table and raising an exception instead
1217
1218 - For long module names, instead of foobarbletchmodule.c you can
1219 use foobarbletch.c
1220
1221 - getintvalue() and getfloatvalue() try to convert any object
1222 instead of requiring an "intobject" or "floatobject"
1223
1224 - All the [new]getargs() formats that retrieve an integer value
1225 will now also work if a float is passed
1226
1227 - C function listtuple() converts list to tuple, fast
1228
1229 - You should now call sigcheck() instead of intrcheck();
1230 sigcheck() also sets an exception when it returns nonzero
1231
1232
Guido van Rossumaa253861994-10-06 17:18:57 +00001233====================================
1234==> Release 1.0.3 (14 July 1994) <==
1235====================================
1236
1237This release consists entirely of bug fixes to the C sources; see the
1238head of ../ChangeLog for a complete list. Most important bugs fixed:
1239
1240- Sometimes the format operator (string%expr) would drop the last
1241character of the format string
1242
1243- Tokenizer looped when last line did not end in \n
1244
1245- Bug when triple-quoted string ended in quote plus newline
1246
1247- Typo in socketmodule (listen) (== instead of =)
1248
1249- typing vars() at the >>> prompt would cause recursive output
1250
1251
1252==================================
1253==> Release 1.0.2 (4 May 1994) <==
1254==================================
1255
1256Overview of the most visible changes. Bug fixes are not listed. See
1257also ChangeLog.
1258
1259Tokens
1260------
1261
1262* String literals follow Standard C rules: they may be continued on
1263the next line using a backslash; adjacent literals are concatenated
1264at compile time.
1265
1266* A new kind of string literals, surrounded by triple quotes (""" or
1267'''), can be continued on the next line without a backslash.
1268
1269Syntax
1270------
1271
1272* Function arguments may have a default value, e.g. def f(a, b=1);
1273defaults are evaluated at function definition time. This also applies
1274to lambda.
1275
1276* The try-except statement has an optional else clause, which is
1277executed when no exception occurs in the try clause.
1278
1279Interpreter
1280-----------
1281
1282* The result of a statement-level expression is no longer printed,
1283except_ for expressions entered interactively. Consequently, the -k
1284command line option is gone.
1285
1286* The result of the last printed interactive expression is assigned to
1287the variable '_'.
1288
1289* Access to implicit global variables has been speeded up by removing
1290an always-failing dictionary lookup in the dictionary of local
1291variables (mod suggested by Steve Makewski and Tim Peters).
1292
1293* There is a new command line option, -u, to force stdout and stderr
1294to be unbuffered.
1295
1296* Incorporated Steve Majewski's mods to import.c for dynamic loading
1297under AIX.
1298
1299* Fewer chances of dumping core when trying to reload or re-import
1300static built-in, dynamically loaded built-in, or frozen modules.
1301
1302* Loops over sequences now don't ask for the sequence's length when
1303they start, but try to access items 0, 1, 2, and so on until they hit
1304an IndexError. This makes it possible to create classes that generate
1305infinite or indefinite sequences a la Steve Majewski. This affects
1306for loops, the (not) in operator, and the built-in functions filter(),
1307map(), max(), min(), reduce().
1308
1309Changed Built-in operations
1310---------------------------
1311
1312* The '%' operator on strings (printf-style formatting) supports a new
1313feature (adapted from a patch by Donald Beaudry) to allow
1314'%(<key>)<format>' % {...} to take values from a dictionary by name
1315instead of from a tuple by position (see also the new function
1316vars()).
1317
1318* The '%s' formatting operator is changed to accept any type and
1319convert it to a string using str().
1320
1321* Dictionaries with more than 20,000 entries can now be created
1322(thanks to Steve Kirsch).
1323
1324New Built-in Functions
1325----------------------
1326
1327* vars() returns a dictionary containing the local variables; vars(m)
1328returns a dictionary containing the variables of module m. Note:
1329dir(x) is now equivalent to vars(x).keys().
1330
1331Changed Built-in Functions
1332--------------------------
1333
1334* open() has an optional third argument to specify the buffer size: 0
1335for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
1336for default.
1337
1338* open()'s second argument is now optional; it defaults to "r".
1339
1340* apply() now checks that its second argument is indeed a tuple.
1341
1342New Built-in Modules
1343--------------------
1344
1345Changed Built-in Modules
1346------------------------
1347
1348The thread module no longer supports exit_prog().
1349
1350New Python Modules
1351------------------
1352
1353* Module addpack contains a standard interface to modify sys.path to
1354find optional packages (groups of related modules).
1355
1356* Module urllib contains a number of functions to access
1357World-Wide-Web files specified by their URL.
1358
1359* Module httplib implements the client side of the HTTP protocol used
1360by World-Wide-Web servers.
1361
1362* Module gopherlib implements the client side of the Gopher protocol.
1363
1364* Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
1365style mailbox files.
1366
1367* Module random contains various random distributions, e.g. gauss().
1368
1369* Module lockfile locks and unlocks open files using fcntl (inspired
1370by a similar module by Andy Bensky).
1371
1372* Module ntpath (by Jaap Vermeulen) implements path operations for
1373Windows/NT.
1374
1375* Module test_thread (in Lib/test) contains a small test set for the
1376thread module.
1377
1378Changed Python Modules
1379----------------------
1380
1381* The string module's expandvars() function is now documented and is
1382implemented in Python (using regular expressions) instead of forking
1383off a shell process.
1384
1385* Module rfc822 now supports accessing the header fields using the
1386mapping/dictionary interface, e.g. h['subject'].
1387
1388* Module pdb now makes it possible to set a break on a function
1389(syntax: break <expression>, where <expression> yields a function
1390object).
1391
1392Changed Demos
1393-------------
1394
1395* The Demo/scripts/freeze.py script is working again (thanks to Jaap
1396Vermeulen).
1397
1398New Demos
1399---------
1400
1401* Demo/threads/Generator.py is a proposed interface for restartable
1402functions a la Tim Peters.
1403
1404* Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
1405directory full of HTML pages which between them contain links to all
1406the newsgroups available on your server.
1407
1408* Demo/dns contains a DNS (Domain Name Server) client.
1409
1410* Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
1411nice enhanced Python shell!!!).
1412
1413* Demo/turing contains a Turing machine by Amrit Prem.
1414
1415Documentation
1416-------------
1417
1418* Documented new language features mentioned above (but not all new
1419modules).
1420
1421* Added a chapter to the Tutorial describing recent additions to
1422Python.
1423
1424* Clarified some sentences in the reference manual,
1425e.g. break/continue, local/global scope, slice assignment.
1426
1427Source Structure
1428----------------
1429
1430* Moved Include/tokenizer.h to Parser/tokenizer.h.
1431
1432* Added Python/getopt.c for systems that don't have it.
1433
1434Emacs mode
1435----------
1436
1437* Indentation of continuated lines is done more intelligently;
1438consequently the variable py-continuation-offset is gone.
1439
1440========================================
1441==> Release 1.0.1 (15 February 1994) <==
1442========================================
1443
1444* Many portability fixes should make it painless to build Python on
1445several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
1446
1447* Fixed test for <stdarg.h> -- this broke on some platforms.
1448
1449* Fixed test for shared library dynalic loading -- this broke on SunOS
14504.x using the GNU loader.
1451
1452* Changed order and number of SVR4 networking libraries (it is now
1453-lsocket -linet -lnsl, if these libraries exist).
1454
1455* Installing the build intermediate stages with "make libainstall" now
1456also installs config.c.in, Setup and makesetup, which are used by the
1457new Extensions mechanism.
1458
1459* Improved README file contains more hints and new troubleshooting
1460section.
1461
1462* The built-in module strop now defines fast versions of three more
1463functions of the standard string module: atoi(), atol() and atof().
1464The strop versions of atoi() and atol() support an optional second
1465argument to specify the base (default 10). NOTE: you don't have to
1466explicitly import strop to use the faster versions -- the string
1467module contains code to let versions from stop override the default
1468versions.
1469
1470* There is now a working Lib/dospath.py for those who use Python under
1471DOS (or Windows). Thanks, Jaap!
1472
1473* There is now a working Modules/dosmodule.c for DOS (or Windows)
1474system calls.
1475
1476* Lib.os.py has been reorganized (making it ready for more operating
1477systems).
1478
1479* Lib/ospath.py is now obsolete (use os.path instead).
1480
1481* Many fixes to the tutorial to make it match Python 1.0. Thanks,
1482Tim!
1483
1484* Fixed Doc/Makefile, Doc/README and various scripts there.
1485
1486* Added missing description of fdopen to Doc/libposix.tex.
1487
1488* Made cleanup() global, for the benefit of embedded applications.
1489
1490* Added parsing of addresses and dates to Lib/rfc822.py.
1491
1492* Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
1493them usable at all.
1494
1495* New module Lib/wave.py reads RIFF (*.wav) audio files.
1496
1497* Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
1498belongs.
1499
1500* New options and comments for Modules/makesetup (used by new
1501Extension mechanism).
1502
1503* Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
1504and elsewhere.
1505
1506* Fixed coredump in filter(None, 'abcdefg').
1507
1508
1509=======================================
1510==> Release 1.0.0 (26 January 1994) <==
1511=======================================
1512
1513As is traditional, so many things have changed that I can't pretend to
1514be complete in these release notes, but I'll try anyway :-)
1515
1516Note that the very last section is labeled "remaining bugs".
1517
1518
1519Source organization and build process
1520-------------------------------------
1521
1522* The sources have finally been split: instead of a single src
1523subdirectory there are now separate directories Include, Parser,
1524Grammar, Objects, Python and Modules. Other directories also start
1525with a capital letter: Misc, Doc, Lib, Demo.
1526
1527* A few extensions (notably Amoeba and X support) have been moved to a
1528separate subtree Extensions, which is no longer in the core
1529distribution, but separately ftp'able as extensions.tar.Z. (The
1530distribution contains a placeholder Ext-dummy with a description of
1531the Extensions subtree as well as the most recent versions of the
1532scripts used there.)
1533
1534* A few large specialized demos (SGI video and www) have been
1535moved to a separate subdirectory Demo2, which is no longer in the core
1536distribution, but separately ftp'able as demo2.tar.Z.
1537
1538* Parts of the standard library have been moved to subdirectories:
1539there are now standard subdirectories stdwin, test, sgi and sun4.
1540
1541* The configuration process has radically changed: I now use GNU
1542autoconf. This makes it much easier to build on new Unix flavors, as
1543well as fully supporting VPATH (if your Make has it). The scripts
1544Configure.py and Addmodule.sh are no longer needed. Many source files
1545have been adapted in order to work with the symbols that the configure
1546script generated by autoconf defines (or not); the resulting source is
1547much more portable to different C compilers and operating systems,
1548even non Unix systems (a Mac port was done in an afternoon). See the
1549toplevel README file for a description of the new build process.
1550
1551* GNU readline (a slightly newer version) is now a subdirectory of the
1552Python toplevel. It is still not automatically configured (being
1553totally autoconf-unaware :-). One problem has been solved: typing
1554Control-C to a readline prompt will now work. The distribution no
1555longer contains a "super-level" directory (above the python toplevel
1556directory), and dl, dl-dld and GNU dld are no longer part of the
1557Python distribution (you can still ftp them from
1558ftp.cwi.nl:/pub/dynload).
1559
1560* The DOS functions have been taken out of posixmodule.c and moved
1561into a separate file dosmodule.c.
1562
1563* There's now a separate file version.c which contains nothing but
1564the version number.
1565
1566* The actual main program is now contained in config.c (unless NO_MAIN
1567is defined); pythonmain.c now contains a function realmain() which is
1568called from config.c's main().
1569
1570* All files needed to use the built-in module md5 are now contained in
1571the distribution. The module has been cleaned up considerably.
1572
1573
1574Documentation
1575-------------
1576
1577* The library manual has been split into many more small latex files,
1578so it is easier to edit Doc/lib.tex file to create a custom library
1579manual, describing only those modules supported on your system. (This
1580is not automated though.)
1581
1582* A fourth manual has been added, titled "Extending and Embedding the
1583Python Interpreter" (Doc/ext.tex), which collects information about
1584the interpreter which was previously spread over several files in the
1585misc subdirectory.
1586
1587* The entire documentation is now also available on-line for those who
1588have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL
1589"http://www.cwi.nl/~guido/Python.html".
1590
1591
1592Syntax
1593------
1594
1595* Strings may now be enclosed in double quotes as well as in single
1596quotes. There is no difference in interpretation. The repr() of
1597string objects will use double quotes if the string contains a single
1598quote and no double quotes. Thanks to Amrit Prem for these changes!
1599
1600* There is a new keyword 'exec'. This replaces the exec() built-in
1601function. If a function contains an exec statement, local variable
1602optimization is not performed for that particular function, thus
1603making assignment to local variables in exec statements less
1604confusing. (As a consequence, os.exec and python.exec have been
1605renamed to execv.)
1606
1607* There is a new keyword 'lambda'. An expression of the form
1608
1609 lambda <parameters> : <expression>
1610
1611yields an anonymous function. This is really only syntactic sugar;
1612you can just as well define a local function using
1613
1614 def some_temporary_name(<parameters>): return <expression>
1615
1616Lambda expressions are particularly useful in combination with map(),
1617filter() and reduce(), described below. Thanks to Amrit Prem for
1618submitting this code (as well as map(), filter(), reduce() and
1619xrange())!
1620
1621
1622Built-in functions
1623------------------
1624
1625* The built-in module containing the built-in functions is called
1626__builtin__ instead of builtin.
1627
1628* New built-in functions map(), filter() and reduce() perform standard
1629functional programming operations (though not lazily):
1630
1631- map(f, seq) returns a new sequence whose items are the items from
1632seq with f() applied to them.
1633
1634- filter(f, seq) returns a subsequence of seq consisting of those
1635items for which f() is true.
1636
1637- reduce(f, seq, initial) returns a value computed as follows:
1638 acc = initial
1639 for item in seq: acc = f(acc, item)
1640 return acc
1641
1642* New function xrange() creates a "range object". Its arguments are
1643the same as those of range(), and when used in a for loop a range
1644objects also behaves identical. The advantage of xrange() over
1645range() is that its representation (if the range contains many
1646elements) is much more compact than that of range(). The disadvantage
1647is that the result cannot be used to initialize a list object or for
1648the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern
1649architectures, benchmarks have shown that "for i in range(...): ..."
1650actually executes *faster* than "for i in xrange(...): ...", but on
1651memory starved machines like PCs running DOS range(100000) may be just
1652too big to be represented at all...
1653
1654* Built-in function exec() has been replaced by the exec statement --
1655see above.
1656
1657
1658The interpreter
1659---------------
1660
1661* Syntax errors are now not printed to stderr by the parser, but
1662rather the offending line and other relevant information are packed up
1663in the SyntaxError exception argument. When the main loop catches a
1664SyntaxError exception it will print the error in the same format as
1665previously, but at the proper position in the stack traceback.
1666
1667* You can now set a maximum to the number of traceback entries
1668printed by assigning to sys.tracebacklimit. The default is 1000.
1669
1670* The version number in .pyc files has changed yet again.
1671
1672* It is now possible to have a .pyc file without a corresponding .py
1673file. (Warning: this may break existing installations if you have an
1674old .pyc file lingering around somewhere on your module search path
1675without a corresponding .py file, when there is a .py file for a
1676module of the same name further down the path -- the new interpreter
1677will find the first .pyc file and complain about it, while the old
1678interpreter would ignore it and use the .py file further down.)
1679
1680* The list sys.builtin_module_names is now sorted and also contains
1681the names of a few hardwired built-in modules (sys, __main__ and
1682__builtin__).
1683
1684* A module can now find its own name by accessing the global variable
1685__name__. Assigning to this variable essentially renames the module
1686(it should also be stored under a different key in sys.modules).
1687A neat hack follows from this: a module that wants to execute a main
1688program when called as a script no longer needs to compare
1689sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
1690
1691* When an object is printed by the print statement, its implementation
1692of str() is used. This means that classes can define __str__(self) to
1693direct how their instances are printed. This is different from
1694__repr__(self), which should define an unambigous string
1695representation of the instance. (If __str__() is not defined, it
1696defaults to __repr__().)
1697
1698* Functions and code objects can now be compared meaningfully.
1699
1700* On systems supporting SunOS or SVR4 style shared libraries, dynamic
1701loading of modules using shared libraries is automatically configured.
1702Thanks to Bill Jansen and Denis Severson for contributing this change!
1703
1704
1705Built-in objects
1706----------------
1707
1708* File objects have acquired a new method writelines() which is the
1709reverse of readlines(). (It does not actually write lines, just a
1710list of strings, but the symmetry makes the choice of name OK.)
1711
1712
1713Built-in modules
1714----------------
1715
1716* Socket objects no longer support the avail() method. Use the select
1717module instead, or use this function to replace it:
1718
1719 def avail(f):
1720 import select
1721 return f in select.select([f], [], [], 0)[0]
1722
1723* Initialization of stdwin is done differently. It actually modifies
1724sys.argv (taking out the options the X version of stdwin recognizes)
1725the first time it is imported.
1726
1727* A new built-in module parser provides a rudimentary interface to the
1728python parser. Corresponding standard library modules token and symbol
1729defines the numeric values of tokens and non-terminal symbols.
1730
1731* The posix module has aquired new functions setuid(), setgid(),
1732execve(), and exec() has been renamed to execv().
1733
1734* The array module is extended with 8-byte object swaps, the 'i'
1735format character, and a reverse() method. The read() and write()
1736methods are renamed to fromfile() and tofile().
1737
1738* The rotor module has freed of portability bugs. This introduces a
1739backward compatibility problem: strings encoded with the old rotor
1740module can't be decoded by the new version.
1741
1742* For select.select(), a timeout (4th) argument of None means the same
1743as leaving the timeout argument out.
1744
1745* Module strop (and hence standard library module string) has aquired
1746a new function: rindex(). Thanks to Amrit Prem!
1747
1748* Module regex defines a new function symcomp() which uses an extended
1749regular expression syntax: parenthesized subexpressions may be labeled
1750using the form "\(<labelname>...\)", and the group() method can return
1751sub-expressions by name. Thanks to Tracy Tims for these changes!
1752
1753* Multiple threads are now supported on Solaris 2. Thanks to Sjoerd
1754Mullender!
1755
1756
1757Standard library modules
1758------------------------
1759
1760* The library is now split in several subdirectories: all stuff using
1761stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
1762is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
1763test modules are in Lib/test. The default module search path will
1764include all relevant subdirectories by default.
1765
1766* Module os now knows about trying to import dos. It defines
1767functions execl(), execle(), execlp() and execvp().
1768
1769* New module dospath (should be attacked by a DOS hacker though).
1770
1771* All modules defining classes now define __init__() constructors
1772instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE!
1773
1774* Some minor changes and bugfixes module ftplib (mostly Steve
1775Majewski's suggestions); the debug() method is renamed to
1776set_debuglevel().
1777
1778* Some new test modules (not run automatically by testall though):
1779test_audioop, test_md5, test_rgbimg, test_select.
1780
1781* Module string now defines rindex() and rfind() in analogy of index()
1782and find(). It also defines atof() and atol() (and corresponding
1783exceptions) in analogy to atoi().
1784
1785* Added help() functions to modules profile and pdb.
1786
1787* The wdb debugger (now in Lib/stdwin) now shows class or instance
1788variables on a double click. Thanks to Sjoerd Mullender!
1789
1790* The (undocumented) module lambda has gone -- you couldn't import it
1791any more, and it was basically more a demo than a library module...
1792
1793
1794Multimedia extensions
1795---------------------
1796
1797* The optional built-in modules audioop and imageop are now standard
1798parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen
1799for contributing this code!
1800
1801* There's a new operation in audioop: minmax().
1802
1803* There's a new built-in module called rgbimg which supports portable
1804efficient reading of SGI RCG image files. Thanks also to Paul
1805Haeberli for the original code! (Who will contribute a GIF reader?)
1806
1807* The module aifc is gone -- you should now always use aifc, which has
1808received a facelift.
1809
1810* There's a new module sunau., for reading Sun (and NeXT) audio files.
1811
1812* There's a new module audiodev which provides a uniform interface to
1813(SGI Indigo and Sun Sparc) audio hardware.
1814
1815* There's a new module sndhdr which recognizes various sound files by
1816looking in their header and checking for various magic words.
1817
1818
1819Optimizations
1820-------------
1821
1822* Most optimizations below can be configured by compile-time flags.
1823Thanks to Sjoerd Mullender for submitting these optimizations!
1824
1825* Small integers (default -1..99) are shared -- i.e. if two different
1826functions compute the same value it is possible (but not
1827guaranteed!!!) that they return the same *object*. Python programs
1828can detect this but should *never* rely on it.
1829
1830* Empty tuples (which all compare equal) are shared in the same
1831manner.
1832
1833* Tuples of size up to 20 (default) are put in separate free lists
1834when deallocated.
1835
1836* There is a compile-time option to cache a string's hash function,
1837but this appeared to have a negligeable effect, and as it costs 4
1838bytes per string it is disabled by default.
1839
1840
1841Embedding Python
1842----------------
1843
1844* The initialization interface has been simplified somewhat. You now
1845only call "initall()" to initialize the interpreter.
1846
1847* The previously announced renaming of externally visible identifiers
1848has not been carried out. It will happen in a later release. Sorry.
1849
1850
1851Miscellaneous bugs that have been fixed
1852---------------------------------------
1853
1854* All known portability bugs.
1855
1856* Version 0.9.9 dumped core in <listobject>.sort() which has been
1857fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix
1858on the mailing list while I was away!
1859
1860* Core dump on a format string ending in '%', e.g. in the expression
1861'%' % None.
1862
1863* The array module yielded a bogus result for concatenation (a+b would
1864yield a+a).
1865
1866* Some serious memory leaks in strop.split() and strop.splitfields().
1867
1868* Several problems with the nis module.
1869
1870* Subtle problem when copying a class method from another class
1871through assignment (the method could not be called).
1872
1873
1874Remaining bugs
1875--------------
1876
1877* One problem with 64-bit machines remains -- since .pyc files are
1878portable and use only 4 bytes to represent an integer object, 64-bit
1879integer literals are silently truncated when written into a .pyc file.
1880Work-around: use eval('123456789101112').
1881
1882* The freeze script doesn't work any more. A new and more portable
1883one can probably be cooked up using tricks from Extensions/mkext.py.
1884
1885* The dos support hasn't been tested yet. (Really Soon Now we should
1886have a PC with a working C compiler!)
1887
1888
Guido van Rossuma7925f11994-01-26 10:20:16 +00001889===================================
1890==> Release 0.9.9 (29 Jul 1993) <==
1891===================================
1892
1893I *believe* these are the main user-visible changes in this release,
1894but there may be others. SGI users may scan the {src,lib}/ChangeLog
1895files for improvements of some SGI specific modules, e.g. aifc and
1896cl. Developers of extension modules should also read src/ChangeLog.
1897
1898
1899Naming of C symbols used by the Python interpreter
1900--------------------------------------------------
1901
1902* This is the last release using the current naming conventions. New
1903naming conventions are explained in the file misc/NAMING.
1904Summarizing, all externally visible symbols get (at least) a "Py"
1905prefix, and most functions are renamed to the standard form
1906PyModule_FunctionName.
1907
1908* Writers of extensions are urged to start using the new naming
1909conventions. The next release will use the new naming conventions
1910throughout (it will also have a different source directory
1911structure).
1912
1913* As a result of the preliminary work for the great renaming, many
1914functions that were accidentally global have been made static.
1915
1916
1917BETA X11 support
1918----------------
1919
1920* There are now modules interfacing to the X11 Toolkit Intrinsics, the
1921Athena widgets, and the Motif 1.1 widget set. These are not yet
1922documented except through the examples and README file in the demo/x11
1923directory. It is expected that this interface will be replaced by a
1924more powerful and correct one in the future, which may or may not be
1925backward compatible. In other words, this part of the code is at most
1926BETA level software! (Note: the rest of Python is rock solid as ever!)
1927
1928* I understand that the above may be a bit of a disappointment,
1929however my current schedule does not allow me to change this situation
1930before putting the release out of the door. By releasing it
1931undocumented and buggy, at least some of the (working!) demo programs,
1932like itr (my Internet Talk Radio browser) become available to a larger
1933audience.
1934
1935* There are also modules interfacing to SGI's "Glx" widget (a GL
1936window wrapped in a widget) and to NCSA's "HTML" widget (which can
1937format HyperText Markup Language, the document format used by the
1938World Wide Web).
1939
1940* I've experienced some problems when building the X11 support. In
1941particular, the Xm and Xaw widget sets don't go together, and it
1942appears that using X11R5 is better than using X11R4. Also the threads
1943module and its link time options may spoil things. My own strategy is
1944to build two Python binaries: one for use with X11 and one without
1945it, which can contain a richer set of built-in modules. Don't even
1946*think* of loading the X11 modules dynamically...
1947
1948
1949Environmental changes
1950---------------------
1951
1952* Compiled files (*.pyc files) created by this Python version are
1953incompatible with those created by the previous version. Both
1954versions detect this and silently create a correct version, but it
1955means that it is not a good idea to use the same library directory for
1956an old and a new interpreter, since they will start to "fight" over
1957the *.pyc files...
1958
1959* When a stack trace is printed, the exception is printed last instead
1960of first. This means that if the beginning of the stack trace
1961scrolled out of your window you can still see what exception caused
1962it.
1963
1964* Sometimes interrupting a Python operation does not work because it
1965hangs in a blocking system call. You can now kill the interpreter by
1966interrupting it three times. The second time you interrupt it, a
1967message will be printed telling you that the third interrupt will kill
1968the interpreter. The "sys.exitfunc" feature still makes limited
1969clean-up possible in this case.
1970
1971
1972Changes to the command line interface
1973-------------------------------------
1974
1975* The python usage message is now much more informative.
1976
1977* New option -i enters interactive mode after executing a script --
1978useful for debugging.
1979
1980* New option -k raises an exception when an expression statement
1981yields a value other than None.
1982
1983* For each option there is now also a corresponding environment
1984variable.
1985
1986
1987Using Python as an embedded language
1988------------------------------------
1989
1990* The distribution now contains (some) documentation on the use of
1991Python as an "embedded language" in other applications, as well as a
1992simple example. See the file misc/EMBEDDING and the directory embed/.
1993
1994
1995Speed improvements
1996------------------
1997
1998* Function local variables are now generally stored in an array and
1999accessed using an integer indexing operation, instead of through a
2000dictionary lookup. (This compensates the somewhat slower dictionary
2001lookup caused by the generalization of the dictionary module.)
2002
2003
2004Changes to the syntax
2005---------------------
2006
2007* Continuation lines can now *sometimes* be written without a
2008backslash: if the continuation is contained within nesting (), [] or
2009{} brackets the \ may be omitted. There's a much improved
2010python-mode.el in the misc directory which knows about this as well.
2011
2012* You can no longer use an empty set of parentheses to define a class
2013without base classes. That is, you no longer write this:
2014
2015 class Foo(): # syntax error
2016 ...
2017
2018You must write this instead:
2019
2020 class Foo:
2021 ...
2022
2023This was already the preferred syntax in release 0.9.8 but many
2024people seemed not to have picked it up. There's a Python script that
2025fixes old code: demo/scripts/classfix.py.
2026
2027* There's a new reserved word: "access". The syntax and semantics are
2028still subject of of research and debate (as well as undocumented), but
2029the parser knows about the keyword so you must not use it as a
2030variable, function, or attribute name.
2031
2032
2033Changes to the semantics of the language proper
2034-----------------------------------------------
2035
2036* The following compatibility hack is removed: if a function was
2037defined with two or more arguments, and called with a single argument
2038that was a tuple with just as many arguments, the items of this tuple
2039would be used as the arguments. This is no longer supported.
2040
2041
2042Changes to the semantics of classes and instances
2043-------------------------------------------------
2044
2045* Class variables are now also accessible as instance variables for
2046reading (assignment creates an instance variable which overrides the
2047class variable of the same name though).
2048
2049* If a class attribute is a user-defined function, a new kind of
2050object is returned: an "unbound method". This contains a pointer to
2051the class and can only be called with a first argument which is a
2052member of that class (or a derived class).
2053
2054* If a class defines a method __init__(self, arg1, ...) then this
2055method is called when a class instance is created by the classname()
2056construct. Arguments passed to classname() are passed to the
2057__init__() method. The __init__() methods of base classes are not
2058automatically called; the derived __init__() method must call these if
2059necessary (this was done so the derived __init__() method can choose
2060the call order and arguments for the base __init__() methods).
2061
2062* If a class defines a method __del__(self) then this method is called
2063when an instance of the class is about to be destroyed. This makes it
2064possible to implement clean-up of external resources attached to the
2065instance. As with __init__(), the __del__() methods of base classes
2066are not automatically called. If __del__ manages to store a reference
2067to the object somewhere, its destruction is postponed; when the object
2068is again about to be destroyed its __del__() method will be called
2069again.
2070
2071* Classes may define a method __hash__(self) to allow their instances
2072to be used as dictionary keys. This must return a 32-bit integer.
2073
2074
2075Minor improvements
2076------------------
2077
2078* Function and class objects now know their name (the name given in
2079the 'def' or 'class' statement that created them).
2080
2081* Class instances now know their class name.
2082
2083
2084Additions to built-in operations
2085--------------------------------
2086
2087* The % operator with a string left argument implements formatting
2088similar to sprintf() in C. The right argument is either a single
2089value or a tuple of values. All features of Standard C sprintf() are
2090supported except %p.
2091
2092* Dictionaries now support almost any key type, instead of just
2093strings. (The key type must be an immutable type or must be a class
2094instance where the class defines a method __hash__(), in order to
2095avoid losing track of keys whose value may change.)
2096
2097* Built-in methods are now compared properly: when comparing x.meth1
2098and y.meth2, if x is equal to y and the methods are defined by the
2099same function, x.meth1 compares equal to y.meth2.
2100
2101
2102Additions to built-in functions
2103-------------------------------
2104
2105* str(x) returns a string version of its argument. If the argument is
2106a string it is returned unchanged, otherwise it returns `x`.
2107
2108* repr(x) returns the same as `x`. (Some users found it easier to
2109have this as a function.)
2110
2111* round(x) returns the floating point number x rounded to an whole
2112number, represented as a floating point number. round(x, n) returns x
2113rounded to n digits.
2114
2115* hasattr(x, name) returns true when x has an attribute with the given
2116name.
2117
2118* hash(x) returns a hash code (32-bit integer) of an arbitrary
2119immutable object's value.
2120
2121* id(x) returns a unique identifier (32-bit integer) of an arbitrary
2122object.
2123
2124* compile() compiles a string to a Python code object.
2125
2126* exec() and eval() now support execution of code objects.
2127
2128
2129Changes to the documented part of the library (standard modules)
2130----------------------------------------------------------------
2131
2132* os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
2133the border case '/foo/..' returns '/' instead of ''.
2134
2135* A new function string.find() is added with similar semantics to
2136string.index(); however when it does not find the given substring it
2137returns -1 instead of raising string.index_error.
2138
2139
2140Changes to built-in modules
2141---------------------------
2142
2143* New optional module 'array' implements operations on sequences of
2144integers or floating point numbers of a particular size. This is
2145useful to manipulate large numerical arrays or to read and write
2146binary files consisting of numerical data.
2147
2148* Regular expression objects created by module regex now support a new
2149method named group(), which returns one or more \(...\) groups by number.
2150The number of groups is increased from 10 to 100.
2151
2152* Function compile() in module regex now supports an optional mapping
2153argument; a variable casefold is added to the module which can be used
2154as a standard uppercase to lowercase mapping.
2155
2156* Module time now supports many routines that are defined in the
2157Standard C time interface (<time.h>): gmtime(), localtime(),
2158asctime(), ctime(), mktime(), as well as these variables (taken from
2159System V): timezone, altzone, daylight and tzname. (The corresponding
2160functions in the undocumented module calendar have been removed; the
2161undocumented and unfinished module tzparse is now obsolete and will
2162disappear in a future release.)
2163
2164* Module strop (the fast built-in version of standard module string)
2165now uses C's definition of whitespace instead of fixing it to space,
2166tab and newline; in practice this usually means that vertical tab,
2167form feed and return are now also considered whitespace. It exports
2168the string of characters that are considered whitespace as well as the
2169characters that are considered lowercase or uppercase.
2170
2171* Module sys now defines the variable builtin_module_names, a list of
2172names of modules built into the current interpreter (including not
2173yet imported, but excluding two special modules that always have to be
2174defined -- sys and builtin).
2175
2176* Objects created by module sunaudiodev now also support flush() and
2177close() methods.
2178
2179* Socket objects created by module socket now support an optional
2180flags argument for their methods sendto() and recvfrom().
2181
2182* Module marshal now supports dumping to and loading from strings,
2183through the functions dumps() and loads().
2184
2185* Module stdwin now supports some new functionality. You may have to
2186ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
2187
2188
2189Bugs fixed
2190----------
2191
2192* Fixed comparison of negative long integers.
2193
2194* The tokenizer no longer botches input lines longer than BUFSIZ.
2195
2196* Fixed several severe memory leaks in module select.
2197
2198* Fixed memory leaks in modules socket and sv.
2199
2200* Fixed memory leak in divmod() for long integers.
2201
2202* Problems with definition of floatsleep() on Suns fixed.
2203
2204* Many portability bugs fixed (and undoubtedly new ones added :-).
2205
2206
2207Changes to the build procedure
2208------------------------------
2209
2210* The Makefile supports some new targets: "make default" and "make
2211all". Both are by normally equivalent to "make python".
2212
2213* The Makefile no longer uses $> since it's not supported by all
2214versions of Make.
2215
2216* The header files now all contain #ifdef constructs designed to make
2217it safe to include the same header file twice, as well as support for
2218inclusion from C++ programs (automatic extern "C" { ... } added).
2219
2220
2221Freezing Python scripts
2222-----------------------
2223
2224* There is now some support for "freezing" a Python script as a
2225stand-alone executable binary file. See the script
2226demo/scripts/freeze.py. It will require some site-specific tailoring
2227of the script to get this working, but is quite worthwhile if you write
2228Python code for other who may not have built and installed Python.
2229
2230
2231MS-DOS
2232------
2233
2234* A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks,
2235Marcel van der Peijl! This requires fewer compatibility hacks in
2236posixmodule.c. The executable is not yet available but will be soon
2237(check the mailing list).
2238
2239* The default PYTHONPATH has changed.
2240
2241
2242Changes for developers of extension modules
2243-------------------------------------------
2244
2245* Read src/ChangeLog for full details.
2246
2247
2248SGI specific changes
2249--------------------
2250
2251* Read src/ChangeLog for full details.
2252
Guido van Rossumaa253861994-10-06 17:18:57 +00002253
Guido van Rossuma7925f11994-01-26 10:20:16 +00002254==================================
2255==> Release 0.9.8 (9 Jan 1993) <==
2256==================================
2257
2258I claim no completeness here, but I've tried my best to scan the log
2259files throughout my source tree for interesting bits of news. A more
2260complete account of the changes is to be found in the various
2261ChangeLog files. See also "News for release 0.9.7beta" below if you're
2262still using release 0.9.6, and the file HISTORY if you have an even
2263older release.
2264
2265 --Guido
2266
2267
2268Changes to the language proper
2269------------------------------
2270
2271There's only one big change: the conformance checking for function
2272argument lists (of user-defined functions only) is stricter. Earlier,
2273you could get away with the following:
2274
2275 (a) define a function of one argument and call it with any
2276 number of arguments; if the actual argument count wasn't
2277 one, the function would receive a tuple containing the
2278 arguments arguments (an empty tuple if there were none).
2279
2280 (b) define a function of two arguments, and call it with more
2281 than two arguments; if there were more than two arguments,
2282 the second argument would be passed as a tuple containing
2283 the second and further actual arguments.
2284
2285(Note that an argument (formal or actual) that is a tuple is counted as
2286one; these rules don't apply inside such tuples, only at the top level
2287of the argument list.)
2288
2289Case (a) was needed to accommodate variable-length argument lists;
2290there is now an explicit "varargs" feature (precede the last argument
2291with a '*'). Case (b) was needed for compatibility with old class
2292definitions: up to release 0.9.4 a method with more than one argument
2293had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
2294Version 0.9.6 provide better ways to handle both casees, bot provided
2295backward compatibility; version 0.9.8 retracts the compatibility hacks
2296since they also cause confusing behavior if a function is called with
2297the wrong number of arguments.
2298
2299There's a script that helps converting classes that still rely on (b),
2300provided their methods' first argument is called "self":
2301demo/scripts/methfix.py.
2302
2303If this change breaks lots of code you have developed locally, try
2304#defining COMPAT_HACKS in ceval.c.
2305
2306(There's a third compatibility hack, which is the reverse of (a): if a
2307function is defined with two or more arguments, and called with a
2308single argument that is a tuple with just as many arguments, the items
2309of this tuple will be used as the arguments. Although this can (and
2310should!) be done using the built-in function apply() instead, it isn't
2311withdrawn yet.)
2312
2313
2314One minor change: comparing instance methods works like expected, so
2315that if x is an instance of a user-defined class and has a method m,
2316then (x.m==x.m) yields 1.
2317
2318
2319The following was already present in 0.9.7beta, but not explicitly
2320mentioned in the NEWS file: user-defined classes can now define types
2321that behave in almost allrespects like numbers. See
2322demo/classes/Rat.py for a simple example.
2323
2324
2325Changes to the build process
2326----------------------------
2327
2328The Configure.py script and the Makefile has been made somewhat more
2329bullet-proof, after reports of (minor) trouble on certain platforms.
2330
2331There is now a script to patch Makefile and config.c to add a new
2332optional built-in module: Addmodule.sh. Read the script before using!
2333
2334Useing Addmodule.sh, all optional modules can now be configured at
2335compile time using Configure.py, so there are no modules left that
2336require dynamic loading.
2337
2338The Makefile has been fixed to make it easier to use with the VPATH
2339feature of some Make versions (e.g. SunOS).
2340
2341
2342Changes affecting portability
2343-----------------------------
2344
2345Several minor portability problems have been solved, e.g. "malloc.h"
2346has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
2347the system now tolerates malloc(0) returning 0.
2348
2349For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
2350distributed with Python. This solves several minor problems, in
2351particular scripts invoked using #! can now use dynamic loading.
2352
2353
2354Changes to the interpreter interface
2355------------------------------------
2356
2357On popular demand, there's finally a "profile" feature for interactive
2358use of the interpreter. If the environment variable $PYTHONSTARTUP is
2359set to the name of an existing file, Python statements in this file
2360are executed when the interpreter is started in interactive mode.
2361
2362There is a new clean-up mechanism, complementing try...finally: if you
2363assign a function object to sys.exitfunc, it will be called when
2364Python exits or receives a SIGTERM or SIGHUP signal.
2365
2366The interpreter is now generally assumed to live in
2367/usr/local/bin/python (as opposed to /usr/local/python). The script
2368demo/scripts/fixps.py will update old scripts in place (you can easily
2369modify it to do other similar changes).
2370
2371Most I/O that uses sys.stdin/stdout/stderr will now use any object
2372assigned to those names as long as the object supports readline() or
2373write() methods.
2374
2375The parser stack has been increased to 500 to accommodate more
2376complicated expressions (7 levels used to be the practical maximum,
2377it's now about 38).
2378
2379The limit on the size of the *run-time* stack has completely been
2380removed -- this means that tuple or list displays can contain any
2381number of elements (formerly more than 50 would crash the
2382interpreter).
2383
2384
2385Changes to existing built-in functions and methods
2386--------------------------------------------------
2387
2388The built-in functions int(), long(), float(), oct() and hex() now
2389also apply to class instalces that define corresponding methods
2390(__int__ etc.).
2391
2392
2393New built-in functions
2394----------------------
2395
2396The new functions str() and repr() convert any object to a string.
2397The function repr(x) is in all respects equivalent to `x` -- some
2398people prefer a function for this. The function str(x) does the same
2399except if x is already a string -- then it returns x unchanged
2400(repr(x) adds quotes and escapes "funny" characters as octal escapes).
2401
2402The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
2403
2404
2405Changes to general built-in modules
2406-----------------------------------
2407
2408The time module's functions are more general: time() returns a
2409floating point number and sleep() accepts one. Their accuracies
2410depends on the precision of the system clock. Millisleep is no longer
2411needed (although it still exists for now), but millitimer is still
2412needed since on some systems wall clock time is only available with
2413seconds precision, while a source of more precise time exists that
2414isn't synchronized with the wall clock. (On UNIX systems that support
2415the BSD gettimeofday() function, time.time() is as time.millitimer().)
2416
2417The string representation of a file object now includes an address:
2418'<file 'filename', mode 'r' at #######>' where ###### is a hex number
2419(the object's address) to make it unique.
2420
2421New functions added to posix: nice(), setpgrp(), and if your system
2422supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
2423
2424Improvements to the socket module: socket objects have new methods
2425getpeername() and getsockname(), and the {get,set}sockopt methods can
2426now get/set any kind of option using strings built with the new struct
2427module. And there's a new function fromfd() which creates a socket
2428object given a file descriptor (useful for servers started by inetd,
2429which have a socket connected to stdin and stdout).
2430
2431
2432Changes to SGI-specific built-in modules
2433----------------------------------------
2434
2435The FORMS library interface (fl) now requires FORMS 2.1a. Some new
2436functions have been added and some bugs have been fixed.
2437
2438Additions to al (audio library interface): added getname(),
2439getdefault() and getminmax().
2440
2441The gl modules doesn't call "foreground()" when initialized (this
2442caused some problems) like it dit in 0.9.7beta (but not before).
2443There's a new gl function 'gversion() which returns a version string.
2444
2445The interface to sv (Indigo video interface) has totally changed.
2446(Sorry, still no documentation, but see the examples in
2447demo/sgi/{sv,video}.)
2448
2449
2450Changes to standard library modules
2451-----------------------------------
2452
2453Most functions in module string are now much faster: they're actually
2454implemented in C. The module containing the C versions is called
2455"strop" but you should still import "string" since strop doesn't
2456provide all the interfaces defined in string (and strop may be renamed
2457to string when it is complete in a future release).
2458
2459string.index() now accepts an optional third argument giving an index
2460where to start searching in the first argument, so you can find second
2461and further occurrences (this is similar to the regular expression
2462functions in regex).
2463
2464The definition of what string.splitfields(anything, '') should return
2465is changed for the last time: it returns a singleton list containing
2466its whole first argument unchanged. This is compatible with
2467regsub.split() which also ignores empty delimiter matches.
2468
2469posixpath, macpath: added dirname() and normpath() (and basename() to
2470macpath).
2471
2472The mainloop module (for use with stdwin) can now demultiplex input
2473from other sources, as long as they can be polled with select().
2474
2475
2476New built-in modules
2477--------------------
2478
2479Module struct defines functions to pack/unpack values to/from strings
2480representing binary values in native byte order.
2481
2482Module strop implements C versions of many functions from string (see
2483above).
2484
2485Optional module fcntl defines interfaces to fcntl() and ioctl() --
2486UNIX only. (Not yet properly documented -- see however src/fcntl.doc.)
2487
2488Optional module mpz defines an interface to an altaernative long
2489integer implementation, the GNU MPZ library.
2490
2491Optional module md5 uses the GNU MPZ library to calculate MD5
2492signatures of strings.
2493
2494There are also optional new modules specific to SGI machines: imageop
2495defines some simple operations to images represented as strings; sv
2496interfaces to the Indigo video board; cl interfaces to the (yet
2497unreleased) compression library.
2498
2499
2500New standard library modules
2501----------------------------
2502
2503(Unfortunately the following modules are not all documented; read the
2504sources to find out more about them!)
2505
2506autotest: run testall without showing any output unless it differs
2507from the expected output
2508
2509bisect: use bisection to insert or find an item in a sorted list
2510
2511colorsys: defines conversions between various color systems (e.g. RGB
2512<-> YUV)
2513
2514nntplib: a client interface to NNTP servers
2515
2516pipes: utility to construct pipeline from templates, e.g. for
2517conversion from one file format to another using several utilities.
2518
2519regsub: contains three functions that are more or less compatible with
2520awk functions of the same name: sub() and gsub() do string
2521substitution, split() splits a string using a regular expression to
2522define how separators are define.
2523
2524test_types: test operations on the built-in types of Python
2525
2526toaiff: convert various audio file formats to AIFF format
2527
2528tzparse: parse the TZ environment parameter (this may be less general
2529than it could be, let me know if you fix it).
2530
2531(Note that the obsolete module "path" no longer exists.)
2532
2533
2534New SGI-specific library modules
2535--------------------------------
2536
2537CL: constants for use with the built-in compression library interface (cl)
2538
2539Queue: a multi-producer, multi-consumer queue class implemented for
2540use with the built-in thread module
2541
2542SOCKET: constants for use with built-in module socket, e.g. to set/get
2543socket options. This is SGI-specific because the constants to be
2544passed are system-dependent. You can generate a version for your own
2545system by running the script demo/scripts/h2py.py with
2546/usr/include/sys/socket.h as input.
2547
2548cddb: interface to the database used the the CD player
2549
2550torgb: convert various image file types to rgb format (requires pbmplus)
2551
2552
2553New demos
2554---------
2555
2556There's an experimental interface to define Sun RPC clients and
2557servers in demo/rpc.
2558
2559There's a collection of interfaces to WWW, WAIS and Gopher (both
2560Python classes and program providing a user interface) in demo/www.
2561This includes a program texi2html.py which converts texinfo files to
2562HTML files (the format used hy WWW).
2563
2564The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
2565
2566For SGI systems, there's a whole collection of programs and classes
2567that make use of the Indigo video board in demo/sgi/{sv,video}. This
2568represents a significant amount of work that we're giving away!
2569
2570There are demos "rsa" and "md5test" that exercise the mpz and md5
2571modules, respectively. The rsa demo is a complete implementation of
2572the RSA public-key cryptosystem!
2573
2574A bunch of games and examples submitted by Stoffel Erasmus have been
2575included in demo/stoffel.
2576
2577There are miscellaneous new files in some existing demo
2578subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
2579sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
2580
2581There are also many minor changes to existing files, but I'm too lazy
2582to run a diff and note the differences -- you can do this yourself if
2583you save the old distribution's demos. One highlight: the
2584stdwin/python.py demo is much improved!
2585
2586
2587Changes to the documentation
2588----------------------------
2589
2590The LaTeX source for the library uses different macros to enable it to
2591be converted to texinfo, and from there to INFO or HTML format so it
2592can be browsed as a hypertext. The net result is that you can now
2593read the Python library documentation in Emacs info mode!
2594
2595
2596Changes to the source code that affect C extension writers
2597----------------------------------------------------------
2598
2599The function strdup() no longer exists (it was used only in one places
2600and is somewhat of a a portability problem sice some systems have the
2601same function in their C library.
2602
2603The functions NEW() and RENEW() allocate one spare byte to guard
2604against a NULL return from malloc(0) being taken for an error, but
2605this should not be relied upon.
2606
2607
2608=========================
2609==> Release 0.9.7beta <==
2610=========================
2611
2612
2613Changes to the language proper
2614------------------------------
2615
2616User-defined classes can now implement operations invoked through
2617special syntax, such as x[i] or `x` by defining methods named
2618__getitem__(self, i) or __repr__(self), etc.
2619
2620
2621Changes to the build process
2622----------------------------
2623
2624Instead of extensive manual editing of the Makefile to select
2625compile-time options, you can now run a Configure.py script.
2626The Makefile as distributed builds a minimal interpreter sufficient to
2627run Configure.py. See also misc/BUILD
2628
2629The Makefile now includes more "utility" targets, e.g. install and
2630tags/TAGS
2631
2632Using the provided strtod.c and strtol.c are now separate options, as
2633on the Sun the provided strtod.c dumps core :-(
2634
2635The regex module is now an option chosen by the Makefile, since some
2636(old) C compilers choke on regexpr.c
2637
2638
2639Changes affecting portability
2640-----------------------------
2641
2642You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
2643interface
2644
2645Dynamic loading is now supported for Sun (and other non-COFF systems)
2646throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
2647DL is out, 1.4)
2648
2649The system-dependent code for the use of the select() system call is
2650moved to one file: myselect.h
2651
2652Thanks to Jaap Vermeulen, the code should now port cleanly to the
2653SEQUENT
2654
2655
2656Changes to the interpreter interface
2657------------------------------------
2658
2659The interpretation of $PYTHONPATH in the environment is different: it
2660is inserted in front of the default path instead of overriding it
2661
2662
2663Changes to existing built-in functions and methods
2664--------------------------------------------------
2665
2666List objects now support an optional argument to their sort() method,
2667which is a comparison function similar to qsort(3) in C
2668
2669File objects now have a method fileno(), used by the new select module
2670(see below)
2671
2672
2673New built-in function
2674---------------------
2675
2676coerce(x, y): take two numbers and return a tuple containing them
2677both converted to a common type
2678
2679
2680Changes to built-in modules
2681---------------------------
2682
2683sys: fixed core dumps in settrace() and setprofile()
2684
2685socket: added socket methods setsockopt() and getsockopt(); and
2686fileno(), used by the new select module (see below)
2687
2688stdwin: added fileno() == connectionnumber(), in support of new module
2689select (see below)
2690
2691posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
2692
2693gl: added qgetfd()
2694
2695fl: added several new functions, fixed several obscure bugs, adapted
2696to FORMS 2.1
2697
2698
2699Changes to standard modules
2700---------------------------
2701
2702posixpath: changed implementation of ismount()
2703
2704string: atoi() no longer mistakes leading zero for octal number
2705
2706...
2707
2708
2709New built-in modules
2710--------------------
2711
2712Modules marked "dynamic only" are not configured at compile time but
2713can be loaded dynamically. You need to turn on the DL or DLD option in
2714the Makefile for support dynamic loading of modules (this requires
2715external code).
2716
2717select: interfaces to the BSD select() system call
2718
2719dbm: interfaces to the (new) dbm library (dynamic only)
2720
2721nis: interfaces to some NIS functions (aka yellow pages)
2722
2723thread: limited form of multiple threads (sgi only)
2724
2725audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
2726coding (dynamic only)
2727
2728cd: interface to Indigo SCSI CDROM player audio library (sgi only)
2729
2730jpeg: read files in JPEG format (dynamic only, sgi only; needs
2731external code)
2732
2733imgfile: read SGI image files (dynamic only, sgi only)
2734
2735sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
2736
2737sv: interface to Indigo video library (sgi only)
2738
2739pc: a minimal set of MS-DOS interfaces (MS-DOS only)
2740
2741rotor: encryption, by Lance Ellinghouse (dynamic only)
2742
2743
2744New standard modules
2745--------------------
2746
2747Not all these modules are documented. Read the source:
2748lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains
2749additional documentation.
2750
2751imghdr: recognizes image file headers
2752
2753sndhdr: recognizes sound file headers
2754
2755profile: print run-time statistics of Python code
2756
2757readcd, cdplayer: companion modules for built-in module cd (sgi only)
2758
2759emacs: interface to Emacs using py-connect.el (see below).
2760
2761SOCKET: symbolic constant definitions for socket options
2762
2763SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
2764
2765SV: symbolic constat definitions for sv (sgi only)
2766
2767CD: symbolic constat definitions for cd (sgi only)
2768
2769
2770New demos
2771---------
2772
2773scripts/pp.py: execute Python as a filter with a Perl-like command
2774line interface
2775
2776classes/: examples using the new class features
2777
2778threads/: examples using the new thread module
2779
2780sgi/cd/: examples using the new cd module
2781
2782
2783Changes to the documentation
2784----------------------------
2785
2786The last-minute syntax changes of release 0.9.6 are now reflected
2787everywhere in the manuals
2788
2789The reference manual has a new section (3.2) on implementing new kinds
2790of numbers, sequences or mappings with user classes
2791
2792Classes are now treated extensively in the tutorial (chapter 9)
2793
2794Slightly restructured the system-dependent chapters of the library
2795manual
2796
2797The file misc/EXTENDING incorporates documentation for mkvalue() and
2798a new section on error handling
2799
2800The files misc/CLASSES and misc/ERRORS are no longer necessary
2801
2802The doc/Makefile now creates PostScript files automatically
2803
2804
2805Miscellaneous changes
2806---------------------
2807
2808Incorporated Tim Peters' changes to python-mode.el, it's now version
28091.06
2810
2811A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
2812program running in an Emacs buffer execute Emacs lisp code. The
2813necessary Python code is in lib/emacs.py. The Emacs code is
2814misc/py-connect.el (it needs some external Emacs lisp code)
2815
2816
2817Changes to the source code that affect C extension writers
2818----------------------------------------------------------
2819
2820New service function mkvalue() to construct a Python object from C
2821values according to a "format" string a la getargs()
2822
2823Most functions from pythonmain.c moved to new pythonrun.c which is
2824in libpython.a. This should make embedded versions of Python easier
2825
2826ceval.h is split in eval.h (which needs compile.h and only declares
2827eval_code) and ceval.h (which doesn't need compile.hand declares the
2828rest)
2829
2830ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
2831improve the parallellism of multi-threaded programs by letting other
2832Python code run when a blocking system call or something similar is
2833made)
2834
2835In structmember.[ch], new member types BYTE, CHAR and unsigned
2836variants have been added
2837
2838New file xxmodule.c is a template for new extension modules.
2839
Guido van Rossumaa253861994-10-06 17:18:57 +00002840
Guido van Rossuma7925f11994-01-26 10:20:16 +00002841==================================
2842==> RELEASE 0.9.6 (6 Apr 1992) <==
2843==================================
2844
2845Misc news in 0.9.6:
2846- Restructured the misc subdirectory
2847- Reference manual completed, library manual much extended (with indexes!)
2848- the GNU Readline library is now distributed standard with Python
2849- the script "../demo/scripts/classfix.py" fixes Python modules using old
2850 class syntax
2851- Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
2852- Because of the GNU copyleft business I am not using the GNU regular
2853 expression implementation but a free re-implementation by Tatu Ylonen
2854 that recently appeared in comp.sources.misc (Bravo, Tatu!)
2855
2856New features in 0.9.6:
2857- stricter try stmt syntax: cannot mix except and finally clauses on 1 try
2858- New module 'os' supplants modules 'mac' and 'posix' for most cases;
2859 module 'path' is replaced by 'os.path'
2860- os.path.split() return value differs from that of old path.split()
2861- sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
2862 currently being handled
2863- sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
2864 exception
2865- New function string.expandtabs() expands tabs in a string
2866- Added times() interface to posix (user & sys time of process & children)
2867- Added uname() interface to posix (returns OS type, hostname, etc.)
2868- New built-in function execfile() is like exec() but from a file
2869- Functions exec() and eval() are less picky about whitespace/newlines
2870- New built-in functions getattr() and setattr() access arbitrary attributes
2871- More generic argument handling in built-in functions (see "./EXTENDING")
2872- Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
2873- Division and modulo for long and plain integers with negative operands
2874 have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
2875 as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as
2876 (a/b, a%b) for integers. For floats, % is also changed, but of course
2877 / is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
2878- A function with explicit variable-length argument list can be declared
2879 like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
2880- Code tracing and profiling features have been added, and two source
2881 code debuggers are provided in the library (pdb.py, tty-oriented,
2882 and wdb, window-oriented); you can now step through Python programs!
2883 See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
2884- '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
2885 a script that fixes old Python modules
2886- Plain integer right shift now uses sign extension
2887- Long integer shift/mask operations now simulate 2's complement
2888 to give more useful results for negative operands
2889- Changed/added range checks for long/plain integer shifts
2890- Options found after "-c command" are now passed to the command in sys.argv
2891 (note subtle incompatiblity with "python -c command -- -options"!)
2892- Module stdwin is better protected against touching objects after they've
2893 been closed; menus can now also be closed explicitly
2894- Stdwin now uses its own exception (stdwin.error)
2895
2896New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
2897- dictionary objects can now be compared properly; e.g., {}=={} is true
2898- new exception SystemExit causes termination if not caught;
2899 it is raised by sys.exit() so that 'finally' clauses can clean up,
2900 and it may even be caught. It does work interactively!
2901- new module "regex" implements GNU Emacs style regular expressions;
2902 module "regexp" is rewritten in Python for backward compatibility
2903- formal parameter lists may contain trailing commas
2904
2905Bugs fixed in 0.9.6:
2906- assigning to or deleting a list item with a negative index dumped core
2907- divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
2908
2909Bugs fixed in 0.9.5:
2910- masking operations involving negative long integers gave wrong results
2911
2912
2913===================================
2914==> RELEASE 0.9.4 (24 Dec 1991) <==
2915===================================
2916
2917- new function argument handling (see below)
2918- built-in apply(func, args) means func(args[0], args[1], ...)
2919- new, more refined exceptions
2920- new exception string values (NameError = 'NameError' etc.)
2921- better checking for math exceptions
2922- for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
2923- fixed list assignment bug: "a[1:1] = a" now works correctly
2924- new class syntax, without extraneous parentheses
2925- new 'global' statement to assign global variables from within a function
2926
2927
2928New class syntax
2929----------------
2930
2931You can now declare a base class as follows:
2932
2933 class B: # Was: class B():
2934 def some_method(self): ...
2935 ...
2936
2937and a derived class thusly:
2938
2939 class D(B): # Was: class D() = B():
2940 def another_method(self, arg): ...
2941
2942Multiple inheritance looks like this:
2943
2944 class M(B, D): # Was: class M() = B(), D():
2945 def this_or_that_method(self, arg): ...
2946
2947The old syntax is still accepted by Python 0.9.4, but will disappear
2948in Python 1.0 (to be posted to comp.sources).
2949
2950
2951New 'global' statement
2952----------------------
2953
2954Every now and then you have a global variable in a module that you
2955want to change from within a function in that module -- say, a count
2956of calls to a function, or an option flag, etc. Until now this was
2957not directly possible. While several kludges are known that
2958circumvent the problem, and often the need for a global variable can
2959be avoided by rewriting the module as a class, this does not always
2960lead to clearer code.
2961
2962The 'global' statement solves this dilemma. Its occurrence in a
2963function body means that, for the duration of that function, the
2964names listed there refer to global variables. For instance:
2965
2966 total = 0.0
2967 count = 0
2968
2969 def add_to_total(amount):
2970 global total, count
2971 total = total + amount
2972 count = count + 1
2973
2974'global' must be repeated in each function where it is needed. The
2975names listed in a 'global' statement must not be used in the function
2976before the statement is reached.
2977
2978Remember that you don't need to use 'global' if you only want to *use*
2979a global variable in a function; nor do you need ot for assignments to
2980parts of global variables (e.g., list or dictionary items or
2981attributes of class instances). This has not changed; in fact
2982assignment to part of a global variable was the standard workaround.
2983
2984
2985New exceptions
2986--------------
2987
2988Several new exceptions have been defined, to distinguish more clearly
2989between different types of errors.
2990
2991name meaning was
2992
2993AttributeError reference to non-existing attribute NameError
2994IOError unexpected I/O error RuntimeError
2995ImportError import of non-existing module or name NameError
2996IndexError invalid string, tuple or list index RuntimeError
2997KeyError key not in dictionary RuntimeError
2998OverflowError numeric overflow RuntimeError
2999SyntaxError invalid syntax RuntimeError
3000ValueError invalid argument value RuntimeError
3001ZeroDivisionError division by zero RuntimeError
3002
3003The string value of each exception is now its name -- this makes it
3004easier to experimentally find out which operations raise which
3005exceptions; e.g.:
3006
3007 >>> KeyboardInterrupt
3008 'KeyboardInterrupt'
3009 >>>
3010
3011
3012New argument passing semantics
3013------------------------------
3014
3015Off-line discussions with Steve Majewski and Daniel LaLiberte have
3016convinced me that Python's parameter mechanism could be changed in a
3017way that made both of them happy (I hope), kept me happy, fixed a
3018number of outstanding problems, and, given some backward compatibility
3019provisions, would only break a very small amount of existing code --
3020probably all mine anyway. In fact I suspect that most Python users
3021will hardly notice the difference. And yet it has cost me at least
3022one sleepless night to decide to make the change...
3023
3024Philosophically, the change is quite radical (to me, anyway): a
3025function is no longer called with either zero or one argument, which
3026is a tuple if there appear to be more arguments. Every function now
3027has an argument list containing 0, 1 or more arguments. This list is
3028always implemented as a tuple, and it is a (run-time) error if a
3029function is called with a different number of arguments than expected.
3030
3031What's the difference? you may ask. The answer is, very little unless
3032you want to write variadic functions -- functions that may be called
3033with a variable number of arguments. Formerly, you could write a
3034function that accepted one or more arguments with little trouble, but
3035writing a function that could be called with either 0 or 1 argument
3036(or more) was next to impossible. This is now a piece of cake: you
3037can simply declare an argument that receives the entire argument
3038tuple, and check its length -- it will be of size 0 if there are no
3039arguments.
3040
3041Another anomaly of the old system was the way multi-argument methods
3042(in classes) had to be declared, e.g.:
3043
3044 class Point():
3045 def init(self, (x, y, color)): ...
3046 def setcolor(self, color): ...
3047 dev moveto(self, (x, y)): ...
3048 def draw(self): ...
3049
3050Using the new scheme there is no need to enclose the method arguments
3051in an extra set of parentheses, so the above class could become:
3052
3053 class Point:
3054 def init(self, x, y, color): ...
3055 def setcolor(self, color): ...
3056 dev moveto(self, x, y): ...
3057 def draw(self): ...
3058
3059That is, the equivalence rule between methods and functions has
3060changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
3061while formerly it was equivalent to Point.moveto(p,(x,y)).
3062
3063A special backward compatibility rule makes that the old version also
3064still works: whenever a function with exactly two arguments (at the top
3065level) is called with more than two arguments, the second and further
3066arguments are packed into a tuple and passed as the second argument.
3067This rule is invoked independently of whether the function is actually a
3068method, so there is a slight chance that some erroneous calls of
3069functions expecting two arguments with more than that number of
3070arguments go undetected at first -- when the function tries to use the
3071second argument it may find it is a tuple instead of what was expected.
3072Note that this rule will be removed from future versions of the
3073language; it is a backward compatibility provision *only*.
3074
3075Two other rules and a new built-in function handle conversion between
3076tuples and argument lists:
3077
3078Rule (a): when a function with more than one argument is called with a
3079single argument that is a tuple of the right size, the tuple's items
3080are used as arguments.
3081
3082Rule (b): when a function with exactly one argument receives no
3083arguments or more than one, that one argument will receive a tuple
3084containing the arguments (the tuple will be empty if there were no
3085arguments).
3086
3087
3088A new built-in function, apply(), was added to support functions that
3089need to call other functions with a constructed argument list. The call
3090
3091 apply(function, tuple)
3092
3093is equivalent to
3094
3095 function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
3096
3097
3098While no new argument syntax was added in this phase, it would now be
3099quite sensible to add explicit syntax to Python for default argument
3100values (as in C++ or Modula-3), or a "rest" argument to receive the
3101remaining arguments of a variable-length argument list.
3102
3103
3104========================================================
3105==> Release 0.9.3 (never made available outside CWI) <==
3106========================================================
3107
3108- string sys.version shows current version (also printed on interactive entry)
3109- more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
3110- 'global' statement to declare module-global variables assigned in functions.
3111- new class declaration syntax: class C(Base1, Base2, ...): suite
3112 (the old syntax is still accepted -- be sure to convert your classes now!)
3113- C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
3114- C comparison operators: == != (the old = and <> remain valid).
3115- floating point numbers may now start with a period (e.g., .14).
3116- definition of integer division tightened (always truncates towards zero).
3117- new builtins hex(x), oct(x) return hex/octal string from (long) integer.
3118- new list method l.count(x) returns the number of occurrences of x in l.
3119- new SGI module: al (Indigo and 4D/35 audio library).
3120- the FORMS interface (modules fl and FL) now uses FORMS 2.0
3121- module gl: added lrect{read,write}, rectzoom and pixmode;
3122 added (non-GL) functions (un)packrect.
3123- new socket method: s.allowbroadcast(flag).
3124- many objects support __dict__, __methods__ or __members__.
3125- dir() lists anything that has __dict__.
3126- class attributes are no longer read-only.
3127- classes support __bases__, instances support __class__ (and __dict__).
3128- divmod() now also works for floats.
3129- fixed obscure bug in eval('1 ').
3130
3131
3132===================================
3133==> Release 0.9.2 (Autumn 1991) <==
3134===================================
3135
3136Highlights
3137----------
3138
3139- tutorial now (almost) complete; library reference reorganized
3140- new syntax: continue statement; semicolons; dictionary constructors;
3141 restrictions on blank lines in source files removed
3142- dramatically improved module load time through precompiled modules
3143- arbitrary precision integers: compute 2 to the power 1000 and more...
3144- arithmetic operators now accept mixed type operands, e.g., 3.14/4
3145- more operations on list: remove, index, reverse; repetition
3146- improved/new file operations: readlines, seek, tell, flush, ...
3147- process management added to the posix module: fork/exec/wait/kill etc.
3148- BSD socket operations (with example servers and clients!)
3149- many new STDWIN features (color, fonts, polygons, ...)
3150- new SGI modules: font manager and FORMS library interface
3151
3152
3153Extended list of changes in 0.9.2
3154---------------------------------
3155
3156Here is a summary of the most important user-visible changes in 0.9.2,
3157in somewhat arbitrary order. Changes in later versions are listed in
3158the "highlights" section above.
3159
3160
31611. Changes to the interpreter proper
3162
3163- Simple statements can now be separated by semicolons.
3164 If you write "if t: s1; s2", both s1 and s2 are executed
3165 conditionally.
3166- The 'continue' statement was added, with semantics as in C.
3167- Dictionary displays are now allowed on input: {key: value, ...}.
3168- Blank lines and lines bearing only a comment no longer need to
3169 be indented properly. (A completely empty line still ends a multi-
3170 line statement interactively.)
3171- Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
3172- Option "-c command" to execute statements from the command line
3173- Compiled versions of modules are cached in ".pyc" files, giving a
3174 dramatic improvement of start-up time
3175- Other, smaller speed improvements, e.g., extracting characters from
3176 strings, looking up single-character keys, and looking up global
3177 variables
3178- Interrupting a print operation raises KeyboardInterrupt instead of
3179 only cancelling the print operation
3180- Fixed various portability problems (it now passes gcc with only
3181 warnings -- more Standard C compatibility will be provided in later
3182 versions)
3183- Source is prepared for porting to MS-DOS
3184- Numeric constants are now checked for overflow (this requires
3185 standard-conforming strtol() and strtod() functions; a correct
3186 strtol() implementation is provided, but the strtod() provided
3187 relies on atof() for everything, including error checking
3188
3189
31902. Changes to the built-in types, functions and modules
3191
3192- New module socket: interface to BSD socket primitives
3193- New modules pwd and grp: access the UNIX password and group databases
3194- (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
3195- (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
3196- New numeric type: long integer, for unlimited precision
3197 - integer constants suffixed with 'L' or 'l' are long integers
3198 - new built-in function long(x) converts int or float to long
3199 - int() and float() now also convert from long integers
3200- New built-in function:
3201 - pow(x, y) returns x to the power y
3202- New operation and methods for lists:
3203 - l*n returns a new list consisting of n concatenated copies of l
3204 - l.remove(x) removes the first occurrence of the value x from l
3205 - l.index(x) returns the index of the first occurrence of x in l
3206 - l.reverse() reverses l in place
3207- New operation for tuples:
3208 - t*n returns a tuple consisting of n concatenated copies of t
3209- Improved file handling:
3210 - f.readline() no longer restricts the line length, is faster,
3211 and isn't confused by null bytes; same for raw_input()
3212 - f.read() without arguments reads the entire (rest of the) file
3213 - mixing of print and sys.stdout.write() has different effect
3214- New methods for files:
3215 - f.readlines() returns a list containing the lines of the file,
3216 as read with f.readline()
3217 - f.flush(), f.tell(), f.seek() call their stdio counterparts
3218 - f.isatty() tests for "tty-ness"
3219- New posix functions:
3220 - _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
3221 - popen() returns a file object connected to a pipe
3222 - utime() replaces utimes() (the latter is not a POSIX name)
3223- New stdwin features, including:
3224 - font handling
3225 - color drawing
3226 - scroll bars made optional
3227 - polygons
3228 - filled and xor shapes
3229 - text editing objects now have a 'settext' method
3230
3231
32323. Changes to the standard library
3233
3234- Name change: the functions path.cat and macpath.cat are now called
3235 path.join and macpath.join
3236- Added new modules: formatter, mutex, persist, sched, mainloop
3237- Added some modules and functionality to the "widget set" (which is
3238 still under development, so please bear with me):
3239 DirList, FormSplit, TextEdit, WindowSched
3240- Fixed module testall to work non-interactively
3241- Module string:
3242 - added functions join() and joinfields()
3243 - fixed center() to work correct and make it "transitive"
3244- Obsolete modules were removed: util, minmax
3245- Some modules were moved to the demo directory
3246
3247
32484. Changes to the demonstration programs
3249
3250- Added new useful scipts: byteyears, eptags, fact, from, lfact,
3251 objgraph, pdeps, pi, primes, ptags, which
3252- Added a bunch of socket demos
3253- Doubled the speed of ptags
3254- Added new stdwin demos: microedit, miniedit
3255- Added a windowing interface to the Python interpreter: python (most
3256 useful on the Mac)
3257- Added a browser for Emacs info files: demo/stdwin/ibrowse
3258 (yes, I plan to put all STDWIN and Python documentation in texinfo
3259 form in the future)
3260
3261
32625. Other changes to the distribution
3263
3264- An Emacs Lisp file "python.el" is provided to facilitate editing
3265 Python programs in GNU Emacs (slightly improved since posted to
3266 gnu.emacs.sources)
3267- Some info on writing an extension in C is provided
3268- Some info on building Python on non-UNIX platforms is provided
3269
3270
3271=====================================
3272==> Release 0.9.1 (February 1991) <==
3273=====================================
3274
3275- Micro changes only
3276- Added file "patchlevel.h"
3277
3278
3279=====================================
3280==> Release 0.9.0 (February 1991) <==
3281=====================================
3282
3283Original posting to alt.sources.