blob: 4c1b5513c87871317cdca9d070fc88c874972e54 [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
61.5a3 that will be in 1.5a4; this list is not yet complete and will be
7merged with the main list later.
Guido van Rossum61000331997-08-15 04:39:58 +00008
Guido van Rossum1f83cce1997-10-06 21:04:35 +00009A note on attributions: while I have sprinkled some names throughout
10here, I'm grateful to many more people who remain anonymous. You may
11find your name in the ACKS file. If you believe you deserve more
12credit, let me know and I'll add you to the list!
13
14
15Security
16--------
17
18- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
19please use the new version. The old version has a huge security leak.
Guido van Rossum61000331997-08-15 04:39:58 +000020
21Miscellaneous
22-------------
23
Guido van Rossum1f83cce1997-10-06 21:04:35 +000024- Because of various (small) incompatible changes in the Python
25bytecode interpreter, the magic number for .pyc files has changed
26again.
27
Guido van Rossum2da391f1997-08-18 21:17:32 +000028- The default module search path is now much saner. Both on Unix and
29Windows, it is essentially derived from the path to the executable
30(which can be overridden by setting the environment variable
31$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
32front of the default path, like in Unix (instead of overriding the
33default path). On Windows, the directory containing the executable is
34added to the end of the path.
35
Guido van Rossum1f83cce1997-10-06 21:04:35 +000036- A new version of python-mode.el for Emacs has been included. Also,
37a new file ccpy-style.el has been added to configure Emacs cc-mode for
38the preferred style in Python C sources.
39
Guido van Rossum2da391f1997-08-18 21:17:32 +000040- On Unix, when using sys.argv[0] to insert the script directory in
41front of sys.path, expand a symbolic link. You can now install a
42program in a private directory and have a symbolic link to it in a
43public bin directory, and it will put the private directory in the
44module search path. Note that the symlink is expanded in sys.path[0]
45but not in sys.argv[0], so you can still tell the name by which you
46were invoked.
47
48- It is now recommended to use ``#!/usr/bin/env python'' instead of
49``#!/usr/local/bin/python'' at the start of executable scripts, except
50for CGI scripts. It has been determined that the use of /usr/bin/env
51is more portable than that of /usr/local/bin/python -- scripts almost
52never have to be edited when the Python interpreter lives in a
53non-standard place. Note that this doesn't work for CGI scripts since
54the python executable often doesn't live in the HTTP server's default
55search path.
Guido van Rossum61000331997-08-15 04:39:58 +000056
57- The silly -s command line option and the corresponding
58PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
59flag in the Python/C API) are gone.
60
61- Most problems on 64-bit platforms should now be fixed. Andrew
62Kuchling helped. Some uncommon extension modules are still not
63clean (image and audio ops?).
64
65- Fixed a bug where multiple anonymous tuple arguments would be mixed up
66when using the debugger or profiler (reported by Just van Rossum).
67The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
68would print the wrong value when run under the debugger or profiler.
69
Guido van Rossum2da391f1997-08-18 21:17:32 +000070- The hacks that the dictionary implementation used to speed up
71repeated lookups of the same C string were removed; these were a
72source of subtle problems and don't seem to serve much of a purpose
73any longer.
74
75- All traces of support for the long dead access statement have been
76removed from the sources.
77
Guido van Rossum61000331997-08-15 04:39:58 +000078- Plugged the two-byte memory leak in the tokenizer when reading an
79interactive EOF.
80
Guido van Rossum1f83cce1997-10-06 21:04:35 +000081- There's a -O option to the interpreter that removes SET_LINENO
82instructions and assert statements (see below); it uses and produces
83.pyo files instead of .pyc files. The speedup is only a few percent
84in most cases. The line numbers are still available in the .pyo file,
85as a separate table (which is also available in .pyc files). However,
86the removal of the SET_LINENO instructions means that the debugger
87(pdb) can't set breakpoints on lines in -O mode. The traceback module
88contains a function to extract a line number from the code object
89referenced in a traceback object. In the future it should be possible
90to write external bytecode optimizers that create better optimized
91.pyo files, and there should be more control over optimization;
92consider the -O option a "teaser". Without -O, the assert statement
93actually generates code that first checks __debug__; if this variable
94is false, the assertion is not checked. __debug__ is a built-in
95variable whose value is initialized to track the -O flag (it's true
96iff -O is not specified). With -O, no code is generated for assert
97statements, nor for code of the form ``if __debug__: <something>''.
98Sorry, no further constant folding happens.
99
Guido van Rossum61000331997-08-15 04:39:58 +0000100
101Performance
102-----------
103
Guido van Rossum2da391f1997-08-18 21:17:32 +0000104- It's much faster (almost twice for pystone.py -- see
105Tools/scripts). See the entry on string interning below.
Guido van Rossum61000331997-08-15 04:39:58 +0000106
107- Some speedup by using separate free lists for method objects (both
108the C and the Python variety) and for floating point numbers.
109
110- Big speedup by allocating frame objects with a single malloc() call.
111The Python/C API for frames is changed (you shouldn't be using this
112anyway).
113
114- Significant speedup by inlining some common opcodes for common operand
115types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
116
117- Small speedup by reordering the method tables of some common
118objects (e.g. list.append is now first).
119
Guido van Rossum2da391f1997-08-18 21:17:32 +0000120- Big optimization to the read() method of file objects. A read()
121without arguments now attempts to use fstat to allocate a buffer of
122the right size; for pipes and sockets, it will fall back to doubling
123the buffer size. While that the improvement is real on all systems,
124it is most dramatic on Windows.
125
Guido van Rossum61000331997-08-15 04:39:58 +0000126
127Documentation
128-------------
129
130- Many new pieces of library documentation were contributed, mostly by
131Andrew Kuchling. Even cmath is now documented! There's also a
132chapter of the library manual, "libundoc.tex", which provides a
133listing of all undocumented modules, plus their status (e.g. internal,
134obsolete, or in need of documentation). Also contributions by Sue
135Williams, Skip Montanaro, and some module authors who succumbed to
136pressure to document their own contributed modules :-). Note that
137printing the documentation now kills fewer trees -- the margins have
138been reduced.
139
140- I have started documenting the Python/C API. Unfortunately this project
141hasn't been completed yet. It will be complete before the final release of
142Python 1.5, though. At the moment, it's better to read the LaTeX source
143than to attempt to run it through LaTeX and print the resulting dvi file.
144
145- The posix module (and hence os.py) now has doc strings! Thanks to Neil
146Schemenauer. I received a few other contributions of doc strings. In most
147other places, doc strings are still wishful thinking...
148
149
150Language changes
151----------------
152
153- Private variables with leading double underscore are now a permanent
154feature of the language. (These were experimental in release 1.4. I have
155favorable experience using them; I can't label them "experimental"
156forever.)
157
158- There's new string literal syntax for "raw strings". Prefixing a string
159literal with the letter r (or R) disables all escape processing in the
160string; for example, r'\n' is a two-character string consisting of a
161backslash followed by the letter n. This combines with all forms of string
162quotes; it is actually useful for triple quoted doc strings which might
163contain references to \n or \t. An embedded quote prefixed with a
164backslash does not terminate the string, but the backslash is still
165included in the string; for example, r'\'' is a two-character string
166consisting of a backslash and a quote. (Raw strings are also
167affectionately known as Robin strings, after their inventor, Robin
168Friedrich.)
169
Guido van Rossum2da391f1997-08-18 21:17:32 +0000170- There's a simple assert statement, and a new exception
171AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
172not foo > 0: raise AssertionError''. Sorry, the text of the asserted
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000173condition is not available; it would be too complicated to generate
174code for this (since the code is generated from a parse tree).
175However, the text is displayed as part of the traceback!
176
177- The raise statement has a new feature: when using "raise SomeClass,
178somevalue" where somevalue is not an instance of SomeClass, it
179instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
180instance of a *derived* class of SomeClass, the exception class raised
181is set to somevalue.__class__, and SomeClass is ignored after that.
182
183- Duplicate keyword arguments are now detected at compile time;
184f(a=1,a=2) is now a syntax error.
Guido van Rossum61000331997-08-15 04:39:58 +0000185
186
187Changes to builtin features
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000188---------------------------
189
Guido van Rossum2da391f1997-08-18 21:17:32 +0000190- There's a new exception FloatingPointError (used only by Lee Busby's
191patches to catch floating point exceptions, at the moment).
192
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000193- The obsolete exception ConflictError (presumably used by the long
194obsolete access statement) has been deleted.
Guido van Rossum2da391f1997-08-18 21:17:32 +0000195
Guido van Rossum61000331997-08-15 04:39:58 +0000196- There's a new function sys.exc_info() which returns the tuple
197(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000198
Guido van Rossum61000331997-08-15 04:39:58 +0000199- There's a new variable sys.executable, pointing to the executable file
200for the Python interpreter.
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000201
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000202- The sort() methods for lists no longer uses the C library qsort(); I
203wrote my own quicksort implementation, with lots of help (in the form
204of a kind of competition) from Tim Peters. This solves a bug in
205dictionary comparisons on some Solaris versions when Python is built
206with threads, and makes sorting lists even faster.
207
208- The semantics of comparing two dictionaries have changed, to make
209comparison of unequal dictionaries faster. A shorter dictionary is
210always considered smaller than a larger dictionary. For dictionaries
211of the same size, the smallest differing element determines the
212outcome (which yields the same results as before in this case, without
213explicit sorting). Thanks to Aaron Watters for suggesting something
214like this.
215
Guido van Rossum61000331997-08-15 04:39:58 +0000216- The semantics of try-except have changed subtly so that calling a
217function in an exception handler that itself raises and catches an
218exception no longer overwrites the sys.exc_* variables. This also
219alleviates the problem that objects referenced in a stack frame that
220caught an exception are kept alive until another exception is caught
221-- the sys.exc_* variables are restored to their previous value when
222returning from a function that caught an exception.
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000223
Guido van Rossum61000331997-08-15 04:39:58 +0000224- There's a new "buffer" interface. Certain objects (e.g. strings and
225arrays) now support the "buffer" protocol. Buffer objects are acceptable
226whenever formerly a string was required for a write operation; mutable
227buffer objects can be the target of a read operation using the call
228f.readinto(buffer). A cool feature is that regular expression matching now
229also work on array objects. Contribution by Jack Jansen. (Needs
230documentation.)
231
232- String interning: dictionary lookups are faster when the lookup
233string object is the same object as the key in the dictionary, not
234just a string with the same value. This is done by having a pool of
235"interned" strings. Most names generated by the interpreter are now
236automatically interned, and there's a new built-in function intern(s)
237that returns the interned version of a string. Interned strings are
238not a different object type, and interning is totally optional, but by
239interning most keys a speedup of about 15% was obtained for the
240pystone benchmark.
241
242- Dictionary objects have several new methods; clear() and copy() have
243the obvious semantics, while update(d) merges the contents of another
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000244dictionary d into this one, overriding existing keys. The dictionary
245implementation file is now called dictobject.c rather than the
246confusing mappingobject.c.
Guido van Rossum61000331997-08-15 04:39:58 +0000247
Guido van Rossum61000331997-08-15 04:39:58 +0000248- The intrinsic function dir() is much smarter; it looks in __dict__,
249__members__ and __methods__.
250
Guido van Rossum2da391f1997-08-18 21:17:32 +0000251- The intrinsic functions int(), long() and float() can now take a
252string argument and then do the same thing as string.atoi(),
253string.atol(), and string.atof(). No second 'base' argument is
254allowed, and complex() does not take a string (nobody cared enough).
255
Guido van Rossum61000331997-08-15 04:39:58 +0000256- When a module is deleted, its globals are now deleted in two phases.
257In the first phase, all variables whose name begins with exactly one
258underscore are replaced by None; in the second phase, all variables
259are deleted. This makes it possible to have global objects whose
260destructors depend on other globals. The deletion order within each
261phase is still random.
262
263- It is no longer an error for a function to be called without a
264global variable __builtins__ -- an empty directory will be provided
265by default.
266
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000267- Guido's corollary to the "Don Beaudry hook": it is now possible to
268do metaprogramming by using an instance as a base class. Not for the
Guido van Rossum61000331997-08-15 04:39:58 +0000269faint of heart; and undocumented as yet, but basically if a base class
270is an instance, its class will be instantiated to create the new
271class. Jim Fulton will love it -- it also works with instances of his
272"extension classes", since it is triggered by the presence of a
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000273__class__ attribute on the purported base class. See
274Demo/metaclasses/index.html for an explanation and see that directory
275for examples.
276
277- Another change is that the Don Beaudry hook is now invoked when
278*any* base class is special. (Up to 1.5a3, the *last* special base
279class is used; in 1.5a4, the more rational choice of the *first*
280special base class is used.)
Guido van Rossum61000331997-08-15 04:39:58 +0000281
Guido van Rossum2da391f1997-08-18 21:17:32 +0000282- New optional parameter to the readlines() method of file objects.
283This indicates the number of bytes to read (the actual number of bytes
284read will be somewhat larger due to buffering reading until the end of
285the line). Some optimizations have also been made to speed it up (but
286not as much as read()).
287
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000288- Complex numbers no longer have the ".conj" pseudo attribute; use
289z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
290now *do* support the __members__ and __methods__ special attributes.
291
292- The complex() function now looks for a __complex__() method on class
293instances before giving up.
294
295- Long integers now support arbitrary shift counts, so you can now
296write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
297shift count for this.)
298
299- The hex() and oct() functions have been changed so that for regular
300integers, they never emit a minus sign. For example, on a 32-bit
301machine, oct(-1) now returns '037777777777' and hex(-1) returns
302'0xffffffff'. While this may seem inconsistent, it is much more
303useful. (For long integers, a minus sign is used as before, to fit
304the result in memory :-)
305
306- The hash() function computes better hashes for several data types,
307including strings, floating point numbers, and complex numbers.
308
Guido van Rossum61000331997-08-15 04:39:58 +0000309
310New extension modules
311---------------------
312
313- New extension modules cStringIO.c and cPickle.c, written by Jim
314Fulton and other folks at Digital Creations. These are much more
315efficient than their Python counterparts StringIO.py and pickle.py,
316but don't support subclassing. cPickle.c clocks up to 1000 times
Guido van Rossum2da391f1997-08-18 21:17:32 +0000317faster than pickle.py; cStringIO.c's improvement is less dramatic but
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000318still significant.
Guido van Rossum61000331997-08-15 04:39:58 +0000319
320- New extension module zlibmodule.c, interfacing to the free zlib
321library (gzip compatible compression). There's also a module gzip.py
322which provides a higher level interface. Written by Andrew Kuchling
323and Jeremy Hylton.
324
325- New module readline; see the "miscellaneous" section above.
326
327- New Unix extension module resource.c, by Jeremy Hylton, provides
328access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
329related symbolic constants.
330
331- New extension puremodule.c, by Barry Warsaw, which interfaces to the
332Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
333possible to enable Purify by simply setting the PURIFY Makefile
334variable in the Modules/Setup file.
335
336
337Changes in extension modules
338----------------------------
339
340- The struct extension module has several new features to control byte
341order and word size. It supports reading and writing IEEE floats even
Guido van Rossum1f83cce1997-10-06 21:04:35 +0000342on platforms where this is not the native format. It uses uppercase
343format codes for unsigned integers of various sizes (always using
344Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
345and 'p' for "Pascal strings" (with a leading length byte, included in
346the size; blame Hannu Krosing). A prefix '>' forces big-endian data
347and '<' forces little-endian data; these also select standard data
348sizes and disable automatic alignment (use pad bytes as needed).
349
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 Rossum2da391f1997-08-18 21:17:32 +0000974Fixed after 1.5a3 was released
975------------------------------
Guido van Rossum61000331997-08-15 04:39:58 +0000976
Guido van Rossum2da391f1997-08-18 21:17:32 +0000977The following changes have been made to the source base after the
978release of 1.5a3. These need to be merged into their respective
979categories for the next release.
Guido van Rossumf0b69f01997-08-15 02:50:47 +0000980
Guido van Rossum522578e1997-08-28 03:43:21 +0000981- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
982feature; better install instructions; removed faqmain.py (which was an
983older version).
984
985- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
986about the treatment of lines starting with '.'. Added a minimal test
987function.
988
989- struct module: ignore most whitespace in format strings.
990
991- urllib.py: close the socket and temp file in URLopener.retrieve() so
992that multiple retrievals using the same connection work.
993
994- Three new C API functions:
995
996 - int PyErr_GivenExceptionMatches(obj1, obj2)
997
998 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
999 instance of type obj2, or of a class derived from obj2
1000
1001 - int PyErr_ExceptionMatches(obj)
1002
1003 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
1004 PyErr_Occurred() as obj1. This will be the more commonly called
1005 function.
1006
1007 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
1008
1009 Normalizes exceptions, and places the normalized values in the
1010 arguments. If type is not a class, this does nothing. If type is a
1011 class, then it makes sure that value is an instance of the class by:
1012
1013 1. if instance is of the type, or a class derived from type, it does
1014 nothing.
1015
1016 2. otherwise it instantiates the class, using the value as an
1017 argument. If value is None, it uses an empty arg tuple, and if
1018 the value is a tuple, it uses just that.
1019
1020- Demo/metaclasses: new demo subdir explains metaclasses (read
1021index.html in a browser).
1022
1023- core interpreter: remove the distinction between tuple and list
1024unpacking; allow an arbitrary sequence on the right hand side of any
1025unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
1026thing, which should really be called UNPACK_SEQUENCE.)
1027
1028- classes: Allow assignments to an instance's __dict__ or __class__,
1029so you can change ivars (including shared ivars -- shock horror) and
1030change classes dynamically. Also make the check on read-only
1031attributes of classes less draconic -- only the specials names
1032__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
1033assigned.
1034
1035- Two new built-in functions: issubclass() and isinstance(). Both
1036take classes as their second arguments. The former takes a class as
1037the first argument and returns true iff first is second, or is a
1038subclass of second. The latter takes any object as the first argument
1039and returns true iff first is an instance of the second, or any
1040subclass of second.
1041
1042- configure: Added configuration tests for presence of alarm(),
1043pause(), and getpwent().
1044
1045- Doc/Makefile: changed latex2html targets.
1046
1047- classes: Reverse the search order for the Don Beaudry hook so that
1048the first class with an applicable hook wins. Makes more sense.
1049
1050- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
1051now legal to call these more than once. The first call to
1052Py_Initialize() initializes, the first call to Py_Finalize()
1053finalizes. There's also a new API, Py_IsInitalized() which checks
1054whether we are already initialized (in case you want to leave things
1055as they were).
1056
1057- Completely disable the declarations for malloc(), realloc() and
1058free(). Any 90's C compiler has these in header files, and the tests
1059to decide whether to suppress the declarations kept failing on some
1060platforms.
1061
1062- *Before* (instead of after) signalmodule.o is added, remove both
1063intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
1064ld on various systems.
1065
1066- Added reop to PC/config.c
1067
1068- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
1069Removed outdated HP-UX comments from README. Added Cray T3E comments.
1070
1071- Various renames of statically defined functions that had name
1072conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
1073roundup (sys/types.h).
1074
1075- urllib.py: Interpret three slashes in file: URL as local file (for
1076Netscape on Windows/Mac).
1077
1078- copy.py: Make sure the objects returned by __getinitargs__() are
1079kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
1080easily reproducable because it requires a later call to
1081__getinitargs__() to return a tuple that happens to be allocated at
1082the same address.)
1083
1084- Added definition of AR to toplevel Makefile. Renamed @buildno temp
1085file to buildno1.
1086
1087- Moved Include/assert.h to Parser/assert.h, which seems to be the
1088only place where it's needed.
1089
1090- Alas, the thread support for _tkinter didn't work. Withdrew it.
1091
1092- Tweaked the dictionary lookup code again for some more speed
1093(Vladimir Marangozov).
1094
1095- NT build: Changed the way python15.lib is included in the other
1096projects. Per Mark Hammond's suggestion, add it to the extra libs in
1097Settings instead of to the project's source files.
1098
1099- regrtest.py: Change default verbosity so that there are only three
1100levels left: -q, default and -v. In default mode, the name of each
1101test is now printed. -v is the same as the old -vv. -q is more quiet
1102than the old default mode.
1103
1104- Removed the old FAQ from the distribution. You now have to get it
1105from the web!
1106
1107- Removed the PC/make_nt.in file from the distribution; it is no
1108longer needed.
1109
1110- Changed the build sequence so that shared modules are built last.
1111This fixes things for AIX and doesn't hurt elsewhere.
1112
1113- Improved test for GNU MP v1 in mpzmodule.c
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001114
Guido van Rossum2da391f1997-08-18 21:17:32 +00001115- fileobject.c: ftell() on Linux discards all buffered data; changed
Guido van Rossum522578e1997-08-28 03:43:21 +00001116read() code to use lseek() instead to get the same effect
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001117
Guido van Rossum2da391f1997-08-18 21:17:32 +00001118- configure.in, configure, importdl.c: NeXT sharedlib fixes
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001119
Guido van Rossum2da391f1997-08-18 21:17:32 +00001120- tupleobject.c: PyTuple_SetItem asserts refcnt==1
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001121
Guido van Rossum522578e1997-08-28 03:43:21 +00001122- resource.c: Different strategy regarding whether to declare
1123getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
1124conflicting decls in its headers. Choice: only declare the return
1125type, not the argument prototype, and not on Linux.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001126
Guido van Rossum2da391f1997-08-18 21:17:32 +00001127- importdl.c, configure*: set sharedlib extensions properly for NeXT
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001128
Guido van Rossum2da391f1997-08-18 21:17:32 +00001129- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
1130fixed; moved addition of PURIFY to LINKCC to configure
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001131
Guido van Rossum522578e1997-08-28 03:43:21 +00001132- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
1133added to shup up various compilers.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001134
Guido van Rossum2da391f1997-08-18 21:17:32 +00001135- _tkinter.c: removed buggy mac #ifndef
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001136
Guido van Rossum2da391f1997-08-18 21:17:32 +00001137- Doc: various Mac documentation changes, added docs for 'ic' module
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001138
Guido van Rossum2da391f1997-08-18 21:17:32 +00001139- PC/make_nt.in: deleted
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001140
Guido van Rossum522578e1997-08-28 03:43:21 +00001141- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
1142"")
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001143
Guido van Rossum2da391f1997-08-18 21:17:32 +00001144- test_rotor.py: print b -> print `b`
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001145
Guido van Rossum2da391f1997-08-18 21:17:32 +00001146- Tkinter.py: (tagOrId) -> (tagOrId,)
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001147
1148- Tkinter.py: the Tk class now also has a configure() method and
1149friends (they have been moved to the Misc class to accomplish this).
1150
1151- dict.get(key[, default]) returns dict[key] if it exists, or default
1152if it doesn't. The default defaults to None. This is quicker for
1153some applications than using either has_key() or try:...except
1154KeyError:....
1155