blob: 3718fbe1142cb4d3fbb273b900ca0f40a7f7b258 [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 Rossum1f83cce1997-10-06 21:04:35 +00004Below is a list of all relevant changes since the release 1.4, up till
5the release of 1.5a3. At the end is a list of changes made since
Guido van Rossum92664b81997-10-07 00:12:43 +000061.5a3 up to the release of 1.5a4.
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
9here, I'm grateful to many more people who remain anonymous. You may
10find 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
14Security
15--------
16
17- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
18please use the new version. The old version has a huge security leak.
Guido van Rossum61000331997-08-15 04:39:58 +000019
20Miscellaneous
21-------------
22
Guido van Rossum1f83cce1997-10-06 21:04:35 +000023- Because of various (small) incompatible changes in the Python
24bytecode interpreter, the magic number for .pyc files has changed
25again.
26
Guido van Rossum2da391f1997-08-18 21:17:32 +000027- The default module search path is now much saner. Both on Unix and
28Windows, it is essentially derived from the path to the executable
29(which can be overridden by setting the environment variable
30$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
31front of the default path, like in Unix (instead of overriding the
32default path). On Windows, the directory containing the executable is
33added to the end of the path.
34
Guido van Rossum1f83cce1997-10-06 21:04:35 +000035- A new version of python-mode.el for Emacs has been included. Also,
36a new file ccpy-style.el has been added to configure Emacs cc-mode for
37the preferred style in Python C sources.
38
Guido van Rossum2da391f1997-08-18 21:17:32 +000039- On Unix, when using sys.argv[0] to insert the script directory in
40front of sys.path, expand a symbolic link. You can now install a
41program in a private directory and have a symbolic link to it in a
42public bin directory, and it will put the private directory in the
43module search path. Note that the symlink is expanded in sys.path[0]
44but not in sys.argv[0], so you can still tell the name by which you
45were invoked.
46
47- It is now recommended to use ``#!/usr/bin/env python'' instead of
48``#!/usr/local/bin/python'' at the start of executable scripts, except
49for CGI scripts. It has been determined that the use of /usr/bin/env
50is more portable than that of /usr/local/bin/python -- scripts almost
51never have to be edited when the Python interpreter lives in a
52non-standard place. Note that this doesn't work for CGI scripts since
53the python executable often doesn't live in the HTTP server's default
54search path.
Guido van Rossum61000331997-08-15 04:39:58 +000055
56- The silly -s command line option and the corresponding
57PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
58flag in the Python/C API) are gone.
59
60- Most problems on 64-bit platforms should now be fixed. Andrew
61Kuchling helped. Some uncommon extension modules are still not
62clean (image and audio ops?).
63
64- Fixed a bug where multiple anonymous tuple arguments would be mixed up
65when using the debugger or profiler (reported by Just van Rossum).
66The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
67would print the wrong value when run under the debugger or profiler.
68
Guido van Rossum2da391f1997-08-18 21:17:32 +000069- The hacks that the dictionary implementation used to speed up
70repeated lookups of the same C string were removed; these were a
71source of subtle problems and don't seem to serve much of a purpose
72any longer.
73
74- All traces of support for the long dead access statement have been
75removed from the sources.
76
Guido van Rossum61000331997-08-15 04:39:58 +000077- Plugged the two-byte memory leak in the tokenizer when reading an
78interactive EOF.
79
Guido van Rossum1f83cce1997-10-06 21:04:35 +000080- There's a -O option to the interpreter that removes SET_LINENO
81instructions and assert statements (see below); it uses and produces
82.pyo files instead of .pyc files. The speedup is only a few percent
83in most cases. The line numbers are still available in the .pyo file,
84as a separate table (which is also available in .pyc files). However,
85the removal of the SET_LINENO instructions means that the debugger
86(pdb) can't set breakpoints on lines in -O mode. The traceback module
87contains a function to extract a line number from the code object
88referenced in a traceback object. In the future it should be possible
89to write external bytecode optimizers that create better optimized
90.pyo files, and there should be more control over optimization;
91consider the -O option a "teaser". Without -O, the assert statement
92actually generates code that first checks __debug__; if this variable
93is false, the assertion is not checked. __debug__ is a built-in
94variable whose value is initialized to track the -O flag (it's true
95iff -O is not specified). With -O, no code is generated for assert
96statements, nor for code of the form ``if __debug__: <something>''.
97Sorry, no further constant folding happens.
98
Guido van Rossum61000331997-08-15 04:39:58 +000099
100Performance
101-----------
102
Guido van Rossum2da391f1997-08-18 21:17:32 +0000103- It's much faster (almost twice for pystone.py -- see
104Tools/scripts). See the entry on string interning below.
Guido van Rossum61000331997-08-15 04:39:58 +0000105
106- Some speedup by using separate free lists for method objects (both
107the C and the Python variety) and for floating point numbers.
108
109- Big speedup by allocating frame objects with a single malloc() call.
110The Python/C API for frames is changed (you shouldn't be using this
111anyway).
112
113- Significant speedup by inlining some common opcodes for common operand
114types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
115
116- Small speedup by reordering the method tables of some common
117objects (e.g. list.append is now first).
118
Guido van Rossum2da391f1997-08-18 21:17:32 +0000119- Big optimization to the read() method of file objects. A read()
120without arguments now attempts to use fstat to allocate a buffer of
121the right size; for pipes and sockets, it will fall back to doubling
122the buffer size. While that the improvement is real on all systems,
123it is most dramatic on Windows.
124
Guido van Rossum61000331997-08-15 04:39:58 +0000125
126Documentation
127-------------
128
129- Many new pieces of library documentation were contributed, mostly by
130Andrew Kuchling. Even cmath is now documented! There's also a
131chapter of the library manual, "libundoc.tex", which provides a
132listing of all undocumented modules, plus their status (e.g. internal,
133obsolete, or in need of documentation). Also contributions by Sue
134Williams, Skip Montanaro, and some module authors who succumbed to
135pressure to document their own contributed modules :-). Note that
136printing the documentation now kills fewer trees -- the margins have
137been reduced.
138
139- I have started documenting the Python/C API. Unfortunately this project
140hasn't been completed yet. It will be complete before the final release of
141Python 1.5, though. At the moment, it's better to read the LaTeX source
142than to attempt to run it through LaTeX and print the resulting dvi file.
143
144- The posix module (and hence os.py) now has doc strings! Thanks to Neil
145Schemenauer. I received a few other contributions of doc strings. In most
146other places, doc strings are still wishful thinking...
147
148
149Language changes
150----------------
151
152- Private variables with leading double underscore are now a permanent
153feature of the language. (These were experimental in release 1.4. I have
154favorable experience using them; I can't label them "experimental"
155forever.)
156
157- There's new string literal syntax for "raw strings". Prefixing a string
158literal with the letter r (or R) disables all escape processing in the
159string; for example, r'\n' is a two-character string consisting of a
160backslash followed by the letter n. This combines with all forms of string
161quotes; it is actually useful for triple quoted doc strings which might
162contain references to \n or \t. An embedded quote prefixed with a
163backslash does not terminate the string, but the backslash is still
164included in the string; for example, r'\'' is a two-character string
165consisting of a backslash and a quote. (Raw strings are also
166affectionately known as Robin strings, after their inventor, Robin
167Friedrich.)
168
Guido van Rossum2da391f1997-08-18 21:17:32 +0000169- There's a simple assert statement, and a new exception
170AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
171not foo > 0: raise AssertionError''. Sorry, the text of the asserted
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000172condition is not available; it would be too complicated to generate
173code for this (since the code is generated from a parse tree).
174However, the text is displayed as part of the traceback!
175
176- The raise statement has a new feature: when using "raise SomeClass,
177somevalue" where somevalue is not an instance of SomeClass, it
178instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
179instance of a *derived* class of SomeClass, the exception class raised
180is set to somevalue.__class__, and SomeClass is ignored after that.
181
182- Duplicate keyword arguments are now detected at compile time;
183f(a=1,a=2) is now a syntax error.
Guido van Rossum61000331997-08-15 04:39:58 +0000184
185
186Changes to builtin features
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000187---------------------------
188
Guido van Rossum2da391f1997-08-18 21:17:32 +0000189- There's a new exception FloatingPointError (used only by Lee Busby's
190patches to catch floating point exceptions, at the moment).
191
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000192- The obsolete exception ConflictError (presumably used by the long
193obsolete access statement) has been deleted.
Guido van Rossum2da391f1997-08-18 21:17:32 +0000194
Guido van Rossum61000331997-08-15 04:39:58 +0000195- There's a new function sys.exc_info() which returns the tuple
196(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000197
Guido van Rossum61000331997-08-15 04:39:58 +0000198- There's a new variable sys.executable, pointing to the executable file
199for the Python interpreter.
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000200
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000201- The sort() methods for lists no longer uses the C library qsort(); I
202wrote my own quicksort implementation, with lots of help (in the form
203of a kind of competition) from Tim Peters. This solves a bug in
204dictionary comparisons on some Solaris versions when Python is built
205with threads, and makes sorting lists even faster.
206
207- The semantics of comparing two dictionaries have changed, to make
208comparison of unequal dictionaries faster. A shorter dictionary is
209always considered smaller than a larger dictionary. For dictionaries
210of the same size, the smallest differing element determines the
211outcome (which yields the same results as before in this case, without
212explicit sorting). Thanks to Aaron Watters for suggesting something
213like this.
214
Guido van Rossum61000331997-08-15 04:39:58 +0000215- The semantics of try-except have changed subtly so that calling a
216function in an exception handler that itself raises and catches an
217exception no longer overwrites the sys.exc_* variables. This also
218alleviates the problem that objects referenced in a stack frame that
219caught an exception are kept alive until another exception is caught
220-- the sys.exc_* variables are restored to their previous value when
221returning from a function that caught an exception.
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000222
Guido van Rossum61000331997-08-15 04:39:58 +0000223- There's a new "buffer" interface. Certain objects (e.g. strings and
224arrays) now support the "buffer" protocol. Buffer objects are acceptable
225whenever formerly a string was required for a write operation; mutable
226buffer objects can be the target of a read operation using the call
227f.readinto(buffer). A cool feature is that regular expression matching now
228also work on array objects. Contribution by Jack Jansen. (Needs
229documentation.)
230
231- String interning: dictionary lookups are faster when the lookup
232string object is the same object as the key in the dictionary, not
233just a string with the same value. This is done by having a pool of
234"interned" strings. Most names generated by the interpreter are now
235automatically interned, and there's a new built-in function intern(s)
236that returns the interned version of a string. Interned strings are
237not a different object type, and interning is totally optional, but by
238interning most keys a speedup of about 15% was obtained for the
239pystone benchmark.
240
241- Dictionary objects have several new methods; clear() and copy() have
242the obvious semantics, while update(d) merges the contents of another
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000243dictionary d into this one, overriding existing keys. The dictionary
244implementation file is now called dictobject.c rather than the
245confusing mappingobject.c.
Guido van Rossum61000331997-08-15 04:39:58 +0000246
Guido van Rossum61000331997-08-15 04:39:58 +0000247- The intrinsic function dir() is much smarter; it looks in __dict__,
248__members__ and __methods__.
249
Guido van Rossum2da391f1997-08-18 21:17:32 +0000250- The intrinsic functions int(), long() and float() can now take a
251string argument and then do the same thing as string.atoi(),
252string.atol(), and string.atof(). No second 'base' argument is
253allowed, and complex() does not take a string (nobody cared enough).
254
Guido van Rossum61000331997-08-15 04:39:58 +0000255- When a module is deleted, its globals are now deleted in two phases.
256In the first phase, all variables whose name begins with exactly one
257underscore are replaced by None; in the second phase, all variables
258are deleted. This makes it possible to have global objects whose
259destructors depend on other globals. The deletion order within each
260phase is still random.
261
262- It is no longer an error for a function to be called without a
263global variable __builtins__ -- an empty directory will be provided
264by default.
265
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000266- Guido's corollary to the "Don Beaudry hook": it is now possible to
267do metaprogramming by using an instance as a base class. Not for the
Guido van Rossum61000331997-08-15 04:39:58 +0000268faint of heart; and undocumented as yet, but basically if a base class
269is an instance, its class will be instantiated to create the new
270class. Jim Fulton will love it -- it also works with instances of his
271"extension classes", since it is triggered by the presence of a
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000272__class__ attribute on the purported base class. See
273Demo/metaclasses/index.html for an explanation and see that directory
274for examples.
275
276- Another change is that the Don Beaudry hook is now invoked when
277*any* base class is special. (Up to 1.5a3, the *last* special base
278class is used; in 1.5a4, the more rational choice of the *first*
279special base class is used.)
Guido van Rossum61000331997-08-15 04:39:58 +0000280
Guido van Rossum2da391f1997-08-18 21:17:32 +0000281- New optional parameter to the readlines() method of file objects.
282This indicates the number of bytes to read (the actual number of bytes
283read will be somewhat larger due to buffering reading until the end of
284the line). Some optimizations have also been made to speed it up (but
285not as much as read()).
286
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000287- Complex numbers no longer have the ".conj" pseudo attribute; use
288z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
289now *do* support the __members__ and __methods__ special attributes.
290
291- The complex() function now looks for a __complex__() method on class
292instances before giving up.
293
294- Long integers now support arbitrary shift counts, so you can now
295write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
296shift count for this.)
297
298- The hex() and oct() functions have been changed so that for regular
299integers, they never emit a minus sign. For example, on a 32-bit
300machine, oct(-1) now returns '037777777777' and hex(-1) returns
301'0xffffffff'. While this may seem inconsistent, it is much more
302useful. (For long integers, a minus sign is used as before, to fit
303the result in memory :-)
304
305- The hash() function computes better hashes for several data types,
306including strings, floating point numbers, and complex numbers.
307
Guido van Rossum61000331997-08-15 04:39:58 +0000308
309New extension modules
310---------------------
311
312- New extension modules cStringIO.c and cPickle.c, written by Jim
313Fulton and other folks at Digital Creations. These are much more
314efficient than their Python counterparts StringIO.py and pickle.py,
315but don't support subclassing. cPickle.c clocks up to 1000 times
Guido van Rossum2da391f1997-08-18 21:17:32 +0000316faster than pickle.py; cStringIO.c's improvement is less dramatic but
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000317still significant.
Guido van Rossum61000331997-08-15 04:39:58 +0000318
319- New extension module zlibmodule.c, interfacing to the free zlib
320library (gzip compatible compression). There's also a module gzip.py
321which provides a higher level interface. Written by Andrew Kuchling
322and Jeremy Hylton.
323
324- New module readline; see the "miscellaneous" section above.
325
326- New Unix extension module resource.c, by Jeremy Hylton, provides
327access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
328related symbolic constants.
329
330- New extension puremodule.c, by Barry Warsaw, which interfaces to the
331Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
332possible to enable Purify by simply setting the PURIFY Makefile
333variable in the Modules/Setup file.
334
335
336Changes in extension modules
337----------------------------
338
339- The struct extension module has several new features to control byte
340order and word size. It supports reading and writing IEEE floats even
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000341on platforms where this is not the native format. It uses uppercase
342format codes for unsigned integers of various sizes (always using
343Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
344and 'p' for "Pascal strings" (with a leading length byte, included in
Guido van Rossum92664b81997-10-07 00:12:43 +0000345the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
346big-endian data and '<' forces little-endian data; these also select
347standard data sizes and disable automatic alignment (use pad bytes as
348needed).
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000349
350- The array module supports uppercase format codes for unsigned data
351formats (like the struct module).
Guido van Rossum61000331997-08-15 04:39:58 +0000352
353- The fcntl extension module now exports the needed symbolic
354constants. (Formerly these were in FCNTL.py which was not available
355or correct for all platforms.)
356
357- The extension modules dbm, gdbm and bsddb now check that the
358database is still open before making any new calls.
359
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000360- The dbhash module is no more. Use bsddb instead. (There's a third
361party interface for the BSD 2.x code somewhere on the web; support for
362bsddb will be deprecated.)
363
364- The gdbm module now supports a sync() method.
365
366- The socket module now has some new functions: getprotobyname(), and
367the set {ntoh,hton}{s,l}().
368
Guido van Rossum61000331997-08-15 04:39:58 +0000369- Various modules now export their type object: socket.SocketType,
370array.ArrayType.
371
Guido van Rossum2da391f1997-08-18 21:17:32 +0000372- The socket module's accept() method now returns unknown addresses as
373a tuple rather than raising an exception. (This can happen in
374promiscuous mode.) Theres' also a new function getprotobyname().
375
Guido van Rossum61000331997-08-15 04:39:58 +0000376- The pthread support for the thread module now works on most platforms.
377
378- STDWIN is now officially obsolete. Support for it will eventually
379be removed from the distribution.
380
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000381- The binascii extension module is now hopefully fully debugged.
382(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
383received.)
Guido van Rossum61000331997-08-15 04:39:58 +0000384
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000385- audioop.c: added a ratecv() function; better handling of overflow in
386add().
Guido van Rossum2da391f1997-08-18 21:17:32 +0000387
388- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
389Windows, also O_TEXT and O_BINARY. The 'error' variable (the
390exception is raises) is renamed -- its string value is now "os.error",
391so newbies don't believe they have to import posix (or nt) to catch
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000392it when they see os.error reported as posix.error. The execve()
393function now accepts any mapping object for the environment.
Guido van Rossum2da391f1997-08-18 21:17:32 +0000394
395- A new version of the al (audio library) module for SGI was
396contributed by Sjoerd Mullender.
397
398- The regex module has a new function get_syntax() which retrieves the
399syntax setting set by set_syntax(). The code was also sanitized,
400removing worries about unclean error handling. See also below for its
401successor, re.py.
402
403- The "new" module (which creates new objects of various types) once
404again has a fully functioning new.function() method. Dangerous as
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000405ever! Also, new.code() has several new arguments.
406
407- A problem has been fixed in the rotor module: on systems with signed
408characters, rotor-encoded data was not portable when the key contained
4098-bit characters. Also, setkey() now requires its argument rather
410than having broken code to default it.
411
412- The sys.builtin_module_names variable is now a tuple. Another new
413variables in sys is sys.executable (the full path to the Python
414binary, if known).
415
416- The specs for time.strftime() have undergone some revisions. It
417appears that not all format characters are supported in the same way
418on all platforms. Rather than reimplement it, we note these
419differences in the documentation, and emphasize the shared set of
420features. There's also a thorough test set (that occasionally finds
421problems in the C library implementation, e.g. on some Linuxes),
422thanks to Skip Montanaro.
423
424- The nis module seems broken when used with NIS+; unfortunately
425nobody knows how to fix it. It should still work with old NIS.
Guido van Rossum2da391f1997-08-18 21:17:32 +0000426
Guido van Rossum61000331997-08-15 04:39:58 +0000427
428New library modules
429-------------------
430
431- New (still experimental) Perl-style regular expression module,
432re.py, which uses a new interface for matching as well as a new
433syntax; the new interface avoids the thread-unsafety of the regex
434interface. This comes with a helper extension reopmodule.c and vastly
435rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
436Peters, and Andrew Kuchling. See the documentation libre.tex. In
4371.5, the old regex module is still fully supported; in the future, it
438will become obsolete.
439
440- New module gzip.py; see zlib above.
441
442- New module keyword.py exports knowledge about Python's built-in
443keywords. (New version by Ka-Ping Yee.)
444
445- New module pprint.py (with documentation) which supports
446pretty-printing of lists, tuples, & dictionaries recursively. By Fred
447Drake.
448
449- New module code.py. The function code.compile_command() can
450determine whether an interactively entered command is complete or not,
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000451distinguishing incomplete from invalid input. (XXX Unfortunately,
452this seems broken at this moment, and I don't have the time to fix
453it. It's probably better to add an explicit interface to the parser
454for this.)
Guido van Rossum61000331997-08-15 04:39:58 +0000455
Guido van Rossum522578e1997-08-28 03:43:21 +0000456- There is now a library module xdrlib.py which can read and write the
Guido van Rossum61000331997-08-15 04:39:58 +0000457XDR data format as used by Sun RPC, for example. It uses the struct
458module.
459
460
461Changes in library modules
462--------------------------
463
464- Module codehack.py is now completely obsolete.
465
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000466- The pickle.py module has been updated to make it compatible with the
467new binary format that cPickle.c produces. By default it produces the
468old all-ASCII format compatible with the old pickle.py, still much
469faster than pickle.py; it will read both formats automatically. A few
470other updates have been made.
471
472- A new helper module, copy_reg.py, is provided to register extensions
473to the pickling code.
474
Guido van Rossum61000331997-08-15 04:39:58 +0000475- Revamped module tokenize.py is much more accurate and has an
476interface that makes it a breeze to write code to colorize Python
477source code. Contributed by Ka-Ping Yee.
478
479- In ihooks.py, ModuleLoader.load_module() now closes the file under
480all circumstances.
481
482- The tempfile.py module has a new class, TemporaryFile, which creates
483an open temporary file that will be deleted automatically when
484closed. This works on Windows and MacOS as well as on Unix. (Jim
485Fulton.)
486
487- Changes to the cgi.py module: Most imports are now done at the
488top of the module, which provides a speedup when using ni (Jim
489Fulton). The problem with file upload to a Windows platform is solved
490by using the new tempfile.TemporaryFile class; temporary files are now
491always opened in binary mode (Jim Fulton). The cgi.escape() function
492now takes an optional flag argument that quotes '"' to '&quot;'. It
493is now possible to invoke cgi.py from a command line script, to test
494cgi scripts more easily outside an http server. There's an optional
495limit to the size of uploads to POST (Skip Montanaro). Added a
496'strict_parsing' option to all parsing functions (Jim Fulton). The
497function parse_qs() now uses urllib.unquote() on the name as well as
Guido van Rossum2da391f1997-08-18 21:17:32 +0000498the value of fields (Clarence Gardner). The FieldStorage class now
499has a __len__() method.
Guido van Rossum61000331997-08-15 04:39:58 +0000500
501- httplib.py: the socket object is no longer closed; all HTTP/1.*
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000502responses are now accepted; and it is now thread-safe (by not using
503the regex module).
Guido van Rossum61000331997-08-15 04:39:58 +0000504
505- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
506
507- The popen2.py module is now rewritten using a class, which makes
508access to the standard error stream and the process id of the
509subprocess possible.
510
Guido van Rossum2da391f1997-08-18 21:17:32 +0000511- Added timezone support to the rfc822.py module, in the form of a
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000512getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
513Also added recognition of some non-standard date formats, by Lars
514Wirzenius, and RFC 850 dates (Chris Lawrence).
Guido van Rossum61000331997-08-15 04:39:58 +0000515
516- mhlib.py: various enhancements, including almost compatible parsing
517of message sequence specifiers without invoking a subprocess. Also
518added a createmessage() method by Lars Wirzenius.
519
520- The StringIO.StringIO class now supports readline(nbytes). (Lars
521Wirzenius.) (Of course, you should be using cStringIO for performance.)
522
523- UserDict.py supports the new dictionary methods as well.
524
525- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
526speed it up, and replace 0 seed values by 1 to avoid degeneration.
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000527A bug was fixed in the test for invalid arguments.
Guido van Rossum61000331997-08-15 04:39:58 +0000528
Guido van Rossum2da391f1997-08-18 21:17:32 +0000529- Module ftplib.py: added support for parsing a .netrc file (Fred
530Drake). Also added an ntransfercmd() method to the FTP class, which
531allows access to the expected size of a transfer when available, and a
532parse150() function to the module which parses the corresponding 150
533response.
Guido van Rossum61000331997-08-15 04:39:58 +0000534
535- urllib.py: the ftp cache is now limited to 10 entries. Added
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000536quote_plus() and unquote_plus() functions which are like quote() and
537unquote() but also replace spaces with '+' or vice versa, for
538encoding/decoding CGI form arguments. Catch all errors from the ftp
539module. HTTP requests now add the Host: header line. The proxy
Guido van Rossum2da391f1997-08-18 21:17:32 +0000540variable names are now mapped to lower case, for Windows. The
541spliturl() function no longer erroneously throws away all data past
542the first newline. The basejoin() function now intereprets "../"
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000543correctly. I *believe* that the problems with "exception raised in
544__del__" under certain circumstances have been fixed (mostly by
545changes elsewher in the interpreter).
546
547- In urlparse.py, there is a cache for results in urlparse.urlparse();
548its size limit is set to 20. Also, new URL schemes shttp, https, and
549snews are "supported".
Guido van Rossum61000331997-08-15 04:39:58 +0000550
Guido van Rossum2da391f1997-08-18 21:17:32 +0000551- shelve.py: use cPickle and cStringIO when available. Also added
552a sync() method, which calls the database's sync() method if there is
553one.
Guido van Rossum61000331997-08-15 04:39:58 +0000554
555- The mimetools.py module now uses the available Python modules for
556decoding quoted-printable, uuencode and base64 formats, rather than
557creating a subprocess.
558
559- The python debugger (pdb.py, and its base class bdb.py) now support
560conditional breakpoints. See the docs.
561
562- The modules base64.py, uu.py and quopri.py can now be used as simple
563command line utilities.
564
565- Various small fixes to the nntplib.py module that I can't bother to
566document in detail.
567
Guido van Rossum61000331997-08-15 04:39:58 +0000568- Sjoerd Mullender's mimify.py module now supports base64 encoding and
569includes functions to handle the funny encoding you sometimes see in mail
570headers. It is now documented.
571
Guido van Rossum2da391f1997-08-18 21:17:32 +0000572- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
573gotten from the environment.
574
575- Many more modules now correctly open files in binary mode when this
576is necessary on non-Unix platforms.
577
578- The copying functions in the undocumented module shutil.py are
579smarter.
580
581- The Writer classes in the formatter.py module now have a flush()
582method.
583
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000584- The sgmllib.py module accepts hyphens and periods in the middle of
585attribute names. While this is against the SGML standard, there is
586some HTML out there that uses this...
587
588- The interface for the Python bytecode disassembler module, dis.py,
589has been enhanced quite a bit. There's now one main function,
590dis.dis(), which takes almost any kind of object (function, module,
591class, instance, method, code object) and disassembles it; without
592arguments it disassembles the last frame of the last traceback. The
593other functions have changed slightly, too.
Guido van Rossum2da391f1997-08-18 21:17:32 +0000594
595- The imghdr.py module recognizes new image types: BMP, PNG.
596
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000597- The string.py module has a new function replace(str, old, new,
Guido van Rossum2da391f1997-08-18 21:17:32 +0000598[maxsplit]) which does substring replacements. It is actually
599implemented in C in the strop module. The functions [r]find() an
600[r]index() have an optional 4th argument indicating the end of the
601substring to search, alsoo implemented by their strop counterparts.
602(Remember, never import strop -- import string uses strop when
603available with zero overhead.)
604
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000605- The string.join() function now accepts any sequence argument, not
606just lists and tuples.
607
608- The string.maketrans() requires its first two arguments to be
609present. The old version didn't require them, but there's not much
610point without them, and the documentation suggests that they are
611required, so we fixed the code to match the documentation.
612
613- The regsub.py module has a function clear_cache(), which clears its
614internal cache of compiled regular expressions. Also, the cache now
615takes the current syntax setting into account. (However, this module
616is now obsolete -- use the sub() or subn() functions or methods in the
617re module.)
618
619- The undocumented module Complex.py has been removed, now that Python
620has built-in complex numbers. A similar module remains as
621Demo/classes/Complex.py, as an example.
622
Guido van Rossum61000331997-08-15 04:39:58 +0000623
624Changes to the build process
625----------------------------
626
627- The way GNU readline is configured is totally different. The
628--with-readline configure option is gone. It is now an extension
629module, which may be loaded dynamically. You must enable it (and
630specify the correct linraries to link with) in the Modules/Setup file.
631Importing the module installs some hooks which enable command line
632editing. When the interpreter shell is invoked interactively, it
633attempts to import the readline module; when this fails, the default
634input mechanism is used. The hook variables are PyOS_InputHook and
635PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
636ideas from William Magro.)
637
638- New build procedure: a single library, libpython1.5.a, is now built,
639which contains absolutely everything except for a one-line main()
640program (which calls Py_Main(argc, argv) to start the interpreter
641shell). This makes life much simpler for applications that need to
642embed Python. The serial number of the build is now included in the
643version string (sys.version).
644
645- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
646emits a single warning any more when compiling Python.
647
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000648- A number of new Makefile variables have been added for special
649situations, e.g. LDLAST is appended to the link command. These are
650used by editing the Makefile or passing them on the make command
651line.
652
Guido van Rossum61000331997-08-15 04:39:58 +0000653- A set of patches from Lee Busby has been integrated that make it
654possible to catch floating point exceptions. Use the configure option
655--with-fpectl to enable the patches; the extension modules fpectl and
656fpetest provide control to enable/disable and test the feature,
657respectively.
658
659- The support for shared libraries under AIX is now simpler and more
660robust. Thanks to Vladimir Marangozov for revamping his own patches!
661
662- The Modules/makesetup script now reads a file Setup.local as well as
663a file Setup. Most changes to the Setup script can be done by editing
664Setup.local instead, which makes it easier to carry a particular setup
665over from one release to the next.
666
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000667- The Modules/makesetup script now copies any "include" lines it
668encounters verbatim into the output Makefile. It also recognizes .cxx
669and .cpp as C++ source files.
670
Guido van Rossum61000331997-08-15 04:39:58 +0000671- The configure script is smarter about C compiler options; e.g. with
672gcc it uses -O2 and -g when possible, and on some other platforms it
673uses -Olimit 1500 to avoid a warning from the optimizer about the main
674loop in ceval.c (which has more than 1000 basic blocks).
675
676- The configure script now detects whether malloc(0) returns a NULL
677pointer or a valid block (of length zero). This avoids the nonsense
678of always adding one byte to all malloc() arguments on most platforms.
679
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000680- The configure script has a new option, --with-dec-threads, to enable
681DEC threads on DEC Alpha platforms. Also, --with-threads is now an
682alias for --with-thread (this was the Most Common Typo in configure
683arguments).
684
685- Many changes in Doc/Makefile; amongst others, latex2html is now used
686to generate HTML from all latex documents.
687
Guido van Rossum61000331997-08-15 04:39:58 +0000688
689Change to the Python/C API
690--------------------------
691
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000692- Because some interfaces have changed, the PYTHON_API macro has been
693bumped. Most extensions built for the old API version will still run,
694but I can't guarantee this. Python prints a warning message on
695version mismatches; it dumps core when the version mismatch causes a
696serious problem :-)
697
Guido van Rossum2da391f1997-08-18 21:17:32 +0000698- I've completed the Grand Renaming, with the help of Roger Masse and
699Barry Warsaw. This makes reading or debugging the code much easier.
700Many other unrelated code reorganizations have also been carried out.
701The allobjects.h header file is gone; instead, you would have to
702include Python.h followed by rename2.h. But you're better off running
703Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
704the rename2.h; it will disappear in the next release.
705
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000706- Various and sundry small bugs in the "abstract" interfaces have been
707fixed. Thanks to all the (involuntary) testers of the Python 1.4
708version! Some new functions have been added, e.g. PySequence_List(o),
709equivalent to list(o) in Python.
710
711- New API functions PyLong_FromUnsignedLong() and
712PyLong_AsUnsignedLong().
713
Guido van Rossum2da391f1997-08-18 21:17:32 +0000714- The API functions in the file cgensupport.c are no longer
715supported. This file has been moved to Modules and is only ever
716compiled when the SGI specific 'gl' module is built.
Guido van Rossum61000331997-08-15 04:39:58 +0000717
718- PyObject_Compare() can now raise an exception. Check with
719PyErr_Occurred(). The comparison function in an object type may also
720raise an exception.
721
722- The slice interface uses an upper bound of INT_MAX when no explicit
723upper bound is given (e.x. for a[1:]). It used to ask the object for
724its length and do the calculations.
725
726- Support for multiple independent interpreters. See Doc/api.tex,
727functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
728documentation is incomplete, also see the new Demo/pysvr example
729(which shows how to use these in a threaded application) and the
730source code.
731
732- There is now a Py_Finalize() function which "de-initializes"
733Python. It is possible to completely restart the interpreter
734repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
735change of functionality in Py_Initialize() means that it is now a
736fatal error to call it while the interpreter is already initialized.
737The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
738is deprecated (it is nothing more than Py_Finalize() followed by
739exit()).
740
Guido van Rossum2da391f1997-08-18 21:17:32 +0000741- There are no known memory leaks left. While Py_Finalize() doesn't
742free *all* allocated memory (some of it is hard to track down),
743repeated calls to Py_Finalize() and Py_Initialize() do not create
744unaccessible heap blocks.
Guido van Rossum61000331997-08-15 04:39:58 +0000745
746- There is now explicit per-thread state. (Inspired by, but not the
747same as, Greg Stein's free threading patches.)
748
749- There is now better support for threading C applications. There are
750now explicit APIs to manipulate the interpreter lock. Read the source
751or the Demo/pysvr example; the new functions are
752PyEval_{Acquire,Release}{Lock,Thread}().
753
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000754- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
755with other libraries' DEBUG macros. Likewise for any other test
756macros that didn't yet start with Py_.
757
Guido van Rossum61000331997-08-15 04:39:58 +0000758- New wrappers around malloc() and friends: Py_Malloc() etc. call
759malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
760just malloc(). Use of these wrappers could be essential if multiple
761memory allocators exist (e.g. when using certain DLL setups under
762Windows). (Idea by Jim Fulton.)
763
764- New C API PyImport_Import() which uses whatever __import__() hook
765that is installed for the current execution environment. By Jim
766Fulton.
767
768- It is now possible for an extension module's init function to fail
769non-fatally, by calling one of the PyErr_* functions and returning.
770
771- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
772argument to the proper type, like the similar PyString macros already
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000773did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
774and PyList_GET_ITEM.
Guido van Rossum61000331997-08-15 04:39:58 +0000775
776- Some of the Py_Get* function, like Py_GetVersion() (but not yet
777Py_GetPath()) are now declared as returning a const char *. (More
778should follow.)
779
780- Changed the run-time library to check for exceptions after object
781comparisons. PyObject_Compare() can now return an exception; use
782PyErr_Occurred() to check (there is *no* special return value).
783
784- PyFile_WriteString() and Py_Flushline() now return error indicators
785instead of clearing exceptions. This fixes an obscure bug where using
786these would clear a pending exception, discovered by Just van Rossum.
787
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000788- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
789an argument list including keyword arguments. Contributed by Geoff
790Philbrick.
791
Guido van Rossum2da391f1997-08-18 21:17:32 +0000792- PyArg_GetInt() is gone.
793
794- It's no longer necessary to include graminit.h when calling one of
795the extended parser API functions. The three public grammar start
796symbols are now in Python.h as Py_single_input, Py_file_input, and
797Py_eval_input.
798
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000799- The CObject interface has a new function,
800PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
801on the object referenced by "module.name".
802
Guido van Rossum61000331997-08-15 04:39:58 +0000803
804Tkinter
805-------
806
Guido van Rossum2da391f1997-08-18 21:17:32 +0000807- On popular demand, _tkinter once again installs a hook for readline
808that processes certain Tk events while waiting for the user to type
809(using PyOS_InputHook).
810
811- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
812caused by command definitions referencing widget objects beyond their
813lifetime.
814
815- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
816tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000817with the new Tk dialog scripts, and provide more "native platform"
818style file selection dialog boxes on some platforms. Contributed by
819Fredrik Lundh.
Guido van Rossum61000331997-08-15 04:39:58 +0000820
821- Tkinter.py: when the first Tk object is destroyed, it sets the
822hiddel global _default_root to None, so that when another Tk object is
823created it becomes the new default root. Other miscellaneous
824changes and fixes.
825
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000826- The Image class now has a configure method.
827
828- Added a bunch of new winfo options to Tkinter.py; we should now be
829up to date with Tk 4.2. The new winfo options supported are:
830mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
831visualsavailable.
832
833- The broken bind() method on Canvas objects defined in the Canvas.py
834module has been fixed. The CanvasItem and Group classes now also have
835an unbind() method.
836
837- The problem with Tkinter.py falling back to trying to import
838"tkinter" when "_tkinter" is not found has been fixed -- it no longer
839tries "tkinter", ever. This makes diagnosing the problem "_tkinter
840not configured" much easier and will hopefully reduce the newsgroup
841traffic on this topic.
842
843- The ScrolledText module once again supports the 'cnf' parameter, to
844be compatible with the examples in Mark Lutz' book (I know, I know,
845too late...)
846
Guido van Rossum61000331997-08-15 04:39:58 +0000847- The _tkinter.c extension module has been revamped. It now support
848Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
849works well under Windows and Mac (with the latest Tk ports to those
850platforms). It also supports threading -- it is safe for one
851(Python-created) thread to be blocked in _tkinter.mainloop() while
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000852other threads modify widgets. To make the changes visible, those
853threads must use update_idletasks()method. (The patch for threading
854in 1.5a3 was broken; in 1.5a4, it is back in a different version,
855which requires access to the Tcl sources to get it to work -- hence it
856is disabled by default.)
857
858- A bug in _tkinter.c has been fixed, where Split() with a string
859containing an unmatched '"' could cause an exception or core dump.
860
861- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
862CreateFileHandler, so _tkinter.createfilehandler is not available on
863those platforms when using Tk 8.0 or later. I will have to rethink
864how to interface with Tcl's lower-level event mechanism, or with its
865channels (which are like Python's file-like objects). Jack Jansen has
866provided a fix for the Mac, so createfilehandler *is* actually
867supported there; maybe I can adapt his fix for Windows.
Guido van Rossum61000331997-08-15 04:39:58 +0000868
869
870Tools and Demos
871---------------
872
873- A new regression test suite is provided, which tests most of the
874standard and built-in modules. The regression test is run by invoking
875the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
876he and Roger Masse contributed most of the new tests.
877
878- New tool: faqwiz -- the CGI script that is used to maintain the
879Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
880Tools/faqwiz.
881
882- New tool: webchecker -- a simple extensible web robot that, when
883aimed at a web server, checks that server for dead links. Available
884are a command line utility as well as a Tkinter based GUI version. In
885Tools/webchecker. A simplified version of this program is dissected
886in my article in O'Reilly's WWW Journal, the issue on Scripting
887Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
888Includes a parser for robots.txt files by Skip Montanaro.
889
890- New small tools: cvsfiles.py (prints a list of all files under CVS
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000891n a particular directory tree), treesync.py (a rather Guido-specific
Guido van Rossum61000331997-08-15 04:39:58 +0000892script to synchronize two source trees, one on Windows NT, the other
893one on Unix under CVS but accessible from the NT box), and logmerge.py
894(sort a collection of RCS or CVS logs by date). In Tools/scripts.
895
896- The freeze script now also works under Windows (NT). Another
897feature allows the -p option to be pointed at the Python source tree
898instead of the installation prefix. This was loosely based on part of
899xfreeze by Sam Rushing and Bill Tutt.
900
901- New examples (Demo/extend) that show how to use the generic
902extension makefile (Misc/Makefile.pre.in).
903
904- Tools/scripts/h2py.py now supports C++ comments.
905
Guido van Rossum2da391f1997-08-18 21:17:32 +0000906- Tools/scripts/pystone.py script is upgraded to version 1.1; there
907was a bug in version 1.0 (distributed with Python 1.4) that leaked
908memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
909
910- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
Guido van Rossum61000331997-08-15 04:39:58 +0000911
912
913Windows (NT and 95)
914-------------------
915
916- New project files for Developer Studio (Visual C++) 5.0 for Windows
917NT (the old VC++ 4.2 Makefile is also still supported, but will
918eventually be withdrawn due to its bulkiness).
919
920- See the note on the new module search path in the "Miscellaneous" section
921above.
922
923- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
924basically withdrawn. If it still works for you, you're lucky.
925
926- There's a new extension module, msvcrt.c, which provides various
927low-level operations defined in the Microsoft Visual C++ Runtime Library.
928These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
929console I/O functions like kbhit(), getch() and putch().
930
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000931- The -u option not only sets the standard I/O streams to unbuffered
932status, but also sets them in binary mode. (This can also be done
933using msvcrt.setmode(), by the way.)
Guido van Rossum61000331997-08-15 04:39:58 +0000934
935- The, sys.prefix and sys.exec_prefix variables point to the directory
936where Python is installed, or to the top of the source tree, if it was run
937from there.
938
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000939- The various os.path modules (posixpath, ntpath, macpath) now support
940passing more than two arguments to the join() function, so
941os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
942c)).
943
Guido van Rossum61000331997-08-15 04:39:58 +0000944- The ntpath module (normally used as os.path) supports ~ to $HOME
945expansion in expanduser().
946
947- The freeze tool now works on Windows.
948
Guido van Rossum2da391f1997-08-18 21:17:32 +0000949- See also the Tkinter category for a sad note on
950_tkinter.createfilehandler().
951
952- The truncate() method for file objects now works on Windows.
953
954- Py_Initialize() is no longer called when the DLL is loaded. You
955must call it yourself. (And you can't call it twice -- it's a fatal
956error to call it when Python is already initialized.)
Guido van Rossum61000331997-08-15 04:39:58 +0000957
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000958- The time module's clock() function now has good precision through
959the use of the Win32 API QueryPerformanceCounter().
960
961- Mark Hammond will release Python 1.5 versions of PythonWin and his
962other Windows specific code: the win32api extensions, COM/ActiveX
963support, and the MFC interface.
964
Guido van Rossum61000331997-08-15 04:39:58 +0000965
966Mac
967---
968
Guido van Rossum2da391f1997-08-18 21:17:32 +0000969- As always, the Macintosh port will be done by Jack Jansen. He will
970make a separate announcement for the Mac specific source code and the
971binary distribution(s) when these are ready.
Guido van Rossum61000331997-08-15 04:39:58 +0000972
973
Guido van Rossum92664b81997-10-07 00:12:43 +0000974======================================================================
975
976
Guido van Rossum2da391f1997-08-18 21:17:32 +0000977Fixed after 1.5a3 was released
978------------------------------
Guido van Rossum61000331997-08-15 04:39:58 +0000979
Guido van Rossum2da391f1997-08-18 21:17:32 +0000980The following changes have been made to the source base after the
Guido van Rossum92664b81997-10-07 00:12:43 +0000981release of 1.5a3. They still need to be sorted. They also need to be
982merged into their respective categories for the final release, but
983it's useful to have them separately during the alpha test cycle.
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000984
Guido van Rossum522578e1997-08-28 03:43:21 +0000985- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
986feature; better install instructions; removed faqmain.py (which was an
987older version).
988
989- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
990about the treatment of lines starting with '.'. Added a minimal test
991function.
992
993- struct module: ignore most whitespace in format strings.
994
995- urllib.py: close the socket and temp file in URLopener.retrieve() so
996that multiple retrievals using the same connection work.
997
Guido van Rossum92664b81997-10-07 00:12:43 +0000998- All standard exceptions are now classes by default; use -X to make
999them strings (for backward compatibility only).
1000
1001- There's a new standard exception hierarchy, defined in the standard
1002library module exceptions.py (which you never need to import
1003explicitly). See
1004http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
1005more info.
1006
Guido van Rossum522578e1997-08-28 03:43:21 +00001007- Three new C API functions:
1008
1009 - int PyErr_GivenExceptionMatches(obj1, obj2)
1010
1011 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
1012 instance of type obj2, or of a class derived from obj2
1013
1014 - int PyErr_ExceptionMatches(obj)
1015
1016 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
1017 PyErr_Occurred() as obj1. This will be the more commonly called
1018 function.
1019
1020 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
1021
1022 Normalizes exceptions, and places the normalized values in the
1023 arguments. If type is not a class, this does nothing. If type is a
1024 class, then it makes sure that value is an instance of the class by:
1025
1026 1. if instance is of the type, or a class derived from type, it does
1027 nothing.
1028
1029 2. otherwise it instantiates the class, using the value as an
1030 argument. If value is None, it uses an empty arg tuple, and if
1031 the value is a tuple, it uses just that.
1032
Guido van Rossum92664b81997-10-07 00:12:43 +00001033- Another new C API function: PyErr_NewException() creates a new
1034exception class derived from Exception; when -X is given, it creates a
1035new string exception.
Guido van Rossum522578e1997-08-28 03:43:21 +00001036
1037- core interpreter: remove the distinction between tuple and list
1038unpacking; allow an arbitrary sequence on the right hand side of any
1039unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
1040thing, which should really be called UNPACK_SEQUENCE.)
1041
1042- classes: Allow assignments to an instance's __dict__ or __class__,
1043so you can change ivars (including shared ivars -- shock horror) and
1044change classes dynamically. Also make the check on read-only
1045attributes of classes less draconic -- only the specials names
1046__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
1047assigned.
1048
1049- Two new built-in functions: issubclass() and isinstance(). Both
1050take classes as their second arguments. The former takes a class as
1051the first argument and returns true iff first is second, or is a
1052subclass of second. The latter takes any object as the first argument
1053and returns true iff first is an instance of the second, or any
1054subclass of second.
1055
1056- configure: Added configuration tests for presence of alarm(),
1057pause(), and getpwent().
1058
1059- Doc/Makefile: changed latex2html targets.
1060
1061- classes: Reverse the search order for the Don Beaudry hook so that
1062the first class with an applicable hook wins. Makes more sense.
1063
1064- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
1065now legal to call these more than once. The first call to
1066Py_Initialize() initializes, the first call to Py_Finalize()
1067finalizes. There's also a new API, Py_IsInitalized() which checks
1068whether we are already initialized (in case you want to leave things
1069as they were).
1070
1071- Completely disable the declarations for malloc(), realloc() and
1072free(). Any 90's C compiler has these in header files, and the tests
1073to decide whether to suppress the declarations kept failing on some
1074platforms.
1075
1076- *Before* (instead of after) signalmodule.o is added, remove both
1077intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
1078ld on various systems.
1079
1080- Added reop to PC/config.c
1081
1082- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
1083Removed outdated HP-UX comments from README. Added Cray T3E comments.
1084
1085- Various renames of statically defined functions that had name
1086conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
1087roundup (sys/types.h).
1088
1089- urllib.py: Interpret three slashes in file: URL as local file (for
1090Netscape on Windows/Mac).
1091
1092- copy.py: Make sure the objects returned by __getinitargs__() are
1093kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
1094easily reproducable because it requires a later call to
1095__getinitargs__() to return a tuple that happens to be allocated at
1096the same address.)
1097
1098- Added definition of AR to toplevel Makefile. Renamed @buildno temp
1099file to buildno1.
1100
1101- Moved Include/assert.h to Parser/assert.h, which seems to be the
1102only place where it's needed.
1103
1104- Alas, the thread support for _tkinter didn't work. Withdrew it.
1105
1106- Tweaked the dictionary lookup code again for some more speed
1107(Vladimir Marangozov).
1108
1109- NT build: Changed the way python15.lib is included in the other
1110projects. Per Mark Hammond's suggestion, add it to the extra libs in
1111Settings instead of to the project's source files.
1112
1113- regrtest.py: Change default verbosity so that there are only three
1114levels left: -q, default and -v. In default mode, the name of each
1115test is now printed. -v is the same as the old -vv. -q is more quiet
1116than the old default mode.
1117
1118- Removed the old FAQ from the distribution. You now have to get it
1119from the web!
1120
1121- Removed the PC/make_nt.in file from the distribution; it is no
1122longer needed.
1123
1124- Changed the build sequence so that shared modules are built last.
1125This fixes things for AIX and doesn't hurt elsewhere.
1126
1127- Improved test for GNU MP v1 in mpzmodule.c
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001128
Guido van Rossum2da391f1997-08-18 21:17:32 +00001129- fileobject.c: ftell() on Linux discards all buffered data; changed
Guido van Rossum522578e1997-08-28 03:43:21 +00001130read() code to use lseek() instead to get the same effect
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001131
Guido van Rossum2da391f1997-08-18 21:17:32 +00001132- configure.in, configure, importdl.c: NeXT sharedlib fixes
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001133
Guido van Rossum2da391f1997-08-18 21:17:32 +00001134- tupleobject.c: PyTuple_SetItem asserts refcnt==1
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001135
Guido van Rossum522578e1997-08-28 03:43:21 +00001136- resource.c: Different strategy regarding whether to declare
1137getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
1138conflicting decls in its headers. Choice: only declare the return
1139type, not the argument prototype, and not on Linux.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001140
Guido van Rossum2da391f1997-08-18 21:17:32 +00001141- importdl.c, configure*: set sharedlib extensions properly for NeXT
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001142
Guido van Rossum2da391f1997-08-18 21:17:32 +00001143- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
1144fixed; moved addition of PURIFY to LINKCC to configure
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001145
Guido van Rossum522578e1997-08-28 03:43:21 +00001146- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
1147added to shup up various compilers.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001148
Guido van Rossum2da391f1997-08-18 21:17:32 +00001149- _tkinter.c: removed buggy mac #ifndef
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001150
Guido van Rossum2da391f1997-08-18 21:17:32 +00001151- Doc: various Mac documentation changes, added docs for 'ic' module
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001152
Guido van Rossum2da391f1997-08-18 21:17:32 +00001153- PC/make_nt.in: deleted
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001154
Guido van Rossum522578e1997-08-28 03:43:21 +00001155- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
1156"")
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001157
Guido van Rossum2da391f1997-08-18 21:17:32 +00001158- test_rotor.py: print b -> print `b`
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001159
Guido van Rossum2da391f1997-08-18 21:17:32 +00001160- Tkinter.py: (tagOrId) -> (tagOrId,)
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001161
1162- Tkinter.py: the Tk class now also has a configure() method and
1163friends (they have been moved to the Misc class to accomplish this).
1164
1165- dict.get(key[, default]) returns dict[key] if it exists, or default
1166if it doesn't. The default defaults to None. This is quicker for
1167some applications than using either has_key() or try:...except
1168KeyError:....
1169
Guido van Rossum92664b81997-10-07 00:12:43 +00001170- Tools/webchecker/: some small changes to webchecker.py; added
1171websucker.py (a simple web site mirroring script).
1172
1173- Dictionary objects now have a get() method (also in UserDict.py).
1174dict.get(key, default) returns dict[key] if it exists and default
1175otherwise; default defaults to None.
1176
1177- Tools/scripts/logmerge.py: print the author, too.
1178
1179- Changes to import: support for "import a.b.c" is now built in. See
1180http://grail.cnri.reston.va.us/python/essays/packages.html
1181for more info. Most important deviations from "ni.py": __init__.py is
1182executed in the package's namespace instead of as a submodule; and
1183there's no support for "__" or "__domain__". Note that "ni.py" is not
1184changed to match this -- it is simply declared obsolete (while at the
1185same time, it is documented...:-( ).
1186Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
1187for an example implementation of hierarchical module import written in
1188Python).
1189
1190- More changes to import: the site.py module is now imported by
1191default when Python is initialized; use -S to disable it. The site.py
1192module extends the path with several more directories: site-packages
1193inside the lib/python1.5/ directory, site-python in the lib/
1194directory, and pathnames mentioned in *.pth files found in either of
1195those directories. See
1196http://grail.cnri.reston.va.us/python/essays/packages.html
1197for more info.
1198
1199- Changes to standard library subdirectory names: those subdirectories
1200that are not packages have been renamed with a hypen in their name,
1201e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
1202The test suite is now a package -- to run a test, you must now use
1203"import test.test_foo".
1204
1205- A completely new re.py module is provided (thanks to Andrew
1206Kuchling) which uses Philip Hazel's "pcre" re compiler and engine.
1207For a while, the "old" re.py (which was new in 1.5a3!) will be kept
1208around as re1.py. The "old" regex module and underlying parser and
1209engine are still present -- while regex is now officially obsolete, it
1210will probably take several major release cycles before it can be
1211removed.
1212
1213- The posix module now has a strerror() function which translates an
1214error code to a string.
1215
1216- The emacs.py module (which was long obsolete) has been removed.
1217
1218- The universal makefile Misc/Makefile.pre.in now features an
1219"install" target. By default, installed shared libraries go into
1220$exec_prefix/lib/python$VERSION/site-packages/.
1221
1222- The install-sh script is installed with the other configuration
1223specific files (in the config/ subdirectory).
1224
1225- It turns out whatsound.py and sndhdr.py were identical modules.
1226Since there's also an imghdr.py file, I propose to make sndhdr.py the
1227official one. For compatibility, whatsound.py imports * from
1228sndhdr.py.
1229
1230- Class objects have a new attribute, __module__, giving the name of
1231the module in which they were declared. This is useful for pickle and
1232for printing the full name of a class exception.
1233
1234- Many extension modules no longer issue a fatal error when their
1235initialization fails; the importing code now checks whether an error
1236occurred during module initialization, and correctly propagates the
1237exception to the import statement.
1238
1239- Most extension modules now raise class-based exceptions (except when
1240-X is used).
1241
1242- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
1243thread state -- just don't manipulate the lock if it isn't there.
1244
1245- Fixed a bug in Python/getopt.c that made it do the wrong thing when
1246an option was a single '-'. Thanks to Andrew Kuchling.
1247
1248- New module mimetypes.py will guess a MIME type from a filename's
1249extension.
1250
1251- Windows: the DLL version is now settable via a resource rather than
1252being hardcoded. This can be used for "branding" a binary Python
1253distribution.
1254
1255- urllib.py is now threadsafe -- it now uses re instead of regex, and
1256sys.exc_info() instead of sys.exc_{type,value}.
1257
1258- Many other library modules that used to use
1259sys.exc_{type,value,traceback} are now more thread-safe by virtue of
1260using sys.exc_info().
1261
1262- The functions in popen2 have an optional buffer size parameter.
1263Also, the command argument can now be either a string (passed to the
1264shell) or a list of arguments (passed directly to execv).
1265
1266- The thread support for _tkinter.c now works. The bad news is that
1267it requires a modified version of a file in the standard Tcl
1268distribution, which you must compile with a -I option pointing to the
1269standard Tcl source tree. For this reason, the thread support is
1270disabled by default.
1271
1272- The errno extension module adds two tables: errorcode maps errno
1273numbers to errno names (e.g. EINTR), and errorcode maps them to
1274message strings. (The latter is redundant because the new call
1275posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
1276
1277- The readline extension module now provides some interfaces to
1278internal readline routines that make it possible to write a completer
1279in Python. An example completer, rlcompleter.py, is provided.
1280
1281 When completing a simple identifier, it completes keywords,
1282 built-ins and globals in __main__; when completing
1283 NAME.NAME..., it evaluates (!) the expression up to the last
1284 dot and completes its attributes.
1285
1286 It's very cool to do "import string" type "string.", hit the
1287 completion key (twice), and see the list of names defined by
1288 the string module!
1289
1290 Tip: to use the tab key as the completion key, call
1291
1292 readline.parse_and_bind("tab: complete")
1293
1294- The traceback.py module has a new function tb_lineno() by Marc-Andre
1295Lemburg which extracts the line number from the linenumber table in
1296the code object. Apparently the traceback object doesn't contains the
1297right linenumber when -O is used. Rather than guessing whether -O is
1298on or off, the module itself uses tb_lineno() unconditionally.
1299
1300- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
1301to tag_bind() so it works again.
1302
1303- The pystone script is now a standard library module. Example use:
1304"import test.pystone; test.pystone.main()".
1305
1306- The import of the readline module in interactive mode is now also
1307attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
1308Lemburg, who asked for this. :-)
1309
1310- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
1311Mullender, to be closer to the standard. This fixes the getaddr()
1312method. Unfortunately, getaddrlist() is as broken as ever, since it
1313splits on commas without regard for RFC 822 quoting conventions.
1314
1315- pprint.py: correctly emit trailing "," in singleton tuples.
1316
1317- _tkinter.c: export names for its type objects, TkappType and
1318TkttType.
1319
1320- pickle.py: use __module__ when defined; fix a particularly hard to
1321reproduce bug that confuses the memo when temporary objects are
1322returned by custom pickling interfaces; and a semantic change: when
1323unpickling the instance variables of an instance, use
1324inst.__dict__.update(value) instead of a for loop with setattr() over
1325the value.keys(). This is more consistent (the pickling doesn't use
1326getattr() either but pickles inst.__dict__) and avoids problems with
1327instances that have a __setattr__ hook. But it *is* a semantic change
1328(because the setattr hook is no longer used). So beware!
1329
1330- config.h is now installed (at last) in
1331$exec_prefix/include/python1.5/. For most sites, this means that it
1332is actually in $prefix/include/python1.5/, with all the other Python
1333include files, since $prefix and $exec_prefix are the same by
1334default.
1335
1336- The imp module now supports parts of the functionality to implement
1337import of hierarchical module names. It now supports find_module()
1338and load_module() for all types of modules. Docstrings have been
1339added for those functions in the built-in impo module that are still
1340relevant (some old interfaces are obsolete). For a sample
1341implementation of hierarchical module import in Python, see the new
1342library module knee.py.
1343
1344- The % operator on string objects now allows arbitrary nested parens
1345in a %(...)X style format. (Brad Howes)
1346
1347- Reverse the order in which Setup and Setup.local are passed to the
1348makesetup script. This allows variable definitions in Setup.local to
1349override definitions in Setup. (But you'll still have to edit Setup
1350if you want to disable modules that are enabled by default, or if such
1351modules need non-standard options.)
1352
1353- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
1354is like PyImport_ImporModule(name) but receives the globals and locals
1355dict and the fromlist arguments as well. (The name is a char*; the
1356others are PyObject*s).
1357
1358- The 'p' format in the struct extension module alloded to above is
1359new in 1.5a4.
1360
1361- The xlib extension module has been debugged and improved.
1362
1363- The types.py module now uses try-except in a few places to make it
1364more likely that it can be imported in restricted mode. Some type
1365names are undefined in that case, e.g. CodeType (inaccessible),
1366FileType (not always accessible), and TracebackType and FrameType
1367(inaccessible).
1368
1369- In urllib.py: added separate administration of temporary files
1370created y URLopener.retrieve() so cleanup() can properly remove them.
1371The old code removed everything in tempcache which was a bad idea if
1372the user had passed a non-temp file into it. Also, in basejoin(),
1373interpret relative paths starting in "../". This is necessary if the
1374server uses symbolic links.
1375
1376- The Windows build procedure and project files are now based on
1377Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
1378directory. It is much more robust, and properly builds separate Debug
1379and Release versions. (The installer will be added shortly.)
1380
1381- Added casts and changed some return types in regexpr.c to avoid
1382compiler warnings or errors on some platforms.
1383
1384- The AIX build tools for shared libraries now supports VPATH. (Donn
1385Cave)
1386
1387- By default, disable the "portable" multimedia modules audioop,
1388imageop, and rgbimg, since they don't work on 64-bit platforms.
1389
1390- Fixed a nasty bug in cStringIO.c when code was actually using the
1391close() method (the destructors would try to free certain fields a
1392second time).
1393
1394- For those who think they need it, there's a "user.py" module. This
1395is *not* imported by default, but can be imported to run user-specific
1396setup commands, ~/.pythonrc.py.
1397
1398- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
1399Vladimir Marangozov, and others.
1400
1401- Added os.altsep; this is '/' on DOS/Windows, and None on systems
1402with a sane filename syntax.
1403
1404- os.py: Write out the dynamic OS choice, to avoid exec statements.
1405Adding support for a new OS is now a bit more work, but I bet that
1406'dos' or 'nt' will cover most situations...
1407
1408- The obsolete exception AccessError is now really gone.
1409
1410- Tools/faqwiz/: New installation instructions show how to maintain
1411multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
1412Added instructions to bootstrap script, too. Version bumped to 0.8.
1413Added <html>...</html> feature suggested by Skip Montanaro. Added
1414leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
1415default SRCDIR.
1416
1417- Documentation for the relatively new modules "keyword" and "symbol"
1418has been added (to the end of the section on the parser extension
1419module).