blob: 4e104692a931980ff90eb78b0f04be0265942985 [file] [log] [blame]
Guido van Rossuma7925f11994-01-26 10:20:16 +00001Python history
2--------------
3
Guido van Rossum439d1fa1998-12-21 21:41:14 +00004This file contains the release messages for previous Python releases.
5As you read on you go back to the dark ages of Python's history.
6
7
8======================================================================
9
10
Guido van Rossum2001da42000-09-01 22:26:44 +000011From 1.5.2c1 to 1.5.2 (final)
12=============================
13
14Tue Apr 13 15:44:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
15
16 * PCbuild/python15.wse: Bump version to 1.5.2 (final)
17
18 * PCbuild/python15.dsp: Added shamodule.c
19
20 * PC/config.c: Added sha module!
21
22 * README, Include/patchlevel.h: Prepare for final release.
23
24 * Misc/ACKS:
25 More (Cameron Laird is honorary; the others are 1.5.2c1 testers).
26
27 * Python/thread_solaris.h:
28 While I can't really test this thoroughly, Pat Knight and the Solaris
29 man pages suggest that the proper thing to do is to add THR_NEW_LWP to
30 the flags on thr_create(), and that there really isn't a downside, so
31 I'll do that.
32
33 * Misc/ACKS:
34 Bunch of new names who helped iron out the last wrinkles of 1.5.2.
35
36 * PC/python_nt.rc:
37 Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3.
38 (I can't even display this on NT, maybe Win/98 can?)
39
40 * Lib/pstats.py:
41 Fix mysterious references to jprofile that were in the source since
42 its creation. I'm assuming these were once valid references to "Jim
43 Roskind's profile"...
44
45 * Lib/Attic/threading_api.py:
46 Removed; since long subsumed in Doc/lib/libthreading.tex
47
48 * Modules/socketmodule.c:
49 Put back __osf__ support for gethostbyname_r(); the real bug was that
50 it was being used even without threads. This of course might be an
51 all-platform problem so now we only use the _r variant when we are
52 using threads.
53
54Mon Apr 12 22:51:20 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
55
56 * Modules/cPickle.c:
57 Fix accidentally reversed NULL test in load_mark(). Suggested by
58 Tamito Kajiyama. (This caused a bug only on platforms where malloc(0)
59 returns NULL.)
60
61 * README:
62 Add note about popen2 problem on Linux noticed by Pablo Bleyer.
63
64 * README: Add note about -D_REENTRANT for HP-UX 10.20.
65
66 * Modules/Makefile.pre.in: 'clean' target should remove hassignal.
67
68 * PC/Attic/vc40.mak, PC/readme.txt:
69 Remove all VC++ info (except VC 1.5) from readme.txt;
70 remove the VC++ 4.0 project file; remove the unused _tkinter extern defs.
71
72 * README: Clarify PC build instructions (point to PCbuild).
73
74 * Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port).
75
76 * Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py:
77 Forgot to add this file. CDROM device parameters.
78
79 * Lib/gzip.py: Two different changes.
80
81 1. Jack Jansen reports that on the Mac, the time may be negative, and
82 solves this by adding a write32u() function that writes an unsigned
83 long.
84
85 2. On 64-bit platforms the CRC comparison fails; I've fixed this by
86 casting both values to be compared to "unsigned long" i.e. modulo
87 0x100000000L.
88
89Sat Apr 10 18:42:02 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
90
91 * PC/Attic/_tkinter.def: No longer needed.
92
93 * Misc/ACKS: Correct missed character in Andrew Dalke's name.
94
95 * README: Add DEC Ultrix notes (from Donn Cave's email).
96
97 * configure: The usual
98
99 * configure.in:
100 Quote a bunch of shell variables used in test, related to long-long.
101
102 * Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c:
103 casts for picky compilers.
104
105 * Modules/socketmodule.c:
106 3-arg gethostbyname_r doesn't really work on OSF/1.
107
108 * PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py:
109 Avoid totally empty files.
110
111Fri Apr 9 14:56:35 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
112
113 * Tools/scripts/fixps.py: Use re instead of regex.
114 Don't rewrite the file in place.
115 (Reported by Andy Dustman.)
116
117 * Lib/netrc.py, Lib/shlex.py: Get rid of #! line
118
119Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
120
121 * PCbuild/python15.wse: Use the Tcl 8.0.5 installer.
122 Add a variable %_TCL_% that makes it easier to switch to a different version.
123
124
125======================================================================
126
127
128From 1.5.2b2 to 1.5.2c1
129=======================
130
131Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
132
133 * PCbuild/python15.wse:
134 Release 1.5.2c1. Add IDLE and Uninstall to program group.
135 Don't distribute zlib.dll. Tweak some comments.
136
137 * PCbuild/zlib.dsp: Now using static zlib 1.1.3
138
139 * Lib/dos-8x3/userdict.py, Lib/dos-8x3/userlist.py, Lib/dos-8x3/test_zli.py, Lib/dos-8x3/test_use.py, Lib/dos-8x3/test_pop.py, Lib/dos-8x3/test_pic.py, Lib/dos-8x3/test_ntp.py, Lib/dos-8x3/test_gzi.py, Lib/dos-8x3/test_fcn.py, Lib/dos-8x3/test_cpi.py, Lib/dos-8x3/test_bsd.py, Lib/dos-8x3/posixfil.py, Lib/dos-8x3/mimetype.py, Lib/dos-8x3/nturl2pa.py, Lib/dos-8x3/compilea.py, Lib/dos-8x3/exceptio.py, Lib/dos-8x3/basehttp.py:
140 The usual
141
142 * Include/patchlevel.h: Release 1.5.2c1
143
144 * README: Release 1.5.2c1.
145
146 * Misc/NEWS: News for the 1.5.2c1 release.
147
148 * Lib/test/test_strftime.py:
149 On Windows, we suddenly find, strftime() may return "" for an
150 unsupported format string. (I guess this is because the logic for
151 deciding whether to reallocate the buffer or not has been improved.)
152 This caused the test code to crash on result[0]. Fix this by assuming
153 an empty result also means the format is not supported.
154
155 * Demo/tkinter/matt/window-creation-w-location.py:
156 This demo imported some private code from Matt. Make it cripple along.
157
158 * Lib/lib-tk/Tkinter.py:
159 Delete an accidentally checked-in feature that actually broke more
160 than was worth it: when deleting a canvas item, it would try to
161 automatically delete the bindings for that item. Since there's
162 nothing that says you can't reuse the tag and still have the bindings,
163 this is not correct. Also, it broke at least one demo
164 (Demo/tkinter/matt/rubber-band-box-demo-1.py).
165
166 * Python/thread_wince.h: Win/CE thread support by Mark Hammond.
167
168Wed Apr 7 20:23:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
169
170 * Modules/zlibmodule.c:
171 Patch by Andrew Kuchling to unflush() (flush() for deflating).
172 Without this, if inflate() returned Z_BUF_ERROR asking for more output
173 space, we would report the error; now, we increase the buffer size and
174 try again, just as for Z_OK.
175
176 * Lib/test/test_gzip.py: Use binary mode for all gzip files we open.
177
178 * Tools/idle/ChangeLog: New change log.
179
180 * Tools/idle/README.txt, Tools/idle/NEWS.txt: New version.
181
182 * Python/pythonrun.c:
183 Alas, get rid of the Win specific hack to ask the user to press Return
184 before exiting when an error happened. This didn't work right when
185 Python is invoked from a daemon.
186
187 * Tools/idle/idlever.py: Version bump awaiting impending new release.
188 (Not much has changed :-( )
189
190 * Lib/lib-tk/Tkinter.py:
191 lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
192 so the preferred name for them is tag_lower, tag_raise
193 (similar to tag_bind, and similar to the Text widget);
194 unfortunately can't delete the old ones yet (maybe in 1.6)
195
196 * Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c:
197 Changes by Mark Hammond for Windows CE. Mostly of the form
198 #ifdef DONT_HAVE_header_H ... #endif around #include <header.h>.
199
200 * Python/bltinmodule.c:
201 Remove unused variable from complex_from_string() code.
202
203 * Include/patchlevel.h:
204 Add the possibility of a gamma release (release candidate).
205 Add '+' to string version number to indicate we're beyond b2 now.
206
207 * Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x.
208
209 * Lib/smtplib.py: Changes by Per Cederquist and The Dragon.
210
211 Per writes:
212
213 """
214 The application where Signum Support uses smtplib needs to be able to
215 report good error messages to the user when sending email fails. To
216 help in diagnosing problems it is useful to be able to report the
217 entire message sent by the server, not only the SMTP error code of the
218 offending command.
219
220 A lot of the functions in sendmail.py unfortunately discards the
221 message, leaving only the code. The enclosed patch fixes that
222 problem.
223
224 The enclosed patch also introduces a base class for exceptions that
225 include an SMTP error code and error message, and make the code and
226 message available on separate attributes, so that surrounding code can
227 deal with them in whatever way it sees fit. I've also added some
228 documentation to the exception classes.
229
230 The constructor will now raise an exception if it cannot connect to
231 the SMTP server.
232
233 The data() method will raise an SMTPDataError if it doesn't receive
234 the expected 354 code in the middle of the exchange.
235
236 According to section 5.2.10 of RFC 1123 a smtp client must accept "any
237 text, including no text at all" after the error code. If the response
238 of a HELO command contains no text self.helo_resp will be set to the
239 empty string (""). The patch fixes the test in the sendmail() method
240 so that helo_resp is tested against None; if it has the empty string
241 as value the sendmail() method would invoke the helo() method again.
242
243 The code no longer accepts a -1 reply from the ehlo() method in
244 sendmail().
245
246 [Text about removing SMTPRecipientsRefused deleted --GvR]
247 """
248
249 and also:
250
251 """
252 smtplib.py appends an extra blank line to the outgoing mail if the
253 `msg' argument to the sendmail method already contains a trailing
254 newline. This patch should fix the problem.
255 """
256
257 The Dragon writes:
258
259 """
260 Mostly I just re-added the SMTPRecipientsRefused exception
261 (the exeption object now has the appropriate info in it ) [Per had
262 removed this in his patch --GvR] and tweaked the behavior of the
263 sendmail method whence it throws the newly added SMTPHeloException (it
264 was closing the connection, which it shouldn't. whatever catches the
265 exception should do that. )
266
267 I pondered the change of the return values to tuples all around,
268 and after some thinking I decided that regularizing the return values was
269 too much of the Right Thing (tm) to not do.
270
271 My one concern is that code expecting an integer & getting a tuple
272 may fail silently.
273
274 (i.e. if it's doing :
275
276 x.somemethod() >= 400:
277 expecting an integer, the expression will always be true if it gets a
278 tuple instead. )
279
280 However, most smtplib code I've seen only really uses the
281 sendmail() method, so this wouldn't bother it. Usually code I've seen
282 that calls the other methods usually only calls helo() and ehlo() for
283 doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
284 and thus I would think not much code uses it yet.
285 """
286
287Tue Apr 6 19:38:18 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
288
289 * Lib/test/test_ntpath.py:
290 Fix the tests now that splitdrive() no longer treats UNC paths special.
291 (Some tests converted to splitunc() tests.)
292
293 * Lib/ntpath.py:
294 Withdraw the UNC support from splitdrive(). Instead, a new function
295 splitunc() parses UNC paths. The contributor of the UNC parsing in
296 splitdrive() doesn't like it, but I haven't heard a good reason to
297 keep it, and it causes some problems. (I think there's a
298 philosophical problem -- to me, the split*() functions are purely
299 syntactical, and the fact that \\foo is not a valid path doesn't mean
300 that it shouldn't be considered an absolute path.)
301
302 Also (quite separately, but strangely related to the philosophical
303 issue above) fix abspath() so that if win32api exists, it doesn't fail
304 when the path doesn't actually exist -- if GetFullPathName() fails,
305 fall back on the old strategy (join with getcwd() if neccessary, and
306 then use normpath()).
307
308 * configure.in, configure, config.h.in, acconfig.h:
309 For BeOS PowerPC. Chris Herborth.
310
311Mon Apr 5 21:54:14 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
312
313 * Modules/timemodule.c:
314 Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on
315 #else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
316
317 * Misc/ACKS:
318 Bunch of new contributors, including 9 who contributed to the Docs,
319 reported by Fred.
320
321Mon Apr 5 18:37:59 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
322
323 * Lib/gzip.py:
324 Oops, missed mode parameter to open().
325
326 * Lib/gzip.py:
327 Made the default mode 'rb' instead of 'r', for better cross-platform
328 support. (Based on comment on the documentation by Bernhard Reiter
329 <bernhard@csd.uwm.edu>).
330
331Fri Apr 2 22:18:25 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
332
333 * Tools/scripts/dutree.py:
334 For reasons I dare not explain, this script should always execute
335 main() when imported (in other words, it is not usable as a module).
336
337Thu Apr 1 15:32:30 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
338
339 * Lib/test/test_cpickle.py: Jonathan Giddy write:
340
341 In test_cpickle.py, the module os got imported, but the line to remove
342 the temp file has gone missing.
343
344Tue Mar 30 20:17:31 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
345
346 * Lib/BaseHTTPServer.py: Per Cederqvist writes:
347
348 If you send something like "PUT / HTTP/1.0" to something derived from
349 BaseHTTPServer that doesn't define do_PUT, you will get a response
350 that begins like this:
351
352 HTTP/1.0 501 Unsupported method ('do_PUT')
353 Server: SimpleHTTP/0.3 Python/1.5
354 Date: Tue, 30 Mar 1999 18:53:53 GMT
355
356 The server should complain about 'PUT' instead of 'do_PUT'. This
357 patch should fix the problem.
358
359Mon Mar 29 20:33:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
360
361 * Lib/smtplib.py: Patch by Per Cederqvist, who writes:
362
363 """
364 - It needlessly used the makefile() method for each response that is
365 read from the SMTP server.
366
367 - If the remote SMTP server closes the connection unexpectedly the
368 code raised an IndexError. It now raises an SMTPServerDisconnected
369 exception instead.
370
371 - The code now checks that all lines in a multiline response actually
372 contains an error code.
373 """
374
375 The Dragon approves.
376
377Mon Mar 29 20:25:40 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
378
379 * Lib/compileall.py:
380 When run as a script, report failures in the exit code as well.
381 Patch largely based on changes by Andrew Dalke, as discussed in the
382 distutils-sig.
383
384Mon Mar 29 20:23:41 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
385
386 * Lib/urllib.py:
387 Hack so that if a 302 or 301 redirect contains a relative URL, the
388 right thing "just happens" (basejoin() with old URL).
389
390 * Modules/cPickle.c:
391 Protection against picling to/from closed (real) file.
392 The problem was reported by Moshe Zadka.
393
394 * Lib/test/test_cpickle.py:
395 Test protection against picling to/from closed (real) file.
396
397 * Modules/timemodule.c: Chris Lawrence writes:
398
399 """
400 The GNU folks, in their infinite wisdom, have decided not to implement
401 altzone in libc6; this would not be horrible, except that timezone
402 (which is implemented) includes the current DST setting (i.e. timezone
403 for Central is 18000 in summer and 21600 in winter). So Python's
404 timezone and altzone variables aren't set correctly during DST.
405
406 Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone
407 show the "right" thing on Linux (by using the tm_gmtoff stuff
408 available in BSD, which is how the GLIBC manual claims things should
409 be done) and (b) should cope with the southern hemisphere. In pursuit
410 of (b), I also took the liberty of renaming the "summer" and "winter"
411 variables to "july" and "jan". This patch should also make certain
412 time calculations on Linux actually work right (like the tz-aware
413 functions in the rfc822 module).
414
415 (It's hard to find DST that's currently being used in the southern
416 hemisphere; I tested using Africa/Windhoek.)
417 """
418
419 * Lib/test/output/test_gzip:
420 Jonathan Giddy discovered this file was missing.
421
422 * Modules/shamodule.c:
423 Avoid warnings from AIX compiler. Reported by Vladimir (AIX is my
424 middlename) Marangozov, patch coded by Greg Stein.
425
426 * Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py:
427 At Tim Peters' recommendation, add a dummy flush() method to PseudoFile.
428
429Sun Mar 28 17:55:32 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
430
431 * Tools/scripts/ndiff.py: Tim Peters writes:
432
433 I should have waited overnight <wink/sigh>. Nothing wrong with the one I
434 sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options
435 for recreating the original files from ndiff's output. That's attached, if
436 you're game! Us Windows guys don't usually have a sed sitting around
437 <wink>.
438
439Sat Mar 27 13:34:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
440
441 * Tools/scripts/ndiff.py: Tim Peters writes:
442
443 Attached is a cleaned-up version of ndiff (added useful module
444 docstring, now echo'ed in case of cmd line mistake); added -q option
445 to suppress initial file identification lines; + other minor cleanups,
446 & a slightly faster match engine.
447
448Fri Mar 26 22:36:00 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
449
450 * Tools/scripts/dutree.py:
451 During display, if EPIPE is raised, it's probably because a pager was
452 killed. Discard the error in that case, but propogate it otherwise.
453
454Fri Mar 26 16:20:45 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
455
456 * Lib/test/output/test_userlist, Lib/test/test_userlist.py:
457 Test suite for UserList.
458
459 * Lib/UserList.py: Use isinstance() where appropriate.
460 Reformatted with 4-space indent.
461
462Fri Mar 26 16:11:40 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
463
464 * Tools/pynche/PyncheWidget.py:
465 Helpwin.__init__(): The text widget should get focus.
466
467 * Tools/pynche/pyColorChooser.py:
468 Removed unnecessary import `from PyncheWidget import PyncheWidget'
469
470Fri Mar 26 15:32:05 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
471
472 * Lib/test/output/test_userdict, Lib/test/test_userdict.py:
473 Test suite for UserDict
474
475 * Lib/UserDict.py: Improved a bunch of things.
476 The constructor now takes an optional dictionary.
477 Use isinstance() where appropriate.
478
479Thu Mar 25 22:38:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
480
481 * Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py:
482 Basic regr tests for pickle/cPickle
483
484 * Lib/pickle.py:
485 Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
486 points out) it doesn't work in JPython Applets.
487
488Thu Mar 25 21:50:27 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
489
490 * Lib/test/test_gzip.py:
491 Added a simple test suite for gzip. It simply opens a temp file,
492 writes a chunk of compressed data, closes it, writes another chunk, and
493 reads the contents back to verify that they are the same.
494
495 * Lib/gzip.py:
496 Based on a suggestion from bruce@hams.com, make a trivial change to
497 allow using the 'a' flag as a mode for opening a GzipFile. gzip
498 files, surprisingly enough, can be concatenated and then decompressed;
499 the effect is to concatenate the two chunks of data.
500
501 If we support it on writing, it should also be supported on reading.
502 This *wasn't* trivial, and required rearranging the code in the
503 reading path, particularly the _read() method.
504
505 Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
506 and 'Unknown compression method'
507
508Thu Mar 25 21:25:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
509
510 * Lib/test/test_b1.py:
511 Add tests for float() and complex() with string args (Nick/Stephanie
512 Lockwood).
513
514Thu Mar 25 21:21:08 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
515
516 * Modules/zlibmodule.c:
517 Add an .unused_data attribute to decompressor objects. If .unused_data
518 is not an empty string, this means that you have arrived at the
519 end of the stream of compressed data, and the contents of .unused_data are
520 whatever follows the compressed stream.
521
522Thu Mar 25 21:16:07 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
523
524 * Python/bltinmodule.c:
525 Patch by Nick and Stephanie Lockwood to implement complex() with a string
526 argument. This closes TODO item 2.19.
527
528Wed Mar 24 19:09:00 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
529
530 * Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker.
531 Unfortunately his code breaks wcgui.py in a way that's not easy
532 to fix. I expect that this is a temporary situation --
533 eventually Sam's changes will be merged back in.
534 (The changes add a -t option to specify exceptions to the -x
535 option, and explicit checking for #foo style fragment ids.)
536
537 * Objects/dictobject.c:
538 Vladimir Marangozov contributed updated comments.
539
540 * Objects/bufferobject.c: Folded long lines.
541
542 * Lib/test/output/test_sha, Lib/test/test_sha.py:
543 Added Jeremy's test code for the sha module.
544
545 * Modules/shamodule.c, Modules/Setup.in:
546 Added Greg Stein and Andrew Kuchling's sha module.
547 Fix comments about zlib version and URL.
548
549 * Lib/test/test_bsddb.py: Remove the temp file when we're done.
550
551 * Include/pythread.h: Conform to standard boilerplate.
552
553 * configure.in, configure, BeOS/linkmodule, BeOS/ar-fake:
554 Chris Herborth: the new compiler in R4.1 needs some new options to work...
555
556 * Modules/socketmodule.c:
557 Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
558 data struct before calling gethostby{name,addr}_r(); (2) ignore the
559 3/5/6 args determinations made by the configure script and switch on
560 platform identifiers instead:
561
562 AIX, OSF have 3 args
563 Sun, SGI have 5 args
564 Linux has 6 args
565
566 On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
567
568 * Modules/socketmodule.c:
569 Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.
570
571 * Lib/mailbox.py:
572 Add readlines() to _Subfile class. Not clear who would need it, but
573 Chris Lawrence sent me a broken version; this one is a tad simpler and
574 more conforming to the standard.
575
576Tue Mar 23 23:05:34 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
577
578 * Lib/gzip.py: use struct instead of bit-manipulate in Python
579
580Tue Mar 23 19:00:55 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
581
582 * Modules/Makefile.pre.in:
583 Add $(EXE) to various occurrences of python so it will work on Cygwin
584 with egcs (after setting EXE=.exe). Patch by Norman Vine.
585
586 * configure, configure.in:
587 Ack! It never defined HAVE_GETHOSTBYNAME_R so that code was never tested!
588
589Mon Mar 22 22:25:39 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
590
591 * Include/thread.h:
592 Adding thread.h -- unused but for b/w compatibility.
593 As requested by Bill Janssen.
594
595 * configure.in, configure:
596 Add code to test for all sorts of gethostbyname_r variants,
597 donated by David Arnold.
598
599 * config.h.in, acconfig.h:
600 Add symbols for gethostbyname_r variants (sigh).
601
602 * Modules/socketmodule.c: Clean up pass for the previous patches.
603
604 - Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
605 glibc2.
606
607 - If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
608 don't know what code should be used.
609
610 - New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
611
612 - Modify the gethostbyaddr() code to also hold on to the lock until
613 after it is safe to release, overlapping with the Python lock.
614
615 (Note: I think that it could in theory be possible that Python code
616 executed while gethostbyname_lock is held could attempt to reacquire
617 the lock -- e.g. in a signal handler or destructor. I will simply say
618 "don't do that then.")
619
620 * Modules/socketmodule.c: Jonathan Giddy writes:
621
622 Here's a patch to fix the race condition, which wasn't fixed by Rob's
623 patch. It holds the gethostbyname lock until the results are copied out,
624 which means that this lock and the Python global lock are held at the same
625 time. This shouldn't be a problem as long as the gethostbyname lock is
626 always acquired when the global lock is not held.
627
628Mon Mar 22 19:25:30 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
629
630 * Modules/zlibmodule.c:
631 Fixed the flush() method of compression objects; the test for
632 the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
633 Logic cleaned up and commented.
634
635 * Lib/test/test_zlib.py:
636 Added simple test for the flush() method of compression objects, trying the
637 different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
638
639Mon Mar 22 15:28:08 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
640
641 * Lib/shlex.py:
642 Bug reported by Tobias Thelen: missing "self." in assignment target.
643
644Fri Mar 19 21:50:11 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
645
646 * Modules/arraymodule.c:
647 Use an unsigned cast to avoid a warning in VC++.
648
649 * Lib/dospath.py, Lib/ntpath.py:
650 New code for split() by Tim Peters, behaves more like posixpath.split().
651
652 * Objects/floatobject.c:
653 Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
654 a block cannot be freed, add its free items back to the free list.
655 This is necessary to avoid leaking when Python is reinitialized later.
656
657 * Objects/intobject.c:
658 Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
659 a block cannot be freed, add its free items back to the free list, and
660 add its valid ints back to the small_ints array if they are in range.
661 This is necessary to avoid leaking when Python is reinitialized later.
662
663 * Lib/types.py:
664 Added BufferType, the type returned by the new builtin buffer(). Greg Stein.
665
666 * Python/bltinmodule.c:
667 New builtin buffer() creates a derived read-only buffer from any
668 object that supports the buffer interface (e.g. strings, arrays).
669
670 * Objects/bufferobject.c:
671 Added check for negative offset for PyBuffer_FromObject and check for
672 negative size for PyBuffer_FromMemory. Greg Stein.
673
674Thu Mar 18 15:10:44 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
675
676 * Lib/urlparse.py: Sjoerd Mullender writes:
677
678 If a filename on Windows starts with \\, it is converted to a URL
679 which starts with ////. If this URL is passed to urlparse.urlparse
680 you get a path that starts with // (and an empty netloc). If you pass
681 the result back to urlparse.urlunparse, you get a URL that starts with
682 //, which is parsed differently by urlparse.urlparse. The fix is to
683 add the (empty) netloc with accompanying slashes if the path in
684 urlunparse starts with //. Do this for all schemes that use a netloc.
685
686 * Lib/nturl2path.py: Sjoerd Mullender writes:
687
688 Pathnames of files on other hosts in the same domain
689 (\\host\path\to\file) are not translated correctly to URLs and back.
690 The URL should be something like file:////host/path/to/file.
691 Note that a combination of drive letter and remote host is not
692 possible.
693
694Wed Mar 17 22:30:10 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
695
696 * Lib/urlparse.py:
697 Delete non-standard-conforming code in urljoin() that would use the
698 netloc from the base url as the default netloc for the resulting url
699 even if the schemes differ.
700
701 Once upon a time, when the web was wild, this was a valuable hack
702 because some people had a URL referencing an ftp server colocated with
703 an http server without having the host in the ftp URL (so they could
704 replicate it or change the hostname easily).
705
706 More recently, after the file: scheme got added back to the list of
707 schemes that accept a netloc, it turns out that this caused weirdness
708 when joining an http: URL with a file: URL -- the resulting file: URL
709 would always inherit the host from the http: URL because the file:
710 scheme supports a netloc but in practice never has one.
711
712 There are two reasons to get rid of the old, once-valuable hack,
713 instead of removing the file: scheme from the uses_netloc list. One,
714 the RFC says that file: uses the netloc syntax, and does not endorse
715 the old hack. Two, neither netscape 4.5 nor IE 4.0 support the old
716 hack.
717
718 * Include/ceval.h, Include/abstract.h:
719 Add DLL level b/w compat for PySequence_In and PyEval_CallObject
720
721Tue Mar 16 21:54:50 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
722
723 * Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson:
724
725 An attempt to execute grid_slaves with arguments (0,0) results in
726 *all* of the slaves being returned, not just the slave associated with
727 row 0, column 0. This is because the test for arguments in the method
728 does not test to see if row (and column) does not equal None, but
729 rather just whether is evaluates to non-false. A value of 0 fails
730 this test.
731
732Tue Mar 16 14:17:48 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
733
734 * Modules/cmathmodule.c:
735 Docstring fix: acosh() returns the hyperbolic arccosine, not the
736 hyperbolic cosine. Problem report via David Ascher by one of his
737 students.
738
739Mon Mar 15 21:40:59 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
740
741 * configure.in:
742 Should test for gethost*by*name_r, not for gethostname_r (which
743 doesn't exist and doesn't make sense).
744
745 * Modules/socketmodule.c:
746 Patch by Rob Riggs for Linux -- glibc2 has a different argument
747 converntion for gethostbyname_r() etc. than Solaris!
748
749 * Python/thread_pthread.h: Rob Riggs wrote:
750
751 """
752 Spec says that on success pthread_create returns 0. It does not say
753 that an error code will be < 0. Linux glibc2 pthread_create() returns
754 ENOMEM (12) when one exceed process limits. (It looks like it should
755 return EAGAIN, but that's another story.)
756
757 For reference, see:
758 http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
759 """
760
761 [I have a feeling that similar bugs were fixed before; perhaps someone
762 could check that all error checks no check for != 0?]
763
764 * Tools/bgen/bgen/bgenObjectDefinition.py:
765 New mixin class that defines cmp and hash that use
766 the ob_itself pointer. This allows (when using the mixin)
767 different Python objects pointing to the same C object and
768 behaving well as dictionary keys.
769
770 Or so sez Jack Jansen...
771
772 * Lib/urllib.py: Yet another patch by Sjoerd Mullender:
773
774 Don't convert URLs to URLs using pathname2url.
775
776Fri Mar 12 22:15:43 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
777
778 * Lib/cmd.py: Patch by Michael Scharf. He writes:
779
780 The module cmd requires for each do_xxx command a help_xxx
781 function. I think this is a little old fashioned.
782
783 Here is a patch: use the docstring as help if no help_xxx
784 function can be found.
785
786 [I'm tempted to rip out all the help_* functions from pdb, but I'll
787 resist it. Any takers? --Guido]
788
789 * Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes:
790
791 Under Windows, python freeze.py -o hello hello.py
792 creates all the correct files in the hello subdirectory, but the
793 Makefile has the directory prefix in it for frozen_extensions.c
794 nmake fails because it tries to locate hello/frozen_extensions.c
795
796 (His fix adds a call to os.path.basename() in the appropriate place.)
797
798 * Objects/floatobject.c, Objects/intobject.c:
799 Vladimir has restructured his code somewhat so that the blocks are now
800 represented by an explicit structure. (There are still too many casts
801 in the code, but that may be unavoidable.)
802
803 Also added code so that with -vv it is very chatty about what it does.
804
805 * Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py:
806 Change #! line to modern usage; also chmod +x
807
808 * Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump:
809 Change #! line to modern usage
810
811 * Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender
812
813 The filename to URL conversion didn't properly quote special
814 characters.
815 The URL to filename didn't properly unquote special chatacters.
816
817 * Objects/floatobject.c:
818 OK, try again. Vladimir gave me a fix for the alignment bus error,
819 so here's his patch again. This time it works (at least on Solaris,
820 Linux and Irix).
821
822Thu Mar 11 23:21:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
823
824 * Tools/idle/PathBrowser.py:
825 Don't crash when sys.path contains an empty string.
826
827 * Tools/idle/PathBrowser.py:
828 - Don't crash in the case where a superclass is a string instead of a
829 pyclbr.Class object; this can happen when the superclass is
830 unrecognizable (to pyclbr), e.g. when module renaming is used.
831
832 - Show a watch cursor when calling pyclbr (since it may take a while
833 recursively parsing imported modules!).
834
835Thu Mar 11 16:04:04 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
836
837 * Lib/mimetypes.py:
838 Added .rdf and .xsl as application/xml types. (.rdf is for the
839 Resource Description Framework, a metadata encoding, and .xsl is for
840 the Extensible Stylesheet Language.)
841
842Thu Mar 11 13:26:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
843
844 * Lib/test/output/test_popen2, Lib/test/test_popen2.py:
845 Test for popen2 module, by Chris Tismer.
846
847 * Objects/floatobject.c:
848 Alas, Vladimir's patch caused a bus error (probably double
849 alignment?), and I didn't test it. Withdrawing it for now.
850
851Wed Mar 10 22:55:47 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
852
853 * Objects/floatobject.c:
854 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
855 floats on finalization.
856
857 * Objects/intobject.c:
858 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
859 integers on finalization.
860
861 * Tools/idle/EditorWindow.py, Tools/idle/Bindings.py:
862 Add PathBrowser to File module
863
864 * Tools/idle/PathBrowser.py:
865 "Path browser" - 4 scrolled lists displaying:
866 directories on sys.path
867 modules in selected directory
868 classes in selected module
869 methods of selected class
870
871 Sinlge clicking in a directory, module or class item updates the next
872 column with info about the selected item. Double clicking in a
873 module, class or method item opens the file (and selects the clicked
874 item if it is a class or method).
875
876 I guess eventually I should be using a tree widget for this, but the
877 ones I've seen don't work well enough, so for now I use the old
878 Smalltalk or NeXT style multi-column hierarchical browser.
879
880 * Tools/idle/MultiScrolledLists.py:
881 New utility: multiple scrolled lists in parallel
882
883 * Tools/idle/ScrolledList.py: - White background.
884 - Display "(None)" (or text of your choosing) when empty.
885 - Don't set the focus.
886
887Tue Mar 9 19:31:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
888
889 * Lib/urllib.py:
890 open_http also had the 'data is None' test backwards. don't call with the
891 extra argument if data is None.
892
893 * Demo/embed/demo.c:
894 Call Py_SetProgramName() instead of redefining getprogramname(),
895 reflecting changes in the runtime around 1.5 or earlier.
896
897 * Python/ceval.c:
898 Always test for an error return (usually NULL or -1) without setting
899 an exception.
900
901 * Modules/timemodule.c: Patch by Chris Herborth for BeOS code.
902 He writes:
903
904 I had an off-by-1000 error in floatsleep(),
905 and the problem with time.clock() is that it's not implemented properly
906 on QNX... ANSI says it's supposed to return _CPU_ time used by the
907 process, but on QNX it returns the amount of real time used... so I was
908 confused.
909
910 * Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen.
911 Test for self.returntype behaving like OSErr rather than being it.
912
913Thu Feb 25 16:14:58 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
914
915 * Lib/urllib.py:
916 http_error had the 'data is None' test backwards. don't call with the
917 extra argument if data is None.
918
919 * Lib/urllib.py: change indentation from 8 spaces to 4 spaces
920
921 * Lib/urllib.py: pleasing the tabnanny
922
923Thu Feb 25 14:26:02 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
924
925 * Lib/colorsys.py:
926 Oops, one more "x, y, z" to convert...
927
928 * Lib/colorsys.py:
929 Adjusted comment at the top to be less confusing, following Fredrik
930 Lundh's example.
931
932 Converted comment to docstring.
933
934Wed Feb 24 18:49:15 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
935
936 * Lib/toaiff.py:
937 Use sndhdr instead of the obsolete whatsound module.
938
939Wed Feb 24 18:42:38 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
940
941 * Lib/urllib.py:
942 When performing a POST request, i.e. when the second argument to
943 urlopen is used to specify form data, make sure the second argument is
944 threaded through all of the http_error_NNN calls. This allows error
945 handlers like the redirect and authorization handlers to properly
946 re-start the connection.
947
948Wed Feb 24 16:25:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
949
950 * Lib/mhlib.py: Patch by Lars Wirzenius:
951
952 o the initial comment is wrong: creating messages is already
953 implemented
954
955 o Message.getbodytext: if the mail or it's part contains an
956 empty content-transfer-encoding header, the code used to
957 break; the change below treats an empty encoding value the same
958 as the other types that do not need decoding
959
960 o SubMessage.getbodytext was missing the decode argument; the
961 change below adds it; I also made it unconditionally return
962 the raw text if decoding was not desired, because my own
963 routines needed that (and it was easier than rewriting my
964 own routines ;-)
965
966Wed Feb 24 00:35:43 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
967
968 * Python/bltinmodule.c (initerrors):
969 Make sure that the exception tuples ("base-classes" when
970 string-based exceptions are used) reflect the real class hierarchy,
971 i.e. that SystemExit derives from Exception not StandardError.
972
973 * Lib/exceptions.py:
974 Document the correct class hierarchy for SystemExit. It is not an
975 error and so it derives from Exception and not SystemError. The
976 docstring was incorrect but the implementation was fine.
977
978Tue Feb 23 23:07:51 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
979
980 * Lib/shutil.py:
981 Add import sys, needed by reference to sys.exc_info() in rmtree().
982 Discovered by Mitch Chapman.
983
984 * config.h.in:
985 Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol
986 disappears. It wasn't used anywhere anyway...
987
988 * Modules/arraymodule.c:
989 Carefully check for overflow when allocating the memory for fromfile
990 -- someone tried to pass in sys.maxint and got bitten by the bogus
991 calculations.
992
993 * configure.in:
994 Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with
995 LIBM (from --with-libm=...); this actually broke the customizability
996 offered by the latter option. Thanks go to Clay Spence for reporting
997 this.
998
999 * Lib/test/test_dl.py:
1000 1. Print the error message (carefully) when a dl.open() fails in verbose mode.
1001 2. When no test case worked, raise ImportError instead of failing.
1002
1003 * Python/bltinmodule.c:
1004 Patch by Tim Peters to improve the range checks for range() and
1005 xrange(), especially for platforms where int and long are different
1006 sizes (so sys.maxint isn't actually the theoretical limit for the
1007 length of a list, but the largest C int is -- sys.maxint is the
1008 largest Python int, which is actually a C long).
1009
1010 * Makefile.in:
1011 1. Augment the DG/UX rule so it doesn't break the BeOS build.
1012 2. Add $(EXE) to various occurrences of python so it will work on
1013 Cygwin with egcs (after setting EXE=.exe). These patches by
1014 Norman Vine.
1015
1016 * Lib/posixfile.py:
1017 According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
1018 list (of bsd variants that have a different lock structure).
1019
1020 * Lib/test/test_fcntl.py:
1021 According to Jeffrey Honig, bsd/os 4.0 should be added to the list.
1022
1023 * Modules/timemodule.c:
1024 Patch by Tadayoshi Funaba (with some changes) to be smarter about
1025 guessing what happened when strftime() returns 0. Is it buffer
1026 overflow or was the result simply 0 bytes long? (This happens for an
1027 empty format string, or when the format string is a single %Z and the
1028 timezone is unknown.) if the buffer is at least 256 times as long as
1029 the format, assume the latter.
1030
1031Mon Feb 22 19:01:42 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1032
1033 * Lib/urllib.py:
1034 As Des Barry points out, we need to call pathname2url(file) in two
1035 calls to addinfourl() in open_file().
1036
1037 * Modules/Setup.in: Document *static* -- in two places!
1038
1039 * Modules/timemodule.c:
1040 We don't support leap seconds, so the seconds field of a time 9-tuple
1041 should be in the range [0-59]. Noted by Tadayoshi Funaba.
1042
1043 * Modules/stropmodule.c:
1044 In atoi(), don't use isxdigit() to test whether the last character
1045 converted was a "digit" -- use isalnum(). This test is there only to
1046 guard against "+" or "-" being interpreted as a valid int literal.
1047 Reported by Takahiro Nakayama.
1048
1049 * Lib/os.py:
1050 As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
1051 so they don't need to be treated specially here.
1052
1053Mon Feb 22 15:38:58 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
1054
1055 * Misc/NEWS:
1056 Typo: "apparentlt" --> "apparently"
1057
1058Mon Feb 22 15:38:46 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
1059
1060 * Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc.
1061
1062 * Modules/posixmodule.c:
1063 The docstring for ttyname(..) claims a second "mode" argument. The
1064 actual code does not allow such an argument. (Finn Bock.)
1065
1066 * Lib/lib-old/poly.py:
1067 Dang. Even though this is obsolete code, somebody found a bug, and I
1068 fix it. Oh well.
1069
1070Thu Feb 18 20:51:50 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
1071
1072 * Lib/pyclbr.py:
1073 Bow to font-lock at the end of the docstring, since it throws stuff
1074 off.
1075
1076 Make sure the path paramter to readmodule() is a list before adding it
1077 with sys.path, or the addition could fail.
1078
1079
1080======================================================================
1081
1082
1083From 1.5.2b1 to 1.5.2b2
1084=======================
1085
1086General
1087-------
1088
1089- Many memory leaks fixed.
1090
1091- Many small bugs fixed.
1092
1093- Command line option -OO (or -O -O) suppresses inclusion of doc
1094strings in resulting bytecode.
1095
1096Windows-specific changes
1097------------------------
1098
1099- New built-in module winsound provides an interface to the Win32
1100PlaySound() call.
1101
1102- Re-enable the audioop module in the config.c file.
1103
1104- On Windows, support spawnv() and associated P_* symbols.
1105
1106- Fixed the conversion of times() return values on Windows.
1107
1108- Removed freeze from the installer -- it doesn't work without the
1109source tree. (See FAQ 8.11.)
1110
1111- On Windows 95/98, the Tkinter module now is smart enough to find
1112Tcl/Tk even when the PATH environment variable hasn't been set -- when
1113the import of _tkinter fails, it searches in a standard locations,
1114patches os.environ["PATH"], and tries again. When it still fails, a
1115clearer error message is produced. This should avoid most
1116installation problems with Tkinter use (e.g. in IDLE).
1117
1118- The -i option doesn't make any calls to set[v]buf() for stdin --
1119this apparently screwed up _kbhit() and the _tkinter main loop.
1120
1121- The ntpath module (and hence, os.path on Windows) now parses out UNC
1122paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
1123splitdrive() will \\host\mountpoint as the drive and \dir\file as the
1124path. ** EXPERIMENTAL **
1125
1126- Added a hack to the exit code so that if (1) the exit status is
1127nonzero and (2) we think we have our own DOS box (i.e. we're not
1128started from a command line shell), we print a message and wait for
1129the user to hit a key before the DOS box is closed.
1130
1131- Updated the installer to WISE 5.0g. Added a dialog warning about
1132the imminent Tcl installation. Added a dialog to specify the program
1133group name in the start menu. Upgraded the Tcl installer to Tcl
11348.0.4.
1135
1136Changes to intrinsics
1137---------------------
1138
1139- The repr() or str() of a module object now shows the __file__
1140attribute (i.e., the file which it was loaded), or the string
1141"(built-in)" if there is no __file__ attribute.
1142
1143- The range() function now avoids overflow during its calculations (if
1144at all possible).
1145
1146- New info string sys.hexversion, which is an integer encoding the
1147version in hexadecimal. In other words, hex(sys.hexversion) ==
11480x010502b2 for Python 1.5.2b2.
1149
1150New or improved ports
1151---------------------
1152
1153- Support for Nextstep descendants (future Mac systems).
1154
1155- Improved BeOS support.
1156
1157- Support dynamic loading of shared libraries on NetBSD platforms that
1158use ELF (i.e., MIPS and Alpha systems).
1159
1160Configuration/build changes
1161---------------------------
1162
1163- The Lib/test directory is no longer included in the default module
1164search path (sys.path) -- "test" has been a package ever since 1.5.
1165
1166- Now using autoconf 2.13.
1167
1168New library modules
1169-------------------
1170
1171- New library modules asyncore and asynchat: these form Sam Rushing's
1172famous asynchronous socket library. Sam has gracefully allowed me to
1173incorporate these in the standard Python library.
1174
1175- New module statvfs contains indexing constants for [f]statvfs()
1176return tuple.
1177
1178Changes to the library
1179----------------------
1180
1181- The wave module (platform-independent support for Windows sound
1182files) has been fixed to actually make it work.
1183
1184- The sunau module (platform-independent support for Sun/NeXT sound
1185files) has been fixed to work across platforms. Also, a weird
1186encoding bug in the header of the audio test data file has been
1187corrected.
1188
1189- Fix a bug in the urllib module that occasionally tripped up
1190webchecker and other ftp retrieves.
1191
1192- ConfigParser's get() method now accepts an optional keyword argument
1193(vars) that is substituted on top of the defaults that were setup in
1194__init__. You can now also have recusive references in your
1195configuration file.
1196
1197- Some improvements to the Queue module, including a put_nowait()
1198module and an optional "block" second argument, to get() and put(),
1199defaulting to 1.
1200
1201- The updated xmllib module is once again compatible with the version
1202present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
1203
1204- The bdb module (base class for the debugger) now supports
1205canonicalizing pathnames used in breakpoints. The derived class must
1206override the new canonical() method for this to work. Also changed
1207clear_break() to the backwards compatible old signature, and added
1208clear_bpbynumber() for the new functionality.
1209
1210- In sgmllib (and hence htmllib), recognize attributes even if they
1211don't have space in front of them. I.e. '<a
1212name="foo"href="bar.html">' will now have two attributes recognized.
1213
1214- In the debugger (pdb), change clear syntax to support three
1215alternatives: clear; clear file:line; clear bpno bpno ...
1216
1217- The os.path module now pretends to be a submodule within the os
1218"package", so you can do things like "from os.path import exists".
1219
1220- The standard exceptions now have doc strings.
1221
1222- In the smtplib module, exceptions are now classes. Also avoid
1223inserting a non-standard space after "TO" in rcpt() command.
1224
1225- The rfc822 module's getaddrlist() method now uses all occurrences of
1226the specified header instead of just the first. Some other bugfixes
1227too (to handle more weird addresses found in a very large test set,
1228and to avoid crashes on certain invalid dates), and a small test
1229module has been added.
1230
1231- Fixed bug in urlparse in the common-case code for HTTP URLs; it
1232would lose the query, fragment, and/or parameter information.
1233
1234- The sndhdr module no longer supports whatraw() -- it depended on a
1235rare extenral program.
1236
1237- The UserList module/class now supports the extend() method, like
1238real list objects.
1239
1240- The uu module now deals better with trailing garbage generated by
1241some broke uuencoders.
1242
1243- The telnet module now has an my_interact() method which uses threads
1244instead of select. The interact() method uses this by default on
1245Windows (where the single-threaded version doesn't work).
1246
1247- Add a class to mailbox.py for dealing with qmail directory
1248mailboxes. The test code was extended to notice these being used as
1249well.
1250
1251Changes to extension modules
1252----------------------------
1253
1254- Support for the [f]statvfs() system call, where it exists.
1255
1256- Fixed some bugs in cPickle where bad input could cause it to dump
1257core.
1258
1259- Fixed cStringIO to make the writelines() function actually work.
1260
1261- Added strop.expandtabs() so string.expandtabs() is now much faster.
1262
1263- Added fsync() and fdatasync(), if they appear to exist.
1264
1265- Support for "long files" (64-bit seek pointers).
1266
1267- Fixed a bug in the zlib module's flush() function.
1268
1269- Added access() system call. It returns 1 if access granted, 0 if
1270not.
1271
1272- The curses module implements an optional nlines argument to
1273w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
1274
1275Changes to tools
1276----------------
1277
1278- Some changes to IDLE; see Tools/idle/NEWS.txt.
1279
1280- Latest version of Misc/python-mode.el included.
1281
1282Changes to Tkinter
1283------------------
1284
1285- Avoid tracebacks when an image is deleted after its root has been
1286destroyed.
1287
1288Changes to the Python/C API
1289---------------------------
1290
1291- When parentheses are used in a PyArg_Parse[Tuple]() call, any
1292sequence is now accepted, instead of requiring a tuple. This is in
1293line with the general trend towards accepting arbitrary sequences.
1294
1295- Added PyModule_GetFilename().
1296
1297- In PyNumber_Power(), remove unneeded and even harmful test for float
1298to the negative power (which is already and better done in
1299floatobject.c).
1300
1301- New version identification symbols; read patchlevel.h for info. The
1302version numbers are now exported by Python.h.
1303
1304- Rolled back the API version change -- it's back to 1007!
1305
1306- The frozenmain.c function calls PyInitFrozenExtensions().
1307
1308- Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
1309INCREF.
1310
1311
1312======================================================================
1313
1314
1315From 1.5.2a2 to 1.5.2b1
1316=======================
1317
1318Changes to intrinsics
1319---------------------
1320
1321- New extension NotImplementedError, derived from RuntimeError. Not
1322used, but recommended use is for "abstract" methods to raise this.
1323
1324- The parser will now spit out a warning or error when -t or -tt is
1325used for parser input coming from a string, too.
1326
1327- The code generator now inserts extra SET_LINENO opcodes when
1328compiling multi-line argument lists.
1329
1330- When comparing bound methods, use identity test on the objects, not
1331equality test.
1332
1333New or improved ports
1334---------------------
1335
1336- Chris Herborth has redone his BeOS port; it now works on PowerPC
1337(R3/R4) and x86 (R4 only). Threads work too in this port.
1338
1339Renaming
1340--------
1341
1342- Thanks to Chris Herborth, the thread primitives now have proper Py*
1343names in the source code (they already had those for the linker,
1344through some smart macros; but the source still had the old, un-Py
1345names).
1346
1347Configuration/build changes
1348---------------------------
1349
1350- Improved support for FreeBSD/3.
1351
1352- Check for pthread_detach instead of pthread_create in libc.
1353
1354- The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
1355
1356- Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
1357Otherwise modules such as thread didn't get incorporated in extensions.
1358
1359New library modules
1360-------------------
1361
1362- shlex.py by Eric Raymond provides a lexical analyzer class for
1363simple shell-like syntaxes.
1364
1365- netrc.py by Eric Raymond provides a parser for .netrc files. (The
1366undocumented Netrc class in ftplib.py is now obsolete.)
1367
1368- codeop.py is a new module that contains the compile_command()
1369function that was previously in code.py. This is so that JPython can
1370provide its own version of this function, while still sharing the
1371higher-level classes in code.py.
1372
1373- turtle.py is a new module for simple turtle graphics. I'm still
1374working on it; let me know if you use this to teach Python to children
1375or other novices without prior programming experience.
1376
1377Obsoleted library modules
1378-------------------------
1379
1380- poly.py and zmod.py have been moved to Lib/lib-old to emphasize
1381their status of obsoleteness. They don't do a particularly good job
1382and don't seem particularly relevant to the Python core.
1383
1384New tools
1385---------
1386
1387- I've added IDLE: my Integrated DeveLopment Environment for Python.
1388Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should
1389work on Macintosh, but I haven't been able to test it there; it does
1390depend on new features in 1.5.2 and perhaps even new features in
13911.5.2b1, especially the new code module). This is very much a work in
1392progress. I'd like to hear how people like it compared to PTUI (or
1393any other IDE they are familiar with).
1394
1395- New tools by Barry Warsaw:
1396
1397 = audiopy: controls the Solaris Audio device
1398 = pynche: The PYthonically Natural Color and Hue Editor
1399 = world: Print mappings between country names and DNS country codes
1400
1401New demos
1402---------
1403
1404- Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
1405song.
1406
1407- Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
1408Tkinter. (By Fredrik Lundh -- not by me!)
1409
1410Changes to the library
1411----------------------
1412
1413- compileall.py now avoids recompiling .py files that haven't changed;
1414it adds a -f option to force recompilation.
1415
1416- New version of xmllib.py by Sjoerd Mullender (0.2 with latest
1417patches).
1418
1419- nntplib.py: statparse() no longer lowercases the message-id.
1420
1421- types.py: use type(__stdin__) for FileType.
1422
1423- urllib.py: fix translations for filenames with "funny" characters.
1424Patch by Sjoerd Mullender. Note that if you subclass one of the
1425URLopener classes, and you have copied code from the old urllib.py,
1426your subclass may stop working. A long-term solution is to provide
1427more methods so that you don't have to copy code.
1428
1429- cgi.py: In read_multi, allow a subclass to override the class we
1430instantiate when we create a recursive instance, by setting the class
1431variable 'FieldStorageClass' to the desired class. By default, this
1432is set to None, in which case we use self.__class__ (as before).
1433Also, a patch by Jim Fulton to pass additional arguments to recursive
1434calls to the FieldStorage constructor from its read_multi method.
1435
1436- UserList.py: In __getslice__, use self.__class__ instead of
1437UserList.
1438
1439- In SimpleHTTPServer.py, the server specified in test() should be
1440BaseHTTPServer.HTTPServer, in case the request handler should want to
1441reference the two attributes added by BaseHTTPServer.server_bind. (By
1442Jeff Rush, for Bobo). Also open the file in binary mode, so serving
1443images from a Windows box might actually work.
1444
1445- In CGIHTTPServer.py, the list of acceptable formats is -split-
1446on spaces but -joined- on commas, resulting in double commas
1447in the joined text. (By Jeff Rush.)
1448
1449- SocketServer.py, patch by Jeff Bauer: a minor change to declare two
1450new threaded versions of Unix Server classes, using the ThreadingMixIn
1451class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
1452
1453- bdb.py: fix bomb on deleting a temporary breakpoint: there's no
1454method do_delete(); do_clear() was meant. By Greg Ward.
1455
1456- getopt.py: accept a non-list sequence for the long options (request
1457by Jack Jansen). Because it might be a common mistake to pass a
1458single string, this situation is treated separately. Also added
1459docstrings (copied from the library manual) and removed the (now
1460redundant) module comments.
1461
1462- tempfile.py: improvements to avoid security leaks.
1463
1464- code.py: moved compile_command() to new module codeop.py.
1465
1466- pickle.py: support pickle format 1.3 (binary float added). By Jim
1467Fulton. Also get rid of the undocumented obsolete Pickler dump_special
1468method.
1469
1470- uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
1471
1472- imaplib.py: fix problem with some versions of IMAP4 servers that
1473choose to mix the case in their CAPABILITIES response.
1474
1475- cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted
1476by Fredrik Lundh.
1477
1478Changes to extension modules
1479----------------------------
1480
1481- More doc strings for several modules were contributed by Chris
1482Petrilli: math, cmath, fcntl.
1483
1484- Fixed a bug in zlibmodule.c that could cause core dumps on
1485decompression of rarely occurring input.
1486
1487- cPickle.c: new version from Jim Fulton, with Open Source copyright
1488notice. Also, initialize self->safe_constructors early on to prevent
1489crash in early dealloc.
1490
1491- cStringIO.c: new version from Jim Fulton, with Open Source copyright
1492notice. Also fixed a core dump in cStringIO.c when doing seeks.
1493
1494- mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
1495
1496- readline.c: Bernard Herzog pointed out that rl_parse_and_bind
1497modifies its argument string (bad function!), so we make a temporary
1498copy.
1499
1500- sunaudiodev.c: Barry Warsaw added more smarts to get the device and
1501control pseudo-device, per audio(7I).
1502
1503Changes to tools
1504----------------
1505
1506- New, improved version of Barry Warsaw's Misc/python-mode.el (editing
1507support for Emacs).
1508
1509- tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
1510only the names of offending files to be printed.
1511
1512- freeze: when printing missing modules, also print the module they
1513were imported from.
1514
1515- untabify.py: patch by Detlef Lannert to implement -t option
1516(set tab size).
1517
1518Changes to Tkinter
1519------------------
1520
1521- grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
1522row2?
1523
1524- _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
1525doesn't work when running in a non-threaded environment. He added
1526some #ifdefs that fix this.
1527
1528Changes to the Python/C API
1529---------------------------
1530
1531- Bumped API version number to 1008 -- enough things have changed!
1532
1533- There's a new macro, PyThreadState_GET(), which does the same work
1534as PyThreadState_Get() without the overhead of a function call (it
1535also avoids the error check). The two top calling locations of
1536PyThreadState_Get() have been changed to use this macro.
1537
1538- All symbols intended for export from a DLL or shared library are now
1539marked as such (with the DL_IMPORT() macro) in the header file that
1540declares them. This was needed for the BeOS port, and should also
1541make some other ports easier. The PC port no longer needs the file
1542with exported symbols (PC/python_nt.def). There's also a DL_EXPORT
1543macro which is only used for init methods in extension modules, and
1544for Py_Main().
1545
1546Invisible changes to internals
1547------------------------------
1548
1549- Fixed a bug in new_buffersize() in fileobject.c which could
1550return a buffer size that was way too large.
1551
1552- Use PySys_WriteStderr instead of fprintf in most places.
1553
1554- dictobject.c: remove dead code discovered by Vladimir Marangozov.
1555
1556- tupleobject.c: make tuples less hungry -- an extra item was
1557allocated but never used. Tip by Vladimir Marangozov.
1558
1559- mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack
1560Jansen)
1561
1562- import.c: Jim Fulton fixes a reference count bug in
1563PyEval_GetGlobals.
1564
1565- glmodule.c: check in the changed version after running the stubber
1566again -- this solves the conflict with curses over the 'clear' entry
1567point much nicer. (Jack Jansen had checked in the changes to cstubs
1568eons ago, but I never regenrated glmodule.c :-( )
1569
1570- frameobject.c: fix reference count bug in PyFrame_New. Vladimir
1571Marangozov.
1572
1573- stropmodule.c: add a missing DECREF in an error exit. Submitted by
1574Jonathan Giddy.
1575
1576
1577======================================================================
1578
1579
1580From 1.5.2a1 to 1.5.2a2
1581=======================
1582
1583General
1584-------
1585
1586- It is now a syntax error to have a function argument without a
1587default following one with a default.
1588
1589- __file__ is now set to the .py file if it was parsed (it used to
1590always be the .pyc/.pyo file).
1591
1592- Don't exit with a fatal error during initialization when there's a
1593problem with the exceptions.py module.
1594
1595- New environment variable PYTHONOPTIMIZE can be used to set -O.
1596
1597- New version of python-mode.el for Emacs.
1598
1599Miscellaneous fixed bugs
1600------------------------
1601
1602- No longer print the (confusing) error message about stack underflow
1603while compiling.
1604
1605- Some threading and locking bugs fixed.
1606
1607- When errno is zero, report "Error", not "Success".
1608
1609Documentation
1610-------------
1611
1612- Documentation will be released separately.
1613
1614- Doc strings added to array and md5 modules by Chris Petrilli.
1615
1616Ports and build procedure
1617-------------------------
1618
1619- Stop installing when a move or copy fails.
1620
1621- New version of the OS/2 port code by Jeff Rush.
1622
1623- The makesetup script handles absolute filenames better.
1624
1625- The 'new' module is now enabled by default in the Setup file.
1626
1627- I *think* I've solved the problem with the Linux build blowing up
1628sometimes due to a conflict between sigcheck/intrcheck and
1629signalmodule.
1630
1631Built-in functions
1632------------------
1633
1634- The second argument to apply() can now be any sequence, not just a
1635tuple.
1636
1637Built-in types
1638--------------
1639
1640- Lists have a new method: L1.extend(L2) is equivalent to the common
1641idiom L1[len(L1):] = L2.
1642
1643- Better error messages when a sequence is indexed with a non-integer.
1644
1645- Bettter error message when calling a non-callable object (include
1646the type in the message).
1647
1648Python services
1649---------------
1650
1651- New version of cPickle.c fixes some bugs.
1652
1653- pickle.py: improved instantiation error handling.
1654
1655- code.py: reworked quite a bit. New base class
1656InteractiveInterpreter and derived class InteractiveConsole. Fixed
1657several problems in compile_command().
1658
1659- py_compile.py: print error message and continue on syntax errors.
1660Also fixed an old bug with the fstat code (it was never used).
1661
1662- pyclbr.py: support submodules of packages.
1663
1664String Services
1665---------------
1666
1667- StringIO.py: raise the right exception (ValueError) for attempted
1668I/O on closed StringIO objects.
1669
1670- re.py: fixed a bug in subn(), which caused .groups() to fail inside
1671the replacement function called by sub().
1672
1673- The struct module has a new format 'P': void * in native mode.
1674
1675Generic OS Services
1676-------------------
1677
1678- Module time: Y2K robustness. 2-digit year acceptance depends on
1679value of time.accept2dyear, initialized from env var PYTHONY2K,
1680default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
1681(POSIX or X/Open recommendation).
1682
1683- os.path: normpath(".//x") should return "x", not "/x".
1684
1685- getpass.py: fall back on default_getpass() when sys.stdin.fileno()
1686doesn't work.
1687
1688- tempfile.py: regenerate the template after a fork() call.
1689
1690Optional OS Services
1691--------------------
1692
1693- In the signal module, disable restarting interrupted system calls
1694when we have siginterrupt().
1695
1696Debugger
1697--------
1698
1699- No longer set __args__; this feature is no longer supported and can
1700affect the debugged code.
1701
1702- cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
1703added aliases and some other useful new features, e.g. much better
1704breakpoint support: temporary breakpoint, disabled breakpoints,
1705breakpoints with ignore counts, and conditions; breakpoints can be set
1706on a file before it is loaded.
1707
1708Profiler
1709--------
1710
1711- Changes so that JPython can use it. Also fix the calibration code
1712so it actually works again
1713.
1714Internet Protocols and Support
1715------------------------------
1716
1717- imaplib.py: new version from Piers Lauder.
1718
1719- smtplib.py: change sendmail() method to accept a single string or a
1720list or strings as the destination (commom newbie mistake).
1721
1722- poplib.py: LIST with a msg argument fixed.
1723
1724- urlparse.py: some optimizations for common case (http).
1725
1726- urllib.py: support content-length in info() for ftp protocol;
1727support for a progress meter through a third argument to
1728urlretrieve(); commented out gopher test (the test site is dead).
1729
1730Internet Data handling
1731----------------------
1732
1733- sgmllib.py: support tags with - or . in their name.
1734
1735- mimetypes.py: guess_type() understands 'data' URLs.
1736
1737Restricted Execution
1738--------------------
1739
1740- The classes rexec.RModuleLoader and rexec.RModuleImporter no
1741longer exist.
1742
1743Tkinter
1744-------
1745
1746- When reporting an exception, store its info in sys.last_*. Also,
1747write all of it to stderr.
1748
1749- Added NS, EW, and NSEW constants, for grid's sticky option.
1750
1751- Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
1752
1753- Make bind variants without a sequence return a tuple of sequences
1754(formerly it returned a string, which wasn't very convenient).
1755
1756- Add image commands to the Text widget (these are new in Tk 8.0).
1757
1758- Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
1759
1760- Improved the thread code (but you still can't call update() from
1761another thread on Windows).
1762
1763- Fixed unnecessary references to _default_root in the new dialog
1764modules.
1765
1766- Miscellaneous problems fixed.
1767
1768
1769Windows General
1770---------------
1771
1772- Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
1773search for dependent dlls in the directory containing the .pyd.
1774
1775- In debugging mode, call DebugBreak() in Py_FatalError().
1776
1777Windows Installer
1778-----------------
1779
1780- Install zlib.dll in the DLLs directory instead of in the win32
1781system directory, to avoid conflicts with other applications that have
1782their own zlib.dll.
1783
1784Test Suite
1785----------
1786
1787- test_long.py: new test for long integers, by Tim Peters.
1788
1789- regrtest.py: improved so it can be used for other test suites as
1790well.
1791
1792- test_strftime.py: use re to compare test results, to support legal
1793variants (e.g. on Linux).
1794
1795Tools and Demos
1796---------------
1797
1798- Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
1799remove/add Windows style '\r\n' line endings), untabify.py (to remove
1800tabs), and rgrep.yp (reverse grep).
1801
1802- Improvements to Tools/freeze/. Each Python module is now written to
1803its own C file. This prevents some compilers or assemblers from
1804blowing up on large frozen programs, and saves recompilation time if
1805only a few modules are changed. Other changes too, e.g. new command
1806line options -x and -i.
1807
1808- Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
1809
1810Python/C API
1811------------
1812
1813- New mechanism to support extensions of the type object while
1814remaining backward compatible with extensions compiled for previous
1815versions of Python 1.5. A flags field indicates presence of certain
1816fields.
1817
1818- Addition to the buffer API to differentiate access to bytes and
18198-bit characters (in anticipation of Unicode characters).
1820
1821- New argument parsing format t# ("text") to indicate 8-bit
1822characters; s# simply means 8-bit bytes, for backwards compatibility.
1823
1824- New object type, bufferobject.c is an example and can be used to
1825create buffers from memory.
1826
1827- Some support for 64-bit longs, including some MS platforms.
1828
1829- Many calls to fprintf(stderr, ...) have been replaced with calls to
1830PySys_WriteStderr(...).
1831
1832- The calling context for PyOS_Readline() has changed: it must now be
1833called with the interpreter lock held! It releases the lock around
1834the call to the function pointed to by PyOS_ReadlineFunctionPointer
1835(default PyOS_StdioReadline()).
1836
1837- New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
1838
1839- Renamed header file "thread.h" to "pythread.h".
1840
1841- The code string of code objects may now be anything that supports the
1842buffer API.
1843
1844
1845======================================================================
1846
1847
1848From 1.5.1 to 1.5.2a1
1849=====================
1850
1851General
1852-------
1853
1854- When searching for the library, a landmark that is a compiled module
1855(string.pyc or string.pyo) is also accepted.
1856
1857- When following symbolic links to the python executable, use a loop
1858so that a symlink to a symlink can work.
1859
1860- Added a hack so that when you type 'quit' or 'exit' at the
1861interpreter, you get a friendly explanation of how to press Ctrl-D (or
1862Ctrl-Z) to exit.
1863
1864- New and improved Misc/python-mode.el (Python mode for Emacs).
1865
1866- Revert a new feature in Unix dynamic loading: for one or two
1867revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
1868out to be a bad idea.
1869
1870Miscellaneous fixed bugs
1871------------------------
1872
1873- All patches on the patch page have been integrated. (But much more
1874has been done!)
1875
1876- Several memory leaks plugged (e.g. the one for classes with a
1877__getattr__ method).
1878
1879- Removed the only use of calloc(). This triggered an obscure bug on
1880multiprocessor Sparc Solaris 2.6.
1881
1882- Fix a peculiar bug that would allow "import sys.time" to succeed
1883(believing the built-in time module to be a part of the sys package).
1884
1885- Fix a bug in the overflow checking when converting a Python long to
1886a C long (failed to convert -2147483648L, and some other cases).
1887
1888Documentation
1889-------------
1890
1891- Doc strings have been added to many extension modules: __builtin__,
1892errno, select, signal, socket, sys, thread, time. Also to methods of
1893list objects (try [].append.__doc__). A doc string on a type will now
1894automatically be propagated to an instance if the instance has methods
1895that are accessed in the usual way.
1896
1897- The documentation has been expanded and the formatting improved.
1898(Remember that the documentation is now unbundled and has its own
1899release cycle though; see http://www.python.org/doc/.)
1900
1901- Added Misc/Porting -- a mini-FAQ on porting to a new platform.
1902
1903Ports and build procedure
1904-------------------------
1905
1906- The BeOS port is now integrated. Courtesy Chris Herborth.
1907
1908- Symbol files for FreeBSD 2.x and 3.x have been contributed
1909(Lib/plat-freebsd[23]/*).
1910
1911- Support HPUX 10.20 DCE threads.
1912
1913- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
1914works, it won't also use -Olimit 1500 (which gives a warning for every
1915file). Also support the SGI_ABI environment variable better.
1916
1917- The makesetup script now understands absolute pathnames ending in .o
1918in the module -- it assumes it's a file for which we have no source.
1919
1920- Other miscellaneous improvements to the configure script and
1921Makefiles.
1922
1923- The test suite now uses a different sound sample.
1924
1925Built-in functions
1926------------------
1927
1928- Better checks for invalid input to int(), long(), string.atoi(),
1929string.atol(). (Formerly, a sign without digits would be accepted as
1930a legal ways to spell zero.)
1931
1932- Changes to map() and filter() to use the length of a sequence only
1933as a hint -- if an IndexError happens earlier, take that. (Formerly,
1934this was considered an error.)
1935
1936- Experimental feature in getattr(): a third argument can specify a
1937default (instead of raising AttributeError).
1938
1939- Implement round() slightly different, so that for negative ndigits
1940no additional errors happen in the last step.
1941
1942- The open() function now adds the filename to the exception when it
1943fails.
1944
1945Built-in exceptions
1946-------------------
1947
1948- New standard exceptions EnvironmentError and PosixError.
1949EnvironmentError is the base class for IOError and PosixError;
1950PosixError is the same as os.error. All this so that either exception
1951class can be instantiated with a third argument indicating a filename.
1952The built-in function open() and most os/posix functions that take a
1953filename argument now use this.
1954
1955Built-in types
1956--------------
1957
1958- List objects now have an experimental pop() method; l.pop() returns
1959and removes the last item; l.pop(i) returns and removes the item at
1960i. Also, the sort() method is faster again. Sorting is now also
1961safer: it is impossible for the sorting function to modify the list
1962while the sort is going on (which could cause core dumps).
1963
1964- Changes to comparisons: numbers are now smaller than any other type.
1965This is done to prevent the circularity where [] < 0L < 1 < [] is
1966true. As a side effect, cmp(None, 0) is now positive instead of
1967negative. This *shouldn't* affect any working code, but I've found
1968that the change caused several "sleeping" bugs to become active, so
1969beware!
1970
1971- Instance methods may now have other callable objects than just
1972Python functions as their im_func. Use new.instancemethod() or write
1973your own C code to create them; new.instancemethod() may be called
1974with None for the instance to create an unbound method.
1975
1976- Assignment to __name__, __dict__ or __bases__ of a class object is
1977now allowed (with stringent type checks); also allow assignment to
1978__getattr__ etc. The cached values for __getattr__ etc. are
1979recomputed after such assignments (but not for derived classes :-( ).
1980
1981- Allow assignment to some attributes of function objects: func_code,
1982func_defaults and func_doc / __doc__. (With type checks except for
1983__doc__ / func_doc .)
1984
1985Python services
1986---------------
1987
1988- New tests (in Lib/test): reperf.py (regular expression benchmark),
1989sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
1990for the MimeWriter module).
1991
1992- Generalized test/regrtest.py so that it is useful for testing other
1993packages.
1994
1995- The ihooks.py module now understands package imports.
1996
1997- In code.py, add a class that subsumes Fredrik Lundh's
1998PythonInterpreter class. The interact() function now uses this.
1999
2000- In rlcompleter.py, in completer(), return None instead of raising an
2001IndexError when there are no more completions left.
2002
2003- Fixed the marshal module to test for certain common kinds of invalid
2004input. (It's still not foolproof!)
2005
2006- In the operator module, add an alias (now the preferred name)
2007"contains" for "sequenceincludes".
2008
2009String Services
2010---------------
2011
2012- In the string and strop modules, in the replace() function, treat an
2013empty pattern as an error (since it's not clear what was meant!).
2014
2015- Some speedups to re.py, especially the string substitution and split
2016functions. Also added new function/method findall(), to find all
2017occurrences of a given substring.
2018
2019- In cStringIO, add better argument type checking and support the
2020readonly 'closed' attribute (like regular files).
2021
2022- In the struct module, unsigned 1-2 byte sized formats no longer
2023result in long integer values.
2024
2025Miscellaneous services
2026----------------------
2027
2028- In whrandom.py, added new method and function randrange(), same as
2029choice(range(start, stop, step)) but faster. This addresses the
2030problem that randint() was accidentally defined as taking an inclusive
2031range. Also, randint(a, b) is now redefined as randrange(a, b+1),
2032adding extra range and type checking to its arguments!
2033
2034- Add some semi-thread-safety to random.gauss() (it used to be able to
2035crash when invoked from separate threads; now the worst it can do is
2036give a duplicate result occasionally).
2037
2038- Some restructuring and generalization done to cmd.py.
2039
2040- Major upgrade to ConfigParser.py; converted to using 're', added new
2041exceptions, support underscore in section header and option name. No
2042longer add 'name' option to every section; instead, add '__name__'.
2043
2044- In getpass.py, don't use raw_input() to ask for the password -- we
2045don't want it to show up in the readline history! Also don't catch
2046interrupts (the try-finally already does all necessary cleanup).
2047
2048Generic OS Services
2049-------------------
2050
2051- New functions in os.py: makedirs(), removedirs(), renames(). New
2052variable: linesep (the line separator as found in binary files,
2053i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
2054this with files opened in (default) text mode; the line separator used
2055will always be '\n'!
2056
2057- Changes to the 'os.path' submodule of os.py: added getsize(),
2058getmtime(), getatime() -- these fetch the most popular items from the
2059stat return tuple.
2060
2061- In the time module, add strptime(), if it exists. (This parses a
2062time according to a format -- the inverse of strftime().) Also,
2063remove the call to mktime() from strftime() -- it messed up the
2064formatting of some non-local times.
2065
2066- In the socket module, added a new function gethostbyname_ex().
2067Also, don't use #ifdef to test for some symbols that are enums on some
2068platforms (and should exist everywhere).
2069
2070Optional OS Services
2071--------------------
2072
2073- Some fixes to gzip.py. In particular, the readlines() method now
2074returns the lines *with* trailing newline characters, like readlines()
2075of regular file objects. Also, it didn't work together with cPickle;
2076fixed that.
2077
2078- In whichdb.py, support byte-swapped dbhash (bsddb) files.
2079
2080- In anydbm.py, look at the type of an existing database to determine
2081which module to use to open it. (The anydbm.error exception is now a
2082tuple.)
2083
2084Unix Services
2085-------------
2086
2087- In the termios module, in tcsetattr(), initialize the structure vy
2088calling tcgetattr().
2089
2090- Added some of the "wait status inspection" macros as functions to
2091the posix module (and thus to the os module): WEXITSTATUS(),
2092WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
2093
2094- In the syslog module, make the default facility more intuitive
2095(matching the docs).
2096
2097Debugger
2098--------
2099
2100- In pdb.py, support for setting breaks on files/modules that haven't
2101been loaded yet.
2102
2103Internet Protocols and Support
2104------------------------------
2105
2106- Changes in urllib.py; sped up unquote() and quote(). Fixed an
2107obscure bug in quote_plus(). Added urlencode(dict) -- convenience
2108function for sending a POST request with urlopen(). Use the getpass
2109module to ask for a password. Rewrote the (test) main program so that
2110when used as a script, it can retrieve one or more URLs to stdout.
2111Use -t to run the self-test. Made the proxy code work again.
2112
2113- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
2114fail when someone asks for their HEAD. Also, for POST, set the
2115default content-type to application/x-www-form-urlencoded. Also, in
2116FieldStorage.__init__(), when method='GET', always get the query
2117string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
2118explicitly passed in fp.
2119
2120- The smtplib.py module now supports ESMTP and has improved standard
2121compliance, for picky servers.
2122
2123- Improved imaplib.py.
2124
2125- Fixed UDP support in SocketServer.py (it never worked).
2126
2127- Fixed a small bug in CGIHTTPServer.py.
2128
2129Internet Data handling
2130----------------------
2131
2132- In rfc822.py, add a new class AddressList. Also support a new
2133overridable method, isheader(). Also add a get() method similar to
2134dictionaries (and make getheader() an alias for it). Also, be smarter
2135about seekable (test whether fp.tell() works) and test for presence of
2136unread() method before trying seeks.
2137
2138- In sgmllib.py, restore the call to report_unbalanced() that was lost
2139long ago. Also some other improvements: handle <? processing
2140instructions >, allow . and - in entity names, and allow \r\n as line
2141separator.
2142
2143- Some restructuring and generalization done to multifile.py; support
2144a 'seekable' flag.
2145
2146Restricted Execution
2147--------------------
2148
2149- Improvements to rexec.py: package support; support a (minimal)
2150sys.exc_info(). Also made the (test) main program a bit fancier (you
2151can now use it to run arbitrary Python scripts in restricted mode).
2152
2153Tkinter
2154-------
2155
2156- On Unix, Tkinter can now safely be used from a multi-threaded
2157application. (Formerly, no threads would make progress while
2158Tkinter's mainloop() was active, because it didn't release the Python
2159interpreter lock.) Unfortunately, on Windows, threads other than the
2160main thread should not call update() or update_idletasks() because
2161this will deadlock the application.
2162
2163- An interactive interpreter that uses readline and Tkinter no longer
2164uses up all available CPU time.
2165
2166- Even if readline is not used, Tk windows created in an interactive
2167interpreter now get continuously updated. (This even works in Windows
2168as long as you don't hit a key.)
2169
2170- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
2171
2172- No longer register Tcl_finalize() as a low-level exit handler. It
2173may call back into Python, and that's a bad idea.
2174
2175- Allow binding of Tcl commands (given as a string).
2176
2177- Some minor speedups; replace explicitly coded getint() with int() in
2178most places.
2179
2180- In FileDialog.py, remember the directory of the selected file, if
2181given.
2182
2183- Change the names of all methods in the Wm class: they are now
2184wm_title(), etc. The old names (title() etc.) are still defined as
2185aliases.
2186
2187- Add a new method of interpreter objects, interpaddr(). This returns
2188the address of the Tcl interpreter object, as an integer. Not very
2189useful for the Python programmer, but this can be called by another C
2190extension that needs to make calls into the Tcl/Tk C API and needs to
2191get the address of the Tcl interpreter object. A simple cast of the
2192return value to (Tcl_Interp *) will do the trick.
2193
2194Windows General
2195---------------
2196
2197- Don't insist on proper case for module source files if the filename
2198is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
2199doesn't). This should address problems with this feature on
2200oldfashioned filesystems (Novell servers?).
2201
2202Windows Library
2203---------------
2204
2205- os.environ is now all uppercase, but accesses are case insensitive,
2206and the putenv() calls made as a side effect of changing os.environ
2207are case preserving.
2208
2209- Removed samefile(), sameopenfile(), samestat() from os.path (aka
2210ntpath.py) -- these cannot be made to work reliably (at least I
2211wouldn't know how).
2212
2213- Fixed os.pipe() so that it returns file descriptors acceptable to
2214os.read() and os.write() (like it does on Unix), rather than Windows
2215file handles.
2216
2217- Added a table of WSA error codes to socket.py.
2218
2219- In the select module, put the (huge) file descriptor arrays on the
2220heap.
2221
2222- The getpass module now raises KeyboardInterrupt when it sees ^C.
2223
2224- In mailbox.py, fix tell/seek when using files opened in text mode.
2225
2226- In rfc822.py, fix tell/seek when using files opened in text mode.
2227
2228- In the msvcrt extension module, release the interpreter lock for
2229calls that may block: _locking(), _getch(), _getche(). Also fix a
2230bogus error return when open_osfhandle() doesn't have the right
2231argument list.
2232
2233Windows Installer
2234-----------------
2235
2236- The registry key used is now "1.5" instead of "1.5.x" -- so future
2237versions of 1.5 and Mark Hammond's win32all installer don't need to be
2238resynchronized.
2239
2240Windows Tools
2241-------------
2242
2243- Several improvements to freeze specifically for Windows.
2244
2245Windows Build Procedure
2246-----------------------
2247
2248- The VC++ project files and the WISE installer have been moved to the
2249PCbuild subdirectory, so they are distributed in the same subdirectory
2250where they must be used. This avoids confusion.
2251
2252- New project files for Windows 3.1 port by Jim Ahlstrom.
2253
2254- Got rid of the obsolete subdirectory PC/setup_nt/.
2255
2256- The projects now use distinct filenames for the .exe, .dll, .lib and
2257.pyd files built in debug mode (by appending "_d" to the base name,
2258before the extension). This makes it easier to switch between the two
2259and get the right versions. There's a pragma in config.h that directs
2260the linker to include the appropriate .lib file (so python15.lib no
2261longer needs to be explicit in your project).
2262
2263- The installer now installs more files (e.g. config.h). The idea is
2264that you shouldn't need the source distribution if you want build your
2265own extensions in C or C++.
2266
2267Tools and Demos
2268---------------
2269
2270- New script nm2def.py by Marc-Andre Lemburg, to construct
2271PC/python_nt.def automatically (some hand editing still required).
2272
2273- New tool ndiff.py: Tim Peters' text diffing tool.
2274
2275- Various and sundry improvements to the freeze script.
2276
2277- The script texi2html.py (which was part of the Doc tree but is no
2278longer used there) has been moved to the Tools/scripts subdirectory.
2279
2280- Some generalizations in the webchecker code. There's now a
2281primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
2282
2283- The ftpmirror.py script now handles symbolic links properly, and
2284also files with multiple spaces in their names.
2285
2286- The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
2287last line is both indented and lacks a newline. This is now fixed.
2288
2289Python/C API
2290------------
2291
2292- Added missing prototypes for PyEval_CallFunction() and
2293PyEval_CallMethod().
2294
2295- New macro PyList_SET_ITEM().
2296
2297- New macros to access object members for PyFunction, PyCFunction
2298objects.
2299
2300- New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
2301dynamically add one or many entries to the table of built-in modules.
2302
2303- New macro Py_InitModule3(name, methods, doc) which calls
2304Py_InitModule4() with appropriate arguments. (The -4 variant requires
2305you to pass an obscure version number constant which is always the same.)
2306
2307- New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
2308sys.stdout or sys.stderr using a printf-like interface. (Used in
2309_tkinter.c, for example.)
2310
2311- New APIs for conversion between Python longs and C 'long long' if
2312your compiler supports it.
2313
2314- PySequence_In() is now called PySequence_Contains().
2315(PySequence_In() is still supported for b/w compatibility; it is
2316declared obsolete because its argument order is confusing.)
2317
2318- PyDict_GetItem() and PyDict_GetItemString() are changed so that they
2319*never* raise an exception -- (even if the hash() fails, simply clear
2320the error). This was necessary because there is lots of code out
2321there that already assumes this.
2322
2323- Changes to PySequence_Tuple() and PySequence_List() to use the
2324length of a sequence only as a hint -- if an IndexError happens
2325earlier, take that. (Formerly, this was considered an error.)
2326
2327- Reformatted abstract.c to give it a more familiar "look" and fixed
2328many error checking bugs.
2329
2330- Add NULL pointer checks to all calls of a C function through a type
2331object and extensions (e.g. nb_add).
2332
2333- The code that initializes sys.path now calls Py_GetPythonHome()
2334instead of getenv("PYTHONHOME"). This, together with the new API
2335Py_SetPythonHome(), makes it easier for embedding applications to
2336change the notion of Python's "home" directory (where the libraries
2337etc. are sought).
2338
2339- Fixed a very old bug in the parsing of "O?" format specifiers.
2340
2341
2342======================================================================
2343
2344
Guido van Rossum439d1fa1998-12-21 21:41:14 +00002345From 1.5 to 1.5.1
2346=================
2347
2348General
2349-------
2350
2351- The documentation is now unbundled. It has also been extensively
2352modified (mostly to implement a new and more uniform formatting
2353style). We figure that most people will prefer to download one of the
2354preformatted documentation sets (HTML, PostScript or PDF) and that
2355only a minority have a need for the LaTeX or FrameMaker sources. Of
2356course, the unbundled documentation sources still released -- just not
2357in the same archive file, and perhaps not on the same date.
2358
2359- All bugs noted on the errors page (and many unnoted) are fixed. All
2360new bugs take their places.
2361
2362- No longer a core dump when attempting to print (or repr(), or str())
2363a list or dictionary that contains an instance of itself; instead, the
2364recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
2365Py_ReprLeave() below. Comparisons of such objects still go beserk,
2366since this requires a different kind of fix; fortunately, this is a
2367less common scenario in practice.
2368
2369Syntax change
2370-------------
2371
2372- The raise statement can now be used without arguments, to re-raise
2373a previously set exception. This should be used after catching an
2374exception with an except clause only, either in the except clause or
2375later in the same function.
2376
2377Import and module handling
2378--------------------------
2379
2380- The implementation of import has changed to use a mutex (when
2381threading is supported). This means that when two threads
2382simultaneously import the same module, the import statements are
2383serialized. Recursive imports are not affected.
2384
2385- Rewrote the finalization code almost completely, to be much more
2386careful with the order in which modules are destroyed. Destructors
2387will now generally be able to reference built-in names such as None
2388without trouble.
2389
2390- Case-insensitive platforms such as Mac and Windows require the case
2391of a module's filename to match the case of the module name as
2392specified in the import statement (see below).
2393
2394- The code for figuring out the default path now distinguishes between
2395files, modules, executable files, and directories. When expecting a
2396module, we also look for the .pyc or .pyo file.
2397
2398Parser/tokenizer changes
2399------------------------
2400
2401- The tokenizer can now warn you when your source code mixes tabs and
2402spaces for indentation in a manner that depends on how much a tab is
2403worth in spaces. Use "python -t" or "python -v" to enable this
2404option. Use "python -tt" to turn the warnings into errors. (See also
2405tabnanny.py and tabpolice.py below.)
2406
2407- Return unsigned characters from tok_nextc(), so '\377' isn't
2408mistaken for an EOF character.
2409
2410- Fixed two pernicious bugs in the tokenizer that only affected AIX.
2411One was actually a general bug that was triggered by AIX's smaller I/O
2412buffer size. The other was a bug in the AIX optimizer's loop
2413unrolling code; swapping two statements made the problem go away.
2414
2415Tools, demos and miscellaneous files
2416------------------------------------
2417
2418- There's a new version of Misc/python-mode.el (the Emacs mode for
2419Python) which is much smarter about guessing the indentation style
2420used in a particular file. Lots of other cool features too!
2421
2422- There are two new tools in Tools/scripts: tabnanny.py and
2423tabpolice.py, implementing two different ways of checking whether a
2424file uses indentation in a way that is sensitive to the interpretation
2425of a tab. The preferred module is tabnanny.py (by Tim Peters).
2426
2427- Some new demo programs:
2428
2429 Demo/tkinter/guido/paint.py -- Dave Mitchell
2430 Demo/sockets/unixserver.py -- Piet van Oostrum
2431
2432
2433- Much better freeze support. The freeze script can now freeze
2434hierarchical module names (with a corresponding change to import.c),
2435and has a few extra options (e.g. to suppress freezing specific
2436modules). It also does much more on Windows NT.
2437
2438- Version 1.0 of the faq wizard is included (only very small changes
2439since version 0.9.0).
2440
2441- New feature for the ftpmirror script: when removing local files
2442(i.e., only when -r is used), do a recursive delete.
2443
2444Configuring and building Python
2445-------------------------------
2446
2447- Get rid of the check for -linet -- recent Sequent Dynix systems don't
2448need this any more and apparently it screws up their configuration.
2449
2450- Some changes because gcc on SGI doesn't support '-all'.
2451
2452- Changed the build rules to use $(LIBRARY) instead of
2453 -L.. -lpython$(VERSION)
2454since the latter trips up the SunOS 4.1.x linker (sigh).
2455
2456- Fix the bug where the '# dgux is broken' comment in the Makefile
2457tripped over Make on some platforms.
2458
2459- Changes for AIX: install the python.exp file; properly use
2460$(srcdir); the makexp_aix script now removes C++ entries of the form
2461Class::method.
2462
2463- Deleted some Makefile targets only used by the (long obsolete)
2464gMakefile hacks.
2465
2466Extension modules
2467-----------------
2468
2469- Performance and threading improvements to the socket and bsddb
2470modules, by Christopher Lindblad of Infoseek.
2471
2472- Added operator.__not__ and operator.not_.
2473
2474- In the thread module, when a thread exits due to an unhandled
2475exception, don't store the exception information in sys.last_*; it
2476prevents proper calling of destructors of local variables.
2477
2478- Fixed a number of small bugs in the cPickle module.
2479
2480- Changed find() and rfind() in the strop module so that
2481find("x","",2) returns -1, matching the implementation in string.py.
2482
2483- In the time module, be more careful with the result of ctime(), and
2484test for HAVE_MKTIME before usinmg mktime().
2485
2486- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
2487modules.
2488
2489- Added the LOG_SYSLOG constant to the syslog module, if defined.
2490
2491Standard library modules
2492------------------------
2493
2494- All standard library modules have been converted to an indentation
2495style using either only tabs or only spaces -- never a mixture -- if
2496they weren't already consistent according to tabnanny. This means
2497that the new -t option (see above) won't complain about standard
2498library modules.
2499
2500- New standard library modules:
2501
2502 threading -- GvR and the thread-sig
2503 Java style thread objects -- USE THIS!!!
2504
2505 getpass -- Piers Lauder
2506 simple utilities to prompt for a password and to
2507 retrieve the current username
2508
2509 imaplib -- Piers Lauder
2510 interface for the IMAP4 protocol
2511
2512 poplib -- David Ascher, Piers Lauder
2513 interface for the POP3 protocol
2514
2515 smtplib -- Dragon De Monsyne
2516 interface for the SMTP protocol
2517
2518- Some obsolete modules moved to a separate directory (Lib/lib-old)
2519which is *not* in the default module search path:
2520
2521 Para
2522 addpack
2523 codehack
2524 fmt
2525 lockfile
2526 newdir
2527 ni
2528 rand
2529 tb
2530
2531- New version of the PCRE code (Perl Compatible Regular Expressions --
2532the re module and the supporting pcre extension) by Andrew Kuchling.
2533Incompatible new feature in re.sub(): the handling of escapes in the
2534replacement string has changed.
2535
2536- Interface change in the copy module: a __deepcopy__ method is now
2537called with the memo dictionary as an argument.
2538
2539- Feature change in the tokenize module: differentiate between NEWLINE
2540token (an official newline) and NL token (a newline that the grammar
2541ignores).
2542
2543- Several bugfixes to the urllib module. It is now truly thread-safe,
2544and several bugs and a portability problem have been fixed. New
2545features, all due to Sjoerd Mullender: When creating a temporary file,
2546it gives it an appropriate suffix. Support the "data:" URL scheme.
2547The open() method uses the tempcache.
2548
2549- New version of the xmllib module (this time with a test suite!) by
2550Sjoerd Mullender.
2551
2552- Added debugging code to the telnetlib module, to be able to trace
2553the actual traffic.
2554
2555- In the rfc822 module, added support for deleting a header (still no
2556support for adding headers, though). Also fixed a bug where an
2557illegal address would cause a crash in getrouteaddr(), fixed a
2558sign reversal in mktime_tz(), and use the local timezone by default
2559(the latter two due to Bill van Melle).
2560
2561- The normpath() function in the dospath and ntpath modules no longer
2562does case normalization -- for that, use the separate function
2563normcase() (which always existed); normcase() has been sped up and
2564fixed (it was the cause of a crash in Mark Hammond's installer in
2565certain locales).
2566
2567- New command supported by the ftplib module: rmd(); also fixed some
2568minor bugs.
2569
2570- The profile module now uses a different timer function by default --
2571time.clock() is generally better than os.times(). This makes it work
2572better on Windows NT, too.
2573
2574- The tempfile module now recovers when os.getcwd() raises an
2575exception.
2576
2577- Fixed some bugs in the random module; gauss() was subtly wrong, and
2578vonmisesvariate() should return a full circle. Courtesy Mike Miller,
2579Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
2580
2581- Better default seed in the whrandom module, courtesy Andrew Kuchling.
2582
2583- Fix slow close() in shelve module.
2584
2585- The Unix mailbox class in the mailbox module is now more robust when
2586a line begins with the string "From " but is definitely not the start
2587of a new message. The pattern used can be changed by overriding a
2588method or class variable.
2589
2590- Added a rmtree() function to the copy module.
2591
2592- Fixed several typos in the pickle module. Also fixed problems when
2593unpickling in restricted execution environments.
2594
2595- Added docstrings and fixed a typo in the py_compile and compileall
2596modules. At Mark Hammond's repeated request, py_compile now append a
2597newline to the source if it needs one. Both modules support an extra
2598parameter to specify the purported source filename (to be used in
2599error messages).
2600
2601- Some performance tweaks by Jeremy Hylton to the gzip module.
2602
2603- Fixed a bug in the merge order of dictionaries in the ConfigParser
2604module. Courtesy Barry Warsaw.
2605
2606- In the multifile module, support the optional second parameter to
2607seek() when possible.
2608
2609- Several fixes to the gopherlib module by Lars Marius Garshol. Also,
2610urlparse now correctly handles Gopher URLs with query strings.
2611
2612- Fixed a tiny bug in format_exception() in the traceback module.
2613Also rewrite tb_lineno() to be compatible with JPython (and not
2614disturb the current exception!); by Jim Hugunin.
2615
2616- The httplib module is more robust when servers send a short response
2617-- courtesy Tim O'Malley.
2618
2619Tkinter and friends
2620-------------------
2621
2622- Various typos and bugs fixed.
2623
2624- New module Tkdnd implements a drag-and-drop protocol (within one
2625application only).
2626
2627- The event_*() widget methods have been restructured slightly -- they
2628no longer use the default root.
2629
2630- The interfaces for the bind*() and unbind() widget methods have been
2631redesigned; the bind*() methods now return the name of the Tcl command
2632created for the callback, and this can be passed as a optional
2633argument to unbind() in order to delete the command (normally, such
2634commands are automatically unbound when the widget is destroyed, but
2635for some applications this isn't enough).
2636
2637- Variable objects now have trace methods to interface to Tcl's
2638variable tracing facilities.
2639
2640- Image objects now have an optional keyword argument, 'master', to
2641specify a widget (tree) to which they belong. The image_names() and
2642image_types() calls are now also widget methods.
2643
2644- There's a new global call, Tkinter.NoDefaultRoot(), which disables
2645all use of the default root by the Tkinter library. This is useful to
2646debug applications that are in the process of being converted from
2647relying on the default root to explicit specification of the root
2648widget.
2649
2650- The 'exit' command is deleted from the Tcl interpreter, since it
2651provided a loophole by which one could (accidentally) exit the Python
2652interpreter without invoking any cleanup code.
2653
2654- Tcl_Finalize() is now registered as a Python low-level exit handle,
2655so Tcl will be finalized when Python exits.
2656
2657The Python/C API
2658----------------
2659
2660- New function PyThreadState_GetDict() returns a per-thread dictionary
2661intended for storing thread-local global variables.
2662
2663- New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
2664dictionary to allow recursive container types to detect recursion in
2665their repr(), str() and print implementations.
2666
2667- New function PyObject_Not(x) calculates (not x) according to Python's
2668standard rules (basically, it negates the outcome PyObject_IsTrue(x).
2669
2670- New function _PyModule_Clear(), which clears a module's dictionary
2671carefully without removing the __builtins__ entry. This is implied
2672when a module object is deallocated (this used to clear the dictionary
2673completely).
2674
2675- New function PyImport_ExecCodeModuleEx(), which extends
2676PyImport_ExecCodeModule() by adding an extra parameter to pass it the
2677true file.
2678
2679- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
2680allow embedded applications to force a different value for PYTHONHOME.
2681
2682- New global flag Py_FrozenFlag is set when this is a "frozen" Python
2683binary; it suppresses warnings about not being able to find the
2684standard library directories.
2685
2686- New global flag Py_TabcheckFlag is incremented by the -t option and
2687causes the tokenizer to issue warnings or errors about inconsistent
2688mixing of tabs and spaces for indentation.
2689
2690Miscellaneous minor changes and bug fixes
2691-----------------------------------------
2692
2693- Improved the error message when an attribute of an attribute-less
2694object is requested -- include the name of the attribute and the type
2695of the object in the message.
2696
2697- Sped up int(), long(), float() a bit.
2698
2699- Fixed a bug in list.sort() that would occasionally dump core.
2700
2701- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
2702when taken tothe real power.
2703
2704- Fixed a number of bugs in the file reading code, at least one of
2705which could cause a core dump on NT, and one of which would
2706occasionally cause file.read() to return less than the full contents
2707of the file.
2708
2709- Performance hack by Vladimir Marangozov for stack frame creation.
2710
2711- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
2712
2713Windows 95/NT
2714-------------
2715
2716- The .lib files are now part of the distribution; they are collected
2717in the subdirectory "libs" of the installation directory.
2718
2719- The extension modules (.pyd files) are now collected in a separate
2720subdirectory of the installation directory named "DLLs".
2721
2722- The case of a module's filename must now match the case of the
2723module name as specified in the import statement. This is an
2724experimental feature -- if it turns out to break in too many
2725situations, it will be removed (or disabled by default) in the future.
2726It can be disabled on a per-case basis by setting the environment
2727variable PYTHONCASEOK (to any value).
2728
2729
2730======================================================================
2731
2732
2733From 1.5b2 to 1.5
2734=================
2735
2736- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
2737
2738- Added doc strings to string.py, stropmodule.c, structmodule.c,
2739thanks to Charles Waldman.
2740
2741- Many nits fixed in the manuals, thanks to Fred Drake and many others
2742(especially Rob Hooft and Andrew Kuchling). The HTML version now uses
2743HTML markup instead of inline GIF images for tables; only two images
2744are left (for obsure bits of math). The index of the HTML version has
2745also been much improved. Finally, it is once again possible to
2746generate an Emacs info file from the library manual (but I don't
2747commit to supporting this in future versions).
2748
2749- New module: telnetlib.py (a simple telnet client library).
2750
2751- New tool: Tools/versioncheck/, by Jack Jansen.
2752
2753- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
2754DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
2755extension modules.
2756
2757- Many small changes again to Tkinter.py -- mostly bugfixes and adding
2758missing routines. Thanks to Greg McFarlane for reporting a bunch of
2759problems and proofreading my fixes.
2760
2761- The re module and its documentation are up to date with the latest
2762version released to the string-sig (Dec. 22).
2763
2764- Stop test_grp.py from failing when the /etc/group file is empty
2765(yes, this happens!).
2766
2767- Fix bug in integer conversion (mystrtoul.c) that caused
27684294967296==0 to be true!
2769
2770- The VC++ 4.2 project file should be complete again.
2771
2772- In tempfile.py, use a better template on NT, and add a new optional
2773argument "suffix" with default "" to specify a specific extension for
2774the temporary filename (needed sometimes on NT but perhaps also handy
2775elsewhere).
2776
2777- Fixed some bugs in the FAQ wizard, and converted it to use re
2778instead of regex.
2779
2780- Fixed a mysteriously undetected error in dlmodule.c (it was using a
2781totally bogus routine name to raise an exception).
2782
2783- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
2784
2785- Hopefully harmless changes to the build process to support shared
2786libraries on DG/UX. This adds a target to create
2787libpython$(VERSION).so; however this target is *only* for DG/UX.
2788
2789- Fixed a bug in the new format string error checking in getargs.c.
2790
2791- A simple fix for infinite recursion when printing __builtins__:
2792reset '_' to None before printing and set it to the printed variable
2793*after* printing (and only when printing is successful).
2794
2795- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
2796parent window is not (Skip Montanaro).
2797
2798- Fixed the two most annoying problems with ftp URLs in
2799urllib.urlopen(); an empty file now correctly raises an error, and it
2800is no longer required to explicitly close the returned "file" object
2801before opening another ftp URL to the same host and directory.
2802
2803
2804======================================================================
2805
2806
2807From 1.5b1 to 1.5b2
2808===================
2809
2810- Fixed a bug in cPickle.c that caused it to crash right away because
2811the version string had a different format.
2812
2813- Changes in pickle.py and cPickle.c: when unpickling an instance of a
2814class that doesn't define the __getinitargs__() method, the __init__()
2815constructor is no longer called. This makes a much larger group of
2816classes picklable by default, but may occasionally change semantics.
2817To force calling __init__() on unpickling, define a __getinitargs__()
2818method. Other changes too, in particular cPickle now handles classes
2819defined in packages correctly. The same change applies to copying
2820instances with copy.py. The cPickle.c changes and some pickle.py
2821changes are courtesy Jim Fulton.
2822
2823- Locale support in he "re" (Perl regular expressions) module. Use
2824the flag re.L (or re.LOCALE) to enable locale-specific matching
2825rules for \w and \b. The in-line syntax for this flag is (?L).
2826
2827- The built-in function isinstance(x, y) now also succeeds when y is
2828a type object and type(x) is y.
2829
2830- repr() and str() of class and instance objects now reflect the
2831package/module in which the class is defined.
2832
2833- Module "ni" has been removed. (If you really need it, it's been
2834renamed to "ni1". Let me know if this causes any problems for you.
2835Package authors are encouraged to write __init__.py files that
2836support both ni and 1.5 package support, so the same version can be
2837used with Python 1.4 as well as 1.5.)
2838
2839- The thread module is now automatically included when threads are
2840configured. (You must remove it from your existing Setup file,
2841since it is now in its own Setup.thread file.)
2842
2843- New command line option "-x" to skip the first line of the script;
2844handy to make executable scripts on non-Unix platforms.
2845
2846- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
2847haven't checked how this affects things, but it should make symbols
2848in one shared library available to the next one.
2849
2850- The Windows installer now installs in the "Program Files" folder on
2851the proper volume by default.
2852
2853- The Windows configuration adds a new main program, "pythonw", and
2854registers a new extension, ".pyw" that invokes this. This is a
2855pstandard Python interpreter that does not pop up a console window;
2856handy for pure Tkinter applications. All output to the original
2857stdout and stderr is lost; reading from the original stdin yields
2858EOF. Also, both python.exe and pythonw.exe now have a pretty icon
2859(a green snake in a box, courtesy Mark Hammond).
2860
2861- Lots of improvements to emacs-mode.el again. See Barry's web page:
2862http://www.python.org/ftp/emacs/pmdetails.html.
2863
2864- Lots of improvements and additions to the library reference manual;
2865many by Fred Drake.
2866
2867- Doc strings for the following modules: rfc822.py, posixpath.py,
2868ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
2869
2870- Some more regression testing.
2871
2872- An optional 4th (maxsplit) argument to strop.replace().
2873
2874- Fixed handling of maxsplit in string.splitfields().
2875
2876- Tweaked os.environ so it can be pickled and copied.
2877
2878- The portability problems caused by indented preprocessor commands
2879and C++ style comments should be gone now.
2880
2881- In random.py, added Pareto and Weibull distributions.
2882
2883- The crypt module is now disabled in Modules/Setup.in by default; it
2884is rarely needed and causes errors on some systems where users often
2885don't know how to deal with those.
2886
2887- Some improvements to the _tkinter build line suggested by Case Roole.
2888
2889- A full suite of platform specific files for NetBSD 1.x, submitted by
2890Anders Andersen.
2891
2892- New Solaris specific header STROPTS.py.
2893
2894- Moved a confusing occurrence of *shared* from the comments in
2895Modules/Setup.in (people would enable this one instead of the real
2896one, and get disappointing results).
2897
2898- Changed the default mode for directories to be group-writable when
2899the installation process creates them.
2900
2901- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
2902shared libraries for both.
2903
2904- Support FreeBSD and NetBSD in posixfile.py.
2905
2906- Support for the "event" command, new in Tk 4.2. By Case Roole.
2907
2908- Add Tix_SafeInit() support to tkappinit.c.
2909
2910- Various bugs fixed in "re.py" and "pcre.c".
2911
2912- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
2913
2914- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
2915is set.
2916
2917- Provide default blocksize for retrbinary in ftplib.py (Skip
2918Montanaro).
2919
2920- In NT, pick the username up from different places in user.py (Jeff
2921Bauer).
2922
2923- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
2924
2925- Many small improvements to Jeff Rush' OS/2 support.
2926
2927- ospath.py is gone; it's been obsolete for so many years now...
2928
2929- The reference manual is now set up to prepare better HTML (still
2930using webmaker, alas).
2931
2932- Add special handling to /Tools/freeze for Python modules that are
2933imported implicitly by the Python runtime: 'site' and 'exceptions'.
2934
2935- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
2936inside <PRE>, by "Scott".
2937
2938- Added ConfigParser.py, a generic parser for sectioned configuration
2939files.
2940
2941- In _localemodule.c, LC_MESSAGES is not always defined; put it
2942between #ifdefs.
2943
2944- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
2945
2946- Demo/scripts/newslist.py: Fix the way the version number is gotten
2947out of the RCS revision.
2948
2949- PyArg_Parse[Tuple] now explicitly check for bad characters at the
2950end of the format string.
2951
2952- Revamped PC/example_nt to support VC++ 5.x.
2953
2954- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
2955after studying the GNU libg++ quicksort. This should be much faster
2956if there are lots of duplicates, and otherwise at least as good.
2957
2958- Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
2959uudecode bug where it complaints about trailing garbage is still there
2960:-( ).
2961
2962- pickle.py requires integers in text mode to be in decimal notation
2963(it used to accept octal and hex, even though it would only generate
2964decimal numbers).
2965
2966- In string.atof(), don't fail when the "re" module is unavailable.
2967Plug the ensueing security leak by supplying an empty __builtins__
2968directory to eval().
2969
2970- A bunch of small fixes and improvements to Tkinter.py.
2971
2972- Fixed a buffer overrun in PC/getpathp.c.
2973
2974
2975======================================================================
2976
2977
2978From 1.5a4 to 1.5b1
2979===================
2980
2981- The Windows NT/95 installer now includes full HTML of all manuals.
2982It also has a checkbox that lets you decide whether to install the
2983interpreter and library. The WISE installer script for the installer
2984is included in the source tree as PC/python15.wse, and so are the
2985icons used for Python files. The config.c file for the Windows build
2986is now complete with the pcre module.
2987
2988- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
2989evaluated for the prompt.
2990
2991- The reference manual is brought up to date (more or less -- it still
2992needs work, e.g. in the area of package import).
2993
2994- The icons used by latex2html are now included in the Doc
2995subdirectory (mostly so that tarring up the HTML files can be fully
2996automated). A simple index.html is also added to Doc (it only works
2997after you have successfully run latex2html).
2998
2999- For all you would-be proselytizers out there: a new version of
3000Misc/BLURB describes Python more concisely, and Misc/comparisons
3001compares Python to several other languages. Misc/BLURB.WINDOWS
3002contains a blurb specifically aimed at Windows programmers (by Mark
3003Hammond).
3004
3005- A new version of the Python mode for Emacs is included as
3006Misc/python-mode.el. There are too many new features to list here.
3007See http://www.python.org/ftp/emacs/pmdetails.html for more info.
3008
3009- New module fileinput makes iterating over the lines of a list of
3010files easier. (This still needs some more thinking to make it more
3011extensible.)
3012
3013- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
3014version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
3015Age C++ compiler. I expect that Jeff will also provide a binary
3016release for this platform.
3017
3018- On Linux, the configure script now uses '-Xlinker -export-dynamic'
3019instead of '-rdynamic' to link the main program so that it exports its
3020symbols to shared libraries it loads dynamically. I hope this doesn't
3021break on older Linux versions; it is needed for mklinux and appears to
3022work on Linux 2.0.30.
3023
3024- Some Tkinter resstructuring: the geometry methods that apply to a
3025master are now properly usable on toplevel master widgets. There's a
3026new (internal) widget class, BaseWidget. New, longer "official" names
3027for the geometry manager methods have been added,
3028e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
3029shorter names still work, and where there's ambiguity, pack wins over
3030place wins over grid. Also, the bind_class method now returns its
3031value.
3032
3033- New, RFC-822 conformant parsing of email addresses and address lists
3034in the rfc822 module, courtesy Ben Escoto.
3035
3036- New, revamped tkappinit.c with support for popular packages (PIL,
3037TIX, BLT, TOGL). For the last three, you need to execute the Tcl
3038command "load {} Tix" (or Blt, or Togl) to gain access to them.
3039The Modules/Setup line for the _tkinter module has been rewritten
3040using the cool line-breaking feature of most Bourne shells.
3041
3042- New socket method connect_ex() returns the error code from connect()
3043instead of raising an exception on errors; this makes the logic
3044required for asynchronous connects simpler and more efficient.
3045
3046- New "locale" module with (still experimental) interface to the
3047standard C library locale interface, courtesy Martin von Loewis. This
3048does not repeat my mistake in 1.5a4 of always calling
3049setlocale(LC_ALL, ""). In fact, we've pretty much decided that
3050Python's standard numerical formatting operations should always use
3051the conventions for the C locale; the locale module contains utility
3052functions to format numbers according to the user specified locale.
3053(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
3054"C") after locale-changing calls.) See the library manual. (Alas, the
3055promised changes to the "re" module for locale support have not been
3056materialized yet. If you care, volunteer!)
3057
3058- Memory leak plugged in Py_BuildValue when building a dictionary.
3059
3060- Shared modules can now live inside packages (hierarchical module
3061namespaces). No changes to the shared module itself are needed.
3062
3063- Improved policy for __builtins__: this is a module in __main__ and a
3064dictionary everywhere else.
3065
3066- Python no longer catches SIGHUP and SIGTERM by default. This was
3067impossible to get right in the light of thread contexts. If you want
3068your program to clean up when a signal happens, use the signal module
3069to set up your own signal handler.
3070
3071- New Python/C API PyNumber_CoerceEx() does not return an exception
3072when no coercion is possible. This is used to fix a problem where
3073comparing incompatible numbers for equality would raise an exception
3074rather than return false as in Python 1.4 -- it once again will return
3075false.
3076
3077- The errno module is changed again -- the table of error messages
3078(errorstr) is removed. Instead, you can use os.strerror(). This
3079removes redundance and a potential locale dependency.
3080
3081- New module xmllib, to parse XML files. By Sjoerd Mullender.
3082
3083- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
3084It resets the signal module's notion of what the current process ID
3085and thread are, so that signal handlers will work after (and across)
3086calls to os.fork().
3087
3088- Fixed most occurrences of fatal errors due to missing thread state.
3089
3090- For vgrind (a flexible source pretty printer) fans, there's a simple
3091Python definition in Misc/vgrindefs, courtesy Neale Pickett.
3092
3093- Fixed memory leak in exec statement.
3094
3095- The test.pystone module has a new function, pystones(loops=LOOPS),
3096which returns a (benchtime, stones) tuple. The main() function now
3097calls this and prints the report.
3098
3099- Package directories now *require* the presence of an __init__.py (or
3100__init__.pyc) file before they are considered as packages. This is
3101done to prevent accidental subdirectories with common names from
3102overriding modules with the same name.
3103
3104- Fixed some strange exceptions in __del__ methods in library modules
3105(e.g. urllib). This happens because the builtin names are already
3106deleted by the time __del__ is called. The solution (a hack, but it
3107works) is to set some instance variables to 0 instead of None.
3108
3109- The table of built-in module initializers is replaced by a pointer
3110variable. This makes it possible to switch to a different table at
3111run time, e.g. when a collection of modules is loaded from a shared
3112library. (No example code of how to do this is given, but it is
3113possible.) The table is still there of course, its name prefixed with
3114an underscore and used to initialize the pointer.
3115
3116- The warning about a thread still having a frame now only happens in
3117verbose mode.
3118
3119- Change the signal finialization so that it also resets the signal
3120handlers. After this has been called, our signal handlers are no
3121longer active!
3122
3123- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
3124literals. There's now also a test fort this module.
3125
3126- The copy module now also uses __dict__.update(state) instead of
3127going through individual attribute assignments, for class instances
3128without a __setstate__ method.
3129
3130- New module reconvert translates old-style (regex module) regular
3131expressions to new-style (re module, Perl-style) regular expressions.
3132
3133- Most modules that used to use the regex module now use the re
3134module. The grep module has a new pgrep() function which uses
3135Perl-style regular expressions.
3136
3137- The (very old, backwards compatibility) regexp.py module has been
3138deleted.
3139
3140- Restricted execution (rexec): added the pcre module (support for the
3141re module) to the list of trusted extension modules.
3142
3143- New version of Jim Fulton's CObject object type, adds
3144PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
3145
3146- Some patches to Lee Busby's fpectl mods that accidentally didn't
3147make it into 1.5a4.
3148
3149- In the string module, add an optional 4th argument to count(),
3150matching find() etc.
3151
3152- Patch for the nntplib module by Charles Waldman to add optional user
3153and password arguments to NNTP.__init__(), for nntp servers that need
3154them.
3155
3156- The str() function for class objects now returns
3157"modulename.classname" instead of returning the same as repr().
3158
3159- The parsing of \xXX escapes no longer relies on sscanf().
3160
3161- The "sharedmodules" subdirectory of the installation is renamed to
3162"lib-dynload". (You may have to edit your Modules/Setup file to fix
3163this in an existing installation!)
3164
3165- Fixed Don Beaudry's mess-up with the OPT test in the configure
3166script. Certain SGI platforms will still issue a warning for each
3167compile; there's not much I can do about this since the compiler's
3168exit status doesn't indicate that I was using an obsolete option.
3169
3170- Fixed Barry's mess-up with {}.get(), and added test cases for it.
3171
3172- Shared libraries didn't quite work under AIX because of the change
3173in status of the GNU readline interface. Fix due to by Vladimir
3174Marangozov.
3175
3176
3177======================================================================
3178
3179
3180From 1.5a3 to 1.5a4
3181===================
3182
3183- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
3184feature; better install instructions; removed faqmain.py (which was an
3185older version).
3186
3187- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
3188about the treatment of lines starting with '.'. Added a minimal test
3189function.
3190
3191- struct module: ignore most whitespace in format strings.
3192
3193- urllib.py: close the socket and temp file in URLopener.retrieve() so
3194that multiple retrievals using the same connection work.
3195
3196- All standard exceptions are now classes by default; use -X to make
3197them strings (for backward compatibility only).
3198
3199- There's a new standard exception hierarchy, defined in the standard
3200library module exceptions.py (which you never need to import
3201explicitly). See
3202http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
3203more info.
3204
3205- Three new C API functions:
3206
3207 - int PyErr_GivenExceptionMatches(obj1, obj2)
3208
3209 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
3210 instance of type obj2, or of a class derived from obj2
3211
3212 - int PyErr_ExceptionMatches(obj)
3213
3214 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
3215 PyErr_Occurred() as obj1. This will be the more commonly called
3216 function.
3217
3218 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
3219
3220 Normalizes exceptions, and places the normalized values in the
3221 arguments. If type is not a class, this does nothing. If type is a
3222 class, then it makes sure that value is an instance of the class by:
3223
3224 1. if instance is of the type, or a class derived from type, it does
3225 nothing.
3226
3227 2. otherwise it instantiates the class, using the value as an
3228 argument. If value is None, it uses an empty arg tuple, and if
3229 the value is a tuple, it uses just that.
3230
3231- Another new C API function: PyErr_NewException() creates a new
3232exception class derived from Exception; when -X is given, it creates a
3233new string exception.
3234
3235- core interpreter: remove the distinction between tuple and list
3236unpacking; allow an arbitrary sequence on the right hand side of any
3237unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
3238thing, which should really be called UNPACK_SEQUENCE.)
3239
3240- classes: Allow assignments to an instance's __dict__ or __class__,
3241so you can change ivars (including shared ivars -- shock horror) and
3242change classes dynamically. Also make the check on read-only
3243attributes of classes less draconic -- only the specials names
3244__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
3245assigned.
3246
3247- Two new built-in functions: issubclass() and isinstance(). Both
3248take classes as their second arguments. The former takes a class as
3249the first argument and returns true iff first is second, or is a
3250subclass of second. The latter takes any object as the first argument
3251and returns true iff first is an instance of the second, or any
3252subclass of second.
3253
3254- configure: Added configuration tests for presence of alarm(),
3255pause(), and getpwent().
3256
3257- Doc/Makefile: changed latex2html targets.
3258
3259- classes: Reverse the search order for the Don Beaudry hook so that
3260the first class with an applicable hook wins. Makes more sense.
3261
3262- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
3263now legal to call these more than once. The first call to
3264Py_Initialize() initializes, the first call to Py_Finalize()
3265finalizes. There's also a new API, Py_IsInitalized() which checks
3266whether we are already initialized (in case you want to leave things
3267as they were).
3268
3269- Completely disable the declarations for malloc(), realloc() and
3270free(). Any 90's C compiler has these in header files, and the tests
3271to decide whether to suppress the declarations kept failing on some
3272platforms.
3273
3274- *Before* (instead of after) signalmodule.o is added, remove both
3275intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
3276ld on various systems.
3277
3278- Added reop to PC/config.c
3279
3280- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
3281Removed outdated HP-UX comments from README. Added Cray T3E comments.
3282
3283- Various renames of statically defined functions that had name
3284conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
3285roundup (sys/types.h).
3286
3287- urllib.py: Interpret three slashes in file: URL as local file (for
3288Netscape on Windows/Mac).
3289
3290- copy.py: Make sure the objects returned by __getinitargs__() are
3291kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
3292easily reproducable because it requires a later call to
3293__getinitargs__() to return a tuple that happens to be allocated at
3294the same address.)
3295
3296- Added definition of AR to toplevel Makefile. Renamed @buildno temp
3297file to buildno1.
3298
3299- Moved Include/assert.h to Parser/assert.h, which seems to be the
3300only place where it's needed.
3301
3302- Tweaked the dictionary lookup code again for some more speed
3303(Vladimir Marangozov).
3304
3305- NT build: Changed the way python15.lib is included in the other
3306projects. Per Mark Hammond's suggestion, add it to the extra libs in
3307Settings instead of to the project's source files.
3308
3309- regrtest.py: Change default verbosity so that there are only three
3310levels left: -q, default and -v. In default mode, the name of each
3311test is now printed. -v is the same as the old -vv. -q is more quiet
3312than the old default mode.
3313
3314- Removed the old FAQ from the distribution. You now have to get it
3315from the web!
3316
3317- Removed the PC/make_nt.in file from the distribution; it is no
3318longer needed.
3319
3320- Changed the build sequence so that shared modules are built last.
3321This fixes things for AIX and doesn't hurt elsewhere.
3322
3323- Improved test for GNU MP v1 in mpzmodule.c
3324
3325- fileobject.c: ftell() on Linux discards all buffered data; changed
3326read() code to use lseek() instead to get the same effect
3327
3328- configure.in, configure, importdl.c: NeXT sharedlib fixes
3329
3330- tupleobject.c: PyTuple_SetItem asserts refcnt==1
3331
3332- resource.c: Different strategy regarding whether to declare
3333getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
3334conflicting decls in its headers. Choice: only declare the return
3335type, not the argument prototype, and not on Linux.
3336
3337- importdl.c, configure*: set sharedlib extensions properly for NeXT
3338
3339- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
3340fixed; moved addition of PURIFY to LINKCC to configure
3341
3342- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
3343added to shup up various compilers.
3344
3345- _tkinter.c: removed buggy mac #ifndef
3346
3347- Doc: various Mac documentation changes, added docs for 'ic' module
3348
3349- PC/make_nt.in: deleted
3350
3351- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
3352"")
3353
3354- test_rotor.py: print b -> print `b`
3355
3356- Tkinter.py: (tagOrId) -> (tagOrId,)
3357
3358- Tkinter.py: the Tk class now also has a configure() method and
3359friends (they have been moved to the Misc class to accomplish this).
3360
3361- dict.get(key[, default]) returns dict[key] if it exists, or default
3362if it doesn't. The default defaults to None. This is quicker for
3363some applications than using either has_key() or try:...except
3364KeyError:....
3365
3366- Tools/webchecker/: some small changes to webchecker.py; added
3367websucker.py (a simple web site mirroring script).
3368
3369- Dictionary objects now have a get() method (also in UserDict.py).
3370dict.get(key, default) returns dict[key] if it exists and default
3371otherwise; default defaults to None.
3372
3373- Tools/scripts/logmerge.py: print the author, too.
3374
3375- Changes to import: support for "import a.b.c" is now built in. See
3376http://grail.cnri.reston.va.us/python/essays/packages.html
3377for more info. Most important deviations from "ni.py": __init__.py is
3378executed in the package's namespace instead of as a submodule; and
3379there's no support for "__" or "__domain__". Note that "ni.py" is not
3380changed to match this -- it is simply declared obsolete (while at the
3381same time, it is documented...:-( ).
3382Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
3383for an example implementation of hierarchical module import written in
3384Python).
3385
3386- More changes to import: the site.py module is now imported by
3387default when Python is initialized; use -S to disable it. The site.py
3388module extends the path with several more directories: site-packages
3389inside the lib/python1.5/ directory, site-python in the lib/
3390directory, and pathnames mentioned in *.pth files found in either of
3391those directories. See
3392http://grail.cnri.reston.va.us/python/essays/packages.html
3393for more info.
3394
3395- Changes to standard library subdirectory names: those subdirectories
3396that are not packages have been renamed with a hypen in their name,
3397e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
3398The test suite is now a package -- to run a test, you must now use
3399"import test.test_foo".
3400
3401- A completely new re.py module is provided (thanks to Andrew
3402Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
3403"pcre" re compiler and engine. For a while, the "old" re.py (which
3404was new in 1.5a3!) will be kept around as re1.py. The "old" regex
3405module and underlying parser and engine are still present -- while
3406regex is now officially obsolete, it will probably take several major
3407release cycles before it can be removed.
3408
3409- The posix module now has a strerror() function which translates an
3410error code to a string.
3411
3412- The emacs.py module (which was long obsolete) has been removed.
3413
3414- The universal makefile Misc/Makefile.pre.in now features an
3415"install" target. By default, installed shared libraries go into
3416$exec_prefix/lib/python$VERSION/site-packages/.
3417
3418- The install-sh script is installed with the other configuration
3419specific files (in the config/ subdirectory).
3420
3421- It turns out whatsound.py and sndhdr.py were identical modules.
3422Since there's also an imghdr.py file, I propose to make sndhdr.py the
3423official one. For compatibility, whatsound.py imports * from
3424sndhdr.py.
3425
3426- Class objects have a new attribute, __module__, giving the name of
3427the module in which they were declared. This is useful for pickle and
3428for printing the full name of a class exception.
3429
3430- Many extension modules no longer issue a fatal error when their
3431initialization fails; the importing code now checks whether an error
3432occurred during module initialization, and correctly propagates the
3433exception to the import statement.
3434
3435- Most extension modules now raise class-based exceptions (except when
3436-X is used).
3437
3438- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
3439thread state -- just don't manipulate the lock if it isn't there.
3440
3441- Fixed a bug in Python/getopt.c that made it do the wrong thing when
3442an option was a single '-'. Thanks to Andrew Kuchling.
3443
3444- New module mimetypes.py will guess a MIME type from a filename's
3445extension.
3446
3447- Windows: the DLL version is now settable via a resource rather than
3448being hardcoded. This can be used for "branding" a binary Python
3449distribution.
3450
3451- urllib.py is now threadsafe -- it now uses re instead of regex, and
3452sys.exc_info() instead of sys.exc_{type,value}.
3453
3454- Many other library modules that used to use
3455sys.exc_{type,value,traceback} are now more thread-safe by virtue of
3456using sys.exc_info().
3457
3458- The functions in popen2 have an optional buffer size parameter.
3459Also, the command argument can now be either a string (passed to the
3460shell) or a list of arguments (passed directly to execv).
3461
3462- Alas, the thread support for _tkinter released with 1.5a3 didn't
3463work. It's been rewritten. The bad news is that it now requires a
3464modified version of a file in the standard Tcl distribution, which you
3465must compile with a -I option pointing to the standard Tcl source
3466tree. For this reason, the thread support is disabled by default.
3467
3468- The errno extension module adds two tables: errorcode maps errno
3469numbers to errno names (e.g. EINTR), and errorstr maps them to
3470message strings. (The latter is redundant because the new call
3471posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
3472
3473- The readline extension module now provides some interfaces to
3474internal readline routines that make it possible to write a completer
3475in Python. An example completer, rlcompleter.py, is provided.
3476
3477 When completing a simple identifier, it completes keywords,
3478 built-ins and globals in __main__; when completing
3479 NAME.NAME..., it evaluates (!) the expression up to the last
3480 dot and completes its attributes.
3481
3482 It's very cool to do "import string" type "string.", hit the
3483 completion key (twice), and see the list of names defined by
3484 the string module!
3485
3486 Tip: to use the tab key as the completion key, call
3487
3488 readline.parse_and_bind("tab: complete")
3489
3490- The traceback.py module has a new function tb_lineno() by Marc-Andre
3491Lemburg which extracts the line number from the linenumber table in
3492the code object. Apparently the traceback object doesn't contains the
3493right linenumber when -O is used. Rather than guessing whether -O is
3494on or off, the module itself uses tb_lineno() unconditionally.
3495
3496- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
3497to tag_bind() so it works again.
3498
3499- The pystone script is now a standard library module. Example use:
3500"import test.pystone; test.pystone.main()".
3501
3502- The import of the readline module in interactive mode is now also
3503attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
3504Lemburg, who asked for this. :-)
3505
3506- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
3507Mullender, to be closer to the standard. This fixes the getaddr()
3508method. Unfortunately, getaddrlist() is as broken as ever, since it
3509splits on commas without regard for RFC 822 quoting conventions.
3510
3511- pprint.py: correctly emit trailing "," in singleton tuples.
3512
3513- _tkinter.c: export names for its type objects, TkappType and
3514TkttType.
3515
3516- pickle.py: use __module__ when defined; fix a particularly hard to
3517reproduce bug that confuses the memo when temporary objects are
3518returned by custom pickling interfaces; and a semantic change: when
3519unpickling the instance variables of an instance, use
3520inst.__dict__.update(value) instead of a for loop with setattr() over
3521the value.keys(). This is more consistent (the pickling doesn't use
3522getattr() either but pickles inst.__dict__) and avoids problems with
3523instances that have a __setattr__ hook. But it *is* a semantic change
3524(because the setattr hook is no longer used). So beware!
3525
3526- config.h is now installed (at last) in
3527$exec_prefix/include/python1.5/. For most sites, this means that it
3528is actually in $prefix/include/python1.5/, with all the other Python
3529include files, since $prefix and $exec_prefix are the same by
3530default.
3531
3532- The imp module now supports parts of the functionality to implement
3533import of hierarchical module names. It now supports find_module()
3534and load_module() for all types of modules. Docstrings have been
3535added for those functions in the built-in imp module that are still
3536relevant (some old interfaces are obsolete). For a sample
3537implementation of hierarchical module import in Python, see the new
3538library module knee.py.
3539
3540- The % operator on string objects now allows arbitrary nested parens
3541in a %(...)X style format. (Brad Howes)
3542
3543- Reverse the order in which Setup and Setup.local are passed to the
3544makesetup script. This allows variable definitions in Setup.local to
3545override definitions in Setup. (But you'll still have to edit Setup
3546if you want to disable modules that are enabled by default, or if such
3547modules need non-standard options.)
3548
3549- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
3550is like PyImport_ImporModule(name) but receives the globals and locals
3551dict and the fromlist arguments as well. (The name is a char*; the
3552others are PyObject*s).
3553
3554- The 'p' format in the struct extension module alloded to above is
3555new in 1.5a4.
3556
3557- The types.py module now uses try-except in a few places to make it
3558more likely that it can be imported in restricted mode. Some type
3559names are undefined in that case, e.g. CodeType (inaccessible),
3560FileType (not always accessible), and TracebackType and FrameType
3561(inaccessible).
3562
3563- In urllib.py: added separate administration of temporary files
3564created y URLopener.retrieve() so cleanup() can properly remove them.
3565The old code removed everything in tempcache which was a bad idea if
3566the user had passed a non-temp file into it. Also, in basejoin(),
3567interpret relative paths starting in "../". This is necessary if the
3568server uses symbolic links.
3569
3570- The Windows build procedure and project files are now based on
3571Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
3572directory. It is much more robust, and properly builds separate Debug
3573and Release versions. (The installer will be added shortly.)
3574
3575- Added casts and changed some return types in regexpr.c to avoid
3576compiler warnings or errors on some platforms.
3577
3578- The AIX build tools for shared libraries now supports VPATH. (Donn
3579Cave)
3580
3581- By default, disable the "portable" multimedia modules audioop,
3582imageop, and rgbimg, since they don't work on 64-bit platforms.
3583
3584- Fixed a nasty bug in cStringIO.c when code was actually using the
3585close() method (the destructors would try to free certain fields a
3586second time).
3587
3588- For those who think they need it, there's a "user.py" module. This
3589is *not* imported by default, but can be imported to run user-specific
3590setup commands, ~/.pythonrc.py.
3591
3592- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
3593Vladimir Marangozov, and others.
3594
3595- Added os.altsep; this is '/' on DOS/Windows, and None on systems
3596with a sane filename syntax.
3597
3598- os.py: Write out the dynamic OS choice, to avoid exec statements.
3599Adding support for a new OS is now a bit more work, but I bet that
3600'dos' or 'nt' will cover most situations...
3601
3602- The obsolete exception AccessError is now really gone.
3603
3604- Tools/faqwiz/: New installation instructions show how to maintain
3605multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
3606Added instructions to bootstrap script, too. Version bumped to 0.8.1.
3607Added <html>...</html> feature suggested by Skip Montanaro. Added
3608leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
3609default SRCDIR.
3610
3611- Documentation for the relatively new modules "keyword" and "symbol"
3612has been added (to the end of the section on the parser extension
3613module).
3614
3615- In module bisect.py, but functions have two optional argument 'lo'
3616and 'hi' which allow you to specify a subsequence of the array to
3617operate on.
3618
3619- In ftplib.py, changed most methods to return their status (even when
3620it is always "200 OK") rather than swallowing it.
3621
3622- main() now calls setlocale(LC_ALL, ""), if setlocale() and
3623<locale.h> are defined.
3624
3625- Changes to configure.in, the configure script, and both
3626Makefile.pre.in files, to support SGI's SGI_ABI platform selection
3627environment variable.
3628
3629
3630======================================================================
3631
3632
3633From 1.4 to 1.5a3
3634=================
3635
3636Security
3637--------
3638
3639- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
3640please use the new version. The old version has a huge security leak.
3641
3642Miscellaneous
3643-------------
3644
3645- Because of various (small) incompatible changes in the Python
3646bytecode interpreter, the magic number for .pyc files has changed
3647again.
3648
3649- The default module search path is now much saner. Both on Unix and
3650Windows, it is essentially derived from the path to the executable
3651(which can be overridden by setting the environment variable
3652$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
3653front of the default path, like in Unix (instead of overriding the
3654default path). On Windows, the directory containing the executable is
3655added to the end of the path.
3656
3657- A new version of python-mode.el for Emacs has been included. Also,
3658a new file ccpy-style.el has been added to configure Emacs cc-mode for
3659the preferred style in Python C sources.
3660
3661- On Unix, when using sys.argv[0] to insert the script directory in
3662front of sys.path, expand a symbolic link. You can now install a
3663program in a private directory and have a symbolic link to it in a
3664public bin directory, and it will put the private directory in the
3665module search path. Note that the symlink is expanded in sys.path[0]
3666but not in sys.argv[0], so you can still tell the name by which you
3667were invoked.
3668
3669- It is now recommended to use ``#!/usr/bin/env python'' instead of
3670``#!/usr/local/bin/python'' at the start of executable scripts, except
3671for CGI scripts. It has been determined that the use of /usr/bin/env
3672is more portable than that of /usr/local/bin/python -- scripts almost
3673never have to be edited when the Python interpreter lives in a
3674non-standard place. Note that this doesn't work for CGI scripts since
3675the python executable often doesn't live in the HTTP server's default
3676search path.
3677
3678- The silly -s command line option and the corresponding
3679PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
3680flag in the Python/C API) are gone.
3681
3682- Most problems on 64-bit platforms should now be fixed. Andrew
3683Kuchling helped. Some uncommon extension modules are still not
3684clean (image and audio ops?).
3685
3686- Fixed a bug where multiple anonymous tuple arguments would be mixed up
3687when using the debugger or profiler (reported by Just van Rossum).
3688The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
3689would print the wrong value when run under the debugger or profiler.
3690
3691- The hacks that the dictionary implementation used to speed up
3692repeated lookups of the same C string were removed; these were a
3693source of subtle problems and don't seem to serve much of a purpose
3694any longer.
3695
3696- All traces of support for the long dead access statement have been
3697removed from the sources.
3698
3699- Plugged the two-byte memory leak in the tokenizer when reading an
3700interactive EOF.
3701
3702- There's a -O option to the interpreter that removes SET_LINENO
3703instructions and assert statements (see below); it uses and produces
3704.pyo files instead of .pyc files. The speedup is only a few percent
3705in most cases. The line numbers are still available in the .pyo file,
3706as a separate table (which is also available in .pyc files). However,
3707the removal of the SET_LINENO instructions means that the debugger
3708(pdb) can't set breakpoints on lines in -O mode. The traceback module
3709contains a function to extract a line number from the code object
3710referenced in a traceback object. In the future it should be possible
3711to write external bytecode optimizers that create better optimized
3712.pyo files, and there should be more control over optimization;
3713consider the -O option a "teaser". Without -O, the assert statement
3714actually generates code that first checks __debug__; if this variable
3715is false, the assertion is not checked. __debug__ is a built-in
3716variable whose value is initialized to track the -O flag (it's true
3717iff -O is not specified). With -O, no code is generated for assert
3718statements, nor for code of the form ``if __debug__: <something>''.
3719Sorry, no further constant folding happens.
3720
3721
3722Performance
3723-----------
3724
3725- It's much faster (almost twice for pystone.py -- see
3726Tools/scripts). See the entry on string interning below.
3727
3728- Some speedup by using separate free lists for method objects (both
3729the C and the Python variety) and for floating point numbers.
3730
3731- Big speedup by allocating frame objects with a single malloc() call.
3732The Python/C API for frames is changed (you shouldn't be using this
3733anyway).
3734
3735- Significant speedup by inlining some common opcodes for common operand
3736types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
3737
3738- Small speedup by reordering the method tables of some common
3739objects (e.g. list.append is now first).
3740
3741- Big optimization to the read() method of file objects. A read()
3742without arguments now attempts to use fstat to allocate a buffer of
3743the right size; for pipes and sockets, it will fall back to doubling
3744the buffer size. While that the improvement is real on all systems,
3745it is most dramatic on Windows.
3746
3747
3748Documentation
3749-------------
3750
3751- Many new pieces of library documentation were contributed, mostly by
3752Andrew Kuchling. Even cmath is now documented! There's also a
3753chapter of the library manual, "libundoc.tex", which provides a
3754listing of all undocumented modules, plus their status (e.g. internal,
3755obsolete, or in need of documentation). Also contributions by Sue
3756Williams, Skip Montanaro, and some module authors who succumbed to
3757pressure to document their own contributed modules :-). Note that
3758printing the documentation now kills fewer trees -- the margins have
3759been reduced.
3760
3761- I have started documenting the Python/C API. Unfortunately this project
3762hasn't been completed yet. It will be complete before the final release of
3763Python 1.5, though. At the moment, it's better to read the LaTeX source
3764than to attempt to run it through LaTeX and print the resulting dvi file.
3765
3766- The posix module (and hence os.py) now has doc strings! Thanks to Neil
3767Schemenauer. I received a few other contributions of doc strings. In most
3768other places, doc strings are still wishful thinking...
3769
3770
3771Language changes
3772----------------
3773
3774- Private variables with leading double underscore are now a permanent
3775feature of the language. (These were experimental in release 1.4. I have
3776favorable experience using them; I can't label them "experimental"
3777forever.)
3778
3779- There's new string literal syntax for "raw strings". Prefixing a string
3780literal with the letter r (or R) disables all escape processing in the
3781string; for example, r'\n' is a two-character string consisting of a
3782backslash followed by the letter n. This combines with all forms of string
3783quotes; it is actually useful for triple quoted doc strings which might
3784contain references to \n or \t. An embedded quote prefixed with a
3785backslash does not terminate the string, but the backslash is still
3786included in the string; for example, r'\'' is a two-character string
3787consisting of a backslash and a quote. (Raw strings are also
3788affectionately known as Robin strings, after their inventor, Robin
3789Friedrich.)
3790
3791- There's a simple assert statement, and a new exception
3792AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
3793not foo > 0: raise AssertionError''. Sorry, the text of the asserted
3794condition is not available; it would be too complicated to generate
3795code for this (since the code is generated from a parse tree).
3796However, the text is displayed as part of the traceback!
3797
3798- The raise statement has a new feature: when using "raise SomeClass,
3799somevalue" where somevalue is not an instance of SomeClass, it
3800instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
3801instance of a *derived* class of SomeClass, the exception class raised
3802is set to somevalue.__class__, and SomeClass is ignored after that.
3803
3804- Duplicate keyword arguments are now detected at compile time;
3805f(a=1,a=2) is now a syntax error.
3806
3807
3808Changes to builtin features
3809---------------------------
3810
3811- There's a new exception FloatingPointError (used only by Lee Busby's
3812patches to catch floating point exceptions, at the moment).
3813
3814- The obsolete exception ConflictError (presumably used by the long
3815obsolete access statement) has been deleted.
3816
3817- There's a new function sys.exc_info() which returns the tuple
3818(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
3819
3820- There's a new variable sys.executable, pointing to the executable file
3821for the Python interpreter.
3822
3823- The sort() methods for lists no longer uses the C library qsort(); I
3824wrote my own quicksort implementation, with lots of help (in the form
3825of a kind of competition) from Tim Peters. This solves a bug in
3826dictionary comparisons on some Solaris versions when Python is built
3827with threads, and makes sorting lists even faster.
3828
3829- The semantics of comparing two dictionaries have changed, to make
3830comparison of unequal dictionaries faster. A shorter dictionary is
3831always considered smaller than a larger dictionary. For dictionaries
3832of the same size, the smallest differing element determines the
3833outcome (which yields the same results as before in this case, without
3834explicit sorting). Thanks to Aaron Watters for suggesting something
3835like this.
3836
3837- The semantics of try-except have changed subtly so that calling a
3838function in an exception handler that itself raises and catches an
3839exception no longer overwrites the sys.exc_* variables. This also
3840alleviates the problem that objects referenced in a stack frame that
3841caught an exception are kept alive until another exception is caught
3842-- the sys.exc_* variables are restored to their previous value when
3843returning from a function that caught an exception.
3844
3845- There's a new "buffer" interface. Certain objects (e.g. strings and
3846arrays) now support the "buffer" protocol. Buffer objects are acceptable
3847whenever formerly a string was required for a write operation; mutable
3848buffer objects can be the target of a read operation using the call
3849f.readinto(buffer). A cool feature is that regular expression matching now
3850also work on array objects. Contribution by Jack Jansen. (Needs
3851documentation.)
3852
3853- String interning: dictionary lookups are faster when the lookup
3854string object is the same object as the key in the dictionary, not
3855just a string with the same value. This is done by having a pool of
3856"interned" strings. Most names generated by the interpreter are now
3857automatically interned, and there's a new built-in function intern(s)
3858that returns the interned version of a string. Interned strings are
3859not a different object type, and interning is totally optional, but by
3860interning most keys a speedup of about 15% was obtained for the
3861pystone benchmark.
3862
3863- Dictionary objects have several new methods; clear() and copy() have
3864the obvious semantics, while update(d) merges the contents of another
3865dictionary d into this one, overriding existing keys. The dictionary
3866implementation file is now called dictobject.c rather than the
3867confusing mappingobject.c.
3868
3869- The intrinsic function dir() is much smarter; it looks in __dict__,
3870__members__ and __methods__.
3871
3872- The intrinsic functions int(), long() and float() can now take a
3873string argument and then do the same thing as string.atoi(),
3874string.atol(), and string.atof(). No second 'base' argument is
3875allowed, and complex() does not take a string (nobody cared enough).
3876
3877- When a module is deleted, its globals are now deleted in two phases.
3878In the first phase, all variables whose name begins with exactly one
3879underscore are replaced by None; in the second phase, all variables
3880are deleted. This makes it possible to have global objects whose
3881destructors depend on other globals. The deletion order within each
3882phase is still random.
3883
3884- It is no longer an error for a function to be called without a
3885global variable __builtins__ -- an empty directory will be provided
3886by default.
3887
3888- Guido's corollary to the "Don Beaudry hook": it is now possible to
3889do metaprogramming by using an instance as a base class. Not for the
3890faint of heart; and undocumented as yet, but basically if a base class
3891is an instance, its class will be instantiated to create the new
3892class. Jim Fulton will love it -- it also works with instances of his
3893"extension classes", since it is triggered by the presence of a
3894__class__ attribute on the purported base class. See
3895Demo/metaclasses/index.html for an explanation and see that directory
3896for examples.
3897
3898- Another change is that the Don Beaudry hook is now invoked when
3899*any* base class is special. (Up to 1.5a3, the *last* special base
3900class is used; in 1.5a4, the more rational choice of the *first*
3901special base class is used.)
3902
3903- New optional parameter to the readlines() method of file objects.
3904This indicates the number of bytes to read (the actual number of bytes
3905read will be somewhat larger due to buffering reading until the end of
3906the line). Some optimizations have also been made to speed it up (but
3907not as much as read()).
3908
3909- Complex numbers no longer have the ".conj" pseudo attribute; use
3910z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
3911now *do* support the __members__ and __methods__ special attributes.
3912
3913- The complex() function now looks for a __complex__() method on class
3914instances before giving up.
3915
3916- Long integers now support arbitrary shift counts, so you can now
3917write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
3918shift count for this.)
3919
3920- The hex() and oct() functions have been changed so that for regular
3921integers, they never emit a minus sign. For example, on a 32-bit
3922machine, oct(-1) now returns '037777777777' and hex(-1) returns
3923'0xffffffff'. While this may seem inconsistent, it is much more
3924useful. (For long integers, a minus sign is used as before, to fit
3925the result in memory :-)
3926
3927- The hash() function computes better hashes for several data types,
3928including strings, floating point numbers, and complex numbers.
3929
3930
3931New extension modules
3932---------------------
3933
3934- New extension modules cStringIO.c and cPickle.c, written by Jim
3935Fulton and other folks at Digital Creations. These are much more
3936efficient than their Python counterparts StringIO.py and pickle.py,
3937but don't support subclassing. cPickle.c clocks up to 1000 times
3938faster than pickle.py; cStringIO.c's improvement is less dramatic but
3939still significant.
3940
3941- New extension module zlibmodule.c, interfacing to the free zlib
3942library (gzip compatible compression). There's also a module gzip.py
3943which provides a higher level interface. Written by Andrew Kuchling
3944and Jeremy Hylton.
3945
3946- New module readline; see the "miscellaneous" section above.
3947
3948- New Unix extension module resource.c, by Jeremy Hylton, provides
3949access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
3950related symbolic constants.
3951
3952- New extension puremodule.c, by Barry Warsaw, which interfaces to the
3953Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
3954possible to enable Purify by simply setting the PURIFY Makefile
3955variable in the Modules/Setup file.
3956
3957
3958Changes in extension modules
3959----------------------------
3960
3961- The struct extension module has several new features to control byte
3962order and word size. It supports reading and writing IEEE floats even
3963on platforms where this is not the native format. It uses uppercase
3964format codes for unsigned integers of various sizes (always using
3965Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
3966and 'p' for "Pascal strings" (with a leading length byte, included in
3967the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
3968big-endian data and '<' forces little-endian data; these also select
3969standard data sizes and disable automatic alignment (use pad bytes as
3970needed).
3971
3972- The array module supports uppercase format codes for unsigned data
3973formats (like the struct module).
3974
3975- The fcntl extension module now exports the needed symbolic
3976constants. (Formerly these were in FCNTL.py which was not available
3977or correct for all platforms.)
3978
3979- The extension modules dbm, gdbm and bsddb now check that the
3980database is still open before making any new calls.
3981
3982- The dbhash module is no more. Use bsddb instead. (There's a third
3983party interface for the BSD 2.x code somewhere on the web; support for
3984bsddb will be deprecated.)
3985
3986- The gdbm module now supports a sync() method.
3987
3988- The socket module now has some new functions: getprotobyname(), and
3989the set {ntoh,hton}{s,l}().
3990
3991- Various modules now export their type object: socket.SocketType,
3992array.ArrayType.
3993
3994- The socket module's accept() method now returns unknown addresses as
3995a tuple rather than raising an exception. (This can happen in
3996promiscuous mode.) Theres' also a new function getprotobyname().
3997
3998- The pthread support for the thread module now works on most platforms.
3999
4000- STDWIN is now officially obsolete. Support for it will eventually
4001be removed from the distribution.
4002
4003- The binascii extension module is now hopefully fully debugged.
4004(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
4005received.)
4006
4007- audioop.c: added a ratecv() function; better handling of overflow in
4008add().
4009
4010- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
4011Windows, also O_TEXT and O_BINARY. The 'error' variable (the
4012exception is raises) is renamed -- its string value is now "os.error",
4013so newbies don't believe they have to import posix (or nt) to catch
4014it when they see os.error reported as posix.error. The execve()
4015function now accepts any mapping object for the environment.
4016
4017- A new version of the al (audio library) module for SGI was
4018contributed by Sjoerd Mullender.
4019
4020- The regex module has a new function get_syntax() which retrieves the
4021syntax setting set by set_syntax(). The code was also sanitized,
4022removing worries about unclean error handling. See also below for its
4023successor, re.py.
4024
4025- The "new" module (which creates new objects of various types) once
4026again has a fully functioning new.function() method. Dangerous as
4027ever! Also, new.code() has several new arguments.
4028
4029- A problem has been fixed in the rotor module: on systems with signed
4030characters, rotor-encoded data was not portable when the key contained
40318-bit characters. Also, setkey() now requires its argument rather
4032than having broken code to default it.
4033
4034- The sys.builtin_module_names variable is now a tuple. Another new
4035variables in sys is sys.executable (the full path to the Python
4036binary, if known).
4037
4038- The specs for time.strftime() have undergone some revisions. It
4039appears that not all format characters are supported in the same way
4040on all platforms. Rather than reimplement it, we note these
4041differences in the documentation, and emphasize the shared set of
4042features. There's also a thorough test set (that occasionally finds
4043problems in the C library implementation, e.g. on some Linuxes),
4044thanks to Skip Montanaro.
4045
4046- The nis module seems broken when used with NIS+; unfortunately
4047nobody knows how to fix it. It should still work with old NIS.
4048
4049
4050New library modules
4051-------------------
4052
4053- New (still experimental) Perl-style regular expression module,
4054re.py, which uses a new interface for matching as well as a new
4055syntax; the new interface avoids the thread-unsafety of the regex
4056interface. This comes with a helper extension reopmodule.c and vastly
4057rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
4058Peters, and Andrew Kuchling. See the documentation libre.tex. In
40591.5, the old regex module is still fully supported; in the future, it
4060will become obsolete.
4061
4062- New module gzip.py; see zlib above.
4063
4064- New module keyword.py exports knowledge about Python's built-in
4065keywords. (New version by Ka-Ping Yee.)
4066
4067- New module pprint.py (with documentation) which supports
4068pretty-printing of lists, tuples, & dictionaries recursively. By Fred
4069Drake.
4070
4071- New module code.py. The function code.compile_command() can
4072determine whether an interactively entered command is complete or not,
4073distinguishing incomplete from invalid input. (XXX Unfortunately,
4074this seems broken at this moment, and I don't have the time to fix
4075it. It's probably better to add an explicit interface to the parser
4076for this.)
4077
4078- There is now a library module xdrlib.py which can read and write the
4079XDR data format as used by Sun RPC, for example. It uses the struct
4080module.
4081
4082
4083Changes in library modules
4084--------------------------
4085
4086- Module codehack.py is now completely obsolete.
4087
4088- The pickle.py module has been updated to make it compatible with the
4089new binary format that cPickle.c produces. By default it produces the
4090old all-ASCII format compatible with the old pickle.py, still much
4091faster than pickle.py; it will read both formats automatically. A few
4092other updates have been made.
4093
4094- A new helper module, copy_reg.py, is provided to register extensions
4095to the pickling code.
4096
4097- Revamped module tokenize.py is much more accurate and has an
4098interface that makes it a breeze to write code to colorize Python
4099source code. Contributed by Ka-Ping Yee.
4100
4101- In ihooks.py, ModuleLoader.load_module() now closes the file under
4102all circumstances.
4103
4104- The tempfile.py module has a new class, TemporaryFile, which creates
4105an open temporary file that will be deleted automatically when
4106closed. This works on Windows and MacOS as well as on Unix. (Jim
4107Fulton.)
4108
4109- Changes to the cgi.py module: Most imports are now done at the
4110top of the module, which provides a speedup when using ni (Jim
4111Fulton). The problem with file upload to a Windows platform is solved
4112by using the new tempfile.TemporaryFile class; temporary files are now
4113always opened in binary mode (Jim Fulton). The cgi.escape() function
4114now takes an optional flag argument that quotes '"' to '&quot;'. It
4115is now possible to invoke cgi.py from a command line script, to test
4116cgi scripts more easily outside an http server. There's an optional
4117limit to the size of uploads to POST (Skip Montanaro). Added a
4118'strict_parsing' option to all parsing functions (Jim Fulton). The
4119function parse_qs() now uses urllib.unquote() on the name as well as
4120the value of fields (Clarence Gardner). The FieldStorage class now
4121has a __len__() method.
4122
4123- httplib.py: the socket object is no longer closed; all HTTP/1.*
4124responses are now accepted; and it is now thread-safe (by not using
4125the regex module).
4126
4127- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
4128
4129- The popen2.py module is now rewritten using a class, which makes
4130access to the standard error stream and the process id of the
4131subprocess possible.
4132
4133- Added timezone support to the rfc822.py module, in the form of a
4134getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
4135Also added recognition of some non-standard date formats, by Lars
4136Wirzenius, and RFC 850 dates (Chris Lawrence).
4137
4138- mhlib.py: various enhancements, including almost compatible parsing
4139of message sequence specifiers without invoking a subprocess. Also
4140added a createmessage() method by Lars Wirzenius.
4141
4142- The StringIO.StringIO class now supports readline(nbytes). (Lars
4143Wirzenius.) (Of course, you should be using cStringIO for performance.)
4144
4145- UserDict.py supports the new dictionary methods as well.
4146
4147- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
4148speed it up, and replace 0 seed values by 1 to avoid degeneration.
4149A bug was fixed in the test for invalid arguments.
4150
4151- Module ftplib.py: added support for parsing a .netrc file (Fred
4152Drake). Also added an ntransfercmd() method to the FTP class, which
4153allows access to the expected size of a transfer when available, and a
4154parse150() function to the module which parses the corresponding 150
4155response.
4156
4157- urllib.py: the ftp cache is now limited to 10 entries. Added
4158quote_plus() and unquote_plus() functions which are like quote() and
4159unquote() but also replace spaces with '+' or vice versa, for
4160encoding/decoding CGI form arguments. Catch all errors from the ftp
4161module. HTTP requests now add the Host: header line. The proxy
4162variable names are now mapped to lower case, for Windows. The
4163spliturl() function no longer erroneously throws away all data past
4164the first newline. The basejoin() function now intereprets "../"
4165correctly. I *believe* that the problems with "exception raised in
4166__del__" under certain circumstances have been fixed (mostly by
4167changes elsewher in the interpreter).
4168
4169- In urlparse.py, there is a cache for results in urlparse.urlparse();
4170its size limit is set to 20. Also, new URL schemes shttp, https, and
4171snews are "supported".
4172
4173- shelve.py: use cPickle and cStringIO when available. Also added
4174a sync() method, which calls the database's sync() method if there is
4175one.
4176
4177- The mimetools.py module now uses the available Python modules for
4178decoding quoted-printable, uuencode and base64 formats, rather than
4179creating a subprocess.
4180
4181- The python debugger (pdb.py, and its base class bdb.py) now support
4182conditional breakpoints. See the docs.
4183
4184- The modules base64.py, uu.py and quopri.py can now be used as simple
4185command line utilities.
4186
4187- Various small fixes to the nntplib.py module that I can't bother to
4188document in detail.
4189
4190- Sjoerd Mullender's mimify.py module now supports base64 encoding and
4191includes functions to handle the funny encoding you sometimes see in mail
4192headers. It is now documented.
4193
4194- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
4195gotten from the environment.
4196
4197- Many more modules now correctly open files in binary mode when this
4198is necessary on non-Unix platforms.
4199
4200- The copying functions in the undocumented module shutil.py are
4201smarter.
4202
4203- The Writer classes in the formatter.py module now have a flush()
4204method.
4205
4206- The sgmllib.py module accepts hyphens and periods in the middle of
4207attribute names. While this is against the SGML standard, there is
4208some HTML out there that uses this...
4209
4210- The interface for the Python bytecode disassembler module, dis.py,
4211has been enhanced quite a bit. There's now one main function,
4212dis.dis(), which takes almost any kind of object (function, module,
4213class, instance, method, code object) and disassembles it; without
4214arguments it disassembles the last frame of the last traceback. The
4215other functions have changed slightly, too.
4216
4217- The imghdr.py module recognizes new image types: BMP, PNG.
4218
4219- The string.py module has a new function replace(str, old, new,
4220[maxsplit]) which does substring replacements. It is actually
4221implemented in C in the strop module. The functions [r]find() an
4222[r]index() have an optional 4th argument indicating the end of the
4223substring to search, alsoo implemented by their strop counterparts.
4224(Remember, never import strop -- import string uses strop when
4225available with zero overhead.)
4226
4227- The string.join() function now accepts any sequence argument, not
4228just lists and tuples.
4229
4230- The string.maketrans() requires its first two arguments to be
4231present. The old version didn't require them, but there's not much
4232point without them, and the documentation suggests that they are
4233required, so we fixed the code to match the documentation.
4234
4235- The regsub.py module has a function clear_cache(), which clears its
4236internal cache of compiled regular expressions. Also, the cache now
4237takes the current syntax setting into account. (However, this module
4238is now obsolete -- use the sub() or subn() functions or methods in the
4239re module.)
4240
4241- The undocumented module Complex.py has been removed, now that Python
4242has built-in complex numbers. A similar module remains as
4243Demo/classes/Complex.py, as an example.
4244
4245
4246Changes to the build process
4247----------------------------
4248
4249- The way GNU readline is configured is totally different. The
4250--with-readline configure option is gone. It is now an extension
4251module, which may be loaded dynamically. You must enable it (and
4252specify the correct linraries to link with) in the Modules/Setup file.
4253Importing the module installs some hooks which enable command line
4254editing. When the interpreter shell is invoked interactively, it
4255attempts to import the readline module; when this fails, the default
4256input mechanism is used. The hook variables are PyOS_InputHook and
4257PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
4258ideas from William Magro.)
4259
4260- New build procedure: a single library, libpython1.5.a, is now built,
4261which contains absolutely everything except for a one-line main()
4262program (which calls Py_Main(argc, argv) to start the interpreter
4263shell). This makes life much simpler for applications that need to
4264embed Python. The serial number of the build is now included in the
4265version string (sys.version).
4266
4267- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
4268emits a single warning any more when compiling Python.
4269
4270- A number of new Makefile variables have been added for special
4271situations, e.g. LDLAST is appended to the link command. These are
4272used by editing the Makefile or passing them on the make command
4273line.
4274
4275- A set of patches from Lee Busby has been integrated that make it
4276possible to catch floating point exceptions. Use the configure option
4277--with-fpectl to enable the patches; the extension modules fpectl and
4278fpetest provide control to enable/disable and test the feature,
4279respectively.
4280
4281- The support for shared libraries under AIX is now simpler and more
4282robust. Thanks to Vladimir Marangozov for revamping his own patches!
4283
4284- The Modules/makesetup script now reads a file Setup.local as well as
4285a file Setup. Most changes to the Setup script can be done by editing
4286Setup.local instead, which makes it easier to carry a particular setup
4287over from one release to the next.
4288
4289- The Modules/makesetup script now copies any "include" lines it
4290encounters verbatim into the output Makefile. It also recognizes .cxx
4291and .cpp as C++ source files.
4292
4293- The configure script is smarter about C compiler options; e.g. with
4294gcc it uses -O2 and -g when possible, and on some other platforms it
4295uses -Olimit 1500 to avoid a warning from the optimizer about the main
4296loop in ceval.c (which has more than 1000 basic blocks).
4297
4298- The configure script now detects whether malloc(0) returns a NULL
4299pointer or a valid block (of length zero). This avoids the nonsense
4300of always adding one byte to all malloc() arguments on most platforms.
4301
4302- The configure script has a new option, --with-dec-threads, to enable
4303DEC threads on DEC Alpha platforms. Also, --with-threads is now an
4304alias for --with-thread (this was the Most Common Typo in configure
4305arguments).
4306
4307- Many changes in Doc/Makefile; amongst others, latex2html is now used
4308to generate HTML from all latex documents.
4309
4310
4311Change to the Python/C API
4312--------------------------
4313
4314- Because some interfaces have changed, the PYTHON_API macro has been
4315bumped. Most extensions built for the old API version will still run,
4316but I can't guarantee this. Python prints a warning message on
4317version mismatches; it dumps core when the version mismatch causes a
4318serious problem :-)
4319
4320- I've completed the Grand Renaming, with the help of Roger Masse and
4321Barry Warsaw. This makes reading or debugging the code much easier.
4322Many other unrelated code reorganizations have also been carried out.
4323The allobjects.h header file is gone; instead, you would have to
4324include Python.h followed by rename2.h. But you're better off running
4325Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
4326the rename2.h; it will disappear in the next release.
4327
4328- Various and sundry small bugs in the "abstract" interfaces have been
4329fixed. Thanks to all the (involuntary) testers of the Python 1.4
4330version! Some new functions have been added, e.g. PySequence_List(o),
4331equivalent to list(o) in Python.
4332
4333- New API functions PyLong_FromUnsignedLong() and
4334PyLong_AsUnsignedLong().
4335
4336- The API functions in the file cgensupport.c are no longer
4337supported. This file has been moved to Modules and is only ever
4338compiled when the SGI specific 'gl' module is built.
4339
4340- PyObject_Compare() can now raise an exception. Check with
4341PyErr_Occurred(). The comparison function in an object type may also
4342raise an exception.
4343
4344- The slice interface uses an upper bound of INT_MAX when no explicit
4345upper bound is given (e.x. for a[1:]). It used to ask the object for
4346its length and do the calculations.
4347
4348- Support for multiple independent interpreters. See Doc/api.tex,
4349functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
4350documentation is incomplete, also see the new Demo/pysvr example
4351(which shows how to use these in a threaded application) and the
4352source code.
4353
4354- There is now a Py_Finalize() function which "de-initializes"
4355Python. It is possible to completely restart the interpreter
4356repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
4357change of functionality in Py_Initialize() means that it is now a
4358fatal error to call it while the interpreter is already initialized.
4359The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
4360is deprecated (it is nothing more than Py_Finalize() followed by
4361exit()).
4362
4363- There are no known memory leaks left. While Py_Finalize() doesn't
4364free *all* allocated memory (some of it is hard to track down),
4365repeated calls to Py_Finalize() and Py_Initialize() do not create
4366unaccessible heap blocks.
4367
4368- There is now explicit per-thread state. (Inspired by, but not the
4369same as, Greg Stein's free threading patches.)
4370
4371- There is now better support for threading C applications. There are
4372now explicit APIs to manipulate the interpreter lock. Read the source
4373or the Demo/pysvr example; the new functions are
4374PyEval_{Acquire,Release}{Lock,Thread}().
4375
4376- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
4377with other libraries' DEBUG macros. Likewise for any other test
4378macros that didn't yet start with Py_.
4379
4380- New wrappers around malloc() and friends: Py_Malloc() etc. call
4381malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
4382just malloc(). Use of these wrappers could be essential if multiple
4383memory allocators exist (e.g. when using certain DLL setups under
4384Windows). (Idea by Jim Fulton.)
4385
4386- New C API PyImport_Import() which uses whatever __import__() hook
4387that is installed for the current execution environment. By Jim
4388Fulton.
4389
4390- It is now possible for an extension module's init function to fail
4391non-fatally, by calling one of the PyErr_* functions and returning.
4392
4393- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
4394argument to the proper type, like the similar PyString macros already
4395did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
4396and PyList_GET_ITEM.
4397
4398- Some of the Py_Get* function, like Py_GetVersion() (but not yet
4399Py_GetPath()) are now declared as returning a const char *. (More
4400should follow.)
4401
4402- Changed the run-time library to check for exceptions after object
4403comparisons. PyObject_Compare() can now return an exception; use
4404PyErr_Occurred() to check (there is *no* special return value).
4405
4406- PyFile_WriteString() and Py_Flushline() now return error indicators
4407instead of clearing exceptions. This fixes an obscure bug where using
4408these would clear a pending exception, discovered by Just van Rossum.
4409
4410- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
4411an argument list including keyword arguments. Contributed by Geoff
4412Philbrick.
4413
4414- PyArg_GetInt() is gone.
4415
4416- It's no longer necessary to include graminit.h when calling one of
4417the extended parser API functions. The three public grammar start
4418symbols are now in Python.h as Py_single_input, Py_file_input, and
4419Py_eval_input.
4420
4421- The CObject interface has a new function,
4422PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
4423on the object referenced by "module.name".
4424
4425
4426Tkinter
4427-------
4428
4429- On popular demand, _tkinter once again installs a hook for readline
4430that processes certain Tk events while waiting for the user to type
4431(using PyOS_InputHook).
4432
4433- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
4434caused by command definitions referencing widget objects beyond their
4435lifetime.
4436
4437- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
4438tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
4439with the new Tk dialog scripts, and provide more "native platform"
4440style file selection dialog boxes on some platforms. Contributed by
4441Fredrik Lundh.
4442
4443- Tkinter.py: when the first Tk object is destroyed, it sets the
4444hiddel global _default_root to None, so that when another Tk object is
4445created it becomes the new default root. Other miscellaneous
4446changes and fixes.
4447
4448- The Image class now has a configure method.
4449
4450- Added a bunch of new winfo options to Tkinter.py; we should now be
4451up to date with Tk 4.2. The new winfo options supported are:
4452mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
4453visualsavailable.
4454
4455- The broken bind() method on Canvas objects defined in the Canvas.py
4456module has been fixed. The CanvasItem and Group classes now also have
4457an unbind() method.
4458
4459- The problem with Tkinter.py falling back to trying to import
4460"tkinter" when "_tkinter" is not found has been fixed -- it no longer
4461tries "tkinter", ever. This makes diagnosing the problem "_tkinter
4462not configured" much easier and will hopefully reduce the newsgroup
4463traffic on this topic.
4464
4465- The ScrolledText module once again supports the 'cnf' parameter, to
4466be compatible with the examples in Mark Lutz' book (I know, I know,
4467too late...)
4468
4469- The _tkinter.c extension module has been revamped. It now support
4470Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
4471works well under Windows and Mac (with the latest Tk ports to those
4472platforms). It also supports threading -- it is safe for one
4473(Python-created) thread to be blocked in _tkinter.mainloop() while
4474other threads modify widgets. To make the changes visible, those
4475threads must use update_idletasks()method. (The patch for threading
4476in 1.5a3 was broken; in 1.5a4, it is back in a different version,
4477which requires access to the Tcl sources to get it to work -- hence it
4478is disabled by default.)
4479
4480- A bug in _tkinter.c has been fixed, where Split() with a string
4481containing an unmatched '"' could cause an exception or core dump.
4482
4483- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
4484CreateFileHandler, so _tkinter.createfilehandler is not available on
4485those platforms when using Tk 8.0 or later. I will have to rethink
4486how to interface with Tcl's lower-level event mechanism, or with its
4487channels (which are like Python's file-like objects). Jack Jansen has
4488provided a fix for the Mac, so createfilehandler *is* actually
4489supported there; maybe I can adapt his fix for Windows.
4490
4491
4492Tools and Demos
4493---------------
4494
4495- A new regression test suite is provided, which tests most of the
4496standard and built-in modules. The regression test is run by invoking
4497the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
4498he and Roger Masse contributed most of the new tests.
4499
4500- New tool: faqwiz -- the CGI script that is used to maintain the
4501Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
4502Tools/faqwiz.
4503
4504- New tool: webchecker -- a simple extensible web robot that, when
4505aimed at a web server, checks that server for dead links. Available
4506are a command line utility as well as a Tkinter based GUI version. In
4507Tools/webchecker. A simplified version of this program is dissected
4508in my article in O'Reilly's WWW Journal, the issue on Scripting
4509Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
4510Includes a parser for robots.txt files by Skip Montanaro.
4511
4512- New small tools: cvsfiles.py (prints a list of all files under CVS
4513n a particular directory tree), treesync.py (a rather Guido-specific
4514script to synchronize two source trees, one on Windows NT, the other
4515one on Unix under CVS but accessible from the NT box), and logmerge.py
4516(sort a collection of RCS or CVS logs by date). In Tools/scripts.
4517
4518- The freeze script now also works under Windows (NT). Another
4519feature allows the -p option to be pointed at the Python source tree
4520instead of the installation prefix. This was loosely based on part of
4521xfreeze by Sam Rushing and Bill Tutt.
4522
4523- New examples (Demo/extend) that show how to use the generic
4524extension makefile (Misc/Makefile.pre.in).
4525
4526- Tools/scripts/h2py.py now supports C++ comments.
4527
4528- Tools/scripts/pystone.py script is upgraded to version 1.1; there
4529was a bug in version 1.0 (distributed with Python 1.4) that leaked
4530memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
4531
4532- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
4533
4534
4535Windows (NT and 95)
4536-------------------
4537
4538- New project files for Developer Studio (Visual C++) 5.0 for Windows
4539NT (the old VC++ 4.2 Makefile is also still supported, but will
4540eventually be withdrawn due to its bulkiness).
4541
4542- See the note on the new module search path in the "Miscellaneous" section
4543above.
4544
4545- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
4546basically withdrawn. If it still works for you, you're lucky.
4547
4548- There's a new extension module, msvcrt.c, which provides various
4549low-level operations defined in the Microsoft Visual C++ Runtime Library.
4550These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
4551console I/O functions like kbhit(), getch() and putch().
4552
4553- The -u option not only sets the standard I/O streams to unbuffered
4554status, but also sets them in binary mode. (This can also be done
4555using msvcrt.setmode(), by the way.)
4556
4557- The, sys.prefix and sys.exec_prefix variables point to the directory
4558where Python is installed, or to the top of the source tree, if it was run
4559from there.
4560
4561- The various os.path modules (posixpath, ntpath, macpath) now support
4562passing more than two arguments to the join() function, so
4563os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
4564c)).
4565
4566- The ntpath module (normally used as os.path) supports ~ to $HOME
4567expansion in expanduser().
4568
4569- The freeze tool now works on Windows.
4570
4571- See also the Tkinter category for a sad note on
4572_tkinter.createfilehandler().
4573
4574- The truncate() method for file objects now works on Windows.
4575
4576- Py_Initialize() is no longer called when the DLL is loaded. You
4577must call it yourself.
4578
4579- The time module's clock() function now has good precision through
4580the use of the Win32 API QueryPerformanceCounter().
4581
4582- Mark Hammond will release Python 1.5 versions of PythonWin and his
4583other Windows specific code: the win32api extensions, COM/ActiveX
4584support, and the MFC interface.
4585
4586
4587Mac
4588---
4589
4590- As always, the Macintosh port will be done by Jack Jansen. He will
4591make a separate announcement for the Mac specific source code and the
4592binary distribution(s) when these are ready.
4593
4594
4595======================================================================
Guido van Rossuma7925f11994-01-26 10:20:16 +00004596
Guido van Rossumaa253861994-10-06 17:18:57 +00004597
Guido van Rossumc30e95f1996-07-30 18:53:51 +00004598=====================================
Guido van Rossum821a5581997-05-23 04:05:31 +00004599==> Release 1.4 (October 25 1996) <==
4600=====================================
4601
4602(Starting in reverse chronological order:)
4603
4604- Changed disclaimer notice.
4605
4606- Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions
4607default to the user's login shell.
4608
4609- In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text
4610widget, and bogus bspace() function.
4611
4612- In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated
4613paragraph.
4614
4615- Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all
4616subprojects, and to remove the (broken) experimental NumPy
4617subprojects.
4618
4619- In Lib/py_compile.py, cast mtime to long() so it will work on Mac
4620(where os.stat() returns mtimes as floats.)
4621- Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to
4622fix POST in CGIHTTPServer.py.
4623
4624- Version 2.83 of Misc/python-mode.el for Emacs is included.
4625
4626- In Modules/regexmodule.c, fixed symcomp() to correctly handle a new
4627group starting immediately after a group tag.
4628
4629- In Lib/SocketServer.py, changed the mode for rfile to unbuffered.
4630
4631- In Objects/stringobject.c, fixed the compare function to do the
4632first char comparison in unsigned mode, for consistency with the way
4633other characters are compared by memcmp().
4634
4635- In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats.
4636
4637- In Lib/urllib.py, fix another case where openedurl wasn't set.
4638
4639(XXX Sorry, the rest is in totally random order. No time to fix it.)
4640
4641- SyntaxError exceptions detected during code generation
4642(e.g. assignment to an expression) now include a line number.
4643
4644- Don't leave trailing / or \ in script directory inserted in front of
4645sys.path.
4646
4647- Added a note to Tools/scripts/classfix.py abouts its historical
4648importance.
4649
4650- Added Misc/Makefile.pre.in, a universal Makefile for extensions
4651built outside the distribution.
4652
4653- Rewritten Misc/faq2html.py, by Ka-Ping Yee.
4654
4655- Install shared modules with mode 555 (needed for performance on some
4656platforms).
4657
4658- Some changes to standard library modules to avoid calling append()
4659with more than one argument -- while supported, this should be
4660outlawed, and I don't want to set a bad example.
4661
4662- bdb.py (and hence pdb.py) supports calling run() with a code object
4663instead of a code string.
4664
4665- Fixed an embarrassing bug cgi.py which prevented correct uploading
4666of binary files from Netscape (which doesn't distinguish between
4667binary and text files). Also added dormant logging support, which
4668makes it easier to debug the cgi module itself.
4669
4670- Added default writer to constructor of NullFormatter class.
4671
4672- Use binary mode for socket.makefile() calls in ftplib.py.
4673
4674- The ihooks module no longer "installs" itself upon import -- this
4675was an experimental feature that helped ironing out some bugs but that
4676slowed down code that imported it without the need to install it
4677(e.g. the rexec module). Also close the file in some cases and add
4678the __file__ attribute to loaded modules.
4679
4680- The test program for mailbox.py is now more useful.
4681
4682- Added getparamnames() to Message class in mimetools.py -- it returns
4683the names of parameters to the content-type header.
4684
4685- Fixed a typo in ni that broke the loop stripping "__." from names.
4686
4687- Fix sys.path[0] for scripts run via pdb.py's new main program.
4688
4689- profile.py can now also run a script, like pdb.
4690
4691- Fix a small bug in pyclbr -- don't add names starting with _ when
4692emulating from ... import *.
4693
4694- Fixed a series of embarrassing typos in rexec's handling of standard
4695I/O redirection. Added some more "safe" built-in modules: cmath,
4696errno, operator.
4697
4698- Fixed embarrassing typo in shelve.py.
4699
4700- Added SliceType and EllipsisType to types.py.
4701
4702- In urllib.py, added handling for error 301 (same as 302); added
4703geturl() method to get the URL after redirection.
4704
4705- Fixed embarrassing typo in xdrlib.py. Also fixed typo in Setup.in
4706for _xdrmodule.c and removed redundant #include from _xdrmodule.c.
4707
4708- Fixed bsddbmodule.c to add binary mode indicator on platforms that
4709have it. This should make it working on Windows NT.
4710
4711- Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32,
4712whatever applies. Also rationalized some other tests for various MS
4713platforms.
4714
4715- Added the sources for the NT installer script used for Python
47161.4beta3. Not tested with this release, but better than nothing.
4717
4718- A compromise in pickle's defenses against Trojan horses: a
4719user-defined function is now okay where a class is expected. A
4720built-in function is not okay, to prevent pickling something that
4721will execute os.system("rm -f *") when unpickling.
4722
4723- dis.py will print the name of local variables referenced by local
4724load/store/delete instructions.
4725
4726- Improved portability of SimpleHTTPServer module to non-Unix
4727platform.
4728
4729- The thread.h interface adds an extra argument to down_sema(). This
4730only affects other C code that uses thread.c; the Python thread module
4731doesn't use semaphores (which aren't provided on all platforms where
4732Python threads are supported). Note: on NT, this change is not
4733implemented.
4734
4735- Fixed some typos in abstract.h; corrected signature of
4736PyNumber_Coerce, added PyMapping_DelItem. Also fixed a bug in
4737abstract.c's PyObject_CallMethod().
4738
4739- apply(classname, (), {}) now works even if the class has no
4740__init__() method.
4741
4742- Implemented complex remainder and divmod() (these would dump core!).
4743Conversion of complex numbers to int, long int or float now raises an
4744exception, since there is no meaningful way to do it without losing
4745information.
4746
4747- Fixed bug in built-in complex() function which gave the wrong result
4748for two real arguments.
4749
4750- Change the hash algorithm for strings -- the multiplier is now
47511000003 instead of 3, which gives better spread for short strings.
4752
4753- New default path for Windows NT, the registry structure now supports
4754default paths for different install packages. (Mark Hammond -- the
4755next PythonWin release will use this.)
4756
4757- Added more symbols to the python_nt.def file.
4758
4759- When using GNU readline, set rl_readline_name to "python".
4760
4761- The Ellipses built-in name has been renamed to Ellipsis -- this is
4762the correct singular form. Thanks to Ka-Ping Yee, who saved us from
4763eternal embarrassment.
4764
4765- Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses ->
4766Ellipsis name change.
4767
4768- Updated the library reference manual. Added documentation of
4769restricted mode (rexec, Bastion) and the formatter module (for use
4770with the htmllib module). Fixed the documentation of htmllib
4771(finally).
4772
4773- The reference manual is now maintained in FrameMaker.
4774
4775- Upgraded scripts Doc/partparse.py and Doc/texi2html.py.
4776
4777- Slight improvements to Doc/Makefile.
4778
4779- Added fcntl.lockf(). This should be used for Unix file locking
4780instead of the posixfile module; lockf() is more portable.
4781
4782- The getopt module now supports long option names, thanks to Lars
4783Wizenius.
4784
4785- Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake
4786and Nils Fischbeck.
4787
4788- Use more bits of time.time() in whrandom's default seed().
4789
4790- Performance hack for regex module's regs attribute.
4791
4792- Don't close already closed socket in socket module.
4793
4794- Correctly handle separators containing embedded nulls in
4795strop.split, strop.find and strop.rfind. Also added more detail to
4796error message for strop.atoi and friends.
4797
4798- Moved fallback definition for hypot() to Python/hypot.c.
4799
4800- Added fallback definition for strdup, in Python/strdup.c.
4801
4802- Fixed some bugs where a function would return 0 to indicate an error
4803where it should return -1.
4804
4805- Test for error returned by time.localtime(), and rationalized its MS
4806tests.
4807
4808- Added Modules/Setup.local file, which is processed after Setup.
4809
4810- Corrected bug in toplevel Makefile.in -- execution of regen script
4811would not use the right PATH and PYTHONPATH.
4812
4813- Various and sundry NeXT configuration changes (sigh).
4814
4815- Support systems where libreadline needs neither termcap nor curses.
4816
4817- Improved ld_so_aix script and python.exp file (for AIX).
4818
4819- More stringent test for working <stdarg.h> in configure script.
4820
4821- Removed Demo/www subdirectory -- it was totally out of date.
4822
4823- Improved demos and docs for Fred Drake's parser module; fixed one
4824typo in the module itself.
4825
4826
4827=========================================
4828==> Release 1.4beta3 (August 26 1996) <==
4829=========================================
4830
4831
4832(XXX This is less readable that it should. I promise to restructure
4833it for the final 1.4 release.)
4834
4835
4836What's new in 1.4beta3 (since beta2)?
4837-------------------------------------
4838
4839- Name mangling to implement a simple form of class-private variables.
4840A name of the form "__spam" can't easily be used outside the class.
4841(This was added in 1.4beta3, but left out of the 1.4beta3 release
4842message.)
4843
4844- In urllib.urlopen(): HTTP URLs containing user:passwd@host are now
4845handled correctly when using a proxy server.
4846
4847- In ntpath.normpath(): don't truncate to 8+3 format.
4848
4849- In mimetools.choose_boundary(): don't die when getuid() or getpid()
4850aren't defined.
4851
4852- Module urllib: some optimizations to (un)quoting.
4853
4854- New module MimeWriter for writing MIME documents.
4855
4856- More changes to formatter module.
4857
4858- The freeze script works once again and is much more robust (using
4859sys.prefix etc.). It also supports a -o option to specify an
4860output directory.
4861
4862- New module whichdb recognizes dbm, gdbm and bsddb/dbhash files.
4863
4864- The Doc/Makefile targets have been reorganized somewhat to remove the
4865insistence on always generating PostScript.
4866
4867- The texinfo to html filter (Doc/texi2html.py) has been improved somewhat.
4868
4869- "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing
4870name conflict on the Mac.
4871
4872- Linking a module compiled with a different setting for Py_TRACE_REFS now
4873generates a linker error rather than a core dump.
4874
4875- The cgi module has a new convenience function print_exception(), which
4876formats a python exception using HTML. It also fixes a bug in the
4877compatibility code and adds a dubious feature which makes it possible to
4878have two query strings, one in the URL and one in the POST data.
4879
4880- A subtle change in the unpickling of class instances makes it possible
4881to unpickle in restricted execution mode, where the __dict__ attribute is
4882not available (but setattr() is).
4883
4884- Documentation for os.path.splitext() (== posixpath.splitext()) has been
4885cleared up. It splits at the *last* dot.
4886
4887- posixfile locking is now also correctly supported on AIX.
4888
4889- The tempfile module once again honors an initial setting of tmpdir. It
4890now works on Windows, too.
4891
4892- The traceback module has some new functions to extract, format and print
4893the active stack.
4894
4895- Some translation functions in the urllib module have been made a little
4896less sluggish.
4897
4898- The addtag_* methods for Canvas widgets in Tkinter as well as in the
4899separate Canvas class have been fixed so they actually do something
4900meaningful.
4901
4902- A tiny _test() function has been added to Tkinter.py.
4903
4904- A generic Makefile for dynamically loaded modules is provided in the Misc
4905subdirectory (Misc/gMakefile).
4906
4907- A new version of python-mode.el for Emacs is provided. See
4908http://www.python.org/ftp/emacs/pmdetails.html for details. The
4909separate file pyimenu.el is no longer needed, imenu support is folded
4910into python-mode.el.
4911
4912- The configure script can finally correctly find the readline library in a
4913non-standard location. The LDFLAGS variable is passed on the the Makefiles
4914from the configure script.
4915
4916- Shared libraries are now installed as programs (i.e. with executable
4917permission). This is required on HP-UX and won't hurt on other systems.
4918
4919- The objc.c module is no longer part of the distribution. Objective-C
4920support may become available as contributed software on the ftp site.
4921
4922- The sybase module is no longer part of the distribution. A much
4923improved sybase module is available as contributed software from the
4924ftp site.
4925
4926- _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and
4927Mac (don't use unpatched Tcl/Tk!). The default line in the Setup.in file
4928now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0.
4929
4930- In Setup, you can now write "*shared*" instead of "*noconfig*", and you
4931can use *.so and *.sl as shared libraries.
4932
4933- Some more fidgeting for AIX shared libraries.
4934
4935- The mpz module is now compatible with GMP 2.x. (Not tested by me.)
4936(Note -- a complete replacement by Niels Mo"ller, called gpmodule, is
4937available from the contrib directory on the ftp site.)
4938
4939- A warning is written to sys.stderr when a __del__ method raises an
4940exception (formerly, such exceptions were completely ignored).
4941
4942- The configure script now defines HAVE_OLD_CPP if the C preprocessor is
4943incapable of ANSI style token concatenation and stringification.
4944
4945- All source files (except a few platform specific modules) are once again
4946compatible with K&R C compilers as well as ANSI compilers. In particular,
4947ANSI-isms have been removed or made conditional in complexobject.c,
4948getargs.c and operator.c.
4949
4950- The abstract object API has three new functions, PyObject_DelItem,
4951PySequence_DelItem, and PySequence_DelSlice.
4952
4953- The operator module has new functions delitem and delslice, and the
4954functions "or" and "and" are renamed to "or_" and "and_" (since "or" and
4955"and" are reserved words). ("__or__" and "__and__" are unchanged.)
4956
4957- The environment module is no longer supported; putenv() is now a function
4958in posixmodule (also under NT).
4959
4960- Error in filter(<function>, "") has been fixed.
4961
4962- Unrecognized keyword arguments raise TypeError, not KeyError.
4963
4964- Better portability, fewer bugs and memory leaks, fewer compiler warnings,
4965some more documentation.
4966
4967- Bug in float power boundary case (0.0 to the negative integer power)
4968fixed.
4969
4970- The test of negative number to the float power has been moved from the
4971built-in pow() functin to floatobject.c (so complex numbers can yield the
4972correct result).
4973
4974- The bug introduced in beta2 where shared libraries loaded (using
4975dlopen()) from the current directory would fail, has been fixed.
4976
4977- Modules imported as shared libraries now also have a __file__ attribute,
4978giving the filename from which they were loaded. The only modules without
4979a __file__ attribute now are built-in modules.
4980
4981- On the Mac, dynamically loaded modules can end in either ".slb" or
4982".<platform>.slb" where <platform> is either "CFM68K" or "ppc". The ".slb"
4983extension should only be used for "fat" binaries.
4984
4985- C API addition: marshal.c now supports
4986PyMarshal_WriteObjectToString(object).
4987
4988- C API addition: getargs.c now supports
4989PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...)
4990to parse keyword arguments.
4991
4992- The PC versioning scheme (sys.winver) has changed once again. the
4993version number is now "<digit>.<digit>.<digit>.<apiversion>", where the
4994first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4,
4995"1.4.1" for Python 1.4.1 -- the beta level is not included) and
4996<apiversion> is the four-digit PYTHON_API_VERSION (currently 1005).
4997
4998- h2py.py accepts whitespace before the # in CPP directives
4999
5000- On Solaris 2.5, it should now be possible to use either Posix threads or
5001Solaris threads (XXX: how do you select which is used???). (Note: the
5002Python pthreads interface doesn't fully support semaphores yet -- anyone
5003care to fix this?)
5004
5005- Thread support should now work on AIX, using either DCE threads or
5006pthreads.
5007
5008- New file Demo/sockets/unicast.py
5009
5010- Working Mac port, with CFM68K support, with Tk 4.1 support (though not
5011both) (XXX)
5012
5013- New project setup for PC port, now compatible with PythonWin, with
5014_tkinter and NumPy support (XXX)
5015
5016- New module site.py (XXX)
5017
5018- New module xdrlib.py and optional support module _xdrmodule.c (XXX)
5019
5020- parser module adapted to new grammar, complete w/ Doc & Demo (XXX)
5021
5022- regen script fixed (XXX)
5023
5024- new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX)
5025
5026- testall now also tests math module (XXX)
5027
5028- string.atoi c.s. now raise an exception for an empty input string.
5029
5030- At last, it is no longer necessary to define HAVE_CONFIG_H in order to
5031have config.h included at various places.
5032
5033- Unrecognized keyword arguments now raise TypeError rather than KeyError.
5034
5035- The makesetup script recognizes files with extension .so or .sl as
5036(shared) libraries.
5037
5038- 'access' is no longer a reserved word, and all code related to its
5039implementation is gone (or at least #ifdef'ed out). This should make
5040Python a little speedier too!
5041
5042- Performance enhancements suggested by Sjoerd Mullender. This includes
5043the introduction of two new optional function pointers in type object,
5044getattro and setattro, which are like getattr and setattr but take a
5045string object instead of a C string pointer.
5046
5047- New operations in string module: lstrip(s) and rstrip(s) strip whitespace
5048only on the left or only on the right, A new optional third argument to
5049split() specifies the maximum number of separators honored (so
5050splitfields(s, sep, n) returns a list of at most n+1 elements). (Since
50511.3, splitfields(s, None) is totally equivalent to split(s).)
5052string.capwords() has an optional second argument specifying the
5053separator (which is passed to split()).
5054
5055- regsub.split() has the same addition as string.split(). regsub.splitx(s,
5056sep, maxsep) implements the functionality that was regsub.split(s, 1) in
50571.4beta2 (return a list containing the delimiters as well as the words).
5058
5059- Final touch for AIX loading, rewritten Misc/AIX-NOTES.
5060
5061- In Modules/_tkinter.c, when using Tk 4.1 or higher, use className
5062argument to _tkinter.create() to set Tcl's argv0 variable, so X
5063resources use the right resource class again.
5064
5065- Add #undef fabs to Modules/mathmodule.c for macintosh.
5066
5067- Added some macro renames for AIX in Modules/operator.c.
5068
5069- Removed spurious 'E' from Doc/liberrno.tex.
5070
5071- Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new
5072Misc/gMakefile and new version of Misc/python-mode.el.
5073
5074- Fixed typo in Lib/ntpath.py (islink has "return false" which gives a
5075NameError).
5076
5077- Added missing "from types import *" to Lib/tkinter/Canvas.py.
5078
5079- Added hint about using default args for __init__ to pickle docs.
5080
5081- Corrected typo in Inclide/abstract.h: PySequence_Lenth ->
5082PySequence_Length.
5083
5084- Some improvements to Doc/texi2html.py.
5085
5086- In Python/import.c, Cast unsigned char * in struct _frozen to char *
5087in calls to rds_object().
5088
5089- In doc/ref4.tex, added note about scope of lambda bodies.
5090
5091What's new in 1.4beta2 (since beta1)?
5092-------------------------------------
5093
5094- Portability bug in the md5.h header solved.
5095
5096- The PC build procedure now really works, and sets sys.platform to a
5097meaningful value (a few things were botched in beta 1). Lib/dos_8x3
5098is now a standard part of the distribution (alas).
5099
5100- More improvements to the installation procedure. Typing "make install"
5101now inserts the version number in the pathnames of almost everything
5102installed, and creates the machine dependent modules (FCNTL.py etc.) if not
5103supplied by the distribution. (XXX There's still a problem with the latter
5104because the "regen" script requires that Python is installed. Some manual
5105intervention may still be required.) (This has been fixed in 1.4beta3.)
5106
5107- New modules: errno, operator (XXX).
5108
5109- Changes for use with Numerical Python: builtin function slice() and
5110Ellipses object, and corresponding syntax:
5111
5112 x[lo:hi:stride] == x[slice(lo, hi, stride)]
5113 x[a, ..., z] == x[(a, Ellipses, z)]
5114
5115- New documentation for errno and cgi mdoules.
5116
5117- The directory containing the script passed to the interpreter is
5118inserted in from of sys.path; "." is no longer a default path
5119component.
5120
5121- Optional third string argument to string.translate() specifies
5122characters to delete. New function string.maketrans() creates a
5123translation table for translate() or for regex.compile().
5124
5125- Module posix (and hence module os under Unix) now supports putenv().
5126Moreover, module os is enhanced so that if putenv() is supported,
5127assignments to os.environ entries make the appropriate putenv() call.
5128(XXX the putenv() implementation can leak a small amount of memory per
5129call.)
5130
5131- pdb.py can now be invoked from the command line to debug a script:
5132python pdb.py <script> <arg> ...
5133
5134- Much improved parseaddr() in rfc822.
5135
5136- In cgi.py, you can now pass an alternative value for environ to
5137nearly all functions.
5138
5139- You can now assign to instance variables whose name begins and ends
5140with '__'.
5141
5142- New version of Fred Drake's parser module and associates (token,
5143symbol, AST).
5144
5145- New PYTHON_API_VERSION value and .pyc file magic number (again!).
5146
5147- The "complex" internal structure type is now called "Py_complex" to
5148avoid name conflicts.
5149
5150- Numerous small bugs fixed.
5151
5152- Slight pickle speedups.
5153
5154- Some slight speedups suggested by Sjoerd (more coming in 1.4 final).
5155
5156- NeXT portability mods by Bill Bumgarner integrated.
5157
5158- Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been
5159converted to new naming style.
5160
5161
5162What's new in 1.4beta1 (since 1.3)?
5163-----------------------------------
5164
5165- Added sys.platform and sys.exec_platform for Bill Janssen.
5166
5167- Installation has been completely overhauled. "make install" now installs
5168everything, not just the python binary. Installation uses the install-sh
5169script (borrowed from X11) to install each file.
5170
5171- New functions in the posix module: mkfifo, plock, remove (== unlink),
5172and ftruncate. More functions are also available under NT.
5173
5174- New function in the fcntl module: flock.
5175
5176- Shared library support for FreeBSD.
5177
5178- The --with-readline option can now be used without a DIRECTORY argument,
5179for systems where libreadline.* is in one of the standard places. It is
5180also possible for it to be a shared library.
5181
5182- The extension tkinter has been renamed to _tkinter, to avoid confusion
5183with Tkinter.py oncase insensitive file systems. It now supports Tk 4.1 as
5184well as 4.0.
5185
5186- Author's change of address from CWI in Amsterdam, The Netherlands, to
5187CNRI in Reston, VA, USA.
5188
5189- The math.hypot() function is now always available (if it isn't found in
5190the C math library, Python provides its own implementation).
5191
5192- The latex documentation is now compatible with latex2e, thanks to David
5193Ascher.
5194
5195- The expression x**y is now equivalent to pow(x, y).
5196
5197- The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)].
5198
5199- Complex numbers are now supported. Imaginary constants are written with
5200a 'j' or 'J' prefix, general complex numbers can be formed by adding a real
5201part to an imaginary part, like 3+4j. Complex numbers are always stored in
5202floating point form, so this is equivalent to 3.0+4.0j. It is also
5203possible to create complex numbers with the new built-in function
5204complex(re, [im]). For the footprint-conscious, complex number support can
5205be disabled by defining the symbol WITHOUT_COMPLEX.
5206
5207- New built-in function list() is the long-awaited counterpart of tuple().
5208
5209- There's a new "cmath" module which provides the same functions as the
5210"math" library but with complex arguments and results. (There are very
5211good reasons why math.sqrt(-1) still raises an exception -- you have to use
5212cmath.sqrt(-1) to get 1j for an answer.)
5213
5214- The Python.h header file (which is really the same as allobjects.h except
5215it disables support for old style names) now includes several more files,
5216so you have to have fewer #include statements in the average extension.
5217
5218- The NDEBUG symbol is no longer used. Code that used to be dependent on
5219the presence of NDEBUG is now present on the absence of DEBUG. TRACE_REFS
5220and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG,
5221respectively. At long last, the source actually compiles and links without
5222errors when this symbol is defined.
5223
5224- Several symbols that didn't follow the new naming scheme have been
5225renamed (usually by adding to rename2.h) to use a Py or _Py prefix. There
5226are no external symbols left without a Py or _Py prefix, not even those
5227defined by sources that were incorporated from elsewhere (regexpr.c,
5228md5c.c). (Macros are a different story...)
5229
5230- There are now typedefs for the structures defined in config.c and
5231frozen.c.
5232
5233- New PYTHON_API_VERSION value and .pyc file magic number.
5234
5235- New module Bastion. (XXX)
5236
5237- Improved performance of StringIO module.
5238
5239- UserList module now supports + and * operators.
5240
5241- The binhex and binascii modules now actually work.
5242
5243- The cgi module has been almost totally rewritten and documented.
5244It now supports file upload and a new data type to handle forms more
5245flexibly.
5246
5247- The formatter module (for use with htmllib) has been overhauled (again).
5248
5249- The ftplib module now supports passive mode and has doc strings.
5250
5251- In (ideally) all places where binary files are read or written, the file
5252is now correctly opened in binary mode ('rb' or 'wb') so the code will work
5253on Mac or PC.
5254
5255- Dummy versions of os.path.expandvars() and expanduser() are now provided
5256on non-Unix platforms.
5257
5258- Module urllib now has two new functions url2pathname and pathname2url
5259which turn local filenames into "file:..." URLs using the same rules as
5260Netscape (why be different). it also supports urlretrieve() with a
5261pathname parameter, and honors the proxy environment variables (http_proxy
5262etc.). The URL parsing has been improved somewhat, too.
5263
5264- Micro improvements to urlparse. Added urlparse.urldefrag() which
5265removes a trailing ``#fragment'' if any.
5266
5267- The mailbox module now supports MH style message delimiters as well.
5268
5269- The mhlib module contains some new functionality: setcontext() to set the
5270current folder and parsesequence() to parse a sequence as commonly passed
5271to MH commands (e.g. 1-10 or last:5).
5272
5273- New module mimify for conversion to and from MIME format of email
5274messages.
5275
5276- Module ni now automatically installs itself when first imported -- this
5277is against the normal rule that modules should define classes and functions
5278but not invoke them, but appears more useful in the case that two
5279different, independent modules want to use ni's features.
5280
5281- Some small performance enhancements in module pickle.
5282
5283- Small interface change to the profile.run*() family of functions -- more
5284sensible handling of return values.
5285
5286- The officially registered Mac creator for Python files is 'Pyth'. This
5287replaces 'PYTH' which was used before but never registered.
5288
5289- Added regsub.capwords(). (XXX)
5290
5291- Added string.capwords(), string.capitalize() and string.translate().
5292(XXX)
5293
5294- Fixed an interface bug in the rexec module: it was impossible to pass a
5295hooks instance to the RExec class. rexec now also supports the dynamic
5296loading of modules from shared libraries. Some other interfaces have been
5297added too.
5298
5299- Module rfc822 now caches the headers in a dictionary for more efficient
5300lookup.
5301
5302- The sgmllib module now understands a limited number of SGML "shorthands"
5303like <A/.../ for <A>...</A>. (It's not clear that this was a good idea...)
5304
5305- The tempfile module actually tries a number of different places to find a
5306usable temporary directory. (This was prompted by certain Linux
5307installations that appear to be missing a /usr/tmp directory.) [A bug in
5308the implementation that would ignore a pre-existing tmpdir global has been
5309fixed in beta3.]
5310
5311- Much improved and enhanved FileDialog module for Tkinter.
5312
5313- Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as
5314well as Tk 4.1).
5315
5316- New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and
5317s.dup(). Sockets now work correctly on Windows. On Windows, the built-in
5318extension is called _socket and a wrapper module win/socket.py provides
5319"makefile()" and "dup()" functionality. On Windows, the select module
5320works only with socket objects.
5321
5322- Bugs in bsddb module fixed (e.g. missing default argument values).
5323
5324- The curses extension now includes <ncurses.h> when available.
5325
5326- The gdbm module now supports opening databases in "fast" mode by
5327specifying 'f' as the second character or the mode string.
5328
5329- new variables sys.prefix and sys.exec_prefix pass corresponding
5330configuration options / Makefile variables to the Python programmer.
5331
5332- The ``new'' module now supports creating new user-defined classes as well
5333as instances thereof.
5334
5335- The soundex module now sports get_soundex() to get the soundex value for an
5336arbitrary string (formerly it would only do soundex-based string
5337comparison) as well as doc strings.
5338
5339- New object type "cobject" to safely wrap void pointers for passing them
5340between various extension modules.
5341
5342- More efficient computation of float**smallint.
5343
5344- The mysterious bug whereby "x.x" (two occurrences of the same
5345one-character name) typed from the commandline would sometimes fail
5346mysteriously.
5347
5348- The initialization of the readline function can now be invoked by a C
5349extension through PyOS_ReadlineInit().
5350
5351- There's now an externally visible pointer PyImport_FrozenModules which
5352can be changed by an embedding application.
5353
5354- The argument parsing functions now support a new format character 'D' to
5355specify complex numbers.
5356
5357- Various memory leaks plugged and bugs fixed.
5358
5359- Improved support for posix threads (now that real implementations are
5360beginning to apepar). Still no fully functioning semaphores.
5361
5362- Some various and sundry improvements and new entries in the Tools
5363directory.
5364
5365
5366=====================================
Guido van Rossumc30e95f1996-07-30 18:53:51 +00005367==> Release 1.3 (13 October 1995) <==
5368=====================================
5369
5370Major change
5371============
5372
5373Two words: Keyword Arguments. See the first section of Chapter 12 of
5374the Tutorial.
5375
5376(The rest of this file is textually the same as the remaining sections
5377of that chapter.)
5378
5379
5380Changes to the WWW and Internet tools
5381=====================================
5382
5383The "htmllib" module has been rewritten in an incompatible fashion.
5384The new version is considerably more complete (HTML 2.0 except forms,
5385but including all ISO-8859-1 entity definitions), and easy to use.
5386Small changes to "sgmllib" have also been made, to better match the
5387tokenization of HTML as recognized by other web tools.
5388
5389A new module "formatter" has been added, for use with the new
5390"htmllib" module.
5391
5392The "urllib"and "httplib" modules have been changed somewhat to allow
5393overriding unknown URL types and to support authentication. They now
5394use "mimetools.Message" instead of "rfc822.Message" to parse headers.
5395The "endrequest()" method has been removed from the HTTP class since
5396it breaks the interaction with some servers.
5397
5398The "rfc822.Message" class has been changed to allow a flag to be
5399passed in that says that the file is unseekable.
5400
5401The "ftplib" module has been fixed to be (hopefully) more robust on
5402Linux.
5403
5404Several new operations that are optionally supported by servers have
5405been added to "nntplib": "xover", "xgtitle", "xpath" and "date".
5406
5407Other Language Changes
5408======================
5409
5410The "raise" statement now takes an optional argument which specifies
5411the traceback to be used when printing the exception's stack trace.
5412This must be a traceback object, such as found in "sys.exc_traceback".
5413When omitted or given as "None", the old behavior (to generate a stack
5414trace entry for the current stack frame) is used.
5415
5416The tokenizer is now more tolerant of alien whitespace. Control-L in
5417the leading whitespace of a line resets the column number to zero,
5418while Control-R just before the end of the line is ignored.
5419
5420Changes to Built-in Operations
5421==============================
5422
5423For file objects, "f.read(0)" and "f.readline(0)" now return an empty
5424string rather than reading an unlimited number of bytes. For the
5425latter, omit the argument altogether or pass a negative value.
5426
5427A new system variable, "sys.platform", has been added. It specifies
5428the current platform, e.g. "sunos5" or "linux1".
5429
5430The built-in functions "input()" and "raw_input()" now use the GNU
5431readline library when it has been configured (formerly, only
5432interactive input to the interpreter itself was read using GNU
5433readline). The GNU readline library provides elaborate line editing
5434and history. The Python debugger ("pdb") is the first beneficiary of
5435this change.
5436
5437Two new built-in functions, "globals()" and "locals()", provide access
5438to dictionaries containming current global and local variables,
5439respectively. (These augment rather than replace "vars()", which
5440returns the current local variables when called without an argument,
5441and a module's global variables when called with an argument of type
5442module.)
5443
5444The built-in function "compile()" now takes a third possible value for
5445the kind of code to be compiled: specifying "'single'" generates code
5446for a single interactive statement, which prints the output of
5447expression statements that evaluate to something else than "None".
5448
5449Library Changes
5450===============
5451
5452There are new module "ni" and "ihooks" that support importing modules
5453with hierarchical names such as "A.B.C". This is enabled by writing
5454"import ni; ni.ni()" at the very top of the main program. These
5455modules are amply documented in the Python source.
5456
5457The module "rexec" has been rewritten (incompatibly) to define a class
5458and to use "ihooks".
5459
5460The "string.split()" and "string.splitfields()" functions are now the
5461same function (the presence or absence of the second argument
5462determines which operation is invoked); similar for "string.join()"
5463and "string.joinfields()".
5464
5465The "Tkinter" module and its helper "Dialog" have been revamped to use
5466keyword arguments. Tk 4.0 is now the standard. A new module
5467"FileDialog" has been added which implements standard file selection
5468dialogs.
5469
5470The optional built-in modules "dbm" and "gdbm" are more coordinated
5471--- their "open()" functions now take the same values for their "flag"
5472argument, and the "flag" and "mode" argument have default values (to
5473open the database for reading only, and to create the database with
5474mode "0666" minuse the umask, respectively). The memory leaks have
5475finally been fixed.
5476
5477A new dbm-like module, "bsddb", has been added, which uses the BSD DB
5478package's hash method.
5479
5480A portable (though slow) dbm-clone, implemented in Python, has been
5481added for systems where none of the above is provided. It is aptly
5482dubbed "dumbdbm".
5483
5484The module "anydbm" provides a unified interface to "bsddb", "gdbm",
5485"dbm", and "dumbdbm", choosing the first one available.
5486
5487A new extension module, "binascii", provides a variety of operations
5488for conversion of text-encoded binary data.
5489
5490There are three new or rewritten companion modules implemented in
5491Python that can encode and decode the most common such formats: "uu"
5492(uuencode), "base64" and "binhex".
5493
5494A module to handle the MIME encoding quoted-printable has also been
5495added: "quopri".
5496
5497The parser module (which provides an interface to the Python parser's
5498abstract syntax trees) has been rewritten (incompatibly) by Fred
5499Drake. It now lets you change the parse tree and compile the result!
5500
5501The \code{syslog} module has been upgraded and documented.
5502
5503Other Changes
5504=============
5505
5506The dynamic module loader recognizes the fact that different filenames
5507point to the same shared library and loads the library only once, so
5508you can have a single shared library that defines multiple modules.
5509(SunOS / SVR4 style shared libraries only.)
5510
5511Jim Fulton's ``abstract object interface'' has been incorporated into
5512the run-time API. For more detailes, read the files
5513"Include/abstract.h" and "Objects/abstract.c".
5514
5515The Macintosh version is much more robust now.
5516
5517Numerous things I have forgotten or that are so obscure no-one will
5518notice them anyway :-)
5519
5520
Guido van Rossumf456b6d1995-01-04 19:20:37 +00005521===================================
Guido van Rossumd462f3d1995-10-09 21:30:37 +00005522==> Release 1.2 (13 April 1995) <==
5523===================================
5524
5525- Changes to Misc/python-mode.el:
5526 - Wrapping and indentation within triple quote strings should work
5527 properly now.
5528 - `Standard' bug reporting mechanism (use C-c C-b)
5529 - py-mark-block was moved to C-c C-m
5530 - C-c C-v shows you the python-mode version
5531 - a basic python-font-lock-keywords has been added for Emacs 19
5532 font-lock colorizations.
5533 - proper interaction with pending-del and del-sel modes.
5534 - New py-electric-colon (:) command for improved outdenting. Also
5535 py-indent-line (TAB) should handle outdented lines better.
5536 - New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
5537
5538- The Library Reference has been restructured, and many new and
5539existing modules are now documented, in particular the debugger and
5540the profiler, as well as the persistency and the WWW/Internet support
5541modules.
5542
5543- All known bugs have been fixed. For example the pow(2,2,3L) bug on
5544Linux has been fixed. Also the re-entrancy problems with __del__ have
5545been fixed.
5546
5547- All known memory leaks have been fixed.
5548
5549- Phase 2 of the Great Renaming has been executed. The header files
5550now use the new names (PyObject instead of object, etc.). The linker
5551also sees the new names. Most source files still use the old names,
5552by virtue of the rename2.h header file. If you include Python.h, you
5553only see the new names. Dynamically linked modules have to be
5554recompiled. (Phase 3, fixing the rest of the sources, will be
5555executed gradually with the release later versions.)
5556
5557- The hooks for implementing "safe-python" (better called "restricted
5558execution") are in place. Specifically, the import statement is
5559implemented by calling the built-in function __import__, and the
5560built-in names used in a particular scope are taken from the
5561dictionary __builtins__ in that scope's global dictionary. See also
5562the new (unsupported, undocumented) module rexec.py.
5563
5564- The import statement now supports the syntax "import a.b.c" and
5565"from a.b.c import name". No officially supported implementation
5566exists, but one can be prototyped by replacing the built-in __import__
5567function. A proposal by Ken Manheimer is provided as newimp.py.
5568
5569- All machinery used by the import statement (or the built-in
5570__import__ function) is now exposed through the new built-in module
5571"imp" (see the library reference manual). All dynamic loading
5572machinery is moved to the new file importdl.c.
5573
5574- Persistent storage is supported through the use of the modules
5575"pickle" and "shelve" (implemented in Python). There's also a "copy"
5576module implementing deepcopy and normal (shallow) copy operations.
5577See the library reference manual.
5578
5579- Documentation strings for many objects types are accessible through
5580the __doc__ attribute. Modules, classes and functions support special
5581syntax to initialize the __doc__ attribute: if the first statement
5582consists of just a string literal, that string literal becomes the
5583value of the __doc__ attribute. The default __doc__ attribute is
5584None. Documentation strings are also supported for built-in
5585functions, types and modules; however this feature hasn't been widely
5586used yet. See the 'new' module for an example. (Basically, the type
5587object's tp_doc field contains the doc string for the type, and the
55884th member of the methodlist structure contains the doc string for the
5589method.)
5590
5591- The __coerce__ and __cmp__ methods for user-defined classes once
5592again work as expected. As an example, there's a new standard class
5593Complex in the library.
5594
5595- The functions posix.popen() and posix.fdopen() now have an optional
5596third argument to specify the buffer size, and default their second
5597(mode) argument to 'r' -- in analogy to the builtin open() function.
5598The same applies to posixfile.open() and the socket method makefile().
5599
5600- The thread.exit_thread() function now raises SystemExit so that
5601'finally' clauses are honored and a memory leak is plugged.
5602
5603- Improved X11 and Motif support, by Sjoerd Mullender. This extension
5604is being maintained and distributed separately.
5605
5606- Improved support for the Apple Macintosh, in part by Jack Jansen,
5607e.g. interfaces to (a few) resource mananger functions, get/set file
5608type and creator, gestalt, sound manager, speech manager, MacTCP, comm
5609toolbox, and the think C console library. This is being maintained
5610and distributed separately.
5611
5612- Improved version for Windows NT, by Mark Hammond. This is being
5613maintained and distributed separately.
5614
5615- Used autoconf 2.0 to generate the configure script. Adapted
5616configure.in to use the new features in autoconf 2.0.
5617
5618- It now builds on the NeXT without intervention, even on the 3.3
5619Sparc pre-release.
5620
5621- Characters passed to isspace() and friends are masked to nonnegative
5622values.
5623
5624- Correctly compute pow(-3.0, 3).
5625
5626- Fix portability problems with getopt (configure now checks for a
5627non-GNU getopt).
5628
5629- Don't add frozenmain.o to libPython.a.
5630
5631- Exceptions can now be classes. ALl built-in exceptions are still
5632string objects, but this will change in the future.
5633
5634- The socket module exports a long list of socket related symbols.
5635(More built-in modules will export their symbolic constants instead of
5636relying on a separately generated Python module.)
5637
5638- When a module object is deleted, it clears out its own dictionary.
5639This fixes a circularity in the references between functions and
5640their global dictionary.
5641
5642- Changed the error handling by [new]getargs() e.g. for "O&".
5643
5644- Dynamic loading of modules using shared libraries is supported for
5645several new platforms.
5646
5647- Support "O&", "[...]" and "{...}" in mkvalue().
5648
5649- Extension to findmethod(): findmethodinchain() (where a chain is a
5650linked list of methodlist arrays). The calling interface for
5651findmethod() has changed: it now gets a pointer to the (static!)
5652methodlist structure rather than just to the function name -- this
5653saves copying flags etc. into the (short-lived) method object.
5654
5655- The callable() function is now public.
5656
5657- Object types can define a few new operations by setting function
5658pointers in the type object structure: tp_call defines how an object
5659is called, and tp_str defines how an object's str() is computed.
5660
5661
5662===================================
Guido van Rossumf456b6d1995-01-04 19:20:37 +00005663==> Release 1.1.1 (10 Nov 1994) <==
5664===================================
5665
5666This is a pure bugfix release again. See the ChangeLog file for details.
5667
5668One exception: a few new features were added to tkinter.
5669
5670
5671=================================
5672==> Release 1.1 (11 Oct 1994) <==
5673=================================
5674
5675This release adds several new features, improved configuration and
5676portability, and fixes more bugs than I can list here (including some
5677memory leaks).
5678
5679The source compiles and runs out of the box on more platforms than
5680ever -- including Windows NT. Makefiles or projects for a variety of
5681non-UNIX platforms are provided.
5682
5683APOLOGY: some new features are badly documented or not at all. I had
5684the choice -- postpone the new release indefinitely, or release it
5685now, with working code but some undocumented areas. The problem with
5686postponing the release is that people continue to suffer from existing
5687bugs, and send me patches based on the previous release -- which I
5688can't apply directly because my own source has changed. Also, some
5689new modules (like signal) have been ready for release for quite some
5690time, and people are anxiously waiting for them. In the case of
5691signal, the interface is simple enough to figure out without
5692documentation (if you're anxious enough :-). In this case it was not
5693simple to release the module on its own, since it relies on many small
5694patches elsewhere in the source.
5695
5696For most new Python modules, the source code contains comments that
5697explain how to use them. Documentation for the Tk interface, written
5698by Matt Conway, is available as tkinter-doc.tar.gz from the Python
5699home and mirror ftp sites (see Misc/FAQ for ftp addresses). For the
5700new operator overloading facilities, have a look at Demo/classes:
5701Complex.py and Rat.py show how to implement a numeric type without and
5702with __coerce__ method. Also have a look at the end of the Tutorial
5703document (Doc/tut.tex). If you're still confused: use the newsgroup
5704or mailing list.
5705
5706
5707New language features:
5708
5709 - More flexible operator overloading for user-defined classes
5710 (INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial.
5711
5712 - Classes can define methods named __getattr__, __setattr__ and
5713 __delattr__ to trap attribute accesses. See end of tutorial.
5714
5715 - Classes can define method __call__ so instances can be called
5716 directly. See end of tutorial.
5717
5718
5719New support facilities:
5720
5721 - The Makefiles (for the base interpreter as well as for extensions)
5722 now support creating dynamically loadable modules if the platform
5723 supports shared libraries.
5724
5725 - Passing the interpreter a .pyc file as script argument will execute
5726 the code in that file. (On the Mac such files can be double-clicked!)
5727
5728 - New Freeze script, to create independently distributable "binaries"
5729 of Python programs -- look in Demo/freeze
5730
5731 - Improved h2py script (in Demo/scripts) follows #includes and
5732 supports macros with one argument
5733
5734 - New module compileall generates .pyc files for all modules in a
5735 directory (tree) without also executing them
5736
5737 - Threads should work on more platforms
5738
5739
5740New built-in modules:
5741
5742 - tkinter (support for Tcl's Tk widget set) is now part of the base
5743 distribution
5744
5745 - signal allows catching or ignoring UNIX signals (unfortunately still
5746 undocumented -- any taker?)
5747
5748 - termios provides portable access to POSIX tty settings
5749
5750 - curses provides an interface to the System V curses library
5751
5752 - syslog provides an interface to the (BSD?) syslog daemon
5753
5754 - 'new' provides interfaces to create new built-in object types
5755 (e.g. modules and functions)
5756
5757 - sybase provides an interface to SYBASE database
5758
5759
5760New/obsolete built-in methods:
5761
5762 - callable(x) tests whether x can be called
5763
5764 - sockets now have a setblocking() method
5765
5766 - sockets no longer have an allowbroadcast() method
5767
5768 - socket methods send() and sendto() return byte count
5769
5770
5771New standard library modules:
5772
5773 - types.py defines standard names for built-in types, e.g. StringType
5774
5775 - urlparse.py parses URLs according to the latest Internet draft
5776
5777 - uu.py does uuencode/uudecode (not the fastest in the world, but
5778 quicker than installing uuencode on a non-UNIX machine :-)
5779
5780 - New, faster and more powerful profile module.py
5781
5782 - mhlib.py provides interface to MH folders and messages
5783
5784
5785New facilities for extension writers (unfortunately still
5786undocumented):
5787
5788 - newgetargs() supports optional arguments and improved error messages
5789
5790 - O!, O& O? formats for getargs allow more versatile type checking of
5791 non-standard types
5792
5793 - can register pending asynchronous callback, to be called the next
5794 time the Python VM begins a new instruction (Py_AddPendingCall)
5795
5796 - can register cleanup routines to be called when Python exits
5797 (Py_AtExit)
5798
5799 - makesetup script understands C++ files in Setup file (use file.C
5800 or file.cc)
5801
5802 - Make variable OPT is passed on to sub-Makefiles
5803
5804 - An init<module>() routine may signal an error by not entering
5805 the module in the module table and raising an exception instead
5806
5807 - For long module names, instead of foobarbletchmodule.c you can
5808 use foobarbletch.c
5809
5810 - getintvalue() and getfloatvalue() try to convert any object
5811 instead of requiring an "intobject" or "floatobject"
5812
5813 - All the [new]getargs() formats that retrieve an integer value
5814 will now also work if a float is passed
5815
5816 - C function listtuple() converts list to tuple, fast
5817
5818 - You should now call sigcheck() instead of intrcheck();
5819 sigcheck() also sets an exception when it returns nonzero
5820
5821
Guido van Rossumaa253861994-10-06 17:18:57 +00005822====================================
5823==> Release 1.0.3 (14 July 1994) <==
5824====================================
5825
5826This release consists entirely of bug fixes to the C sources; see the
5827head of ../ChangeLog for a complete list. Most important bugs fixed:
5828
5829- Sometimes the format operator (string%expr) would drop the last
5830character of the format string
5831
5832- Tokenizer looped when last line did not end in \n
5833
5834- Bug when triple-quoted string ended in quote plus newline
5835
5836- Typo in socketmodule (listen) (== instead of =)
5837
5838- typing vars() at the >>> prompt would cause recursive output
5839
5840
5841==================================
5842==> Release 1.0.2 (4 May 1994) <==
5843==================================
5844
5845Overview of the most visible changes. Bug fixes are not listed. See
5846also ChangeLog.
5847
5848Tokens
5849------
5850
5851* String literals follow Standard C rules: they may be continued on
5852the next line using a backslash; adjacent literals are concatenated
5853at compile time.
5854
5855* A new kind of string literals, surrounded by triple quotes (""" or
5856'''), can be continued on the next line without a backslash.
5857
5858Syntax
5859------
5860
5861* Function arguments may have a default value, e.g. def f(a, b=1);
5862defaults are evaluated at function definition time. This also applies
5863to lambda.
5864
5865* The try-except statement has an optional else clause, which is
5866executed when no exception occurs in the try clause.
5867
5868Interpreter
5869-----------
5870
5871* The result of a statement-level expression is no longer printed,
5872except_ for expressions entered interactively. Consequently, the -k
5873command line option is gone.
5874
5875* The result of the last printed interactive expression is assigned to
5876the variable '_'.
5877
5878* Access to implicit global variables has been speeded up by removing
5879an always-failing dictionary lookup in the dictionary of local
5880variables (mod suggested by Steve Makewski and Tim Peters).
5881
5882* There is a new command line option, -u, to force stdout and stderr
5883to be unbuffered.
5884
5885* Incorporated Steve Majewski's mods to import.c for dynamic loading
5886under AIX.
5887
5888* Fewer chances of dumping core when trying to reload or re-import
5889static built-in, dynamically loaded built-in, or frozen modules.
5890
5891* Loops over sequences now don't ask for the sequence's length when
5892they start, but try to access items 0, 1, 2, and so on until they hit
5893an IndexError. This makes it possible to create classes that generate
5894infinite or indefinite sequences a la Steve Majewski. This affects
5895for loops, the (not) in operator, and the built-in functions filter(),
5896map(), max(), min(), reduce().
5897
5898Changed Built-in operations
5899---------------------------
5900
5901* The '%' operator on strings (printf-style formatting) supports a new
5902feature (adapted from a patch by Donald Beaudry) to allow
5903'%(<key>)<format>' % {...} to take values from a dictionary by name
5904instead of from a tuple by position (see also the new function
5905vars()).
5906
5907* The '%s' formatting operator is changed to accept any type and
5908convert it to a string using str().
5909
5910* Dictionaries with more than 20,000 entries can now be created
5911(thanks to Steve Kirsch).
5912
5913New Built-in Functions
5914----------------------
5915
5916* vars() returns a dictionary containing the local variables; vars(m)
5917returns a dictionary containing the variables of module m. Note:
5918dir(x) is now equivalent to vars(x).keys().
5919
5920Changed Built-in Functions
5921--------------------------
5922
5923* open() has an optional third argument to specify the buffer size: 0
5924for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
5925for default.
5926
5927* open()'s second argument is now optional; it defaults to "r".
5928
5929* apply() now checks that its second argument is indeed a tuple.
5930
5931New Built-in Modules
5932--------------------
5933
5934Changed Built-in Modules
5935------------------------
5936
5937The thread module no longer supports exit_prog().
5938
5939New Python Modules
5940------------------
5941
5942* Module addpack contains a standard interface to modify sys.path to
5943find optional packages (groups of related modules).
5944
5945* Module urllib contains a number of functions to access
5946World-Wide-Web files specified by their URL.
5947
5948* Module httplib implements the client side of the HTTP protocol used
5949by World-Wide-Web servers.
5950
5951* Module gopherlib implements the client side of the Gopher protocol.
5952
5953* Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
5954style mailbox files.
5955
5956* Module random contains various random distributions, e.g. gauss().
5957
5958* Module lockfile locks and unlocks open files using fcntl (inspired
5959by a similar module by Andy Bensky).
5960
5961* Module ntpath (by Jaap Vermeulen) implements path operations for
5962Windows/NT.
5963
5964* Module test_thread (in Lib/test) contains a small test set for the
5965thread module.
5966
5967Changed Python Modules
5968----------------------
5969
5970* The string module's expandvars() function is now documented and is
5971implemented in Python (using regular expressions) instead of forking
5972off a shell process.
5973
5974* Module rfc822 now supports accessing the header fields using the
5975mapping/dictionary interface, e.g. h['subject'].
5976
5977* Module pdb now makes it possible to set a break on a function
5978(syntax: break <expression>, where <expression> yields a function
5979object).
5980
5981Changed Demos
5982-------------
5983
5984* The Demo/scripts/freeze.py script is working again (thanks to Jaap
5985Vermeulen).
5986
5987New Demos
5988---------
5989
5990* Demo/threads/Generator.py is a proposed interface for restartable
5991functions a la Tim Peters.
5992
5993* Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
5994directory full of HTML pages which between them contain links to all
5995the newsgroups available on your server.
5996
5997* Demo/dns contains a DNS (Domain Name Server) client.
5998
5999* Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
6000nice enhanced Python shell!!!).
6001
6002* Demo/turing contains a Turing machine by Amrit Prem.
6003
6004Documentation
6005-------------
6006
6007* Documented new language features mentioned above (but not all new
6008modules).
6009
6010* Added a chapter to the Tutorial describing recent additions to
6011Python.
6012
6013* Clarified some sentences in the reference manual,
6014e.g. break/continue, local/global scope, slice assignment.
6015
6016Source Structure
6017----------------
6018
6019* Moved Include/tokenizer.h to Parser/tokenizer.h.
6020
6021* Added Python/getopt.c for systems that don't have it.
6022
6023Emacs mode
6024----------
6025
6026* Indentation of continuated lines is done more intelligently;
6027consequently the variable py-continuation-offset is gone.
6028
6029========================================
6030==> Release 1.0.1 (15 February 1994) <==
6031========================================
6032
6033* Many portability fixes should make it painless to build Python on
6034several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
6035
6036* Fixed test for <stdarg.h> -- this broke on some platforms.
6037
6038* Fixed test for shared library dynalic loading -- this broke on SunOS
60394.x using the GNU loader.
6040
6041* Changed order and number of SVR4 networking libraries (it is now
6042-lsocket -linet -lnsl, if these libraries exist).
6043
6044* Installing the build intermediate stages with "make libainstall" now
6045also installs config.c.in, Setup and makesetup, which are used by the
6046new Extensions mechanism.
6047
6048* Improved README file contains more hints and new troubleshooting
6049section.
6050
6051* The built-in module strop now defines fast versions of three more
6052functions of the standard string module: atoi(), atol() and atof().
6053The strop versions of atoi() and atol() support an optional second
6054argument to specify the base (default 10). NOTE: you don't have to
6055explicitly import strop to use the faster versions -- the string
6056module contains code to let versions from stop override the default
6057versions.
6058
6059* There is now a working Lib/dospath.py for those who use Python under
6060DOS (or Windows). Thanks, Jaap!
6061
6062* There is now a working Modules/dosmodule.c for DOS (or Windows)
6063system calls.
6064
6065* Lib.os.py has been reorganized (making it ready for more operating
6066systems).
6067
6068* Lib/ospath.py is now obsolete (use os.path instead).
6069
6070* Many fixes to the tutorial to make it match Python 1.0. Thanks,
6071Tim!
6072
6073* Fixed Doc/Makefile, Doc/README and various scripts there.
6074
6075* Added missing description of fdopen to Doc/libposix.tex.
6076
6077* Made cleanup() global, for the benefit of embedded applications.
6078
6079* Added parsing of addresses and dates to Lib/rfc822.py.
6080
6081* Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
6082them usable at all.
6083
6084* New module Lib/wave.py reads RIFF (*.wav) audio files.
6085
6086* Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
6087belongs.
6088
6089* New options and comments for Modules/makesetup (used by new
6090Extension mechanism).
6091
6092* Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
6093and elsewhere.
6094
6095* Fixed coredump in filter(None, 'abcdefg').
6096
6097
6098=======================================
6099==> Release 1.0.0 (26 January 1994) <==
6100=======================================
6101
6102As is traditional, so many things have changed that I can't pretend to
6103be complete in these release notes, but I'll try anyway :-)
6104
6105Note that the very last section is labeled "remaining bugs".
6106
6107
6108Source organization and build process
6109-------------------------------------
6110
6111* The sources have finally been split: instead of a single src
6112subdirectory there are now separate directories Include, Parser,
6113Grammar, Objects, Python and Modules. Other directories also start
6114with a capital letter: Misc, Doc, Lib, Demo.
6115
6116* A few extensions (notably Amoeba and X support) have been moved to a
6117separate subtree Extensions, which is no longer in the core
6118distribution, but separately ftp'able as extensions.tar.Z. (The
6119distribution contains a placeholder Ext-dummy with a description of
6120the Extensions subtree as well as the most recent versions of the
6121scripts used there.)
6122
6123* A few large specialized demos (SGI video and www) have been
6124moved to a separate subdirectory Demo2, which is no longer in the core
6125distribution, but separately ftp'able as demo2.tar.Z.
6126
6127* Parts of the standard library have been moved to subdirectories:
6128there are now standard subdirectories stdwin, test, sgi and sun4.
6129
6130* The configuration process has radically changed: I now use GNU
6131autoconf. This makes it much easier to build on new Unix flavors, as
6132well as fully supporting VPATH (if your Make has it). The scripts
6133Configure.py and Addmodule.sh are no longer needed. Many source files
6134have been adapted in order to work with the symbols that the configure
6135script generated by autoconf defines (or not); the resulting source is
6136much more portable to different C compilers and operating systems,
6137even non Unix systems (a Mac port was done in an afternoon). See the
6138toplevel README file for a description of the new build process.
6139
6140* GNU readline (a slightly newer version) is now a subdirectory of the
6141Python toplevel. It is still not automatically configured (being
6142totally autoconf-unaware :-). One problem has been solved: typing
6143Control-C to a readline prompt will now work. The distribution no
6144longer contains a "super-level" directory (above the python toplevel
6145directory), and dl, dl-dld and GNU dld are no longer part of the
6146Python distribution (you can still ftp them from
6147ftp.cwi.nl:/pub/dynload).
6148
6149* The DOS functions have been taken out of posixmodule.c and moved
6150into a separate file dosmodule.c.
6151
6152* There's now a separate file version.c which contains nothing but
6153the version number.
6154
6155* The actual main program is now contained in config.c (unless NO_MAIN
6156is defined); pythonmain.c now contains a function realmain() which is
6157called from config.c's main().
6158
6159* All files needed to use the built-in module md5 are now contained in
6160the distribution. The module has been cleaned up considerably.
6161
6162
6163Documentation
6164-------------
6165
6166* The library manual has been split into many more small latex files,
6167so it is easier to edit Doc/lib.tex file to create a custom library
6168manual, describing only those modules supported on your system. (This
6169is not automated though.)
6170
6171* A fourth manual has been added, titled "Extending and Embedding the
6172Python Interpreter" (Doc/ext.tex), which collects information about
6173the interpreter which was previously spread over several files in the
6174misc subdirectory.
6175
6176* The entire documentation is now also available on-line for those who
6177have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL
6178"http://www.cwi.nl/~guido/Python.html".
6179
6180
6181Syntax
6182------
6183
6184* Strings may now be enclosed in double quotes as well as in single
6185quotes. There is no difference in interpretation. The repr() of
6186string objects will use double quotes if the string contains a single
6187quote and no double quotes. Thanks to Amrit Prem for these changes!
6188
6189* There is a new keyword 'exec'. This replaces the exec() built-in
6190function. If a function contains an exec statement, local variable
6191optimization is not performed for that particular function, thus
6192making assignment to local variables in exec statements less
6193confusing. (As a consequence, os.exec and python.exec have been
6194renamed to execv.)
6195
6196* There is a new keyword 'lambda'. An expression of the form
6197
6198 lambda <parameters> : <expression>
6199
6200yields an anonymous function. This is really only syntactic sugar;
6201you can just as well define a local function using
6202
6203 def some_temporary_name(<parameters>): return <expression>
6204
6205Lambda expressions are particularly useful in combination with map(),
6206filter() and reduce(), described below. Thanks to Amrit Prem for
6207submitting this code (as well as map(), filter(), reduce() and
6208xrange())!
6209
6210
6211Built-in functions
6212------------------
6213
6214* The built-in module containing the built-in functions is called
6215__builtin__ instead of builtin.
6216
6217* New built-in functions map(), filter() and reduce() perform standard
6218functional programming operations (though not lazily):
6219
6220- map(f, seq) returns a new sequence whose items are the items from
6221seq with f() applied to them.
6222
6223- filter(f, seq) returns a subsequence of seq consisting of those
6224items for which f() is true.
6225
6226- reduce(f, seq, initial) returns a value computed as follows:
6227 acc = initial
6228 for item in seq: acc = f(acc, item)
6229 return acc
6230
6231* New function xrange() creates a "range object". Its arguments are
6232the same as those of range(), and when used in a for loop a range
6233objects also behaves identical. The advantage of xrange() over
6234range() is that its representation (if the range contains many
6235elements) is much more compact than that of range(). The disadvantage
6236is that the result cannot be used to initialize a list object or for
6237the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern
6238architectures, benchmarks have shown that "for i in range(...): ..."
6239actually executes *faster* than "for i in xrange(...): ...", but on
6240memory starved machines like PCs running DOS range(100000) may be just
6241too big to be represented at all...
6242
6243* Built-in function exec() has been replaced by the exec statement --
6244see above.
6245
6246
6247The interpreter
6248---------------
6249
6250* Syntax errors are now not printed to stderr by the parser, but
6251rather the offending line and other relevant information are packed up
6252in the SyntaxError exception argument. When the main loop catches a
6253SyntaxError exception it will print the error in the same format as
6254previously, but at the proper position in the stack traceback.
6255
6256* You can now set a maximum to the number of traceback entries
6257printed by assigning to sys.tracebacklimit. The default is 1000.
6258
6259* The version number in .pyc files has changed yet again.
6260
6261* It is now possible to have a .pyc file without a corresponding .py
6262file. (Warning: this may break existing installations if you have an
6263old .pyc file lingering around somewhere on your module search path
6264without a corresponding .py file, when there is a .py file for a
6265module of the same name further down the path -- the new interpreter
6266will find the first .pyc file and complain about it, while the old
6267interpreter would ignore it and use the .py file further down.)
6268
6269* The list sys.builtin_module_names is now sorted and also contains
6270the names of a few hardwired built-in modules (sys, __main__ and
6271__builtin__).
6272
6273* A module can now find its own name by accessing the global variable
6274__name__. Assigning to this variable essentially renames the module
6275(it should also be stored under a different key in sys.modules).
6276A neat hack follows from this: a module that wants to execute a main
6277program when called as a script no longer needs to compare
6278sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
6279
6280* When an object is printed by the print statement, its implementation
6281of str() is used. This means that classes can define __str__(self) to
6282direct how their instances are printed. This is different from
6283__repr__(self), which should define an unambigous string
6284representation of the instance. (If __str__() is not defined, it
6285defaults to __repr__().)
6286
6287* Functions and code objects can now be compared meaningfully.
6288
6289* On systems supporting SunOS or SVR4 style shared libraries, dynamic
6290loading of modules using shared libraries is automatically configured.
6291Thanks to Bill Jansen and Denis Severson for contributing this change!
6292
6293
6294Built-in objects
6295----------------
6296
6297* File objects have acquired a new method writelines() which is the
6298reverse of readlines(). (It does not actually write lines, just a
6299list of strings, but the symmetry makes the choice of name OK.)
6300
6301
6302Built-in modules
6303----------------
6304
6305* Socket objects no longer support the avail() method. Use the select
6306module instead, or use this function to replace it:
6307
6308 def avail(f):
6309 import select
6310 return f in select.select([f], [], [], 0)[0]
6311
6312* Initialization of stdwin is done differently. It actually modifies
6313sys.argv (taking out the options the X version of stdwin recognizes)
6314the first time it is imported.
6315
6316* A new built-in module parser provides a rudimentary interface to the
6317python parser. Corresponding standard library modules token and symbol
6318defines the numeric values of tokens and non-terminal symbols.
6319
6320* The posix module has aquired new functions setuid(), setgid(),
6321execve(), and exec() has been renamed to execv().
6322
6323* The array module is extended with 8-byte object swaps, the 'i'
6324format character, and a reverse() method. The read() and write()
6325methods are renamed to fromfile() and tofile().
6326
6327* The rotor module has freed of portability bugs. This introduces a
6328backward compatibility problem: strings encoded with the old rotor
6329module can't be decoded by the new version.
6330
6331* For select.select(), a timeout (4th) argument of None means the same
6332as leaving the timeout argument out.
6333
6334* Module strop (and hence standard library module string) has aquired
6335a new function: rindex(). Thanks to Amrit Prem!
6336
6337* Module regex defines a new function symcomp() which uses an extended
6338regular expression syntax: parenthesized subexpressions may be labeled
6339using the form "\(<labelname>...\)", and the group() method can return
6340sub-expressions by name. Thanks to Tracy Tims for these changes!
6341
6342* Multiple threads are now supported on Solaris 2. Thanks to Sjoerd
6343Mullender!
6344
6345
6346Standard library modules
6347------------------------
6348
6349* The library is now split in several subdirectories: all stuff using
6350stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
6351is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
6352test modules are in Lib/test. The default module search path will
6353include all relevant subdirectories by default.
6354
6355* Module os now knows about trying to import dos. It defines
6356functions execl(), execle(), execlp() and execvp().
6357
6358* New module dospath (should be attacked by a DOS hacker though).
6359
6360* All modules defining classes now define __init__() constructors
6361instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE!
6362
6363* Some minor changes and bugfixes module ftplib (mostly Steve
6364Majewski's suggestions); the debug() method is renamed to
6365set_debuglevel().
6366
6367* Some new test modules (not run automatically by testall though):
6368test_audioop, test_md5, test_rgbimg, test_select.
6369
6370* Module string now defines rindex() and rfind() in analogy of index()
6371and find(). It also defines atof() and atol() (and corresponding
6372exceptions) in analogy to atoi().
6373
6374* Added help() functions to modules profile and pdb.
6375
6376* The wdb debugger (now in Lib/stdwin) now shows class or instance
6377variables on a double click. Thanks to Sjoerd Mullender!
6378
6379* The (undocumented) module lambda has gone -- you couldn't import it
6380any more, and it was basically more a demo than a library module...
6381
6382
6383Multimedia extensions
6384---------------------
6385
6386* The optional built-in modules audioop and imageop are now standard
6387parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen
6388for contributing this code!
6389
6390* There's a new operation in audioop: minmax().
6391
6392* There's a new built-in module called rgbimg which supports portable
6393efficient reading of SGI RCG image files. Thanks also to Paul
6394Haeberli for the original code! (Who will contribute a GIF reader?)
6395
6396* The module aifc is gone -- you should now always use aifc, which has
6397received a facelift.
6398
6399* There's a new module sunau., for reading Sun (and NeXT) audio files.
6400
6401* There's a new module audiodev which provides a uniform interface to
6402(SGI Indigo and Sun Sparc) audio hardware.
6403
6404* There's a new module sndhdr which recognizes various sound files by
6405looking in their header and checking for various magic words.
6406
6407
6408Optimizations
6409-------------
6410
6411* Most optimizations below can be configured by compile-time flags.
6412Thanks to Sjoerd Mullender for submitting these optimizations!
6413
6414* Small integers (default -1..99) are shared -- i.e. if two different
6415functions compute the same value it is possible (but not
6416guaranteed!!!) that they return the same *object*. Python programs
6417can detect this but should *never* rely on it.
6418
6419* Empty tuples (which all compare equal) are shared in the same
6420manner.
6421
6422* Tuples of size up to 20 (default) are put in separate free lists
6423when deallocated.
6424
6425* There is a compile-time option to cache a string's hash function,
6426but this appeared to have a negligeable effect, and as it costs 4
6427bytes per string it is disabled by default.
6428
6429
6430Embedding Python
6431----------------
6432
6433* The initialization interface has been simplified somewhat. You now
6434only call "initall()" to initialize the interpreter.
6435
6436* The previously announced renaming of externally visible identifiers
6437has not been carried out. It will happen in a later release. Sorry.
6438
6439
6440Miscellaneous bugs that have been fixed
6441---------------------------------------
6442
6443* All known portability bugs.
6444
6445* Version 0.9.9 dumped core in <listobject>.sort() which has been
6446fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix
6447on the mailing list while I was away!
6448
6449* Core dump on a format string ending in '%', e.g. in the expression
6450'%' % None.
6451
6452* The array module yielded a bogus result for concatenation (a+b would
6453yield a+a).
6454
6455* Some serious memory leaks in strop.split() and strop.splitfields().
6456
6457* Several problems with the nis module.
6458
6459* Subtle problem when copying a class method from another class
6460through assignment (the method could not be called).
6461
6462
6463Remaining bugs
6464--------------
6465
6466* One problem with 64-bit machines remains -- since .pyc files are
6467portable and use only 4 bytes to represent an integer object, 64-bit
6468integer literals are silently truncated when written into a .pyc file.
6469Work-around: use eval('123456789101112').
6470
6471* The freeze script doesn't work any more. A new and more portable
6472one can probably be cooked up using tricks from Extensions/mkext.py.
6473
6474* The dos support hasn't been tested yet. (Really Soon Now we should
6475have a PC with a working C compiler!)
6476
6477
Guido van Rossuma7925f11994-01-26 10:20:16 +00006478===================================
6479==> Release 0.9.9 (29 Jul 1993) <==
6480===================================
6481
6482I *believe* these are the main user-visible changes in this release,
6483but there may be others. SGI users may scan the {src,lib}/ChangeLog
6484files for improvements of some SGI specific modules, e.g. aifc and
6485cl. Developers of extension modules should also read src/ChangeLog.
6486
6487
6488Naming of C symbols used by the Python interpreter
6489--------------------------------------------------
6490
6491* This is the last release using the current naming conventions. New
6492naming conventions are explained in the file misc/NAMING.
6493Summarizing, all externally visible symbols get (at least) a "Py"
6494prefix, and most functions are renamed to the standard form
6495PyModule_FunctionName.
6496
6497* Writers of extensions are urged to start using the new naming
6498conventions. The next release will use the new naming conventions
6499throughout (it will also have a different source directory
6500structure).
6501
6502* As a result of the preliminary work for the great renaming, many
6503functions that were accidentally global have been made static.
6504
6505
6506BETA X11 support
6507----------------
6508
6509* There are now modules interfacing to the X11 Toolkit Intrinsics, the
6510Athena widgets, and the Motif 1.1 widget set. These are not yet
6511documented except through the examples and README file in the demo/x11
6512directory. It is expected that this interface will be replaced by a
6513more powerful and correct one in the future, which may or may not be
6514backward compatible. In other words, this part of the code is at most
6515BETA level software! (Note: the rest of Python is rock solid as ever!)
6516
6517* I understand that the above may be a bit of a disappointment,
6518however my current schedule does not allow me to change this situation
6519before putting the release out of the door. By releasing it
6520undocumented and buggy, at least some of the (working!) demo programs,
6521like itr (my Internet Talk Radio browser) become available to a larger
6522audience.
6523
6524* There are also modules interfacing to SGI's "Glx" widget (a GL
6525window wrapped in a widget) and to NCSA's "HTML" widget (which can
6526format HyperText Markup Language, the document format used by the
6527World Wide Web).
6528
6529* I've experienced some problems when building the X11 support. In
6530particular, the Xm and Xaw widget sets don't go together, and it
6531appears that using X11R5 is better than using X11R4. Also the threads
6532module and its link time options may spoil things. My own strategy is
6533to build two Python binaries: one for use with X11 and one without
6534it, which can contain a richer set of built-in modules. Don't even
6535*think* of loading the X11 modules dynamically...
6536
6537
6538Environmental changes
6539---------------------
6540
6541* Compiled files (*.pyc files) created by this Python version are
6542incompatible with those created by the previous version. Both
6543versions detect this and silently create a correct version, but it
6544means that it is not a good idea to use the same library directory for
6545an old and a new interpreter, since they will start to "fight" over
6546the *.pyc files...
6547
6548* When a stack trace is printed, the exception is printed last instead
6549of first. This means that if the beginning of the stack trace
6550scrolled out of your window you can still see what exception caused
6551it.
6552
6553* Sometimes interrupting a Python operation does not work because it
6554hangs in a blocking system call. You can now kill the interpreter by
6555interrupting it three times. The second time you interrupt it, a
6556message will be printed telling you that the third interrupt will kill
6557the interpreter. The "sys.exitfunc" feature still makes limited
6558clean-up possible in this case.
6559
6560
6561Changes to the command line interface
6562-------------------------------------
6563
6564* The python usage message is now much more informative.
6565
6566* New option -i enters interactive mode after executing a script --
6567useful for debugging.
6568
6569* New option -k raises an exception when an expression statement
6570yields a value other than None.
6571
6572* For each option there is now also a corresponding environment
6573variable.
6574
6575
6576Using Python as an embedded language
6577------------------------------------
6578
6579* The distribution now contains (some) documentation on the use of
6580Python as an "embedded language" in other applications, as well as a
6581simple example. See the file misc/EMBEDDING and the directory embed/.
6582
6583
6584Speed improvements
6585------------------
6586
6587* Function local variables are now generally stored in an array and
6588accessed using an integer indexing operation, instead of through a
6589dictionary lookup. (This compensates the somewhat slower dictionary
6590lookup caused by the generalization of the dictionary module.)
6591
6592
6593Changes to the syntax
6594---------------------
6595
6596* Continuation lines can now *sometimes* be written without a
6597backslash: if the continuation is contained within nesting (), [] or
6598{} brackets the \ may be omitted. There's a much improved
6599python-mode.el in the misc directory which knows about this as well.
6600
6601* You can no longer use an empty set of parentheses to define a class
6602without base classes. That is, you no longer write this:
6603
6604 class Foo(): # syntax error
6605 ...
6606
6607You must write this instead:
6608
6609 class Foo:
6610 ...
6611
6612This was already the preferred syntax in release 0.9.8 but many
6613people seemed not to have picked it up. There's a Python script that
6614fixes old code: demo/scripts/classfix.py.
6615
6616* There's a new reserved word: "access". The syntax and semantics are
6617still subject of of research and debate (as well as undocumented), but
6618the parser knows about the keyword so you must not use it as a
6619variable, function, or attribute name.
6620
6621
6622Changes to the semantics of the language proper
6623-----------------------------------------------
6624
6625* The following compatibility hack is removed: if a function was
6626defined with two or more arguments, and called with a single argument
6627that was a tuple with just as many arguments, the items of this tuple
6628would be used as the arguments. This is no longer supported.
6629
6630
6631Changes to the semantics of classes and instances
6632-------------------------------------------------
6633
6634* Class variables are now also accessible as instance variables for
6635reading (assignment creates an instance variable which overrides the
6636class variable of the same name though).
6637
6638* If a class attribute is a user-defined function, a new kind of
6639object is returned: an "unbound method". This contains a pointer to
6640the class and can only be called with a first argument which is a
6641member of that class (or a derived class).
6642
6643* If a class defines a method __init__(self, arg1, ...) then this
6644method is called when a class instance is created by the classname()
6645construct. Arguments passed to classname() are passed to the
6646__init__() method. The __init__() methods of base classes are not
6647automatically called; the derived __init__() method must call these if
6648necessary (this was done so the derived __init__() method can choose
6649the call order and arguments for the base __init__() methods).
6650
6651* If a class defines a method __del__(self) then this method is called
6652when an instance of the class is about to be destroyed. This makes it
6653possible to implement clean-up of external resources attached to the
6654instance. As with __init__(), the __del__() methods of base classes
6655are not automatically called. If __del__ manages to store a reference
6656to the object somewhere, its destruction is postponed; when the object
6657is again about to be destroyed its __del__() method will be called
6658again.
6659
6660* Classes may define a method __hash__(self) to allow their instances
6661to be used as dictionary keys. This must return a 32-bit integer.
6662
6663
6664Minor improvements
6665------------------
6666
6667* Function and class objects now know their name (the name given in
6668the 'def' or 'class' statement that created them).
6669
6670* Class instances now know their class name.
6671
6672
6673Additions to built-in operations
6674--------------------------------
6675
6676* The % operator with a string left argument implements formatting
6677similar to sprintf() in C. The right argument is either a single
6678value or a tuple of values. All features of Standard C sprintf() are
6679supported except %p.
6680
6681* Dictionaries now support almost any key type, instead of just
6682strings. (The key type must be an immutable type or must be a class
6683instance where the class defines a method __hash__(), in order to
6684avoid losing track of keys whose value may change.)
6685
6686* Built-in methods are now compared properly: when comparing x.meth1
6687and y.meth2, if x is equal to y and the methods are defined by the
6688same function, x.meth1 compares equal to y.meth2.
6689
6690
6691Additions to built-in functions
6692-------------------------------
6693
6694* str(x) returns a string version of its argument. If the argument is
6695a string it is returned unchanged, otherwise it returns `x`.
6696
6697* repr(x) returns the same as `x`. (Some users found it easier to
6698have this as a function.)
6699
6700* round(x) returns the floating point number x rounded to an whole
6701number, represented as a floating point number. round(x, n) returns x
6702rounded to n digits.
6703
6704* hasattr(x, name) returns true when x has an attribute with the given
6705name.
6706
6707* hash(x) returns a hash code (32-bit integer) of an arbitrary
6708immutable object's value.
6709
6710* id(x) returns a unique identifier (32-bit integer) of an arbitrary
6711object.
6712
6713* compile() compiles a string to a Python code object.
6714
6715* exec() and eval() now support execution of code objects.
6716
6717
6718Changes to the documented part of the library (standard modules)
6719----------------------------------------------------------------
6720
6721* os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
6722the border case '/foo/..' returns '/' instead of ''.
6723
6724* A new function string.find() is added with similar semantics to
6725string.index(); however when it does not find the given substring it
6726returns -1 instead of raising string.index_error.
6727
6728
6729Changes to built-in modules
6730---------------------------
6731
6732* New optional module 'array' implements operations on sequences of
6733integers or floating point numbers of a particular size. This is
6734useful to manipulate large numerical arrays or to read and write
6735binary files consisting of numerical data.
6736
6737* Regular expression objects created by module regex now support a new
6738method named group(), which returns one or more \(...\) groups by number.
6739The number of groups is increased from 10 to 100.
6740
6741* Function compile() in module regex now supports an optional mapping
6742argument; a variable casefold is added to the module which can be used
6743as a standard uppercase to lowercase mapping.
6744
6745* Module time now supports many routines that are defined in the
6746Standard C time interface (<time.h>): gmtime(), localtime(),
6747asctime(), ctime(), mktime(), as well as these variables (taken from
6748System V): timezone, altzone, daylight and tzname. (The corresponding
6749functions in the undocumented module calendar have been removed; the
6750undocumented and unfinished module tzparse is now obsolete and will
6751disappear in a future release.)
6752
6753* Module strop (the fast built-in version of standard module string)
6754now uses C's definition of whitespace instead of fixing it to space,
6755tab and newline; in practice this usually means that vertical tab,
6756form feed and return are now also considered whitespace. It exports
6757the string of characters that are considered whitespace as well as the
6758characters that are considered lowercase or uppercase.
6759
6760* Module sys now defines the variable builtin_module_names, a list of
6761names of modules built into the current interpreter (including not
6762yet imported, but excluding two special modules that always have to be
6763defined -- sys and builtin).
6764
6765* Objects created by module sunaudiodev now also support flush() and
6766close() methods.
6767
6768* Socket objects created by module socket now support an optional
6769flags argument for their methods sendto() and recvfrom().
6770
6771* Module marshal now supports dumping to and loading from strings,
6772through the functions dumps() and loads().
6773
6774* Module stdwin now supports some new functionality. You may have to
6775ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
6776
6777
6778Bugs fixed
6779----------
6780
6781* Fixed comparison of negative long integers.
6782
6783* The tokenizer no longer botches input lines longer than BUFSIZ.
6784
6785* Fixed several severe memory leaks in module select.
6786
6787* Fixed memory leaks in modules socket and sv.
6788
6789* Fixed memory leak in divmod() for long integers.
6790
6791* Problems with definition of floatsleep() on Suns fixed.
6792
6793* Many portability bugs fixed (and undoubtedly new ones added :-).
6794
6795
6796Changes to the build procedure
6797------------------------------
6798
6799* The Makefile supports some new targets: "make default" and "make
6800all". Both are by normally equivalent to "make python".
6801
6802* The Makefile no longer uses $> since it's not supported by all
6803versions of Make.
6804
6805* The header files now all contain #ifdef constructs designed to make
6806it safe to include the same header file twice, as well as support for
6807inclusion from C++ programs (automatic extern "C" { ... } added).
6808
6809
6810Freezing Python scripts
6811-----------------------
6812
6813* There is now some support for "freezing" a Python script as a
6814stand-alone executable binary file. See the script
6815demo/scripts/freeze.py. It will require some site-specific tailoring
6816of the script to get this working, but is quite worthwhile if you write
6817Python code for other who may not have built and installed Python.
6818
6819
6820MS-DOS
6821------
6822
6823* A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks,
6824Marcel van der Peijl! This requires fewer compatibility hacks in
6825posixmodule.c. The executable is not yet available but will be soon
6826(check the mailing list).
6827
6828* The default PYTHONPATH has changed.
6829
6830
6831Changes for developers of extension modules
6832-------------------------------------------
6833
6834* Read src/ChangeLog for full details.
6835
6836
6837SGI specific changes
6838--------------------
6839
6840* Read src/ChangeLog for full details.
6841
Guido van Rossumaa253861994-10-06 17:18:57 +00006842
Guido van Rossuma7925f11994-01-26 10:20:16 +00006843==================================
6844==> Release 0.9.8 (9 Jan 1993) <==
6845==================================
6846
6847I claim no completeness here, but I've tried my best to scan the log
6848files throughout my source tree for interesting bits of news. A more
6849complete account of the changes is to be found in the various
6850ChangeLog files. See also "News for release 0.9.7beta" below if you're
6851still using release 0.9.6, and the file HISTORY if you have an even
6852older release.
6853
6854 --Guido
6855
6856
6857Changes to the language proper
6858------------------------------
6859
6860There's only one big change: the conformance checking for function
6861argument lists (of user-defined functions only) is stricter. Earlier,
6862you could get away with the following:
6863
6864 (a) define a function of one argument and call it with any
6865 number of arguments; if the actual argument count wasn't
6866 one, the function would receive a tuple containing the
6867 arguments arguments (an empty tuple if there were none).
6868
6869 (b) define a function of two arguments, and call it with more
6870 than two arguments; if there were more than two arguments,
6871 the second argument would be passed as a tuple containing
6872 the second and further actual arguments.
6873
6874(Note that an argument (formal or actual) that is a tuple is counted as
6875one; these rules don't apply inside such tuples, only at the top level
6876of the argument list.)
6877
6878Case (a) was needed to accommodate variable-length argument lists;
6879there is now an explicit "varargs" feature (precede the last argument
6880with a '*'). Case (b) was needed for compatibility with old class
6881definitions: up to release 0.9.4 a method with more than one argument
6882had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
6883Version 0.9.6 provide better ways to handle both casees, bot provided
6884backward compatibility; version 0.9.8 retracts the compatibility hacks
6885since they also cause confusing behavior if a function is called with
6886the wrong number of arguments.
6887
6888There's a script that helps converting classes that still rely on (b),
6889provided their methods' first argument is called "self":
6890demo/scripts/methfix.py.
6891
6892If this change breaks lots of code you have developed locally, try
6893#defining COMPAT_HACKS in ceval.c.
6894
6895(There's a third compatibility hack, which is the reverse of (a): if a
6896function is defined with two or more arguments, and called with a
6897single argument that is a tuple with just as many arguments, the items
6898of this tuple will be used as the arguments. Although this can (and
6899should!) be done using the built-in function apply() instead, it isn't
6900withdrawn yet.)
6901
6902
6903One minor change: comparing instance methods works like expected, so
6904that if x is an instance of a user-defined class and has a method m,
6905then (x.m==x.m) yields 1.
6906
6907
6908The following was already present in 0.9.7beta, but not explicitly
6909mentioned in the NEWS file: user-defined classes can now define types
6910that behave in almost allrespects like numbers. See
6911demo/classes/Rat.py for a simple example.
6912
6913
6914Changes to the build process
6915----------------------------
6916
6917The Configure.py script and the Makefile has been made somewhat more
6918bullet-proof, after reports of (minor) trouble on certain platforms.
6919
6920There is now a script to patch Makefile and config.c to add a new
6921optional built-in module: Addmodule.sh. Read the script before using!
6922
6923Useing Addmodule.sh, all optional modules can now be configured at
6924compile time using Configure.py, so there are no modules left that
6925require dynamic loading.
6926
6927The Makefile has been fixed to make it easier to use with the VPATH
6928feature of some Make versions (e.g. SunOS).
6929
6930
6931Changes affecting portability
6932-----------------------------
6933
6934Several minor portability problems have been solved, e.g. "malloc.h"
6935has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
6936the system now tolerates malloc(0) returning 0.
6937
6938For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
6939distributed with Python. This solves several minor problems, in
6940particular scripts invoked using #! can now use dynamic loading.
6941
6942
6943Changes to the interpreter interface
6944------------------------------------
6945
6946On popular demand, there's finally a "profile" feature for interactive
6947use of the interpreter. If the environment variable $PYTHONSTARTUP is
6948set to the name of an existing file, Python statements in this file
6949are executed when the interpreter is started in interactive mode.
6950
6951There is a new clean-up mechanism, complementing try...finally: if you
6952assign a function object to sys.exitfunc, it will be called when
6953Python exits or receives a SIGTERM or SIGHUP signal.
6954
6955The interpreter is now generally assumed to live in
6956/usr/local/bin/python (as opposed to /usr/local/python). The script
6957demo/scripts/fixps.py will update old scripts in place (you can easily
6958modify it to do other similar changes).
6959
6960Most I/O that uses sys.stdin/stdout/stderr will now use any object
6961assigned to those names as long as the object supports readline() or
6962write() methods.
6963
6964The parser stack has been increased to 500 to accommodate more
6965complicated expressions (7 levels used to be the practical maximum,
6966it's now about 38).
6967
6968The limit on the size of the *run-time* stack has completely been
6969removed -- this means that tuple or list displays can contain any
6970number of elements (formerly more than 50 would crash the
6971interpreter).
6972
6973
6974Changes to existing built-in functions and methods
6975--------------------------------------------------
6976
6977The built-in functions int(), long(), float(), oct() and hex() now
6978also apply to class instalces that define corresponding methods
6979(__int__ etc.).
6980
6981
6982New built-in functions
6983----------------------
6984
6985The new functions str() and repr() convert any object to a string.
6986The function repr(x) is in all respects equivalent to `x` -- some
6987people prefer a function for this. The function str(x) does the same
6988except if x is already a string -- then it returns x unchanged
6989(repr(x) adds quotes and escapes "funny" characters as octal escapes).
6990
6991The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
6992
6993
6994Changes to general built-in modules
6995-----------------------------------
6996
6997The time module's functions are more general: time() returns a
6998floating point number and sleep() accepts one. Their accuracies
6999depends on the precision of the system clock. Millisleep is no longer
7000needed (although it still exists for now), but millitimer is still
7001needed since on some systems wall clock time is only available with
7002seconds precision, while a source of more precise time exists that
7003isn't synchronized with the wall clock. (On UNIX systems that support
7004the BSD gettimeofday() function, time.time() is as time.millitimer().)
7005
7006The string representation of a file object now includes an address:
7007'<file 'filename', mode 'r' at #######>' where ###### is a hex number
7008(the object's address) to make it unique.
7009
7010New functions added to posix: nice(), setpgrp(), and if your system
7011supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
7012
7013Improvements to the socket module: socket objects have new methods
7014getpeername() and getsockname(), and the {get,set}sockopt methods can
7015now get/set any kind of option using strings built with the new struct
7016module. And there's a new function fromfd() which creates a socket
7017object given a file descriptor (useful for servers started by inetd,
7018which have a socket connected to stdin and stdout).
7019
7020
7021Changes to SGI-specific built-in modules
7022----------------------------------------
7023
7024The FORMS library interface (fl) now requires FORMS 2.1a. Some new
7025functions have been added and some bugs have been fixed.
7026
7027Additions to al (audio library interface): added getname(),
7028getdefault() and getminmax().
7029
7030The gl modules doesn't call "foreground()" when initialized (this
7031caused some problems) like it dit in 0.9.7beta (but not before).
7032There's a new gl function 'gversion() which returns a version string.
7033
7034The interface to sv (Indigo video interface) has totally changed.
7035(Sorry, still no documentation, but see the examples in
7036demo/sgi/{sv,video}.)
7037
7038
7039Changes to standard library modules
7040-----------------------------------
7041
7042Most functions in module string are now much faster: they're actually
7043implemented in C. The module containing the C versions is called
7044"strop" but you should still import "string" since strop doesn't
7045provide all the interfaces defined in string (and strop may be renamed
7046to string when it is complete in a future release).
7047
7048string.index() now accepts an optional third argument giving an index
7049where to start searching in the first argument, so you can find second
7050and further occurrences (this is similar to the regular expression
7051functions in regex).
7052
7053The definition of what string.splitfields(anything, '') should return
7054is changed for the last time: it returns a singleton list containing
7055its whole first argument unchanged. This is compatible with
7056regsub.split() which also ignores empty delimiter matches.
7057
7058posixpath, macpath: added dirname() and normpath() (and basename() to
7059macpath).
7060
7061The mainloop module (for use with stdwin) can now demultiplex input
7062from other sources, as long as they can be polled with select().
7063
7064
7065New built-in modules
7066--------------------
7067
7068Module struct defines functions to pack/unpack values to/from strings
7069representing binary values in native byte order.
7070
7071Module strop implements C versions of many functions from string (see
7072above).
7073
7074Optional module fcntl defines interfaces to fcntl() and ioctl() --
7075UNIX only. (Not yet properly documented -- see however src/fcntl.doc.)
7076
7077Optional module mpz defines an interface to an altaernative long
7078integer implementation, the GNU MPZ library.
7079
7080Optional module md5 uses the GNU MPZ library to calculate MD5
7081signatures of strings.
7082
7083There are also optional new modules specific to SGI machines: imageop
7084defines some simple operations to images represented as strings; sv
7085interfaces to the Indigo video board; cl interfaces to the (yet
7086unreleased) compression library.
7087
7088
7089New standard library modules
7090----------------------------
7091
7092(Unfortunately the following modules are not all documented; read the
7093sources to find out more about them!)
7094
7095autotest: run testall without showing any output unless it differs
7096from the expected output
7097
7098bisect: use bisection to insert or find an item in a sorted list
7099
7100colorsys: defines conversions between various color systems (e.g. RGB
7101<-> YUV)
7102
7103nntplib: a client interface to NNTP servers
7104
7105pipes: utility to construct pipeline from templates, e.g. for
7106conversion from one file format to another using several utilities.
7107
7108regsub: contains three functions that are more or less compatible with
7109awk functions of the same name: sub() and gsub() do string
7110substitution, split() splits a string using a regular expression to
7111define how separators are define.
7112
7113test_types: test operations on the built-in types of Python
7114
7115toaiff: convert various audio file formats to AIFF format
7116
7117tzparse: parse the TZ environment parameter (this may be less general
7118than it could be, let me know if you fix it).
7119
7120(Note that the obsolete module "path" no longer exists.)
7121
7122
7123New SGI-specific library modules
7124--------------------------------
7125
7126CL: constants for use with the built-in compression library interface (cl)
7127
7128Queue: a multi-producer, multi-consumer queue class implemented for
7129use with the built-in thread module
7130
7131SOCKET: constants for use with built-in module socket, e.g. to set/get
7132socket options. This is SGI-specific because the constants to be
7133passed are system-dependent. You can generate a version for your own
7134system by running the script demo/scripts/h2py.py with
7135/usr/include/sys/socket.h as input.
7136
7137cddb: interface to the database used the the CD player
7138
7139torgb: convert various image file types to rgb format (requires pbmplus)
7140
7141
7142New demos
7143---------
7144
7145There's an experimental interface to define Sun RPC clients and
7146servers in demo/rpc.
7147
7148There's a collection of interfaces to WWW, WAIS and Gopher (both
7149Python classes and program providing a user interface) in demo/www.
7150This includes a program texi2html.py which converts texinfo files to
7151HTML files (the format used hy WWW).
7152
7153The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
7154
7155For SGI systems, there's a whole collection of programs and classes
7156that make use of the Indigo video board in demo/sgi/{sv,video}. This
7157represents a significant amount of work that we're giving away!
7158
7159There are demos "rsa" and "md5test" that exercise the mpz and md5
7160modules, respectively. The rsa demo is a complete implementation of
7161the RSA public-key cryptosystem!
7162
7163A bunch of games and examples submitted by Stoffel Erasmus have been
7164included in demo/stoffel.
7165
7166There are miscellaneous new files in some existing demo
7167subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
7168sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
7169
7170There are also many minor changes to existing files, but I'm too lazy
7171to run a diff and note the differences -- you can do this yourself if
7172you save the old distribution's demos. One highlight: the
7173stdwin/python.py demo is much improved!
7174
7175
7176Changes to the documentation
7177----------------------------
7178
7179The LaTeX source for the library uses different macros to enable it to
7180be converted to texinfo, and from there to INFO or HTML format so it
7181can be browsed as a hypertext. The net result is that you can now
7182read the Python library documentation in Emacs info mode!
7183
7184
7185Changes to the source code that affect C extension writers
7186----------------------------------------------------------
7187
7188The function strdup() no longer exists (it was used only in one places
7189and is somewhat of a a portability problem sice some systems have the
7190same function in their C library.
7191
7192The functions NEW() and RENEW() allocate one spare byte to guard
7193against a NULL return from malloc(0) being taken for an error, but
7194this should not be relied upon.
7195
7196
7197=========================
7198==> Release 0.9.7beta <==
7199=========================
7200
7201
7202Changes to the language proper
7203------------------------------
7204
7205User-defined classes can now implement operations invoked through
7206special syntax, such as x[i] or `x` by defining methods named
7207__getitem__(self, i) or __repr__(self), etc.
7208
7209
7210Changes to the build process
7211----------------------------
7212
7213Instead of extensive manual editing of the Makefile to select
7214compile-time options, you can now run a Configure.py script.
7215The Makefile as distributed builds a minimal interpreter sufficient to
7216run Configure.py. See also misc/BUILD
7217
7218The Makefile now includes more "utility" targets, e.g. install and
7219tags/TAGS
7220
7221Using the provided strtod.c and strtol.c are now separate options, as
7222on the Sun the provided strtod.c dumps core :-(
7223
7224The regex module is now an option chosen by the Makefile, since some
7225(old) C compilers choke on regexpr.c
7226
7227
7228Changes affecting portability
7229-----------------------------
7230
7231You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
7232interface
7233
7234Dynamic loading is now supported for Sun (and other non-COFF systems)
7235throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
7236DL is out, 1.4)
7237
7238The system-dependent code for the use of the select() system call is
7239moved to one file: myselect.h
7240
7241Thanks to Jaap Vermeulen, the code should now port cleanly to the
7242SEQUENT
7243
7244
7245Changes to the interpreter interface
7246------------------------------------
7247
7248The interpretation of $PYTHONPATH in the environment is different: it
7249is inserted in front of the default path instead of overriding it
7250
7251
7252Changes to existing built-in functions and methods
7253--------------------------------------------------
7254
7255List objects now support an optional argument to their sort() method,
7256which is a comparison function similar to qsort(3) in C
7257
7258File objects now have a method fileno(), used by the new select module
7259(see below)
7260
7261
7262New built-in function
7263---------------------
7264
7265coerce(x, y): take two numbers and return a tuple containing them
7266both converted to a common type
7267
7268
7269Changes to built-in modules
7270---------------------------
7271
7272sys: fixed core dumps in settrace() and setprofile()
7273
7274socket: added socket methods setsockopt() and getsockopt(); and
7275fileno(), used by the new select module (see below)
7276
7277stdwin: added fileno() == connectionnumber(), in support of new module
7278select (see below)
7279
7280posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
7281
7282gl: added qgetfd()
7283
7284fl: added several new functions, fixed several obscure bugs, adapted
7285to FORMS 2.1
7286
7287
7288Changes to standard modules
7289---------------------------
7290
7291posixpath: changed implementation of ismount()
7292
7293string: atoi() no longer mistakes leading zero for octal number
7294
7295...
7296
7297
7298New built-in modules
7299--------------------
7300
7301Modules marked "dynamic only" are not configured at compile time but
7302can be loaded dynamically. You need to turn on the DL or DLD option in
7303the Makefile for support dynamic loading of modules (this requires
7304external code).
7305
7306select: interfaces to the BSD select() system call
7307
7308dbm: interfaces to the (new) dbm library (dynamic only)
7309
7310nis: interfaces to some NIS functions (aka yellow pages)
7311
7312thread: limited form of multiple threads (sgi only)
7313
7314audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
7315coding (dynamic only)
7316
7317cd: interface to Indigo SCSI CDROM player audio library (sgi only)
7318
7319jpeg: read files in JPEG format (dynamic only, sgi only; needs
7320external code)
7321
7322imgfile: read SGI image files (dynamic only, sgi only)
7323
7324sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
7325
7326sv: interface to Indigo video library (sgi only)
7327
7328pc: a minimal set of MS-DOS interfaces (MS-DOS only)
7329
7330rotor: encryption, by Lance Ellinghouse (dynamic only)
7331
7332
7333New standard modules
7334--------------------
7335
7336Not all these modules are documented. Read the source:
7337lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains
7338additional documentation.
7339
7340imghdr: recognizes image file headers
7341
7342sndhdr: recognizes sound file headers
7343
7344profile: print run-time statistics of Python code
7345
7346readcd, cdplayer: companion modules for built-in module cd (sgi only)
7347
7348emacs: interface to Emacs using py-connect.el (see below).
7349
7350SOCKET: symbolic constant definitions for socket options
7351
7352SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
7353
7354SV: symbolic constat definitions for sv (sgi only)
7355
7356CD: symbolic constat definitions for cd (sgi only)
7357
7358
7359New demos
7360---------
7361
7362scripts/pp.py: execute Python as a filter with a Perl-like command
7363line interface
7364
7365classes/: examples using the new class features
7366
7367threads/: examples using the new thread module
7368
7369sgi/cd/: examples using the new cd module
7370
7371
7372Changes to the documentation
7373----------------------------
7374
7375The last-minute syntax changes of release 0.9.6 are now reflected
7376everywhere in the manuals
7377
7378The reference manual has a new section (3.2) on implementing new kinds
7379of numbers, sequences or mappings with user classes
7380
7381Classes are now treated extensively in the tutorial (chapter 9)
7382
7383Slightly restructured the system-dependent chapters of the library
7384manual
7385
7386The file misc/EXTENDING incorporates documentation for mkvalue() and
7387a new section on error handling
7388
7389The files misc/CLASSES and misc/ERRORS are no longer necessary
7390
7391The doc/Makefile now creates PostScript files automatically
7392
7393
7394Miscellaneous changes
7395---------------------
7396
7397Incorporated Tim Peters' changes to python-mode.el, it's now version
73981.06
7399
7400A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
7401program running in an Emacs buffer execute Emacs lisp code. The
7402necessary Python code is in lib/emacs.py. The Emacs code is
7403misc/py-connect.el (it needs some external Emacs lisp code)
7404
7405
7406Changes to the source code that affect C extension writers
7407----------------------------------------------------------
7408
7409New service function mkvalue() to construct a Python object from C
7410values according to a "format" string a la getargs()
7411
7412Most functions from pythonmain.c moved to new pythonrun.c which is
7413in libpython.a. This should make embedded versions of Python easier
7414
7415ceval.h is split in eval.h (which needs compile.h and only declares
7416eval_code) and ceval.h (which doesn't need compile.hand declares the
7417rest)
7418
7419ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
7420improve the parallellism of multi-threaded programs by letting other
7421Python code run when a blocking system call or something similar is
7422made)
7423
7424In structmember.[ch], new member types BYTE, CHAR and unsigned
7425variants have been added
7426
7427New file xxmodule.c is a template for new extension modules.
7428
Guido van Rossumaa253861994-10-06 17:18:57 +00007429
Guido van Rossuma7925f11994-01-26 10:20:16 +00007430==================================
7431==> RELEASE 0.9.6 (6 Apr 1992) <==
7432==================================
7433
7434Misc news in 0.9.6:
7435- Restructured the misc subdirectory
7436- Reference manual completed, library manual much extended (with indexes!)
7437- the GNU Readline library is now distributed standard with Python
7438- the script "../demo/scripts/classfix.py" fixes Python modules using old
7439 class syntax
7440- Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
7441- Because of the GNU copyleft business I am not using the GNU regular
7442 expression implementation but a free re-implementation by Tatu Ylonen
7443 that recently appeared in comp.sources.misc (Bravo, Tatu!)
7444
7445New features in 0.9.6:
7446- stricter try stmt syntax: cannot mix except and finally clauses on 1 try
7447- New module 'os' supplants modules 'mac' and 'posix' for most cases;
7448 module 'path' is replaced by 'os.path'
7449- os.path.split() return value differs from that of old path.split()
7450- sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
7451 currently being handled
7452- sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
7453 exception
7454- New function string.expandtabs() expands tabs in a string
7455- Added times() interface to posix (user & sys time of process & children)
7456- Added uname() interface to posix (returns OS type, hostname, etc.)
7457- New built-in function execfile() is like exec() but from a file
7458- Functions exec() and eval() are less picky about whitespace/newlines
7459- New built-in functions getattr() and setattr() access arbitrary attributes
7460- More generic argument handling in built-in functions (see "./EXTENDING")
7461- Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
7462- Division and modulo for long and plain integers with negative operands
7463 have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
7464 as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as
7465 (a/b, a%b) for integers. For floats, % is also changed, but of course
7466 / is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
7467- A function with explicit variable-length argument list can be declared
7468 like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
7469- Code tracing and profiling features have been added, and two source
7470 code debuggers are provided in the library (pdb.py, tty-oriented,
7471 and wdb, window-oriented); you can now step through Python programs!
7472 See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
7473- '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
7474 a script that fixes old Python modules
7475- Plain integer right shift now uses sign extension
7476- Long integer shift/mask operations now simulate 2's complement
7477 to give more useful results for negative operands
7478- Changed/added range checks for long/plain integer shifts
7479- Options found after "-c command" are now passed to the command in sys.argv
7480 (note subtle incompatiblity with "python -c command -- -options"!)
7481- Module stdwin is better protected against touching objects after they've
7482 been closed; menus can now also be closed explicitly
7483- Stdwin now uses its own exception (stdwin.error)
7484
7485New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
7486- dictionary objects can now be compared properly; e.g., {}=={} is true
7487- new exception SystemExit causes termination if not caught;
7488 it is raised by sys.exit() so that 'finally' clauses can clean up,
7489 and it may even be caught. It does work interactively!
7490- new module "regex" implements GNU Emacs style regular expressions;
7491 module "regexp" is rewritten in Python for backward compatibility
7492- formal parameter lists may contain trailing commas
7493
7494Bugs fixed in 0.9.6:
7495- assigning to or deleting a list item with a negative index dumped core
7496- divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
7497
7498Bugs fixed in 0.9.5:
7499- masking operations involving negative long integers gave wrong results
7500
7501
7502===================================
7503==> RELEASE 0.9.4 (24 Dec 1991) <==
7504===================================
7505
7506- new function argument handling (see below)
7507- built-in apply(func, args) means func(args[0], args[1], ...)
7508- new, more refined exceptions
7509- new exception string values (NameError = 'NameError' etc.)
7510- better checking for math exceptions
7511- for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
7512- fixed list assignment bug: "a[1:1] = a" now works correctly
7513- new class syntax, without extraneous parentheses
7514- new 'global' statement to assign global variables from within a function
7515
7516
7517New class syntax
7518----------------
7519
7520You can now declare a base class as follows:
7521
7522 class B: # Was: class B():
7523 def some_method(self): ...
7524 ...
7525
7526and a derived class thusly:
7527
7528 class D(B): # Was: class D() = B():
7529 def another_method(self, arg): ...
7530
7531Multiple inheritance looks like this:
7532
7533 class M(B, D): # Was: class M() = B(), D():
7534 def this_or_that_method(self, arg): ...
7535
7536The old syntax is still accepted by Python 0.9.4, but will disappear
7537in Python 1.0 (to be posted to comp.sources).
7538
7539
7540New 'global' statement
7541----------------------
7542
7543Every now and then you have a global variable in a module that you
7544want to change from within a function in that module -- say, a count
7545of calls to a function, or an option flag, etc. Until now this was
7546not directly possible. While several kludges are known that
7547circumvent the problem, and often the need for a global variable can
7548be avoided by rewriting the module as a class, this does not always
7549lead to clearer code.
7550
7551The 'global' statement solves this dilemma. Its occurrence in a
7552function body means that, for the duration of that function, the
7553names listed there refer to global variables. For instance:
7554
7555 total = 0.0
7556 count = 0
7557
7558 def add_to_total(amount):
7559 global total, count
7560 total = total + amount
7561 count = count + 1
7562
7563'global' must be repeated in each function where it is needed. The
7564names listed in a 'global' statement must not be used in the function
7565before the statement is reached.
7566
7567Remember that you don't need to use 'global' if you only want to *use*
7568a global variable in a function; nor do you need ot for assignments to
7569parts of global variables (e.g., list or dictionary items or
7570attributes of class instances). This has not changed; in fact
7571assignment to part of a global variable was the standard workaround.
7572
7573
7574New exceptions
7575--------------
7576
7577Several new exceptions have been defined, to distinguish more clearly
7578between different types of errors.
7579
7580name meaning was
7581
7582AttributeError reference to non-existing attribute NameError
7583IOError unexpected I/O error RuntimeError
7584ImportError import of non-existing module or name NameError
7585IndexError invalid string, tuple or list index RuntimeError
7586KeyError key not in dictionary RuntimeError
7587OverflowError numeric overflow RuntimeError
7588SyntaxError invalid syntax RuntimeError
7589ValueError invalid argument value RuntimeError
7590ZeroDivisionError division by zero RuntimeError
7591
7592The string value of each exception is now its name -- this makes it
7593easier to experimentally find out which operations raise which
7594exceptions; e.g.:
7595
7596 >>> KeyboardInterrupt
7597 'KeyboardInterrupt'
7598 >>>
7599
7600
7601New argument passing semantics
7602------------------------------
7603
7604Off-line discussions with Steve Majewski and Daniel LaLiberte have
7605convinced me that Python's parameter mechanism could be changed in a
7606way that made both of them happy (I hope), kept me happy, fixed a
7607number of outstanding problems, and, given some backward compatibility
7608provisions, would only break a very small amount of existing code --
7609probably all mine anyway. In fact I suspect that most Python users
7610will hardly notice the difference. And yet it has cost me at least
7611one sleepless night to decide to make the change...
7612
7613Philosophically, the change is quite radical (to me, anyway): a
7614function is no longer called with either zero or one argument, which
7615is a tuple if there appear to be more arguments. Every function now
7616has an argument list containing 0, 1 or more arguments. This list is
7617always implemented as a tuple, and it is a (run-time) error if a
7618function is called with a different number of arguments than expected.
7619
7620What's the difference? you may ask. The answer is, very little unless
7621you want to write variadic functions -- functions that may be called
7622with a variable number of arguments. Formerly, you could write a
7623function that accepted one or more arguments with little trouble, but
7624writing a function that could be called with either 0 or 1 argument
7625(or more) was next to impossible. This is now a piece of cake: you
7626can simply declare an argument that receives the entire argument
7627tuple, and check its length -- it will be of size 0 if there are no
7628arguments.
7629
7630Another anomaly of the old system was the way multi-argument methods
7631(in classes) had to be declared, e.g.:
7632
7633 class Point():
7634 def init(self, (x, y, color)): ...
7635 def setcolor(self, color): ...
7636 dev moveto(self, (x, y)): ...
7637 def draw(self): ...
7638
7639Using the new scheme there is no need to enclose the method arguments
7640in an extra set of parentheses, so the above class could become:
7641
7642 class Point:
7643 def init(self, x, y, color): ...
7644 def setcolor(self, color): ...
7645 dev moveto(self, x, y): ...
7646 def draw(self): ...
7647
7648That is, the equivalence rule between methods and functions has
7649changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
7650while formerly it was equivalent to Point.moveto(p,(x,y)).
7651
7652A special backward compatibility rule makes that the old version also
7653still works: whenever a function with exactly two arguments (at the top
7654level) is called with more than two arguments, the second and further
7655arguments are packed into a tuple and passed as the second argument.
7656This rule is invoked independently of whether the function is actually a
7657method, so there is a slight chance that some erroneous calls of
7658functions expecting two arguments with more than that number of
7659arguments go undetected at first -- when the function tries to use the
7660second argument it may find it is a tuple instead of what was expected.
7661Note that this rule will be removed from future versions of the
7662language; it is a backward compatibility provision *only*.
7663
7664Two other rules and a new built-in function handle conversion between
7665tuples and argument lists:
7666
7667Rule (a): when a function with more than one argument is called with a
7668single argument that is a tuple of the right size, the tuple's items
7669are used as arguments.
7670
7671Rule (b): when a function with exactly one argument receives no
7672arguments or more than one, that one argument will receive a tuple
7673containing the arguments (the tuple will be empty if there were no
7674arguments).
7675
7676
7677A new built-in function, apply(), was added to support functions that
7678need to call other functions with a constructed argument list. The call
7679
7680 apply(function, tuple)
7681
7682is equivalent to
7683
7684 function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
7685
7686
7687While no new argument syntax was added in this phase, it would now be
7688quite sensible to add explicit syntax to Python for default argument
7689values (as in C++ or Modula-3), or a "rest" argument to receive the
7690remaining arguments of a variable-length argument list.
7691
7692
7693========================================================
7694==> Release 0.9.3 (never made available outside CWI) <==
7695========================================================
7696
7697- string sys.version shows current version (also printed on interactive entry)
7698- more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
7699- 'global' statement to declare module-global variables assigned in functions.
7700- new class declaration syntax: class C(Base1, Base2, ...): suite
7701 (the old syntax is still accepted -- be sure to convert your classes now!)
7702- C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
7703- C comparison operators: == != (the old = and <> remain valid).
7704- floating point numbers may now start with a period (e.g., .14).
7705- definition of integer division tightened (always truncates towards zero).
7706- new builtins hex(x), oct(x) return hex/octal string from (long) integer.
7707- new list method l.count(x) returns the number of occurrences of x in l.
7708- new SGI module: al (Indigo and 4D/35 audio library).
7709- the FORMS interface (modules fl and FL) now uses FORMS 2.0
7710- module gl: added lrect{read,write}, rectzoom and pixmode;
7711 added (non-GL) functions (un)packrect.
7712- new socket method: s.allowbroadcast(flag).
7713- many objects support __dict__, __methods__ or __members__.
7714- dir() lists anything that has __dict__.
7715- class attributes are no longer read-only.
7716- classes support __bases__, instances support __class__ (and __dict__).
7717- divmod() now also works for floats.
7718- fixed obscure bug in eval('1 ').
7719
7720
7721===================================
7722==> Release 0.9.2 (Autumn 1991) <==
7723===================================
7724
7725Highlights
7726----------
7727
7728- tutorial now (almost) complete; library reference reorganized
7729- new syntax: continue statement; semicolons; dictionary constructors;
7730 restrictions on blank lines in source files removed
7731- dramatically improved module load time through precompiled modules
7732- arbitrary precision integers: compute 2 to the power 1000 and more...
7733- arithmetic operators now accept mixed type operands, e.g., 3.14/4
7734- more operations on list: remove, index, reverse; repetition
7735- improved/new file operations: readlines, seek, tell, flush, ...
7736- process management added to the posix module: fork/exec/wait/kill etc.
7737- BSD socket operations (with example servers and clients!)
7738- many new STDWIN features (color, fonts, polygons, ...)
7739- new SGI modules: font manager and FORMS library interface
7740
7741
7742Extended list of changes in 0.9.2
7743---------------------------------
7744
7745Here is a summary of the most important user-visible changes in 0.9.2,
7746in somewhat arbitrary order. Changes in later versions are listed in
7747the "highlights" section above.
7748
7749
77501. Changes to the interpreter proper
7751
7752- Simple statements can now be separated by semicolons.
7753 If you write "if t: s1; s2", both s1 and s2 are executed
7754 conditionally.
7755- The 'continue' statement was added, with semantics as in C.
7756- Dictionary displays are now allowed on input: {key: value, ...}.
7757- Blank lines and lines bearing only a comment no longer need to
7758 be indented properly. (A completely empty line still ends a multi-
7759 line statement interactively.)
7760- Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
7761- Option "-c command" to execute statements from the command line
7762- Compiled versions of modules are cached in ".pyc" files, giving a
7763 dramatic improvement of start-up time
7764- Other, smaller speed improvements, e.g., extracting characters from
7765 strings, looking up single-character keys, and looking up global
7766 variables
7767- Interrupting a print operation raises KeyboardInterrupt instead of
7768 only cancelling the print operation
7769- Fixed various portability problems (it now passes gcc with only
7770 warnings -- more Standard C compatibility will be provided in later
7771 versions)
7772- Source is prepared for porting to MS-DOS
7773- Numeric constants are now checked for overflow (this requires
7774 standard-conforming strtol() and strtod() functions; a correct
7775 strtol() implementation is provided, but the strtod() provided
7776 relies on atof() for everything, including error checking
7777
7778
77792. Changes to the built-in types, functions and modules
7780
7781- New module socket: interface to BSD socket primitives
7782- New modules pwd and grp: access the UNIX password and group databases
7783- (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
7784- (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
7785- New numeric type: long integer, for unlimited precision
7786 - integer constants suffixed with 'L' or 'l' are long integers
7787 - new built-in function long(x) converts int or float to long
7788 - int() and float() now also convert from long integers
7789- New built-in function:
7790 - pow(x, y) returns x to the power y
7791- New operation and methods for lists:
7792 - l*n returns a new list consisting of n concatenated copies of l
7793 - l.remove(x) removes the first occurrence of the value x from l
7794 - l.index(x) returns the index of the first occurrence of x in l
7795 - l.reverse() reverses l in place
7796- New operation for tuples:
7797 - t*n returns a tuple consisting of n concatenated copies of t
7798- Improved file handling:
7799 - f.readline() no longer restricts the line length, is faster,
7800 and isn't confused by null bytes; same for raw_input()
7801 - f.read() without arguments reads the entire (rest of the) file
7802 - mixing of print and sys.stdout.write() has different effect
7803- New methods for files:
7804 - f.readlines() returns a list containing the lines of the file,
7805 as read with f.readline()
7806 - f.flush(), f.tell(), f.seek() call their stdio counterparts
7807 - f.isatty() tests for "tty-ness"
7808- New posix functions:
7809 - _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
7810 - popen() returns a file object connected to a pipe
7811 - utime() replaces utimes() (the latter is not a POSIX name)
7812- New stdwin features, including:
7813 - font handling
7814 - color drawing
7815 - scroll bars made optional
7816 - polygons
7817 - filled and xor shapes
7818 - text editing objects now have a 'settext' method
7819
7820
78213. Changes to the standard library
7822
7823- Name change: the functions path.cat and macpath.cat are now called
7824 path.join and macpath.join
7825- Added new modules: formatter, mutex, persist, sched, mainloop
7826- Added some modules and functionality to the "widget set" (which is
7827 still under development, so please bear with me):
7828 DirList, FormSplit, TextEdit, WindowSched
7829- Fixed module testall to work non-interactively
7830- Module string:
7831 - added functions join() and joinfields()
7832 - fixed center() to work correct and make it "transitive"
7833- Obsolete modules were removed: util, minmax
7834- Some modules were moved to the demo directory
7835
7836
78374. Changes to the demonstration programs
7838
7839- Added new useful scipts: byteyears, eptags, fact, from, lfact,
7840 objgraph, pdeps, pi, primes, ptags, which
7841- Added a bunch of socket demos
7842- Doubled the speed of ptags
7843- Added new stdwin demos: microedit, miniedit
7844- Added a windowing interface to the Python interpreter: python (most
7845 useful on the Mac)
7846- Added a browser for Emacs info files: demo/stdwin/ibrowse
7847 (yes, I plan to put all STDWIN and Python documentation in texinfo
7848 form in the future)
7849
7850
78515. Other changes to the distribution
7852
7853- An Emacs Lisp file "python.el" is provided to facilitate editing
7854 Python programs in GNU Emacs (slightly improved since posted to
7855 gnu.emacs.sources)
7856- Some info on writing an extension in C is provided
7857- Some info on building Python on non-UNIX platforms is provided
7858
7859
7860=====================================
7861==> Release 0.9.1 (February 1991) <==
7862=====================================
7863
7864- Micro changes only
7865- Added file "patchlevel.h"
7866
7867
7868=====================================
7869==> Release 0.9.0 (February 1991) <==
7870=====================================
7871
7872Original posting to alt.sources.