blob: 738c1ffbd8fd48603184ddec0f6738f4d6579613 [file] [log] [blame]
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001What's new in this release?
Guido van Rossum61000331997-08-15 04:39:58 +00002===========================
3
Guido van Rossum7ea639b1997-11-26 16:36:28 +00004Below is a list of all relevant changes since the release 1.4. The
5most recent changes (from 1.5a3 to 1.5a4 and from 1.5a4 to 1.5b1) are
6listed in separate sections at the end.
Guido van Rossum61000331997-08-15 04:39:58 +00007
Guido van Rossum1f83cce1997-10-06 21:04:35 +00008A note on attributions: while I have sprinkled some names throughout
Guido van Rossum7ea639b1997-11-26 16:36:28 +00009here, I'm grateful to many more people who remain unnamed. You may
Guido van Rossum1f83cce1997-10-06 21:04:35 +000010find your name in the ACKS file. If you believe you deserve more
11credit, let me know and I'll add you to the list!
12
13
Guido van Rossum7ea639b1997-11-26 16:36:28 +000014======================================================================
15
16From 1.4 to 1.5a3
17=================
18
Guido van Rossum1f83cce1997-10-06 21:04:35 +000019Security
20--------
21
22- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
23please use the new version. The old version has a huge security leak.
Guido van Rossum61000331997-08-15 04:39:58 +000024
25Miscellaneous
26-------------
27
Guido van Rossum1f83cce1997-10-06 21:04:35 +000028- Because of various (small) incompatible changes in the Python
29bytecode interpreter, the magic number for .pyc files has changed
30again.
31
Guido van Rossum2da391f1997-08-18 21:17:32 +000032- The default module search path is now much saner. Both on Unix and
33Windows, it is essentially derived from the path to the executable
34(which can be overridden by setting the environment variable
35$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
36front of the default path, like in Unix (instead of overriding the
37default path). On Windows, the directory containing the executable is
38added to the end of the path.
39
Guido van Rossum1f83cce1997-10-06 21:04:35 +000040- A new version of python-mode.el for Emacs has been included. Also,
41a new file ccpy-style.el has been added to configure Emacs cc-mode for
42the preferred style in Python C sources.
43
Guido van Rossum2da391f1997-08-18 21:17:32 +000044- On Unix, when using sys.argv[0] to insert the script directory in
45front of sys.path, expand a symbolic link. You can now install a
46program in a private directory and have a symbolic link to it in a
47public bin directory, and it will put the private directory in the
48module search path. Note that the symlink is expanded in sys.path[0]
49but not in sys.argv[0], so you can still tell the name by which you
50were invoked.
51
52- It is now recommended to use ``#!/usr/bin/env python'' instead of
53``#!/usr/local/bin/python'' at the start of executable scripts, except
54for CGI scripts. It has been determined that the use of /usr/bin/env
55is more portable than that of /usr/local/bin/python -- scripts almost
56never have to be edited when the Python interpreter lives in a
57non-standard place. Note that this doesn't work for CGI scripts since
58the python executable often doesn't live in the HTTP server's default
59search path.
Guido van Rossum61000331997-08-15 04:39:58 +000060
61- The silly -s command line option and the corresponding
62PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
63flag in the Python/C API) are gone.
64
65- Most problems on 64-bit platforms should now be fixed. Andrew
66Kuchling helped. Some uncommon extension modules are still not
67clean (image and audio ops?).
68
69- Fixed a bug where multiple anonymous tuple arguments would be mixed up
70when using the debugger or profiler (reported by Just van Rossum).
71The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
72would print the wrong value when run under the debugger or profiler.
73
Guido van Rossum2da391f1997-08-18 21:17:32 +000074- The hacks that the dictionary implementation used to speed up
75repeated lookups of the same C string were removed; these were a
76source of subtle problems and don't seem to serve much of a purpose
77any longer.
78
79- All traces of support for the long dead access statement have been
80removed from the sources.
81
Guido van Rossum61000331997-08-15 04:39:58 +000082- Plugged the two-byte memory leak in the tokenizer when reading an
83interactive EOF.
84
Guido van Rossum1f83cce1997-10-06 21:04:35 +000085- There's a -O option to the interpreter that removes SET_LINENO
86instructions and assert statements (see below); it uses and produces
87.pyo files instead of .pyc files. The speedup is only a few percent
88in most cases. The line numbers are still available in the .pyo file,
89as a separate table (which is also available in .pyc files). However,
90the removal of the SET_LINENO instructions means that the debugger
91(pdb) can't set breakpoints on lines in -O mode. The traceback module
92contains a function to extract a line number from the code object
93referenced in a traceback object. In the future it should be possible
94to write external bytecode optimizers that create better optimized
95.pyo files, and there should be more control over optimization;
96consider the -O option a "teaser". Without -O, the assert statement
97actually generates code that first checks __debug__; if this variable
98is false, the assertion is not checked. __debug__ is a built-in
99variable whose value is initialized to track the -O flag (it's true
100iff -O is not specified). With -O, no code is generated for assert
101statements, nor for code of the form ``if __debug__: <something>''.
102Sorry, no further constant folding happens.
103
Guido van Rossum61000331997-08-15 04:39:58 +0000104
105Performance
106-----------
107
Guido van Rossum2da391f1997-08-18 21:17:32 +0000108- It's much faster (almost twice for pystone.py -- see
109Tools/scripts). See the entry on string interning below.
Guido van Rossum61000331997-08-15 04:39:58 +0000110
111- Some speedup by using separate free lists for method objects (both
112the C and the Python variety) and for floating point numbers.
113
114- Big speedup by allocating frame objects with a single malloc() call.
115The Python/C API for frames is changed (you shouldn't be using this
116anyway).
117
118- Significant speedup by inlining some common opcodes for common operand
119types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
120
121- Small speedup by reordering the method tables of some common
122objects (e.g. list.append is now first).
123
Guido van Rossum2da391f1997-08-18 21:17:32 +0000124- Big optimization to the read() method of file objects. A read()
125without arguments now attempts to use fstat to allocate a buffer of
126the right size; for pipes and sockets, it will fall back to doubling
127the buffer size. While that the improvement is real on all systems,
128it is most dramatic on Windows.
129
Guido van Rossum61000331997-08-15 04:39:58 +0000130
131Documentation
132-------------
133
134- Many new pieces of library documentation were contributed, mostly by
135Andrew Kuchling. Even cmath is now documented! There's also a
136chapter of the library manual, "libundoc.tex", which provides a
137listing of all undocumented modules, plus their status (e.g. internal,
138obsolete, or in need of documentation). Also contributions by Sue
139Williams, Skip Montanaro, and some module authors who succumbed to
140pressure to document their own contributed modules :-). Note that
141printing the documentation now kills fewer trees -- the margins have
142been reduced.
143
144- I have started documenting the Python/C API. Unfortunately this project
145hasn't been completed yet. It will be complete before the final release of
146Python 1.5, though. At the moment, it's better to read the LaTeX source
147than to attempt to run it through LaTeX and print the resulting dvi file.
148
149- The posix module (and hence os.py) now has doc strings! Thanks to Neil
150Schemenauer. I received a few other contributions of doc strings. In most
151other places, doc strings are still wishful thinking...
152
153
154Language changes
155----------------
156
157- Private variables with leading double underscore are now a permanent
158feature of the language. (These were experimental in release 1.4. I have
159favorable experience using them; I can't label them "experimental"
160forever.)
161
162- There's new string literal syntax for "raw strings". Prefixing a string
163literal with the letter r (or R) disables all escape processing in the
164string; for example, r'\n' is a two-character string consisting of a
165backslash followed by the letter n. This combines with all forms of string
166quotes; it is actually useful for triple quoted doc strings which might
167contain references to \n or \t. An embedded quote prefixed with a
168backslash does not terminate the string, but the backslash is still
169included in the string; for example, r'\'' is a two-character string
170consisting of a backslash and a quote. (Raw strings are also
171affectionately known as Robin strings, after their inventor, Robin
172Friedrich.)
173
Guido van Rossum2da391f1997-08-18 21:17:32 +0000174- There's a simple assert statement, and a new exception
175AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
176not foo > 0: raise AssertionError''. Sorry, the text of the asserted
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000177condition is not available; it would be too complicated to generate
178code for this (since the code is generated from a parse tree).
179However, the text is displayed as part of the traceback!
180
181- The raise statement has a new feature: when using "raise SomeClass,
182somevalue" where somevalue is not an instance of SomeClass, it
183instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
184instance of a *derived* class of SomeClass, the exception class raised
185is set to somevalue.__class__, and SomeClass is ignored after that.
186
187- Duplicate keyword arguments are now detected at compile time;
188f(a=1,a=2) is now a syntax error.
Guido van Rossum61000331997-08-15 04:39:58 +0000189
190
191Changes to builtin features
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000192---------------------------
193
Guido van Rossum2da391f1997-08-18 21:17:32 +0000194- There's a new exception FloatingPointError (used only by Lee Busby's
195patches to catch floating point exceptions, at the moment).
196
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000197- The obsolete exception ConflictError (presumably used by the long
198obsolete access statement) has been deleted.
Guido van Rossum2da391f1997-08-18 21:17:32 +0000199
Guido van Rossum61000331997-08-15 04:39:58 +0000200- There's a new function sys.exc_info() which returns the tuple
201(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000202
Guido van Rossum61000331997-08-15 04:39:58 +0000203- There's a new variable sys.executable, pointing to the executable file
204for the Python interpreter.
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000205
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000206- The sort() methods for lists no longer uses the C library qsort(); I
207wrote my own quicksort implementation, with lots of help (in the form
208of a kind of competition) from Tim Peters. This solves a bug in
209dictionary comparisons on some Solaris versions when Python is built
210with threads, and makes sorting lists even faster.
211
212- The semantics of comparing two dictionaries have changed, to make
213comparison of unequal dictionaries faster. A shorter dictionary is
214always considered smaller than a larger dictionary. For dictionaries
215of the same size, the smallest differing element determines the
216outcome (which yields the same results as before in this case, without
217explicit sorting). Thanks to Aaron Watters for suggesting something
218like this.
219
Guido van Rossum61000331997-08-15 04:39:58 +0000220- The semantics of try-except have changed subtly so that calling a
221function in an exception handler that itself raises and catches an
222exception no longer overwrites the sys.exc_* variables. This also
223alleviates the problem that objects referenced in a stack frame that
224caught an exception are kept alive until another exception is caught
225-- the sys.exc_* variables are restored to their previous value when
226returning from a function that caught an exception.
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000227
Guido van Rossum61000331997-08-15 04:39:58 +0000228- There's a new "buffer" interface. Certain objects (e.g. strings and
229arrays) now support the "buffer" protocol. Buffer objects are acceptable
230whenever formerly a string was required for a write operation; mutable
231buffer objects can be the target of a read operation using the call
232f.readinto(buffer). A cool feature is that regular expression matching now
233also work on array objects. Contribution by Jack Jansen. (Needs
234documentation.)
235
236- String interning: dictionary lookups are faster when the lookup
237string object is the same object as the key in the dictionary, not
238just a string with the same value. This is done by having a pool of
239"interned" strings. Most names generated by the interpreter are now
240automatically interned, and there's a new built-in function intern(s)
241that returns the interned version of a string. Interned strings are
242not a different object type, and interning is totally optional, but by
243interning most keys a speedup of about 15% was obtained for the
244pystone benchmark.
245
246- Dictionary objects have several new methods; clear() and copy() have
247the obvious semantics, while update(d) merges the contents of another
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000248dictionary d into this one, overriding existing keys. The dictionary
249implementation file is now called dictobject.c rather than the
250confusing mappingobject.c.
Guido van Rossum61000331997-08-15 04:39:58 +0000251
Guido van Rossum61000331997-08-15 04:39:58 +0000252- The intrinsic function dir() is much smarter; it looks in __dict__,
253__members__ and __methods__.
254
Guido van Rossum2da391f1997-08-18 21:17:32 +0000255- The intrinsic functions int(), long() and float() can now take a
256string argument and then do the same thing as string.atoi(),
257string.atol(), and string.atof(). No second 'base' argument is
258allowed, and complex() does not take a string (nobody cared enough).
259
Guido van Rossum61000331997-08-15 04:39:58 +0000260- When a module is deleted, its globals are now deleted in two phases.
261In the first phase, all variables whose name begins with exactly one
262underscore are replaced by None; in the second phase, all variables
263are deleted. This makes it possible to have global objects whose
264destructors depend on other globals. The deletion order within each
265phase is still random.
266
267- It is no longer an error for a function to be called without a
268global variable __builtins__ -- an empty directory will be provided
269by default.
270
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000271- Guido's corollary to the "Don Beaudry hook": it is now possible to
272do metaprogramming by using an instance as a base class. Not for the
Guido van Rossum61000331997-08-15 04:39:58 +0000273faint of heart; and undocumented as yet, but basically if a base class
274is an instance, its class will be instantiated to create the new
275class. Jim Fulton will love it -- it also works with instances of his
276"extension classes", since it is triggered by the presence of a
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000277__class__ attribute on the purported base class. See
278Demo/metaclasses/index.html for an explanation and see that directory
279for examples.
280
281- Another change is that the Don Beaudry hook is now invoked when
282*any* base class is special. (Up to 1.5a3, the *last* special base
283class is used; in 1.5a4, the more rational choice of the *first*
284special base class is used.)
Guido van Rossum61000331997-08-15 04:39:58 +0000285
Guido van Rossum2da391f1997-08-18 21:17:32 +0000286- New optional parameter to the readlines() method of file objects.
287This indicates the number of bytes to read (the actual number of bytes
288read will be somewhat larger due to buffering reading until the end of
289the line). Some optimizations have also been made to speed it up (but
290not as much as read()).
291
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000292- Complex numbers no longer have the ".conj" pseudo attribute; use
293z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
294now *do* support the __members__ and __methods__ special attributes.
295
296- The complex() function now looks for a __complex__() method on class
297instances before giving up.
298
299- Long integers now support arbitrary shift counts, so you can now
300write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
301shift count for this.)
302
303- The hex() and oct() functions have been changed so that for regular
304integers, they never emit a minus sign. For example, on a 32-bit
305machine, oct(-1) now returns '037777777777' and hex(-1) returns
306'0xffffffff'. While this may seem inconsistent, it is much more
307useful. (For long integers, a minus sign is used as before, to fit
308the result in memory :-)
309
310- The hash() function computes better hashes for several data types,
311including strings, floating point numbers, and complex numbers.
312
Guido van Rossum61000331997-08-15 04:39:58 +0000313
314New extension modules
315---------------------
316
317- New extension modules cStringIO.c and cPickle.c, written by Jim
318Fulton and other folks at Digital Creations. These are much more
319efficient than their Python counterparts StringIO.py and pickle.py,
320but don't support subclassing. cPickle.c clocks up to 1000 times
Guido van Rossum2da391f1997-08-18 21:17:32 +0000321faster than pickle.py; cStringIO.c's improvement is less dramatic but
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000322still significant.
Guido van Rossum61000331997-08-15 04:39:58 +0000323
324- New extension module zlibmodule.c, interfacing to the free zlib
325library (gzip compatible compression). There's also a module gzip.py
326which provides a higher level interface. Written by Andrew Kuchling
327and Jeremy Hylton.
328
329- New module readline; see the "miscellaneous" section above.
330
331- New Unix extension module resource.c, by Jeremy Hylton, provides
332access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
333related symbolic constants.
334
335- New extension puremodule.c, by Barry Warsaw, which interfaces to the
336Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
337possible to enable Purify by simply setting the PURIFY Makefile
338variable in the Modules/Setup file.
339
340
341Changes in extension modules
342----------------------------
343
344- The struct extension module has several new features to control byte
345order and word size. It supports reading and writing IEEE floats even
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000346on platforms where this is not the native format. It uses uppercase
347format codes for unsigned integers of various sizes (always using
348Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
349and 'p' for "Pascal strings" (with a leading length byte, included in
Guido van Rossum92664b81997-10-07 00:12:43 +0000350the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
351big-endian data and '<' forces little-endian data; these also select
352standard data sizes and disable automatic alignment (use pad bytes as
353needed).
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000354
355- The array module supports uppercase format codes for unsigned data
356formats (like the struct module).
Guido van Rossum61000331997-08-15 04:39:58 +0000357
358- The fcntl extension module now exports the needed symbolic
359constants. (Formerly these were in FCNTL.py which was not available
360or correct for all platforms.)
361
362- The extension modules dbm, gdbm and bsddb now check that the
363database is still open before making any new calls.
364
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000365- The dbhash module is no more. Use bsddb instead. (There's a third
366party interface for the BSD 2.x code somewhere on the web; support for
367bsddb will be deprecated.)
368
369- The gdbm module now supports a sync() method.
370
371- The socket module now has some new functions: getprotobyname(), and
372the set {ntoh,hton}{s,l}().
373
Guido van Rossum61000331997-08-15 04:39:58 +0000374- Various modules now export their type object: socket.SocketType,
375array.ArrayType.
376
Guido van Rossum2da391f1997-08-18 21:17:32 +0000377- The socket module's accept() method now returns unknown addresses as
378a tuple rather than raising an exception. (This can happen in
379promiscuous mode.) Theres' also a new function getprotobyname().
380
Guido van Rossum61000331997-08-15 04:39:58 +0000381- The pthread support for the thread module now works on most platforms.
382
383- STDWIN is now officially obsolete. Support for it will eventually
384be removed from the distribution.
385
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000386- The binascii extension module is now hopefully fully debugged.
387(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
388received.)
Guido van Rossum61000331997-08-15 04:39:58 +0000389
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000390- audioop.c: added a ratecv() function; better handling of overflow in
391add().
Guido van Rossum2da391f1997-08-18 21:17:32 +0000392
393- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
394Windows, also O_TEXT and O_BINARY. The 'error' variable (the
395exception is raises) is renamed -- its string value is now "os.error",
396so newbies don't believe they have to import posix (or nt) to catch
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000397it when they see os.error reported as posix.error. The execve()
398function now accepts any mapping object for the environment.
Guido van Rossum2da391f1997-08-18 21:17:32 +0000399
400- A new version of the al (audio library) module for SGI was
401contributed by Sjoerd Mullender.
402
403- The regex module has a new function get_syntax() which retrieves the
404syntax setting set by set_syntax(). The code was also sanitized,
405removing worries about unclean error handling. See also below for its
406successor, re.py.
407
408- The "new" module (which creates new objects of various types) once
409again has a fully functioning new.function() method. Dangerous as
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000410ever! Also, new.code() has several new arguments.
411
412- A problem has been fixed in the rotor module: on systems with signed
413characters, rotor-encoded data was not portable when the key contained
4148-bit characters. Also, setkey() now requires its argument rather
415than having broken code to default it.
416
417- The sys.builtin_module_names variable is now a tuple. Another new
418variables in sys is sys.executable (the full path to the Python
419binary, if known).
420
421- The specs for time.strftime() have undergone some revisions. It
422appears that not all format characters are supported in the same way
423on all platforms. Rather than reimplement it, we note these
424differences in the documentation, and emphasize the shared set of
425features. There's also a thorough test set (that occasionally finds
426problems in the C library implementation, e.g. on some Linuxes),
427thanks to Skip Montanaro.
428
429- The nis module seems broken when used with NIS+; unfortunately
430nobody knows how to fix it. It should still work with old NIS.
Guido van Rossum2da391f1997-08-18 21:17:32 +0000431
Guido van Rossum61000331997-08-15 04:39:58 +0000432
433New library modules
434-------------------
435
436- New (still experimental) Perl-style regular expression module,
437re.py, which uses a new interface for matching as well as a new
438syntax; the new interface avoids the thread-unsafety of the regex
439interface. This comes with a helper extension reopmodule.c and vastly
440rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
441Peters, and Andrew Kuchling. See the documentation libre.tex. In
4421.5, the old regex module is still fully supported; in the future, it
443will become obsolete.
444
445- New module gzip.py; see zlib above.
446
447- New module keyword.py exports knowledge about Python's built-in
448keywords. (New version by Ka-Ping Yee.)
449
450- New module pprint.py (with documentation) which supports
451pretty-printing of lists, tuples, & dictionaries recursively. By Fred
452Drake.
453
454- New module code.py. The function code.compile_command() can
455determine whether an interactively entered command is complete or not,
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000456distinguishing incomplete from invalid input. (XXX Unfortunately,
457this seems broken at this moment, and I don't have the time to fix
458it. It's probably better to add an explicit interface to the parser
459for this.)
Guido van Rossum61000331997-08-15 04:39:58 +0000460
Guido van Rossum522578e1997-08-28 03:43:21 +0000461- There is now a library module xdrlib.py which can read and write the
Guido van Rossum61000331997-08-15 04:39:58 +0000462XDR data format as used by Sun RPC, for example. It uses the struct
463module.
464
465
466Changes in library modules
467--------------------------
468
469- Module codehack.py is now completely obsolete.
470
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000471- The pickle.py module has been updated to make it compatible with the
472new binary format that cPickle.c produces. By default it produces the
473old all-ASCII format compatible with the old pickle.py, still much
474faster than pickle.py; it will read both formats automatically. A few
475other updates have been made.
476
477- A new helper module, copy_reg.py, is provided to register extensions
478to the pickling code.
479
Guido van Rossum61000331997-08-15 04:39:58 +0000480- Revamped module tokenize.py is much more accurate and has an
481interface that makes it a breeze to write code to colorize Python
482source code. Contributed by Ka-Ping Yee.
483
484- In ihooks.py, ModuleLoader.load_module() now closes the file under
485all circumstances.
486
487- The tempfile.py module has a new class, TemporaryFile, which creates
488an open temporary file that will be deleted automatically when
489closed. This works on Windows and MacOS as well as on Unix. (Jim
490Fulton.)
491
492- Changes to the cgi.py module: Most imports are now done at the
493top of the module, which provides a speedup when using ni (Jim
494Fulton). The problem with file upload to a Windows platform is solved
495by using the new tempfile.TemporaryFile class; temporary files are now
496always opened in binary mode (Jim Fulton). The cgi.escape() function
497now takes an optional flag argument that quotes '"' to '&quot;'. It
498is now possible to invoke cgi.py from a command line script, to test
499cgi scripts more easily outside an http server. There's an optional
500limit to the size of uploads to POST (Skip Montanaro). Added a
501'strict_parsing' option to all parsing functions (Jim Fulton). The
502function parse_qs() now uses urllib.unquote() on the name as well as
Guido van Rossum2da391f1997-08-18 21:17:32 +0000503the value of fields (Clarence Gardner). The FieldStorage class now
504has a __len__() method.
Guido van Rossum61000331997-08-15 04:39:58 +0000505
506- httplib.py: the socket object is no longer closed; all HTTP/1.*
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000507responses are now accepted; and it is now thread-safe (by not using
508the regex module).
Guido van Rossum61000331997-08-15 04:39:58 +0000509
510- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
511
512- The popen2.py module is now rewritten using a class, which makes
513access to the standard error stream and the process id of the
514subprocess possible.
515
Guido van Rossum2da391f1997-08-18 21:17:32 +0000516- Added timezone support to the rfc822.py module, in the form of a
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000517getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
518Also added recognition of some non-standard date formats, by Lars
519Wirzenius, and RFC 850 dates (Chris Lawrence).
Guido van Rossum61000331997-08-15 04:39:58 +0000520
521- mhlib.py: various enhancements, including almost compatible parsing
522of message sequence specifiers without invoking a subprocess. Also
523added a createmessage() method by Lars Wirzenius.
524
525- The StringIO.StringIO class now supports readline(nbytes). (Lars
526Wirzenius.) (Of course, you should be using cStringIO for performance.)
527
528- UserDict.py supports the new dictionary methods as well.
529
530- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
531speed it up, and replace 0 seed values by 1 to avoid degeneration.
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000532A bug was fixed in the test for invalid arguments.
Guido van Rossum61000331997-08-15 04:39:58 +0000533
Guido van Rossum2da391f1997-08-18 21:17:32 +0000534- Module ftplib.py: added support for parsing a .netrc file (Fred
535Drake). Also added an ntransfercmd() method to the FTP class, which
536allows access to the expected size of a transfer when available, and a
537parse150() function to the module which parses the corresponding 150
538response.
Guido van Rossum61000331997-08-15 04:39:58 +0000539
540- urllib.py: the ftp cache is now limited to 10 entries. Added
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000541quote_plus() and unquote_plus() functions which are like quote() and
542unquote() but also replace spaces with '+' or vice versa, for
543encoding/decoding CGI form arguments. Catch all errors from the ftp
544module. HTTP requests now add the Host: header line. The proxy
Guido van Rossum2da391f1997-08-18 21:17:32 +0000545variable names are now mapped to lower case, for Windows. The
546spliturl() function no longer erroneously throws away all data past
547the first newline. The basejoin() function now intereprets "../"
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000548correctly. I *believe* that the problems with "exception raised in
549__del__" under certain circumstances have been fixed (mostly by
550changes elsewher in the interpreter).
551
552- In urlparse.py, there is a cache for results in urlparse.urlparse();
553its size limit is set to 20. Also, new URL schemes shttp, https, and
554snews are "supported".
Guido van Rossum61000331997-08-15 04:39:58 +0000555
Guido van Rossum2da391f1997-08-18 21:17:32 +0000556- shelve.py: use cPickle and cStringIO when available. Also added
557a sync() method, which calls the database's sync() method if there is
558one.
Guido van Rossum61000331997-08-15 04:39:58 +0000559
560- The mimetools.py module now uses the available Python modules for
561decoding quoted-printable, uuencode and base64 formats, rather than
562creating a subprocess.
563
564- The python debugger (pdb.py, and its base class bdb.py) now support
565conditional breakpoints. See the docs.
566
567- The modules base64.py, uu.py and quopri.py can now be used as simple
568command line utilities.
569
570- Various small fixes to the nntplib.py module that I can't bother to
571document in detail.
572
Guido van Rossum61000331997-08-15 04:39:58 +0000573- Sjoerd Mullender's mimify.py module now supports base64 encoding and
574includes functions to handle the funny encoding you sometimes see in mail
575headers. It is now documented.
576
Guido van Rossum2da391f1997-08-18 21:17:32 +0000577- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
578gotten from the environment.
579
580- Many more modules now correctly open files in binary mode when this
581is necessary on non-Unix platforms.
582
583- The copying functions in the undocumented module shutil.py are
584smarter.
585
586- The Writer classes in the formatter.py module now have a flush()
587method.
588
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000589- The sgmllib.py module accepts hyphens and periods in the middle of
590attribute names. While this is against the SGML standard, there is
591some HTML out there that uses this...
592
593- The interface for the Python bytecode disassembler module, dis.py,
594has been enhanced quite a bit. There's now one main function,
595dis.dis(), which takes almost any kind of object (function, module,
596class, instance, method, code object) and disassembles it; without
597arguments it disassembles the last frame of the last traceback. The
598other functions have changed slightly, too.
Guido van Rossum2da391f1997-08-18 21:17:32 +0000599
600- The imghdr.py module recognizes new image types: BMP, PNG.
601
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000602- The string.py module has a new function replace(str, old, new,
Guido van Rossum2da391f1997-08-18 21:17:32 +0000603[maxsplit]) which does substring replacements. It is actually
604implemented in C in the strop module. The functions [r]find() an
605[r]index() have an optional 4th argument indicating the end of the
606substring to search, alsoo implemented by their strop counterparts.
607(Remember, never import strop -- import string uses strop when
608available with zero overhead.)
609
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000610- The string.join() function now accepts any sequence argument, not
611just lists and tuples.
612
613- The string.maketrans() requires its first two arguments to be
614present. The old version didn't require them, but there's not much
615point without them, and the documentation suggests that they are
616required, so we fixed the code to match the documentation.
617
618- The regsub.py module has a function clear_cache(), which clears its
619internal cache of compiled regular expressions. Also, the cache now
620takes the current syntax setting into account. (However, this module
621is now obsolete -- use the sub() or subn() functions or methods in the
622re module.)
623
624- The undocumented module Complex.py has been removed, now that Python
625has built-in complex numbers. A similar module remains as
626Demo/classes/Complex.py, as an example.
627
Guido van Rossum61000331997-08-15 04:39:58 +0000628
629Changes to the build process
630----------------------------
631
632- The way GNU readline is configured is totally different. The
633--with-readline configure option is gone. It is now an extension
634module, which may be loaded dynamically. You must enable it (and
635specify the correct linraries to link with) in the Modules/Setup file.
636Importing the module installs some hooks which enable command line
637editing. When the interpreter shell is invoked interactively, it
638attempts to import the readline module; when this fails, the default
639input mechanism is used. The hook variables are PyOS_InputHook and
640PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
641ideas from William Magro.)
642
643- New build procedure: a single library, libpython1.5.a, is now built,
644which contains absolutely everything except for a one-line main()
645program (which calls Py_Main(argc, argv) to start the interpreter
646shell). This makes life much simpler for applications that need to
647embed Python. The serial number of the build is now included in the
648version string (sys.version).
649
650- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
651emits a single warning any more when compiling Python.
652
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000653- A number of new Makefile variables have been added for special
654situations, e.g. LDLAST is appended to the link command. These are
655used by editing the Makefile or passing them on the make command
656line.
657
Guido van Rossum61000331997-08-15 04:39:58 +0000658- A set of patches from Lee Busby has been integrated that make it
659possible to catch floating point exceptions. Use the configure option
660--with-fpectl to enable the patches; the extension modules fpectl and
661fpetest provide control to enable/disable and test the feature,
662respectively.
663
664- The support for shared libraries under AIX is now simpler and more
665robust. Thanks to Vladimir Marangozov for revamping his own patches!
666
667- The Modules/makesetup script now reads a file Setup.local as well as
668a file Setup. Most changes to the Setup script can be done by editing
669Setup.local instead, which makes it easier to carry a particular setup
670over from one release to the next.
671
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000672- The Modules/makesetup script now copies any "include" lines it
673encounters verbatim into the output Makefile. It also recognizes .cxx
674and .cpp as C++ source files.
675
Guido van Rossum61000331997-08-15 04:39:58 +0000676- The configure script is smarter about C compiler options; e.g. with
677gcc it uses -O2 and -g when possible, and on some other platforms it
678uses -Olimit 1500 to avoid a warning from the optimizer about the main
679loop in ceval.c (which has more than 1000 basic blocks).
680
681- The configure script now detects whether malloc(0) returns a NULL
682pointer or a valid block (of length zero). This avoids the nonsense
683of always adding one byte to all malloc() arguments on most platforms.
684
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000685- The configure script has a new option, --with-dec-threads, to enable
686DEC threads on DEC Alpha platforms. Also, --with-threads is now an
687alias for --with-thread (this was the Most Common Typo in configure
688arguments).
689
690- Many changes in Doc/Makefile; amongst others, latex2html is now used
691to generate HTML from all latex documents.
692
Guido van Rossum61000331997-08-15 04:39:58 +0000693
694Change to the Python/C API
695--------------------------
696
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000697- Because some interfaces have changed, the PYTHON_API macro has been
698bumped. Most extensions built for the old API version will still run,
699but I can't guarantee this. Python prints a warning message on
700version mismatches; it dumps core when the version mismatch causes a
701serious problem :-)
702
Guido van Rossum2da391f1997-08-18 21:17:32 +0000703- I've completed the Grand Renaming, with the help of Roger Masse and
704Barry Warsaw. This makes reading or debugging the code much easier.
705Many other unrelated code reorganizations have also been carried out.
706The allobjects.h header file is gone; instead, you would have to
707include Python.h followed by rename2.h. But you're better off running
708Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
709the rename2.h; it will disappear in the next release.
710
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000711- Various and sundry small bugs in the "abstract" interfaces have been
712fixed. Thanks to all the (involuntary) testers of the Python 1.4
713version! Some new functions have been added, e.g. PySequence_List(o),
714equivalent to list(o) in Python.
715
716- New API functions PyLong_FromUnsignedLong() and
717PyLong_AsUnsignedLong().
718
Guido van Rossum2da391f1997-08-18 21:17:32 +0000719- The API functions in the file cgensupport.c are no longer
720supported. This file has been moved to Modules and is only ever
721compiled when the SGI specific 'gl' module is built.
Guido van Rossum61000331997-08-15 04:39:58 +0000722
723- PyObject_Compare() can now raise an exception. Check with
724PyErr_Occurred(). The comparison function in an object type may also
725raise an exception.
726
727- The slice interface uses an upper bound of INT_MAX when no explicit
728upper bound is given (e.x. for a[1:]). It used to ask the object for
729its length and do the calculations.
730
731- Support for multiple independent interpreters. See Doc/api.tex,
732functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
733documentation is incomplete, also see the new Demo/pysvr example
734(which shows how to use these in a threaded application) and the
735source code.
736
737- There is now a Py_Finalize() function which "de-initializes"
738Python. It is possible to completely restart the interpreter
739repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
740change of functionality in Py_Initialize() means that it is now a
741fatal error to call it while the interpreter is already initialized.
742The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
743is deprecated (it is nothing more than Py_Finalize() followed by
744exit()).
745
Guido van Rossum2da391f1997-08-18 21:17:32 +0000746- There are no known memory leaks left. While Py_Finalize() doesn't
747free *all* allocated memory (some of it is hard to track down),
748repeated calls to Py_Finalize() and Py_Initialize() do not create
749unaccessible heap blocks.
Guido van Rossum61000331997-08-15 04:39:58 +0000750
751- There is now explicit per-thread state. (Inspired by, but not the
752same as, Greg Stein's free threading patches.)
753
754- There is now better support for threading C applications. There are
755now explicit APIs to manipulate the interpreter lock. Read the source
756or the Demo/pysvr example; the new functions are
757PyEval_{Acquire,Release}{Lock,Thread}().
758
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000759- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
760with other libraries' DEBUG macros. Likewise for any other test
761macros that didn't yet start with Py_.
762
Guido van Rossum61000331997-08-15 04:39:58 +0000763- New wrappers around malloc() and friends: Py_Malloc() etc. call
764malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
765just malloc(). Use of these wrappers could be essential if multiple
766memory allocators exist (e.g. when using certain DLL setups under
767Windows). (Idea by Jim Fulton.)
768
769- New C API PyImport_Import() which uses whatever __import__() hook
770that is installed for the current execution environment. By Jim
771Fulton.
772
773- It is now possible for an extension module's init function to fail
774non-fatally, by calling one of the PyErr_* functions and returning.
775
776- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
777argument to the proper type, like the similar PyString macros already
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000778did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
779and PyList_GET_ITEM.
Guido van Rossum61000331997-08-15 04:39:58 +0000780
781- Some of the Py_Get* function, like Py_GetVersion() (but not yet
782Py_GetPath()) are now declared as returning a const char *. (More
783should follow.)
784
785- Changed the run-time library to check for exceptions after object
786comparisons. PyObject_Compare() can now return an exception; use
787PyErr_Occurred() to check (there is *no* special return value).
788
789- PyFile_WriteString() and Py_Flushline() now return error indicators
790instead of clearing exceptions. This fixes an obscure bug where using
791these would clear a pending exception, discovered by Just van Rossum.
792
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000793- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
794an argument list including keyword arguments. Contributed by Geoff
795Philbrick.
796
Guido van Rossum2da391f1997-08-18 21:17:32 +0000797- PyArg_GetInt() is gone.
798
799- It's no longer necessary to include graminit.h when calling one of
800the extended parser API functions. The three public grammar start
801symbols are now in Python.h as Py_single_input, Py_file_input, and
802Py_eval_input.
803
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000804- The CObject interface has a new function,
805PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
806on the object referenced by "module.name".
807
Guido van Rossum61000331997-08-15 04:39:58 +0000808
809Tkinter
810-------
811
Guido van Rossum2da391f1997-08-18 21:17:32 +0000812- On popular demand, _tkinter once again installs a hook for readline
813that processes certain Tk events while waiting for the user to type
814(using PyOS_InputHook).
815
816- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
817caused by command definitions referencing widget objects beyond their
818lifetime.
819
820- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
821tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000822with the new Tk dialog scripts, and provide more "native platform"
823style file selection dialog boxes on some platforms. Contributed by
824Fredrik Lundh.
Guido van Rossum61000331997-08-15 04:39:58 +0000825
826- Tkinter.py: when the first Tk object is destroyed, it sets the
827hiddel global _default_root to None, so that when another Tk object is
828created it becomes the new default root. Other miscellaneous
829changes and fixes.
830
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000831- The Image class now has a configure method.
832
833- Added a bunch of new winfo options to Tkinter.py; we should now be
834up to date with Tk 4.2. The new winfo options supported are:
835mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
836visualsavailable.
837
838- The broken bind() method on Canvas objects defined in the Canvas.py
839module has been fixed. The CanvasItem and Group classes now also have
840an unbind() method.
841
842- The problem with Tkinter.py falling back to trying to import
843"tkinter" when "_tkinter" is not found has been fixed -- it no longer
844tries "tkinter", ever. This makes diagnosing the problem "_tkinter
845not configured" much easier and will hopefully reduce the newsgroup
846traffic on this topic.
847
848- The ScrolledText module once again supports the 'cnf' parameter, to
849be compatible with the examples in Mark Lutz' book (I know, I know,
850too late...)
851
Guido van Rossum61000331997-08-15 04:39:58 +0000852- The _tkinter.c extension module has been revamped. It now support
853Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
854works well under Windows and Mac (with the latest Tk ports to those
855platforms). It also supports threading -- it is safe for one
856(Python-created) thread to be blocked in _tkinter.mainloop() while
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000857other threads modify widgets. To make the changes visible, those
858threads must use update_idletasks()method. (The patch for threading
859in 1.5a3 was broken; in 1.5a4, it is back in a different version,
860which requires access to the Tcl sources to get it to work -- hence it
861is disabled by default.)
862
863- A bug in _tkinter.c has been fixed, where Split() with a string
864containing an unmatched '"' could cause an exception or core dump.
865
866- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
867CreateFileHandler, so _tkinter.createfilehandler is not available on
868those platforms when using Tk 8.0 or later. I will have to rethink
869how to interface with Tcl's lower-level event mechanism, or with its
870channels (which are like Python's file-like objects). Jack Jansen has
871provided a fix for the Mac, so createfilehandler *is* actually
872supported there; maybe I can adapt his fix for Windows.
Guido van Rossum61000331997-08-15 04:39:58 +0000873
874
875Tools and Demos
876---------------
877
878- A new regression test suite is provided, which tests most of the
879standard and built-in modules. The regression test is run by invoking
880the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
881he and Roger Masse contributed most of the new tests.
882
883- New tool: faqwiz -- the CGI script that is used to maintain the
884Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
885Tools/faqwiz.
886
887- New tool: webchecker -- a simple extensible web robot that, when
888aimed at a web server, checks that server for dead links. Available
889are a command line utility as well as a Tkinter based GUI version. In
890Tools/webchecker. A simplified version of this program is dissected
891in my article in O'Reilly's WWW Journal, the issue on Scripting
892Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
893Includes a parser for robots.txt files by Skip Montanaro.
894
895- New small tools: cvsfiles.py (prints a list of all files under CVS
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000896n a particular directory tree), treesync.py (a rather Guido-specific
Guido van Rossum61000331997-08-15 04:39:58 +0000897script to synchronize two source trees, one on Windows NT, the other
898one on Unix under CVS but accessible from the NT box), and logmerge.py
899(sort a collection of RCS or CVS logs by date). In Tools/scripts.
900
901- The freeze script now also works under Windows (NT). Another
902feature allows the -p option to be pointed at the Python source tree
903instead of the installation prefix. This was loosely based on part of
904xfreeze by Sam Rushing and Bill Tutt.
905
906- New examples (Demo/extend) that show how to use the generic
907extension makefile (Misc/Makefile.pre.in).
908
909- Tools/scripts/h2py.py now supports C++ comments.
910
Guido van Rossum2da391f1997-08-18 21:17:32 +0000911- Tools/scripts/pystone.py script is upgraded to version 1.1; there
912was a bug in version 1.0 (distributed with Python 1.4) that leaked
913memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
914
915- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
Guido van Rossum61000331997-08-15 04:39:58 +0000916
917
918Windows (NT and 95)
919-------------------
920
921- New project files for Developer Studio (Visual C++) 5.0 for Windows
922NT (the old VC++ 4.2 Makefile is also still supported, but will
923eventually be withdrawn due to its bulkiness).
924
925- See the note on the new module search path in the "Miscellaneous" section
926above.
927
928- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
929basically withdrawn. If it still works for you, you're lucky.
930
931- There's a new extension module, msvcrt.c, which provides various
932low-level operations defined in the Microsoft Visual C++ Runtime Library.
933These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
934console I/O functions like kbhit(), getch() and putch().
935
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000936- The -u option not only sets the standard I/O streams to unbuffered
937status, but also sets them in binary mode. (This can also be done
938using msvcrt.setmode(), by the way.)
Guido van Rossum61000331997-08-15 04:39:58 +0000939
940- The, sys.prefix and sys.exec_prefix variables point to the directory
941where Python is installed, or to the top of the source tree, if it was run
942from there.
943
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000944- The various os.path modules (posixpath, ntpath, macpath) now support
945passing more than two arguments to the join() function, so
946os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
947c)).
948
Guido van Rossum61000331997-08-15 04:39:58 +0000949- The ntpath module (normally used as os.path) supports ~ to $HOME
950expansion in expanduser().
951
952- The freeze tool now works on Windows.
953
Guido van Rossum2da391f1997-08-18 21:17:32 +0000954- See also the Tkinter category for a sad note on
955_tkinter.createfilehandler().
956
957- The truncate() method for file objects now works on Windows.
958
959- Py_Initialize() is no longer called when the DLL is loaded. You
Guido van Rossumb68b77f1997-10-07 19:12:50 +0000960must call it yourself.
Guido van Rossum61000331997-08-15 04:39:58 +0000961
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000962- The time module's clock() function now has good precision through
963the use of the Win32 API QueryPerformanceCounter().
964
965- Mark Hammond will release Python 1.5 versions of PythonWin and his
966other Windows specific code: the win32api extensions, COM/ActiveX
967support, and the MFC interface.
968
Guido van Rossum61000331997-08-15 04:39:58 +0000969
970Mac
971---
972
Guido van Rossum2da391f1997-08-18 21:17:32 +0000973- As always, the Macintosh port will be done by Jack Jansen. He will
974make a separate announcement for the Mac specific source code and the
975binary distribution(s) when these are ready.
Guido van Rossum61000331997-08-15 04:39:58 +0000976
977
Guido van Rossum92664b81997-10-07 00:12:43 +0000978======================================================================
979
980
Guido van Rossum7ea639b1997-11-26 16:36:28 +0000981From 1.5a3 to 1.5a4
982===================
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000983
Guido van Rossum522578e1997-08-28 03:43:21 +0000984- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
985feature; better install instructions; removed faqmain.py (which was an
986older version).
987
988- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
989about the treatment of lines starting with '.'. Added a minimal test
990function.
991
992- struct module: ignore most whitespace in format strings.
993
994- urllib.py: close the socket and temp file in URLopener.retrieve() so
995that multiple retrievals using the same connection work.
996
Guido van Rossum92664b81997-10-07 00:12:43 +0000997- All standard exceptions are now classes by default; use -X to make
998them strings (for backward compatibility only).
999
1000- There's a new standard exception hierarchy, defined in the standard
1001library module exceptions.py (which you never need to import
1002explicitly). See
1003http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
1004more info.
1005
Guido van Rossum522578e1997-08-28 03:43:21 +00001006- Three new C API functions:
1007
1008 - int PyErr_GivenExceptionMatches(obj1, obj2)
1009
1010 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
1011 instance of type obj2, or of a class derived from obj2
1012
1013 - int PyErr_ExceptionMatches(obj)
1014
1015 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
1016 PyErr_Occurred() as obj1. This will be the more commonly called
1017 function.
1018
1019 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
1020
1021 Normalizes exceptions, and places the normalized values in the
1022 arguments. If type is not a class, this does nothing. If type is a
1023 class, then it makes sure that value is an instance of the class by:
1024
1025 1. if instance is of the type, or a class derived from type, it does
1026 nothing.
1027
1028 2. otherwise it instantiates the class, using the value as an
1029 argument. If value is None, it uses an empty arg tuple, and if
1030 the value is a tuple, it uses just that.
1031
Guido van Rossum92664b81997-10-07 00:12:43 +00001032- Another new C API function: PyErr_NewException() creates a new
1033exception class derived from Exception; when -X is given, it creates a
1034new string exception.
Guido van Rossum522578e1997-08-28 03:43:21 +00001035
1036- core interpreter: remove the distinction between tuple and list
1037unpacking; allow an arbitrary sequence on the right hand side of any
1038unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
1039thing, which should really be called UNPACK_SEQUENCE.)
1040
1041- classes: Allow assignments to an instance's __dict__ or __class__,
1042so you can change ivars (including shared ivars -- shock horror) and
1043change classes dynamically. Also make the check on read-only
1044attributes of classes less draconic -- only the specials names
1045__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
1046assigned.
1047
1048- Two new built-in functions: issubclass() and isinstance(). Both
1049take classes as their second arguments. The former takes a class as
1050the first argument and returns true iff first is second, or is a
1051subclass of second. The latter takes any object as the first argument
1052and returns true iff first is an instance of the second, or any
1053subclass of second.
1054
1055- configure: Added configuration tests for presence of alarm(),
1056pause(), and getpwent().
1057
1058- Doc/Makefile: changed latex2html targets.
1059
1060- classes: Reverse the search order for the Don Beaudry hook so that
1061the first class with an applicable hook wins. Makes more sense.
1062
1063- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
1064now legal to call these more than once. The first call to
1065Py_Initialize() initializes, the first call to Py_Finalize()
1066finalizes. There's also a new API, Py_IsInitalized() which checks
1067whether we are already initialized (in case you want to leave things
1068as they were).
1069
1070- Completely disable the declarations for malloc(), realloc() and
1071free(). Any 90's C compiler has these in header files, and the tests
1072to decide whether to suppress the declarations kept failing on some
1073platforms.
1074
1075- *Before* (instead of after) signalmodule.o is added, remove both
1076intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
1077ld on various systems.
1078
1079- Added reop to PC/config.c
1080
1081- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
1082Removed outdated HP-UX comments from README. Added Cray T3E comments.
1083
1084- Various renames of statically defined functions that had name
1085conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
1086roundup (sys/types.h).
1087
1088- urllib.py: Interpret three slashes in file: URL as local file (for
1089Netscape on Windows/Mac).
1090
1091- copy.py: Make sure the objects returned by __getinitargs__() are
1092kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
1093easily reproducable because it requires a later call to
1094__getinitargs__() to return a tuple that happens to be allocated at
1095the same address.)
1096
1097- Added definition of AR to toplevel Makefile. Renamed @buildno temp
1098file to buildno1.
1099
1100- Moved Include/assert.h to Parser/assert.h, which seems to be the
1101only place where it's needed.
1102
Guido van Rossum522578e1997-08-28 03:43:21 +00001103- Tweaked the dictionary lookup code again for some more speed
1104(Vladimir Marangozov).
1105
1106- NT build: Changed the way python15.lib is included in the other
1107projects. Per Mark Hammond's suggestion, add it to the extra libs in
1108Settings instead of to the project's source files.
1109
1110- regrtest.py: Change default verbosity so that there are only three
1111levels left: -q, default and -v. In default mode, the name of each
1112test is now printed. -v is the same as the old -vv. -q is more quiet
1113than the old default mode.
1114
1115- Removed the old FAQ from the distribution. You now have to get it
1116from the web!
1117
1118- Removed the PC/make_nt.in file from the distribution; it is no
1119longer needed.
1120
1121- Changed the build sequence so that shared modules are built last.
1122This fixes things for AIX and doesn't hurt elsewhere.
1123
1124- Improved test for GNU MP v1 in mpzmodule.c
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001125
Guido van Rossum2da391f1997-08-18 21:17:32 +00001126- fileobject.c: ftell() on Linux discards all buffered data; changed
Guido van Rossum522578e1997-08-28 03:43:21 +00001127read() code to use lseek() instead to get the same effect
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001128
Guido van Rossum2da391f1997-08-18 21:17:32 +00001129- configure.in, configure, importdl.c: NeXT sharedlib fixes
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001130
Guido van Rossum2da391f1997-08-18 21:17:32 +00001131- tupleobject.c: PyTuple_SetItem asserts refcnt==1
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001132
Guido van Rossum522578e1997-08-28 03:43:21 +00001133- resource.c: Different strategy regarding whether to declare
1134getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
1135conflicting decls in its headers. Choice: only declare the return
1136type, not the argument prototype, and not on Linux.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001137
Guido van Rossum2da391f1997-08-18 21:17:32 +00001138- importdl.c, configure*: set sharedlib extensions properly for NeXT
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001139
Guido van Rossum2da391f1997-08-18 21:17:32 +00001140- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
1141fixed; moved addition of PURIFY to LINKCC to configure
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001142
Guido van Rossum522578e1997-08-28 03:43:21 +00001143- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
1144added to shup up various compilers.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001145
Guido van Rossum2da391f1997-08-18 21:17:32 +00001146- _tkinter.c: removed buggy mac #ifndef
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001147
Guido van Rossum2da391f1997-08-18 21:17:32 +00001148- Doc: various Mac documentation changes, added docs for 'ic' module
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001149
Guido van Rossum2da391f1997-08-18 21:17:32 +00001150- PC/make_nt.in: deleted
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001151
Guido van Rossum522578e1997-08-28 03:43:21 +00001152- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
1153"")
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001154
Guido van Rossum2da391f1997-08-18 21:17:32 +00001155- test_rotor.py: print b -> print `b`
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001156
Guido van Rossum2da391f1997-08-18 21:17:32 +00001157- Tkinter.py: (tagOrId) -> (tagOrId,)
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001158
1159- Tkinter.py: the Tk class now also has a configure() method and
1160friends (they have been moved to the Misc class to accomplish this).
1161
1162- dict.get(key[, default]) returns dict[key] if it exists, or default
1163if it doesn't. The default defaults to None. This is quicker for
1164some applications than using either has_key() or try:...except
1165KeyError:....
1166
Guido van Rossum92664b81997-10-07 00:12:43 +00001167- Tools/webchecker/: some small changes to webchecker.py; added
1168websucker.py (a simple web site mirroring script).
1169
1170- Dictionary objects now have a get() method (also in UserDict.py).
1171dict.get(key, default) returns dict[key] if it exists and default
1172otherwise; default defaults to None.
1173
1174- Tools/scripts/logmerge.py: print the author, too.
1175
1176- Changes to import: support for "import a.b.c" is now built in. See
1177http://grail.cnri.reston.va.us/python/essays/packages.html
1178for more info. Most important deviations from "ni.py": __init__.py is
1179executed in the package's namespace instead of as a submodule; and
1180there's no support for "__" or "__domain__". Note that "ni.py" is not
1181changed to match this -- it is simply declared obsolete (while at the
1182same time, it is documented...:-( ).
1183Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
1184for an example implementation of hierarchical module import written in
1185Python).
1186
1187- More changes to import: the site.py module is now imported by
1188default when Python is initialized; use -S to disable it. The site.py
1189module extends the path with several more directories: site-packages
1190inside the lib/python1.5/ directory, site-python in the lib/
1191directory, and pathnames mentioned in *.pth files found in either of
1192those directories. See
1193http://grail.cnri.reston.va.us/python/essays/packages.html
1194for more info.
1195
1196- Changes to standard library subdirectory names: those subdirectories
1197that are not packages have been renamed with a hypen in their name,
1198e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
1199The test suite is now a package -- to run a test, you must now use
1200"import test.test_foo".
1201
1202- A completely new re.py module is provided (thanks to Andrew
1203Kuchling) which uses Philip Hazel's "pcre" re compiler and engine.
1204For a while, the "old" re.py (which was new in 1.5a3!) will be kept
1205around as re1.py. The "old" regex module and underlying parser and
1206engine are still present -- while regex is now officially obsolete, it
1207will probably take several major release cycles before it can be
1208removed.
1209
1210- The posix module now has a strerror() function which translates an
1211error code to a string.
1212
1213- The emacs.py module (which was long obsolete) has been removed.
1214
1215- The universal makefile Misc/Makefile.pre.in now features an
1216"install" target. By default, installed shared libraries go into
1217$exec_prefix/lib/python$VERSION/site-packages/.
1218
1219- The install-sh script is installed with the other configuration
1220specific files (in the config/ subdirectory).
1221
1222- It turns out whatsound.py and sndhdr.py were identical modules.
1223Since there's also an imghdr.py file, I propose to make sndhdr.py the
1224official one. For compatibility, whatsound.py imports * from
1225sndhdr.py.
1226
1227- Class objects have a new attribute, __module__, giving the name of
1228the module in which they were declared. This is useful for pickle and
1229for printing the full name of a class exception.
1230
1231- Many extension modules no longer issue a fatal error when their
1232initialization fails; the importing code now checks whether an error
1233occurred during module initialization, and correctly propagates the
1234exception to the import statement.
1235
1236- Most extension modules now raise class-based exceptions (except when
1237-X is used).
1238
1239- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
1240thread state -- just don't manipulate the lock if it isn't there.
1241
1242- Fixed a bug in Python/getopt.c that made it do the wrong thing when
1243an option was a single '-'. Thanks to Andrew Kuchling.
1244
1245- New module mimetypes.py will guess a MIME type from a filename's
1246extension.
1247
1248- Windows: the DLL version is now settable via a resource rather than
1249being hardcoded. This can be used for "branding" a binary Python
1250distribution.
1251
1252- urllib.py is now threadsafe -- it now uses re instead of regex, and
1253sys.exc_info() instead of sys.exc_{type,value}.
1254
1255- Many other library modules that used to use
1256sys.exc_{type,value,traceback} are now more thread-safe by virtue of
1257using sys.exc_info().
1258
1259- The functions in popen2 have an optional buffer size parameter.
1260Also, the command argument can now be either a string (passed to the
1261shell) or a list of arguments (passed directly to execv).
1262
Guido van Rossumb68b77f1997-10-07 19:12:50 +00001263
1264- Alas, the thread support for _tkinter released with 1.5a3 didn't
1265work. It's been rewritten. The bad news is that it now requires a
1266modified version of a file in the standard Tcl distribution, which you
1267must compile with a -I option pointing to the standard Tcl source
1268tree. For this reason, the thread support is disabled by default.
Guido van Rossum92664b81997-10-07 00:12:43 +00001269
1270- The errno extension module adds two tables: errorcode maps errno
Guido van Rossum764a3771997-10-08 22:49:49 +00001271numbers to errno names (e.g. EINTR), and errorstr maps them to
Guido van Rossum92664b81997-10-07 00:12:43 +00001272message strings. (The latter is redundant because the new call
1273posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
1274
1275- The readline extension module now provides some interfaces to
1276internal readline routines that make it possible to write a completer
1277in Python. An example completer, rlcompleter.py, is provided.
1278
1279 When completing a simple identifier, it completes keywords,
1280 built-ins and globals in __main__; when completing
1281 NAME.NAME..., it evaluates (!) the expression up to the last
1282 dot and completes its attributes.
1283
1284 It's very cool to do "import string" type "string.", hit the
1285 completion key (twice), and see the list of names defined by
1286 the string module!
1287
1288 Tip: to use the tab key as the completion key, call
1289
1290 readline.parse_and_bind("tab: complete")
1291
1292- The traceback.py module has a new function tb_lineno() by Marc-Andre
1293Lemburg which extracts the line number from the linenumber table in
1294the code object. Apparently the traceback object doesn't contains the
1295right linenumber when -O is used. Rather than guessing whether -O is
1296on or off, the module itself uses tb_lineno() unconditionally.
1297
1298- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
1299to tag_bind() so it works again.
1300
1301- The pystone script is now a standard library module. Example use:
1302"import test.pystone; test.pystone.main()".
1303
1304- The import of the readline module in interactive mode is now also
1305attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
1306Lemburg, who asked for this. :-)
1307
1308- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
1309Mullender, to be closer to the standard. This fixes the getaddr()
1310method. Unfortunately, getaddrlist() is as broken as ever, since it
1311splits on commas without regard for RFC 822 quoting conventions.
1312
1313- pprint.py: correctly emit trailing "," in singleton tuples.
1314
1315- _tkinter.c: export names for its type objects, TkappType and
1316TkttType.
1317
1318- pickle.py: use __module__ when defined; fix a particularly hard to
1319reproduce bug that confuses the memo when temporary objects are
1320returned by custom pickling interfaces; and a semantic change: when
1321unpickling the instance variables of an instance, use
1322inst.__dict__.update(value) instead of a for loop with setattr() over
1323the value.keys(). This is more consistent (the pickling doesn't use
1324getattr() either but pickles inst.__dict__) and avoids problems with
1325instances that have a __setattr__ hook. But it *is* a semantic change
1326(because the setattr hook is no longer used). So beware!
1327
1328- config.h is now installed (at last) in
1329$exec_prefix/include/python1.5/. For most sites, this means that it
1330is actually in $prefix/include/python1.5/, with all the other Python
1331include files, since $prefix and $exec_prefix are the same by
1332default.
1333
1334- The imp module now supports parts of the functionality to implement
1335import of hierarchical module names. It now supports find_module()
1336and load_module() for all types of modules. Docstrings have been
Guido van Rossumb68b77f1997-10-07 19:12:50 +00001337added for those functions in the built-in imp module that are still
Guido van Rossum92664b81997-10-07 00:12:43 +00001338relevant (some old interfaces are obsolete). For a sample
1339implementation of hierarchical module import in Python, see the new
1340library module knee.py.
1341
1342- The % operator on string objects now allows arbitrary nested parens
1343in a %(...)X style format. (Brad Howes)
1344
1345- Reverse the order in which Setup and Setup.local are passed to the
1346makesetup script. This allows variable definitions in Setup.local to
1347override definitions in Setup. (But you'll still have to edit Setup
1348if you want to disable modules that are enabled by default, or if such
1349modules need non-standard options.)
1350
1351- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
1352is like PyImport_ImporModule(name) but receives the globals and locals
1353dict and the fromlist arguments as well. (The name is a char*; the
1354others are PyObject*s).
1355
1356- The 'p' format in the struct extension module alloded to above is
1357new in 1.5a4.
1358
Guido van Rossum92664b81997-10-07 00:12:43 +00001359- The types.py module now uses try-except in a few places to make it
1360more likely that it can be imported in restricted mode. Some type
1361names are undefined in that case, e.g. CodeType (inaccessible),
1362FileType (not always accessible), and TracebackType and FrameType
1363(inaccessible).
1364
1365- In urllib.py: added separate administration of temporary files
1366created y URLopener.retrieve() so cleanup() can properly remove them.
1367The old code removed everything in tempcache which was a bad idea if
1368the user had passed a non-temp file into it. Also, in basejoin(),
1369interpret relative paths starting in "../". This is necessary if the
1370server uses symbolic links.
1371
1372- The Windows build procedure and project files are now based on
1373Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
1374directory. It is much more robust, and properly builds separate Debug
1375and Release versions. (The installer will be added shortly.)
1376
1377- Added casts and changed some return types in regexpr.c to avoid
1378compiler warnings or errors on some platforms.
1379
1380- The AIX build tools for shared libraries now supports VPATH. (Donn
1381Cave)
1382
1383- By default, disable the "portable" multimedia modules audioop,
1384imageop, and rgbimg, since they don't work on 64-bit platforms.
1385
1386- Fixed a nasty bug in cStringIO.c when code was actually using the
1387close() method (the destructors would try to free certain fields a
1388second time).
1389
1390- For those who think they need it, there's a "user.py" module. This
1391is *not* imported by default, but can be imported to run user-specific
1392setup commands, ~/.pythonrc.py.
1393
1394- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
1395Vladimir Marangozov, and others.
1396
1397- Added os.altsep; this is '/' on DOS/Windows, and None on systems
1398with a sane filename syntax.
1399
1400- os.py: Write out the dynamic OS choice, to avoid exec statements.
1401Adding support for a new OS is now a bit more work, but I bet that
1402'dos' or 'nt' will cover most situations...
1403
1404- The obsolete exception AccessError is now really gone.
1405
1406- Tools/faqwiz/: New installation instructions show how to maintain
1407multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
Guido van Rossumb68b77f1997-10-07 19:12:50 +00001408Added instructions to bootstrap script, too. Version bumped to 0.8.1.
Guido van Rossum92664b81997-10-07 00:12:43 +00001409Added <html>...</html> feature suggested by Skip Montanaro. Added
1410leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
1411default SRCDIR.
1412
1413- Documentation for the relatively new modules "keyword" and "symbol"
1414has been added (to the end of the section on the parser extension
1415module).
Guido van Rossumb68b77f1997-10-07 19:12:50 +00001416
1417- In module bisect.py, but functions have two optional argument 'lo'
1418and 'hi' which allow you to specify a subsequence of the array to
1419operate on.
1420
1421- In ftplib.py, changed most methods to return their status (even when
1422it is always "200 OK") rather than swallowing it.
Guido van Rossum764a3771997-10-08 22:49:49 +00001423
1424- main() now calls setlocale(LC_ALL, ""), if setlocale() and
1425<locale.h> are defined.
Guido van Rossum9a513ef1997-10-09 23:32:24 +00001426
1427- Changes to configure.in, the configure script, and both
1428Makefile.pre.in files, to support SGI's SGI_ABI platform selection
1429environment variable.
Guido van Rossum7ea639b1997-11-26 16:36:28 +00001430
1431
1432======================================================================
1433
1434
1435From 1.5a4 to 1.5b1
1436===================
1437
1438- The Windows NT/95 installer now includes full HTML of all manuals.
1439It also has a checkbox that lets you decide whether to install the
1440interpreter and library. The WISE installer script for the installer
1441is included in the source tree as PC/python15.wse, and so are the
1442icons used for Python files. The config.c file for the Windows build
1443is now complete with the pcre module.
1444
1445- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
1446evaluated for the prompt.
1447
1448- The reference manual is brought up to date (more or less -- it still
1449needs work, e.g. in the area of package import).
1450
1451- The icons used by latex2html are now included in the Doc
1452subdirectory (mostly so that tarring up the HTML files can be fully
1453automated). A simple index.html is also added to Doc (it only works
1454after you have successfully run latex2html).
1455
1456- For all you would-be proselytizers out there: a new version of
1457Misc/BLURB describes Python more concisely, and Misc/comparisons
1458compares Python to several other languages. Misc/BLURB.WINDOWS
1459contains a blurb specifically aimed at Windows programmers (by Mark
1460Hammond).
1461
1462- A new version of the Python mode for Emacs is included as
1463Misc/python-mode.el. There are too many new features to list here.
1464See http://www.python.org/ftp/emacs/pmdetails.html for more info.
1465
1466- New module fileinput makes iterating over the lines of a list of
1467files easier. (This still needs some more thinking to make it more
1468extensible.)
1469
1470- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
1471version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
1472Age C++ compiler. I expect that Jeff will also provide a binary
1473release for this platform.
1474
1475- On Linux, the configure script now uses '-Xlinker -export-dynamic'
1476instead of '-rdynamic' to link the main program so that it exports its
1477symbols to shared libraries it loads dynamically. I hope this doesn't
1478break on older Linux versions; it is needed for mklinux and appears to
1479work on Linux 2.0.30.
1480
1481- Some Tkinter resstructuring: the geometry methods that apply to a
1482master are now properly usable on toplevel master widgets. There's a
1483new (internal) widget class, BaseWidget. New, longer "official" names
1484for the geometry manager methods have been added,
1485e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
1486shorter names still work, and where there's ambiguity, pack wins over
1487place wins over grid. Also, the bind_class method now returns its
1488value.
1489
1490- New, RFC-822 conformant parsing of email addresses and address lists
1491in the rfc822 module, courtesy Ben Escoto.
1492
1493- New, revamped tkappinit.c with support for popular packages (PIL,
1494TIX, BLT, TOGL). For the last three, you need to execute the Tcl
1495command "load {} Tix" (or Blt, or Togl) to gain access to them.
1496The Modules/Setup line for the _tkinter module has been rewritten
1497using the cool line-breaking feature of most Bourne shells.
1498
1499- New socket method connect_ex() returns the error code from connect()
1500instead of raising an exception on errors; this makes the logic
1501required for asynchronous connects simpler and more efficient.
1502
1503- New "locale" module with (still experimental) interface to the
1504standard C library locale interface, courtesy Martin von Loewis. This
1505does not repeat my mistake in 1.5a4 of always calling
1506setlocale(LC_ALL, ""). In fact, we've pretty much decided that
1507Python's standard numerical formatting operations should always use
1508the conventions for the C locale; the locale module contains utility
1509functions to format numbers according to the user specified locale.
1510(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
1511"C") after locale-changing calls.) See the library manual. (Alas, the
1512promised changes to the "re" module for locale support have not been
1513materialized yet. If you care, volunteer!)
1514
1515- Memory leak plugged in Py_BuildValue when building a dictionary.
1516
1517- Shared modules can now live inside packages (hierarchical module
1518namespaces). No changes to the shared module itself are needed.
1519
1520- Improved policy for __builtins__: this is a module in __main__ and a
1521dictionary everywhere else.
1522
1523- Python no longer catches SIGHUP and SIGTERM by default. This was
1524impossible to get right in the light of thread contexts. If you want
1525your program to clean up when a signal happens, use the signal module
1526to set up your own signal handler.
1527
1528- New Python/C API PyNumber_CoerceEx() does not return an exception
1529when no coercion is possible. This is used to fix a problem where
1530comparing incompatible numbers for equality would raise an exception
1531rather than return false as in Python 1.4 -- it once again will return
1532false.
1533
1534- The errno module is changed again -- the table of error messages
1535(errorstr) is removed. Instead, you can use os.strerror(). This
1536removes redundance and a potential locale dependency.
1537
1538- New module xmllib, to parse XML files. By Sjoerd Mullender.
1539
1540- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
1541It resets the signal module's notion of what the current process ID
1542and thread are, so that signal handlers will work after (and across)
1543calls to os.fork().
1544
1545- Fixed most occurrences of fatal errors due to missing thread state.
1546
1547- For vgrind (a flexible source pretty printer) fans, there's a simple
1548Python definition in Misc/vgrindefs, courtesy Neale Pickett.
1549
1550- Fixed memory leak in exec statement.
1551
1552- The test.pystone module has a new function, pystones(loops=LOOPS),
1553which returns a (benchtime, stones) tuple. The main() function now
1554calls this and prints the report.
1555
1556- Package directories now *require* the presence of an __init__.py (or
1557__init__.pyc) file before they are considered as packages. This is
1558done to prevent accidental subdirectories with common names from
1559overriding modules with the same name.
1560
1561- Fixed some strange exceptions in __del__ methods in library modules
1562(e.g. urllib). This happens because the builtin names are already
1563deleted by the time __del__ is called. The solution (a hack, but it
1564works) is to set some instance variables to 0 instead of None.
1565
1566- The table of built-in module initializers is replaced by a pointer
1567variable. This makes it possible to switch to a different table at
1568run time, e.g. when a collection of modules is loaded from a shared
1569library. (No example code of how to do this is given, but it is
1570possible.) The table is still there of course, its name prefixed with
1571an underscore and used to initialize the pointer.
1572
1573- The warning about a thread still having a frame now only happens in
1574verbose mode.
1575
1576- Change the signal finialization so that it also resets the signal
1577handlers. After this has been called, our signal handlers are no
1578longer active!
1579
1580- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
1581literals. There's now also a test fort this module.
1582
1583- The copy module now also uses __dict__.update(state) instead of
1584going through individual attribute assignments, for class instances
1585without a __setstate__ method.
1586
1587- New module reconvert translates old-style (regex module) regular
1588expressions to new-style (re module, Perl-style) regular expressions.
1589
1590- Most modules that used to use the regex module now use the re
1591module. The grep module has a new pgrep() function which uses
1592Perl-style regular expressions.
1593
1594- The (very old, backwards compatibility) regexp.py module has been
1595deleted.
1596
1597- Restricted execution (rexec): added the pcre module (support for the
1598re module) to the list of trusted extension modules.
1599
1600- New version of Jim Fulton's CObject object type, adds
1601PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
1602
1603- Some patches to Lee Busby's fpectl mods that accidentally didn't
1604make it into 1.5a4.
1605
1606- In the string module, add an optional 4th argument to count(),
1607matching find() etc.
1608
1609- Patch for the nntplib module by Charles Waldman to add optional user
1610and password arguments to NNTP.__init__(), for nntp servers that need
1611them.
1612
1613- The str() function for class objects now returns
1614"modulename.classname" instead of returning the same as repr().
1615
1616- The parsing of \xXX escapes no longer relies on sscanf().
1617
1618- The "sharedmodules" subdirectory of the installation is renamed to
1619"lib-dynload". (You may have to edit your Modules/Setup file to fix
1620this in an existing installation!)
1621
1622- Fixed Don Beaudry's mess-up with the OPT test in the configure
1623script. Certain SGI platforms will still issue a warning for each
1624compile; there's not much I can do about this since the compiler's
1625exit status doesn't indicate that I was using an obsolete option.
1626
1627- Fixed Barry's mess-up with {}.get(), and added test cases for it.
1628
1629- Shared libraries didn't quite work under AIX because of the change
1630in status of the GNU readline interface. Fix due to by Vladimir
1631Marangozov.
1632
1633
1634======================================================================