blob: b58f79ca0fed3073ebe20d70d6544ab012f46d25 [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 Rossumc45cf021998-04-10 20:06:21 +00004Below is a list of all relevant changes since release 1.4. The
5sections are now in a more useful order: the most recent changes are
6listed first.
Guido van Rossum61000331997-08-15 04:39:58 +00007
Guido van Rossum1f83cce1997-10-06 21:04:35 +00008A note on attributions: while I have sprinkled some names throughout
Guido van Rossum7ea639b1997-11-26 16:36:28 +00009here, I'm grateful to many more people who remain unnamed. You may
Guido van Rossum1f83cce1997-10-06 21:04:35 +000010find your name in the ACKS file. If you believe you deserve more
11credit, let me know and I'll add you to the list!
12
13
Guido van Rossum7ea639b1997-11-26 16:36:28 +000014======================================================================
15
Guido van Rossumc45cf021998-04-10 20:06:21 +000016
Guido van Rossumf5475c91998-08-06 17:55:46 +000017From 1.5.1 to 1.5.2a1
18=====================
19
20General/Miscellaneous
21---------------------
22
23- All patches on the patch page have been integrated. (But much more
24has been done!)
25
26- Several memory leaks plugged (e.g. the one for classes with a
27__getattr__ method).
28
29- Better checks for invalid input to int(), long(), string.atoi(),
30string.atol(). (Formerly, a sign without digits would be accepted as
31a legal ways to spell zero.)
32
33- New standard exceptions EnvironmentError and PosixError;
34EnvironmentError is the base class for IOError and PosixError;
35PosixError is the same as os.error. All this so that either exception
36class can be instantiated with a third argument indicating a filename.
37The built-in function open() and most os/posix functions that take a
38filename argument now use this.
39
40- When searching for the library, a landmark that is a compiled module
41(string.pyc or string.pyo) is also accepted.
42
43- Removed the only use of calloc(). This triggered an obscure bug on
44multiprocessor Sparc Solaris 2.6.
45
46- Changes to map() and filter() to use the length of a sequence only
47as a hint -- if an IndexError happens earlier, take that. (Formerly,
48this was considered an error.)
49
50- Instance methods may now have other callable objects than just
51Python functions as their im_func. Use new.instancemethod() or write
52your own C code to create them; new.instancemethod() may be called
53with None for the instance to create an unbound method.
54
55- Assignment to __dict__ or __bases__ of a class object is now
56allowed (with stringent type checks). The cached values for
57__getattr__ etc. are recomputed after such assignments (but not for
58derived classes :-( ).
59
60- New and improved Misc/python-mode.el (Python mode for Emacs).
61
62- New, better performing sort() method for list objects.
63
64- List objects now have an experimental pop() method; l.pop() returns
65and removes the last item; l.pop(i) returns and removes the item at i.
66
67- Experimental feature in getattr(): a third argument can specify a
68default (instead of raising AttributeError).
69
70Documentation
71-------------
72
73- The documentation has been expanded and the formatting improved.
74(Remember that the documentation is now unbundled and has its own
75release cycle though; see http://www.python.org/doc/.)
76
77- Doc strings have been added to many modules: socket, signal, select,
78time, thread, sys, __builtin__. Also to methods of list objects (try
79[].append.__doc__). A doc string on a type will now automatically be
80propagated to an instance if the instance has methods that are
81accessed in the usual way.
82
83Ports
84-----
85
86- The BeOS port is now integrated. Courtesy Chris Herborth.
87
88- Symbol files for FreeBSD 2.x and 3.x have been contributed
89(Lib/plat-freebsd[23]/*).
90
91Windows
92-------
93
94- The project files have been moved so they are distributed in the
95same subdirectory (PCbuild) where they must be used; this avoids
96confusion.
97
98- New project files for Windows 3.1 port by Jim Ahlstrom.
99
100- Got rid of the obsolete subdirectory PC/setup_nt/.
101
102- os.environ is now all uppercase, but accesses are case insensitive.
103
104- Don't insist on proper case for module source files if the filename
105is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
106doesn't). This should address problems with this feature on
107oldfashioned filesystems (Novell servers?).
108
109Library modules
110---------------
111
112- New tests (in Lib/test): reperf.py (regular expression benchmark),
113sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
114for the MimeWriter module).
115
116- Changes to os.py: os.environ now upcases keys before storing them on
117Windows, DOS and OS/2; new functions makedirs(), removedirs(),
118renames().
119
120- Changes to the 'os.path' submodule of os.py: added getsize(),
121getmtime(), getatime() -- these fetch the most popular items from the
122stat return tuple.
123
124- The smtplib.py module now supports ESMTP and has improved standard
125compliance, for picky servers.
126
127- Some fixes to gzip.py. In particular, the readlines() method now
128returns the lines *with* trailing newline characters, like readlines()
129of regular file objects.
130
131- In whrandom.py, added new method and function randrange(), same as
132choice(range(start, stop, step)) but faster. This addresses the
133problem that randint() was accidentally defined as taking an inclusive
134range. Also, randint(a, b) is now redefined as randrange(a, b+1),
135adding extra range and type checking to its arguments!
136
137- In getpass.py, don't use raw_input() to ask for the password -- we
138don't want it to show up in the readline history!
139
140- Generalized test/regrtest.py so that it is useful for testing other
141packages.
142
143- Some small changes in urllib.py; sped up unquote() and quote(),
144fixed an obscure bug in quote_plus(). Added urlencode(dict) --
145convenience function for sending a POST request with urlopen().
146Rewrote the (test) main program so that when used as a script, it can
147retrieve one or more URLs to stdout. Use -t to run the self-test.
148
149- In pdb.py, support for setting breaks on files/modules that haven't
150been loaded yet.
151
152- In rfc822.py, fix tell/seek when using files opened in text mode on
153Windows. Also add a new class AddressList.
154
155- In mailbox.py, fix tell/seek when using files opened in text mode on
156Windows.
157
158- Some speedups to re.py, especially the string substitution and split
159functions. Also added new function/method findall(), to find all
160occurrences of a given substring.
161
162- Improvements to rexec.py: package support; support a (minimal)
163sys.exc_info(). Also made the (test) main program a bit fancier (you
164can now use it to run arbitrary Python scripts in restricted mode).
165
166- In sgmllib.py, restore the call to report_unbalanced() that was lost
167long ago.
168
169- Major upgrade to ConfigParser.py; converted to using 're', added new
170exceptions, support underscore in section header and option name, no
171longer add 'name' option to every section.
172
173- The ihooks.py module now understands package imports.
174
175- Some restructuring and generalization done to cmd.py.
176
177- Some restructuring and generalization done to multifile.py.
178
179- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
180fail when someone asks for their HEAD.
181
182- Improved imaplib.py.
183
184- In code.py, add a class that subsumes Fredrik Lundh's
185PythonInterpreter class. The interact() function now uses this.
186
187- In multifile.py, support a seekable flag.
188
189- Fixed UDP support in SocketServer.py, which never worked.
190
191- In rlcompleter.py, in completer(), return None instead of raising an
192IndexError when there are no more completions left.
193
194
195Tkinter
196-------
197
198- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
199
200- No longer register Tcl_finalize() as a low-level exit handler. It
201may call back into Python, and that's a bad idea.
202
203- On Unix, Tkinter can now safely be used from a multi-threaded
204application. (Formerly, no threads would make progress while
205Tkinter's mainloop() was active, because it didn't release the Python
206interpreter lock.) Unfortunately, on Windows, threads other than the
207main thread should not call update() or update_idletasks() because
208this will deadlock the application.
209
210- Allow binding of Tcl commands (given as a string).
211
212- Some minor speedups.
213
214Extension modules
215-----------------
216
217- In the socket module: new function gethostbyname_ex().
218
219- Added some of the "wait status inspection" macros as functions:
220WEXITSTATUS(), WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(),
221WTERMSIG().
222
223- In cStringIO, add better argument type checking and support the
224readonly 'closed' attribute (like regular files).
225
226- On Windows, in select, put the (huge) file descriptor arrays on the
227heap.
228
229- In the struct module, unsigned 1-2 byte sized formats no longer
230result in long integer values.
231
232Build procedure
233---------------
234
235- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
236works, it won't also use -Olimit 1500 (which gives a warning for every
237file).
238
239- Other miscellaneous improvements to the configure script.
240
241Tools
242-----
243
244- Some improvements to the freeze script.
245
246- New tool ndiff.py: Tim Peters' text diffing tool.
247
248- The script texi2html.py (which was part of the Doc tree but is no
249longer used there) has been moved to the Tools/scripts subdirectory.
250
251- Some generalizations in the webchecker code. There's now a
252primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
253
254- Some improvements to freeze (made it more robust on Windows).
255
256- The ftpmirror.py script now handles symbolic links properly.
257
258Python/C API
259------------
260
261- New APIs for conversion between Python longs and C 'long long' if
262your compiler supports it.
263
264- The code that initializes sys.path now calls Py_GetPythonHome()
265instead of getenv("PYTHONHOME"). This, together with the new API
266Py_SetPythonHome(), makes it easier for embedding applications to
267change the notion of Python's "home" directory (where the libraries
268etc. are sought).
269
270- Changes to PySequence_Tuple() and PySequence_List() to use the
271length of a sequence only as a hint -- if an IndexError happens
272earlier, take that. (Formerly, this was considered an error.)
273
274- New macros to access object members for PyFunction, PyCFunction
275objects.
276
277- New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
278dynamically add one or many entries to the table of built-in modules.
279
280- New macro Py_InitModule3(name, methods, doc) which calls
281Py_InitModule4() with appropriate arguments. (The -4 variant requires
282you to pass an obscure version number constant which is always the same.)
283
Guido van Rossumc45cf021998-04-10 20:06:21 +0000284From 1.5 to 1.5.1
285=================
286
287General
288-------
289
290- The documentation is now unbundled. It has also been extensively
291modified (mostly to implement a new and more uniform formatting
292style). We figure that most people will prefer to download one of the
293preformatted documentation sets (HTML, PostScript or PDF) and that
294only a minority have a need for the LaTeX or FrameMaker sources. Of
295course, the unbundled documentation sources still released -- just not
296in the same archive file, and perhaps not on the same date.
297
298- All bugs noted on the errors page (and many unnoted) are fixed. All
299new bugs take their places.
300
Guido van Rossum974f2951998-04-13 21:00:54 +0000301- No longer a core dump when attempting to print (or repr(), or str())
302a list or dictionary that contains an instance of itself; instead, the
303recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
304Py_ReprLeave() below. Comparisons of such objects still go beserk,
305since this requires a different kind of fix; fortunately, this is a
306less common scenario in practice.
307
Guido van Rossumc45cf021998-04-10 20:06:21 +0000308Syntax change
309-------------
310
311- The raise statement can now be used without arguments, to re-raise
312a previously set exception. This should be used after catching an
313exception with an except clause only, either in the except clause or
314later in the same function.
315
316Import and module handling
317--------------------------
318
319- The implementation of import has changed to use a mutex (when
320threading is supported). This means that when two threads
321simultaneously import the same module, the import statements are
322serialized. Recursive imports are not affected.
323
324- Rewrote the finalization code almost completely, to be much more
325careful with the order in which modules are destroyed. Destructors
Guido van Rossumfc8f5d11998-08-04 22:58:51 +0000326will now generally be able to reference built-in names such as None
Guido van Rossumc45cf021998-04-10 20:06:21 +0000327without trouble.
328
Guido van Rossum974f2951998-04-13 21:00:54 +0000329- Case-insensitive platforms such as Mac and Windows require the case
330of a module's filename to match the case of the module name as
331specified in the import statement (see below).
Guido van Rossumc45cf021998-04-10 20:06:21 +0000332
333- The code for figuring out the default path now distinguishes between
334files, modules, executable files, and directories. When expecting a
335module, we also look for the .pyc or .pyo file.
336
337Parser/tokenizer changes
338------------------------
339
340- The tokenizer can now warn you when your source code mixes tabs and
Guido van Rossum974f2951998-04-13 21:00:54 +0000341spaces for indentation in a manner that depends on how much a tab is
342worth in spaces. Use "python -t" or "python -v" to enable this
343option. Use "python -tt" to turn the warnings into errors. (See also
344tabnanny.py and tabpolice.py below.)
Guido van Rossumc45cf021998-04-10 20:06:21 +0000345
346- Return unsigned characters from tok_nextc(), so '\377' isn't
347mistaken for an EOF character.
348
349- Fixed two pernicious bugs in the tokenizer that only affected AIX.
350One was actually a general bug that was triggered by AIX's smaller I/O
351buffer size. The other was a bug in the AIX optimizer's loop
352unrolling code; swapping two statements made the problem go away.
353
354Tools, demos and miscellaneous files
355------------------------------------
356
357- There's a new version of Misc/python-mode.el (the Emacs mode for
358Python) which is much smarter about guessing the indentation style
359used in a particular file. Lots of other cool features too!
360
361- There are two new tools in Tools/scripts: tabnanny.py and
362tabpolice.py, implementing two different ways of checking whether a
363file uses indentation in a way that is sensitive to the interpretation
364of a tab. The preferred module is tabnanny.py (by Tim Peters).
365
366- Some new demo programs:
367
368 Demo/tkinter/guido/paint.py -- Dave Mitchell
369 Demo/sockets/unixserver.py -- Piet van Oostrum
370
371
372- Much better freeze support. The freeze script can now freeze
373hierarchical module names (with a corresponding change to import.c),
374and has a few extra options (e.g. to suppress freezing specific
375modules). It also does much more on Windows NT.
376
377- Version 1.0 of the faq wizard is included (only very small changes
378since version 0.9.0).
379
380- New feature for the ftpmirror script: when removing local files
381(i.e., only when -r is used), do a recursive delete.
382
383Configuring and building Python
384-------------------------------
385
386- Get rid of the check for -linet -- recent Sequent Dynix systems don't
387need this any more and apparently it screws up their configuration.
388
389- Some changes because gcc on SGI doesn't support '-all'.
390
391- Changed the build rules to use $(LIBRARY) instead of
392 -L.. -lpython$(VERSION)
393since the latter trips up the SunOS 4.1.x linker (sigh).
394
395- Fix the bug where the '# dgux is broken' comment in the Makefile
396tripped over Make on some platforms.
397
398- Changes for AIX: install the python.exp file; properly use
399$(srcdir); the makexp_aix script now removes C++ entries of the form
400Class::method.
401
402- Deleted some Makefile targets only used by the (long obsolete)
403gMakefile hacks.
404
405Extension modules
406-----------------
407
408- Performance and threading improvements to the socket and bsddb
409modules, by Christopher Lindblad of Infoseek.
410
411- Added operator.__not__ and operator.not_.
412
413- In the thread module, when a thread exits due to an unhandled
414exception, don't store the exception information in sys.last_*; it
415prevents proper calling of destructors of local variables.
416
417- Fixed a number of small bugs in the cPickle module.
418
419- Changed find() and rfind() in the strop module so that
420find("x","",2) returns -1, matching the implementation in string.py.
421
422- In the time module, be more careful with the result of ctime(), and
423test for HAVE_MKTIME before usinmg mktime().
424
425- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
426modules.
427
428- Added the LOG_SYSLOG constant to the syslog module, if defined.
429
430Standard library modules
431------------------------
432
433- All standard library modules have been converted to an indentation
434style using either only tabs or only spaces -- never a mixture -- if
Guido van Rossum974f2951998-04-13 21:00:54 +0000435they weren't already consistent according to tabnanny. This means
436that the new -t option (see above) won't complain about standard
437library modules.
Guido van Rossumc45cf021998-04-10 20:06:21 +0000438
439- New standard library modules:
440
441 threading -- GvR and the thread-sig
442 Java style thread objects -- USE THIS!!!
443
444 getpass -- Piers Lauder
445 simple utilities to prompt for a password and to
446 retrieve the current username
447
448 imaplib -- Piers Lauder
449 interface for the IMAP4 protocol
450
451 poplib -- David Ascher, Piers Lauder
452 interface for the POP3 protocol
453
454 smtplib -- Dragon De Monsyne
455 interface for the SMTP protocol
456
457- Some obsolete modules moved to a separate directory (Lib/lib-old)
458which is *not* in the default module search path:
459
460 Para
461 addpack
462 codehack
463 fmt
464 lockfile
465 newdir
466 ni
467 rand
468 tb
469
470- New version of the PCRE code (Perl Compatible Regular Expressions --
471the re module and the supporting pcre extension) by Andrew Kuchling.
472Incompatible new feature in re.sub(): the handling of escapes in the
473replacement string has changed.
474
Guido van Rossum974f2951998-04-13 21:00:54 +0000475- Interface change in the copy module: a __deepcopy__ method is now
476called with the memo dictionary as an argument.
Guido van Rossumc45cf021998-04-10 20:06:21 +0000477
478- Feature change in the tokenize module: differentiate between NEWLINE
479token (an official newline) and NL token (a newline that the grammar
480ignores).
481
482- Several bugfixes to the urllib module. It is now truly thread-safe,
483and several bugs and a portability problem have been fixed. New
484features, all due to Sjoerd Mullender: When creating a temporary file,
485it gives it an appropriate suffix. Support the "data:" URL scheme.
486The open() method uses the tempcache.
487
488- New version of the xmllib module (this time with a test suite!) by
489Sjoerd Mullender.
490
491- Added debugging code to the telnetlib module, to be able to trace
492the actual traffic.
493
494- In the rfc822 module, added support for deleting a header (still no
495support for adding headers, though). Also fixed a bug where an
496illegal address would cause a crash in getrouteaddr(), fixed a
497sign reversal in mktime_tz(), and use the local timezone by default
498(the latter two due to Bill van Melle).
499
500- The normpath() function in the dospath and ntpath modules no longer
501does case normalization -- for that, use the separate function
502normcase() (which always existed); normcase() has been sped up and
503fixed (it was the cause of a crash in Mark Hammond's installer in
504certain locales).
505
506- New command supported by the ftplib module: rmd(); also fixed some
507minor bugs.
508
509- The profile module now uses a different timer function by default --
510time.clock() is generally better than os.times(). This makes it work
511better on Windows NT, too.
512
513- The tempfile module now recovers when os.getcwd() raises an
514exception.
515
516- Fixed some bugs in the random module; gauss() was subtly wrong, and
517vonmisesvariate() should return a full circle. Courtesy Mike Miller,
518Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
519
520- Better default seed in the whrandom module, courtesy Andrew Kuchling.
521
522- Fix slow close() in shelve module.
523
524- The Unix mailbox class in the mailbox module is now more robust when
525a line begins with the string "From " but is definitely not the start
526of a new message. The pattern used can be changed by overriding a
527method or class variable.
528
529- Added a rmtree() function to the copy module.
530
531- Fixed several typos in the pickle module. Also fixed problems when
532unpickling in restricted execution environments.
533
534- Added docstrings and fixed a typo in the py_compile and compileall
535modules. At Mark Hammond's repeated request, py_compile now append a
536newline to the source if it needs one. Both modules support an extra
537parameter to specify the purported source filename (to be used in
538error messages).
539
540- Some performance tweaks by Jeremy Hylton to the gzip module.
541
542- Fixed a bug in the merge order of dictionaries in the ConfigParser
543module. Courtesy Barry Warsaw.
544
545- In the multifile module, support the optional second parameter to
546seek() when possible.
547
548- Several fixes to the gopherlib module by Lars Marius Garshol. Also,
549urlparse now correctly handles Gopher URLs with query strings.
550
551- Fixed a tiny bug in format_exception() in the traceback module.
552Also rewrite tb_lineno() to be compatible with JPython (and not
553disturb the current exception!); by Jim Hugunin.
554
555- The httplib module is more robust when servers send a short response
556-- courtesy Tim O'Malley.
557
558Tkinter and friends
559-------------------
560
561- Various typos and bugs fixed.
562
563- New module Tkdnd implements a drag-and-drop protocol (within one
564application only).
565
566- The event_*() widget methods have been restructured slightly -- they
567no longer use the default root.
568
569- The interfaces for the bind*() and unbind() widget methods have been
570redesigned; the bind*() methods now return the name of the Tcl command
571created for the callback, and this can be passed as a optional
572argument to unbind() in order to delete the command (normally, such
573commands are automatically unbound when the widget is destroyed, but
574for some applications this isn't enough).
575
576- Variable objects now have trace methods to interface to Tcl's
577variable tracing facilities.
578
579- Image objects now have an optional keyword argument, 'master', to
580specify a widget (tree) to which they belong. The image_names() and
581image_types() calls are now also widget methods.
582
583- There's a new global call, Tkinter.NoDefaultRoot(), which disables
584all use of the default root by the Tkinter library. This is useful to
585debug applications that are in the process of being converted from
586relying on the default root to explicit specification of the root
587widget.
588
589- The 'exit' command is deleted from the Tcl interpreter, since it
590provided a loophole by which one could (accidentally) exit the Python
591interpreter without invoking any cleanup code.
592
593- Tcl_Finalize() is now registered as a Python low-level exit handle,
594so Tcl will be finalized when Python exits.
595
596The Python/C API
597----------------
598
Guido van Rossum974f2951998-04-13 21:00:54 +0000599- New function PyThreadState_GetDict() returns a per-thread dictionary
600intended for storing thread-local global variables.
601
602- New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
603dictionary to allow recursive container types to detect recursion in
604their repr(), str() and print implementations.
605
Guido van Rossumc45cf021998-04-10 20:06:21 +0000606- New function PyObject_Not(x) calculates (not x) according to Python's
607standard rules (basically, it negates the outcome PyObject_IsTrue(x).
608
609- New function _PyModule_Clear(), which clears a module's dictionary
610carefully without removing the __builtins__ entry. This is implied
611when a module object is deallocated (this used to clear the dictionary
612completely).
613
614- New function PyImport_ExecCodeModuleEx(), which extends
615PyImport_ExecCodeModule() by adding an extra parameter to pass it the
616true file.
617
618- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
619allow embedded applications to force a different value for PYTHONHOME.
620
621- New global flag Py_FrozenFlag is set when this is a "frozen" Python
622binary; it suppresses warnings about not being able to find the
623standard library directories.
624
625- New global flag Py_TabcheckFlag is incremented by the -t option and
626causes the tokenizer to issue warnings or errors about inconsistent
627mixing of tabs and spaces for indentation.
628
629Miscellaneous minor changes and bug fixes
630-----------------------------------------
631
632- Improved the error message when an attribute of an attribute-less
633object is requested -- include the name of the attribute and the type
634of the object in the message.
635
636- Sped up int(), long(), float() a bit.
637
638- Fixed a bug in list.sort() that would occasionally dump core.
639
640- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
641when taken tothe real power.
642
643- Fixed a number of bugs in the file reading code, at least one of
644which could cause a core dump on NT, and one of which would
645occasionally cause file.read() to return less than the full contents
646of the file.
647
648- Performance hack by Vladimir Marangozov for stack frame creation.
649
650- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
651
Guido van Rossum974f2951998-04-13 21:00:54 +0000652Windows 95/NT
653-------------
654
655- The .lib files are now part of the distribution; they are collected
656in the subdirectory "libs" of the installation directory.
657
658- The extension modules (.pyd files) are now collected in a separate
659subdirectory of the installation directory named "DLLs".
660
661- The case of a module's filename must now match the case of the
662module name as specified in the import statement. This is an
663experimental feature -- if it turns out to break in too many
664situations, it will be removed (or disabled by default) in the future.
665It can be disabled on a per-case basis by setting the environment
666variable PYTHONCASEOK (to any value).
667
668
Guido van Rossumc45cf021998-04-10 20:06:21 +0000669
670======================================================================
671
672
673From 1.5b2 to 1.5
674=================
675
676- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
677
678- Added doc strings to string.py, stropmodule.c, structmodule.c,
679thanks to Charles Waldman.
680
681- Many nits fixed in the manuals, thanks to Fred Drake and many others
682(especially Rob Hooft and Andrew Kuchling). The HTML version now uses
683HTML markup instead of inline GIF images for tables; only two images
684are left (for obsure bits of math). The index of the HTML version has
685also been much improved. Finally, it is once again possible to
686generate an Emacs info file from the library manual (but I don't
687commit to supporting this in future versions).
688
689- New module: telnetlib.py (a simple telnet client library).
690
691- New tool: Tools/versioncheck/, by Jack Jansen.
692
693- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
694DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
695extension modules.
696
697- Many small changes again to Tkinter.py -- mostly bugfixes and adding
698missing routines. Thanks to Greg McFarlane for reporting a bunch of
699problems and proofreading my fixes.
700
701- The re module and its documentation are up to date with the latest
702version released to the string-sig (Dec. 22).
703
704- Stop test_grp.py from failing when the /etc/group file is empty
705(yes, this happens!).
706
707- Fix bug in integer conversion (mystrtoul.c) that caused
7084294967296==0 to be true!
709
710- The VC++ 4.2 project file should be complete again.
711
712- In tempfile.py, use a better template on NT, and add a new optional
713argument "suffix" with default "" to specify a specific extension for
714the temporary filename (needed sometimes on NT but perhaps also handy
715elsewhere).
716
717- Fixed some bugs in the FAQ wizard, and converted it to use re
718instead of regex.
719
720- Fixed a mysteriously undetected error in dlmodule.c (it was using a
721totally bogus routine name to raise an exception).
722
723- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
724
725- Hopefully harmless changes to the build process to support shared
726libraries on DG/UX. This adds a target to create
727libpython$(VERSION).so; however this target is *only* for DG/UX.
728
729- Fixed a bug in the new format string error checking in getargs.c.
730
731- A simple fix for infinite recursion when printing __builtins__:
732reset '_' to None before printing and set it to the printed variable
733*after* printing (and only when printing is successful).
734
735- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
736parent window is not (Skip Montanaro).
737
738- Fixed the two most annoying problems with ftp URLs in
739urllib.urlopen(); an empty file now correctly raises an error, and it
740is no longer required to explicitly close the returned "file" object
741before opening another ftp URL to the same host and directory.
742
743
744======================================================================
745
746
747From 1.5b1 to 1.5b2
748===================
749
750- Fixed a bug in cPickle.c that caused it to crash right away because
751the version string had a different format.
752
753- Changes in pickle.py and cPickle.c: when unpickling an instance of a
754class that doesn't define the __getinitargs__() method, the __init__()
755constructor is no longer called. This makes a much larger group of
756classes picklable by default, but may occasionally change semantics.
757To force calling __init__() on unpickling, define a __getinitargs__()
758method. Other changes too, in particular cPickle now handles classes
759defined in packages correctly. The same change applies to copying
760instances with copy.py. The cPickle.c changes and some pickle.py
761changes are courtesy Jim Fulton.
762
763- Locale support in he "re" (Perl regular expressions) module. Use
764the flag re.L (or re.LOCALE) to enable locale-specific matching
765rules for \w and \b. The in-line syntax for this flag is (?L).
766
767- The built-in function isinstance(x, y) now also succeeds when y is
768a type object and type(x) is y.
769
770- repr() and str() of class and instance objects now reflect the
771package/module in which the class is defined.
772
773- Module "ni" has been removed. (If you really need it, it's been
774renamed to "ni1". Let me know if this causes any problems for you.
775Package authors are encouraged to write __init__.py files that
776support both ni and 1.5 package support, so the same version can be
777used with Python 1.4 as well as 1.5.)
778
779- The thread module is now automatically included when threads are
780configured. (You must remove it from your existing Setup file,
781since it is now in its own Setup.thread file.)
782
783- New command line option "-x" to skip the first line of the script;
784handy to make executable scripts on non-Unix platforms.
785
786- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
787haven't checked how this affects things, but it should make symbols
788in one shared library available to the next one.
789
790- The Windows installer now installs in the "Program Files" folder on
791the proper volume by default.
792
793- The Windows configuration adds a new main program, "pythonw", and
794registers a new extension, ".pyw" that invokes this. This is a
795pstandard Python interpreter that does not pop up a console window;
796handy for pure Tkinter applications. All output to the original
797stdout and stderr is lost; reading from the original stdin yields
798EOF. Also, both python.exe and pythonw.exe now have a pretty icon
799(a green snake in a box, courtesy Mark Hammond).
800
801- Lots of improvements to emacs-mode.el again. See Barry's web page:
802http://www.python.org/ftp/emacs/pmdetails.html.
803
804- Lots of improvements and additions to the library reference manual;
805many by Fred Drake.
806
807- Doc strings for the following modules: rfc822.py, posixpath.py,
808ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
809
810- Some more regression testing.
811
812- An optional 4th (maxsplit) argument to strop.replace().
813
814- Fixed handling of maxsplit in string.splitfields().
815
816- Tweaked os.environ so it can be pickled and copied.
817
818- The portability problems caused by indented preprocessor commands
819and C++ style comments should be gone now.
820
821- In random.py, added Pareto and Weibull distributions.
822
823- The crypt module is now disabled in Modules/Setup.in by default; it
824is rarely needed and causes errors on some systems where users often
825don't know how to deal with those.
826
827- Some improvements to the _tkinter build line suggested by Case Roole.
828
829- A full suite of platform specific files for NetBSD 1.x, submitted by
830Anders Andersen.
831
832- New Solaris specific header STROPTS.py.
833
834- Moved a confusing occurrence of *shared* from the comments in
835Modules/Setup.in (people would enable this one instead of the real
836one, and get disappointing results).
837
838- Changed the default mode for directories to be group-writable when
839the installation process creates them.
840
841- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
842shared libraries for both.
843
844- Support FreeBSD and NetBSD in posixfile.py.
845
846- Support for the "event" command, new in Tk 4.2. By Case Roole.
847
848- Add Tix_SafeInit() support to tkappinit.c.
849
850- Various bugs fixed in "re.py" and "pcre.c".
851
852- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
853
854- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
855is set.
856
857- Provide default blocksize for retrbinary in ftplib.py (Skip
858Montanaro).
859
860- In NT, pick the username up from different places in user.py (Jeff
861Bauer).
862
863- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
864
865- Many small improvements to Jeff Rush' OS/2 support.
866
867- ospath.py is gone; it's been obsolete for so many years now...
868
869- The reference manual is now set up to prepare better HTML (still
870using webmaker, alas).
871
872- Add special handling to /Tools/freeze for Python modules that are
873imported implicitly by the Python runtime: 'site' and 'exceptions'.
874
875- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
876inside <PRE>, by "Scott".
877
878- Added ConfigParser.py, a generic parser for sectioned configuration
879files.
880
881- In _localemodule.c, LC_MESSAGES is not always defined; put it
882between #ifdefs.
883
884- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
885
886- Demo/scripts/newslist.py: Fix the way the version number is gotten
887out of the RCS revision.
888
889- PyArg_Parse[Tuple] now explicitly check for bad characters at the
890end of the format string.
891
892- Revamped PC/example_nt to support VC++ 5.x.
893
894- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
895after studying the GNU libg++ quicksort. This should be much faster
896if there are lots of duplicates, and otherwise at least as good.
897
898- Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
899uudecode bug where it complaints about trailing garbage is still there
900:-( ).
901
902- pickle.py requires integers in text mode to be in decimal notation
903(it used to accept octal and hex, even though it would only generate
904decimal numbers).
905
906- In string.atof(), don't fail when the "re" module is unavailable.
907Plug the ensueing security leak by supplying an empty __builtins__
908directory to eval().
909
910- A bunch of small fixes and improvements to Tkinter.py.
911
912- Fixed a buffer overrun in PC/getpathp.c.
913
914
915======================================================================
916
917
918From 1.5a4 to 1.5b1
919===================
920
921- The Windows NT/95 installer now includes full HTML of all manuals.
922It also has a checkbox that lets you decide whether to install the
923interpreter and library. The WISE installer script for the installer
924is included in the source tree as PC/python15.wse, and so are the
925icons used for Python files. The config.c file for the Windows build
926is now complete with the pcre module.
927
928- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
929evaluated for the prompt.
930
931- The reference manual is brought up to date (more or less -- it still
932needs work, e.g. in the area of package import).
933
934- The icons used by latex2html are now included in the Doc
935subdirectory (mostly so that tarring up the HTML files can be fully
936automated). A simple index.html is also added to Doc (it only works
937after you have successfully run latex2html).
938
939- For all you would-be proselytizers out there: a new version of
940Misc/BLURB describes Python more concisely, and Misc/comparisons
941compares Python to several other languages. Misc/BLURB.WINDOWS
942contains a blurb specifically aimed at Windows programmers (by Mark
943Hammond).
944
945- A new version of the Python mode for Emacs is included as
946Misc/python-mode.el. There are too many new features to list here.
947See http://www.python.org/ftp/emacs/pmdetails.html for more info.
948
949- New module fileinput makes iterating over the lines of a list of
950files easier. (This still needs some more thinking to make it more
951extensible.)
952
953- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
954version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
955Age C++ compiler. I expect that Jeff will also provide a binary
956release for this platform.
957
958- On Linux, the configure script now uses '-Xlinker -export-dynamic'
959instead of '-rdynamic' to link the main program so that it exports its
960symbols to shared libraries it loads dynamically. I hope this doesn't
961break on older Linux versions; it is needed for mklinux and appears to
962work on Linux 2.0.30.
963
964- Some Tkinter resstructuring: the geometry methods that apply to a
965master are now properly usable on toplevel master widgets. There's a
966new (internal) widget class, BaseWidget. New, longer "official" names
967for the geometry manager methods have been added,
968e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
969shorter names still work, and where there's ambiguity, pack wins over
970place wins over grid. Also, the bind_class method now returns its
971value.
972
973- New, RFC-822 conformant parsing of email addresses and address lists
974in the rfc822 module, courtesy Ben Escoto.
975
976- New, revamped tkappinit.c with support for popular packages (PIL,
977TIX, BLT, TOGL). For the last three, you need to execute the Tcl
978command "load {} Tix" (or Blt, or Togl) to gain access to them.
979The Modules/Setup line for the _tkinter module has been rewritten
980using the cool line-breaking feature of most Bourne shells.
981
982- New socket method connect_ex() returns the error code from connect()
983instead of raising an exception on errors; this makes the logic
984required for asynchronous connects simpler and more efficient.
985
986- New "locale" module with (still experimental) interface to the
987standard C library locale interface, courtesy Martin von Loewis. This
988does not repeat my mistake in 1.5a4 of always calling
989setlocale(LC_ALL, ""). In fact, we've pretty much decided that
990Python's standard numerical formatting operations should always use
991the conventions for the C locale; the locale module contains utility
992functions to format numbers according to the user specified locale.
993(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
994"C") after locale-changing calls.) See the library manual. (Alas, the
995promised changes to the "re" module for locale support have not been
996materialized yet. If you care, volunteer!)
997
998- Memory leak plugged in Py_BuildValue when building a dictionary.
999
1000- Shared modules can now live inside packages (hierarchical module
1001namespaces). No changes to the shared module itself are needed.
1002
1003- Improved policy for __builtins__: this is a module in __main__ and a
1004dictionary everywhere else.
1005
1006- Python no longer catches SIGHUP and SIGTERM by default. This was
1007impossible to get right in the light of thread contexts. If you want
1008your program to clean up when a signal happens, use the signal module
1009to set up your own signal handler.
1010
1011- New Python/C API PyNumber_CoerceEx() does not return an exception
1012when no coercion is possible. This is used to fix a problem where
1013comparing incompatible numbers for equality would raise an exception
1014rather than return false as in Python 1.4 -- it once again will return
1015false.
1016
1017- The errno module is changed again -- the table of error messages
1018(errorstr) is removed. Instead, you can use os.strerror(). This
1019removes redundance and a potential locale dependency.
1020
1021- New module xmllib, to parse XML files. By Sjoerd Mullender.
1022
1023- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
1024It resets the signal module's notion of what the current process ID
1025and thread are, so that signal handlers will work after (and across)
1026calls to os.fork().
1027
1028- Fixed most occurrences of fatal errors due to missing thread state.
1029
1030- For vgrind (a flexible source pretty printer) fans, there's a simple
1031Python definition in Misc/vgrindefs, courtesy Neale Pickett.
1032
1033- Fixed memory leak in exec statement.
1034
1035- The test.pystone module has a new function, pystones(loops=LOOPS),
1036which returns a (benchtime, stones) tuple. The main() function now
1037calls this and prints the report.
1038
1039- Package directories now *require* the presence of an __init__.py (or
1040__init__.pyc) file before they are considered as packages. This is
1041done to prevent accidental subdirectories with common names from
1042overriding modules with the same name.
1043
1044- Fixed some strange exceptions in __del__ methods in library modules
1045(e.g. urllib). This happens because the builtin names are already
1046deleted by the time __del__ is called. The solution (a hack, but it
1047works) is to set some instance variables to 0 instead of None.
1048
1049- The table of built-in module initializers is replaced by a pointer
1050variable. This makes it possible to switch to a different table at
1051run time, e.g. when a collection of modules is loaded from a shared
1052library. (No example code of how to do this is given, but it is
1053possible.) The table is still there of course, its name prefixed with
1054an underscore and used to initialize the pointer.
1055
1056- The warning about a thread still having a frame now only happens in
1057verbose mode.
1058
1059- Change the signal finialization so that it also resets the signal
1060handlers. After this has been called, our signal handlers are no
1061longer active!
1062
1063- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
1064literals. There's now also a test fort this module.
1065
1066- The copy module now also uses __dict__.update(state) instead of
1067going through individual attribute assignments, for class instances
1068without a __setstate__ method.
1069
1070- New module reconvert translates old-style (regex module) regular
1071expressions to new-style (re module, Perl-style) regular expressions.
1072
1073- Most modules that used to use the regex module now use the re
1074module. The grep module has a new pgrep() function which uses
1075Perl-style regular expressions.
1076
1077- The (very old, backwards compatibility) regexp.py module has been
1078deleted.
1079
1080- Restricted execution (rexec): added the pcre module (support for the
1081re module) to the list of trusted extension modules.
1082
1083- New version of Jim Fulton's CObject object type, adds
1084PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
1085
1086- Some patches to Lee Busby's fpectl mods that accidentally didn't
1087make it into 1.5a4.
1088
1089- In the string module, add an optional 4th argument to count(),
1090matching find() etc.
1091
1092- Patch for the nntplib module by Charles Waldman to add optional user
1093and password arguments to NNTP.__init__(), for nntp servers that need
1094them.
1095
1096- The str() function for class objects now returns
1097"modulename.classname" instead of returning the same as repr().
1098
1099- The parsing of \xXX escapes no longer relies on sscanf().
1100
1101- The "sharedmodules" subdirectory of the installation is renamed to
1102"lib-dynload". (You may have to edit your Modules/Setup file to fix
1103this in an existing installation!)
1104
1105- Fixed Don Beaudry's mess-up with the OPT test in the configure
1106script. Certain SGI platforms will still issue a warning for each
1107compile; there's not much I can do about this since the compiler's
1108exit status doesn't indicate that I was using an obsolete option.
1109
1110- Fixed Barry's mess-up with {}.get(), and added test cases for it.
1111
1112- Shared libraries didn't quite work under AIX because of the change
1113in status of the GNU readline interface. Fix due to by Vladimir
1114Marangozov.
1115
1116
1117======================================================================
1118
1119
1120From 1.5a3 to 1.5a4
1121===================
1122
1123- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
1124feature; better install instructions; removed faqmain.py (which was an
1125older version).
1126
1127- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
1128about the treatment of lines starting with '.'. Added a minimal test
1129function.
1130
1131- struct module: ignore most whitespace in format strings.
1132
1133- urllib.py: close the socket and temp file in URLopener.retrieve() so
1134that multiple retrievals using the same connection work.
1135
1136- All standard exceptions are now classes by default; use -X to make
1137them strings (for backward compatibility only).
1138
1139- There's a new standard exception hierarchy, defined in the standard
1140library module exceptions.py (which you never need to import
1141explicitly). See
1142http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
1143more info.
1144
1145- Three new C API functions:
1146
1147 - int PyErr_GivenExceptionMatches(obj1, obj2)
1148
1149 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
1150 instance of type obj2, or of a class derived from obj2
1151
1152 - int PyErr_ExceptionMatches(obj)
1153
1154 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
1155 PyErr_Occurred() as obj1. This will be the more commonly called
1156 function.
1157
1158 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
1159
1160 Normalizes exceptions, and places the normalized values in the
1161 arguments. If type is not a class, this does nothing. If type is a
1162 class, then it makes sure that value is an instance of the class by:
1163
1164 1. if instance is of the type, or a class derived from type, it does
1165 nothing.
1166
1167 2. otherwise it instantiates the class, using the value as an
1168 argument. If value is None, it uses an empty arg tuple, and if
1169 the value is a tuple, it uses just that.
1170
1171- Another new C API function: PyErr_NewException() creates a new
1172exception class derived from Exception; when -X is given, it creates a
1173new string exception.
1174
1175- core interpreter: remove the distinction between tuple and list
1176unpacking; allow an arbitrary sequence on the right hand side of any
1177unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
1178thing, which should really be called UNPACK_SEQUENCE.)
1179
1180- classes: Allow assignments to an instance's __dict__ or __class__,
1181so you can change ivars (including shared ivars -- shock horror) and
1182change classes dynamically. Also make the check on read-only
1183attributes of classes less draconic -- only the specials names
1184__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
1185assigned.
1186
1187- Two new built-in functions: issubclass() and isinstance(). Both
1188take classes as their second arguments. The former takes a class as
1189the first argument and returns true iff first is second, or is a
1190subclass of second. The latter takes any object as the first argument
1191and returns true iff first is an instance of the second, or any
1192subclass of second.
1193
1194- configure: Added configuration tests for presence of alarm(),
1195pause(), and getpwent().
1196
1197- Doc/Makefile: changed latex2html targets.
1198
1199- classes: Reverse the search order for the Don Beaudry hook so that
1200the first class with an applicable hook wins. Makes more sense.
1201
1202- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
1203now legal to call these more than once. The first call to
1204Py_Initialize() initializes, the first call to Py_Finalize()
1205finalizes. There's also a new API, Py_IsInitalized() which checks
1206whether we are already initialized (in case you want to leave things
1207as they were).
1208
1209- Completely disable the declarations for malloc(), realloc() and
1210free(). Any 90's C compiler has these in header files, and the tests
1211to decide whether to suppress the declarations kept failing on some
1212platforms.
1213
1214- *Before* (instead of after) signalmodule.o is added, remove both
1215intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
1216ld on various systems.
1217
1218- Added reop to PC/config.c
1219
1220- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
1221Removed outdated HP-UX comments from README. Added Cray T3E comments.
1222
1223- Various renames of statically defined functions that had name
1224conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
1225roundup (sys/types.h).
1226
1227- urllib.py: Interpret three slashes in file: URL as local file (for
1228Netscape on Windows/Mac).
1229
1230- copy.py: Make sure the objects returned by __getinitargs__() are
1231kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
1232easily reproducable because it requires a later call to
1233__getinitargs__() to return a tuple that happens to be allocated at
1234the same address.)
1235
1236- Added definition of AR to toplevel Makefile. Renamed @buildno temp
1237file to buildno1.
1238
1239- Moved Include/assert.h to Parser/assert.h, which seems to be the
1240only place where it's needed.
1241
1242- Tweaked the dictionary lookup code again for some more speed
1243(Vladimir Marangozov).
1244
1245- NT build: Changed the way python15.lib is included in the other
1246projects. Per Mark Hammond's suggestion, add it to the extra libs in
1247Settings instead of to the project's source files.
1248
1249- regrtest.py: Change default verbosity so that there are only three
1250levels left: -q, default and -v. In default mode, the name of each
1251test is now printed. -v is the same as the old -vv. -q is more quiet
1252than the old default mode.
1253
1254- Removed the old FAQ from the distribution. You now have to get it
1255from the web!
1256
1257- Removed the PC/make_nt.in file from the distribution; it is no
1258longer needed.
1259
1260- Changed the build sequence so that shared modules are built last.
1261This fixes things for AIX and doesn't hurt elsewhere.
1262
1263- Improved test for GNU MP v1 in mpzmodule.c
1264
1265- fileobject.c: ftell() on Linux discards all buffered data; changed
1266read() code to use lseek() instead to get the same effect
1267
1268- configure.in, configure, importdl.c: NeXT sharedlib fixes
1269
1270- tupleobject.c: PyTuple_SetItem asserts refcnt==1
1271
1272- resource.c: Different strategy regarding whether to declare
1273getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
1274conflicting decls in its headers. Choice: only declare the return
1275type, not the argument prototype, and not on Linux.
1276
1277- importdl.c, configure*: set sharedlib extensions properly for NeXT
1278
1279- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
1280fixed; moved addition of PURIFY to LINKCC to configure
1281
1282- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
1283added to shup up various compilers.
1284
1285- _tkinter.c: removed buggy mac #ifndef
1286
1287- Doc: various Mac documentation changes, added docs for 'ic' module
1288
1289- PC/make_nt.in: deleted
1290
1291- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
1292"")
1293
1294- test_rotor.py: print b -> print `b`
1295
1296- Tkinter.py: (tagOrId) -> (tagOrId,)
1297
1298- Tkinter.py: the Tk class now also has a configure() method and
1299friends (they have been moved to the Misc class to accomplish this).
1300
1301- dict.get(key[, default]) returns dict[key] if it exists, or default
1302if it doesn't. The default defaults to None. This is quicker for
1303some applications than using either has_key() or try:...except
1304KeyError:....
1305
1306- Tools/webchecker/: some small changes to webchecker.py; added
1307websucker.py (a simple web site mirroring script).
1308
1309- Dictionary objects now have a get() method (also in UserDict.py).
1310dict.get(key, default) returns dict[key] if it exists and default
1311otherwise; default defaults to None.
1312
1313- Tools/scripts/logmerge.py: print the author, too.
1314
1315- Changes to import: support for "import a.b.c" is now built in. See
1316http://grail.cnri.reston.va.us/python/essays/packages.html
1317for more info. Most important deviations from "ni.py": __init__.py is
1318executed in the package's namespace instead of as a submodule; and
1319there's no support for "__" or "__domain__". Note that "ni.py" is not
1320changed to match this -- it is simply declared obsolete (while at the
1321same time, it is documented...:-( ).
1322Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
1323for an example implementation of hierarchical module import written in
1324Python).
1325
1326- More changes to import: the site.py module is now imported by
1327default when Python is initialized; use -S to disable it. The site.py
1328module extends the path with several more directories: site-packages
1329inside the lib/python1.5/ directory, site-python in the lib/
1330directory, and pathnames mentioned in *.pth files found in either of
1331those directories. See
1332http://grail.cnri.reston.va.us/python/essays/packages.html
1333for more info.
1334
1335- Changes to standard library subdirectory names: those subdirectories
1336that are not packages have been renamed with a hypen in their name,
1337e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
1338The test suite is now a package -- to run a test, you must now use
1339"import test.test_foo".
1340
1341- A completely new re.py module is provided (thanks to Andrew
1342Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
1343"pcre" re compiler and engine. For a while, the "old" re.py (which
1344was new in 1.5a3!) will be kept around as re1.py. The "old" regex
1345module and underlying parser and engine are still present -- while
1346regex is now officially obsolete, it will probably take several major
1347release cycles before it can be removed.
1348
1349- The posix module now has a strerror() function which translates an
1350error code to a string.
1351
1352- The emacs.py module (which was long obsolete) has been removed.
1353
1354- The universal makefile Misc/Makefile.pre.in now features an
1355"install" target. By default, installed shared libraries go into
1356$exec_prefix/lib/python$VERSION/site-packages/.
1357
1358- The install-sh script is installed with the other configuration
1359specific files (in the config/ subdirectory).
1360
1361- It turns out whatsound.py and sndhdr.py were identical modules.
1362Since there's also an imghdr.py file, I propose to make sndhdr.py the
1363official one. For compatibility, whatsound.py imports * from
1364sndhdr.py.
1365
1366- Class objects have a new attribute, __module__, giving the name of
1367the module in which they were declared. This is useful for pickle and
1368for printing the full name of a class exception.
1369
1370- Many extension modules no longer issue a fatal error when their
1371initialization fails; the importing code now checks whether an error
1372occurred during module initialization, and correctly propagates the
1373exception to the import statement.
1374
1375- Most extension modules now raise class-based exceptions (except when
1376-X is used).
1377
1378- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
1379thread state -- just don't manipulate the lock if it isn't there.
1380
1381- Fixed a bug in Python/getopt.c that made it do the wrong thing when
1382an option was a single '-'. Thanks to Andrew Kuchling.
1383
1384- New module mimetypes.py will guess a MIME type from a filename's
1385extension.
1386
1387- Windows: the DLL version is now settable via a resource rather than
1388being hardcoded. This can be used for "branding" a binary Python
1389distribution.
1390
1391- urllib.py is now threadsafe -- it now uses re instead of regex, and
1392sys.exc_info() instead of sys.exc_{type,value}.
1393
1394- Many other library modules that used to use
1395sys.exc_{type,value,traceback} are now more thread-safe by virtue of
1396using sys.exc_info().
1397
1398- The functions in popen2 have an optional buffer size parameter.
1399Also, the command argument can now be either a string (passed to the
1400shell) or a list of arguments (passed directly to execv).
1401
1402
1403- Alas, the thread support for _tkinter released with 1.5a3 didn't
1404work. It's been rewritten. The bad news is that it now requires a
1405modified version of a file in the standard Tcl distribution, which you
1406must compile with a -I option pointing to the standard Tcl source
1407tree. For this reason, the thread support is disabled by default.
1408
1409- The errno extension module adds two tables: errorcode maps errno
1410numbers to errno names (e.g. EINTR), and errorstr maps them to
1411message strings. (The latter is redundant because the new call
1412posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
1413
1414- The readline extension module now provides some interfaces to
1415internal readline routines that make it possible to write a completer
1416in Python. An example completer, rlcompleter.py, is provided.
1417
1418 When completing a simple identifier, it completes keywords,
1419 built-ins and globals in __main__; when completing
1420 NAME.NAME..., it evaluates (!) the expression up to the last
1421 dot and completes its attributes.
1422
1423 It's very cool to do "import string" type "string.", hit the
1424 completion key (twice), and see the list of names defined by
1425 the string module!
1426
1427 Tip: to use the tab key as the completion key, call
1428
1429 readline.parse_and_bind("tab: complete")
1430
1431- The traceback.py module has a new function tb_lineno() by Marc-Andre
1432Lemburg which extracts the line number from the linenumber table in
1433the code object. Apparently the traceback object doesn't contains the
1434right linenumber when -O is used. Rather than guessing whether -O is
1435on or off, the module itself uses tb_lineno() unconditionally.
1436
1437- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
1438to tag_bind() so it works again.
1439
1440- The pystone script is now a standard library module. Example use:
1441"import test.pystone; test.pystone.main()".
1442
1443- The import of the readline module in interactive mode is now also
1444attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
1445Lemburg, who asked for this. :-)
1446
1447- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
1448Mullender, to be closer to the standard. This fixes the getaddr()
1449method. Unfortunately, getaddrlist() is as broken as ever, since it
1450splits on commas without regard for RFC 822 quoting conventions.
1451
1452- pprint.py: correctly emit trailing "," in singleton tuples.
1453
1454- _tkinter.c: export names for its type objects, TkappType and
1455TkttType.
1456
1457- pickle.py: use __module__ when defined; fix a particularly hard to
1458reproduce bug that confuses the memo when temporary objects are
1459returned by custom pickling interfaces; and a semantic change: when
1460unpickling the instance variables of an instance, use
1461inst.__dict__.update(value) instead of a for loop with setattr() over
1462the value.keys(). This is more consistent (the pickling doesn't use
1463getattr() either but pickles inst.__dict__) and avoids problems with
1464instances that have a __setattr__ hook. But it *is* a semantic change
1465(because the setattr hook is no longer used). So beware!
1466
1467- config.h is now installed (at last) in
1468$exec_prefix/include/python1.5/. For most sites, this means that it
1469is actually in $prefix/include/python1.5/, with all the other Python
1470include files, since $prefix and $exec_prefix are the same by
1471default.
1472
1473- The imp module now supports parts of the functionality to implement
1474import of hierarchical module names. It now supports find_module()
1475and load_module() for all types of modules. Docstrings have been
1476added for those functions in the built-in imp module that are still
1477relevant (some old interfaces are obsolete). For a sample
1478implementation of hierarchical module import in Python, see the new
1479library module knee.py.
1480
1481- The % operator on string objects now allows arbitrary nested parens
1482in a %(...)X style format. (Brad Howes)
1483
1484- Reverse the order in which Setup and Setup.local are passed to the
1485makesetup script. This allows variable definitions in Setup.local to
1486override definitions in Setup. (But you'll still have to edit Setup
1487if you want to disable modules that are enabled by default, or if such
1488modules need non-standard options.)
1489
1490- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
1491is like PyImport_ImporModule(name) but receives the globals and locals
1492dict and the fromlist arguments as well. (The name is a char*; the
1493others are PyObject*s).
1494
1495- The 'p' format in the struct extension module alloded to above is
1496new in 1.5a4.
1497
1498- The types.py module now uses try-except in a few places to make it
1499more likely that it can be imported in restricted mode. Some type
1500names are undefined in that case, e.g. CodeType (inaccessible),
1501FileType (not always accessible), and TracebackType and FrameType
1502(inaccessible).
1503
1504- In urllib.py: added separate administration of temporary files
1505created y URLopener.retrieve() so cleanup() can properly remove them.
1506The old code removed everything in tempcache which was a bad idea if
1507the user had passed a non-temp file into it. Also, in basejoin(),
1508interpret relative paths starting in "../". This is necessary if the
1509server uses symbolic links.
1510
1511- The Windows build procedure and project files are now based on
1512Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
1513directory. It is much more robust, and properly builds separate Debug
1514and Release versions. (The installer will be added shortly.)
1515
1516- Added casts and changed some return types in regexpr.c to avoid
1517compiler warnings or errors on some platforms.
1518
1519- The AIX build tools for shared libraries now supports VPATH. (Donn
1520Cave)
1521
1522- By default, disable the "portable" multimedia modules audioop,
1523imageop, and rgbimg, since they don't work on 64-bit platforms.
1524
1525- Fixed a nasty bug in cStringIO.c when code was actually using the
1526close() method (the destructors would try to free certain fields a
1527second time).
1528
1529- For those who think they need it, there's a "user.py" module. This
1530is *not* imported by default, but can be imported to run user-specific
1531setup commands, ~/.pythonrc.py.
1532
1533- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
1534Vladimir Marangozov, and others.
1535
1536- Added os.altsep; this is '/' on DOS/Windows, and None on systems
1537with a sane filename syntax.
1538
1539- os.py: Write out the dynamic OS choice, to avoid exec statements.
1540Adding support for a new OS is now a bit more work, but I bet that
1541'dos' or 'nt' will cover most situations...
1542
1543- The obsolete exception AccessError is now really gone.
1544
1545- Tools/faqwiz/: New installation instructions show how to maintain
1546multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
1547Added instructions to bootstrap script, too. Version bumped to 0.8.1.
1548Added <html>...</html> feature suggested by Skip Montanaro. Added
1549leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
1550default SRCDIR.
1551
1552- Documentation for the relatively new modules "keyword" and "symbol"
1553has been added (to the end of the section on the parser extension
1554module).
1555
1556- In module bisect.py, but functions have two optional argument 'lo'
1557and 'hi' which allow you to specify a subsequence of the array to
1558operate on.
1559
1560- In ftplib.py, changed most methods to return their status (even when
1561it is always "200 OK") rather than swallowing it.
1562
1563- main() now calls setlocale(LC_ALL, ""), if setlocale() and
1564<locale.h> are defined.
1565
1566- Changes to configure.in, the configure script, and both
1567Makefile.pre.in files, to support SGI's SGI_ABI platform selection
1568environment variable.
1569
1570
1571======================================================================
1572
1573
Guido van Rossum7ea639b1997-11-26 16:36:28 +00001574From 1.4 to 1.5a3
1575=================
1576
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001577Security
1578--------
1579
1580- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
1581please use the new version. The old version has a huge security leak.
Guido van Rossum61000331997-08-15 04:39:58 +00001582
1583Miscellaneous
1584-------------
1585
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001586- Because of various (small) incompatible changes in the Python
1587bytecode interpreter, the magic number for .pyc files has changed
1588again.
1589
Guido van Rossum2da391f1997-08-18 21:17:32 +00001590- The default module search path is now much saner. Both on Unix and
1591Windows, it is essentially derived from the path to the executable
1592(which can be overridden by setting the environment variable
1593$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
1594front of the default path, like in Unix (instead of overriding the
1595default path). On Windows, the directory containing the executable is
1596added to the end of the path.
1597
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001598- A new version of python-mode.el for Emacs has been included. Also,
1599a new file ccpy-style.el has been added to configure Emacs cc-mode for
1600the preferred style in Python C sources.
1601
Guido van Rossum2da391f1997-08-18 21:17:32 +00001602- On Unix, when using sys.argv[0] to insert the script directory in
1603front of sys.path, expand a symbolic link. You can now install a
1604program in a private directory and have a symbolic link to it in a
1605public bin directory, and it will put the private directory in the
1606module search path. Note that the symlink is expanded in sys.path[0]
1607but not in sys.argv[0], so you can still tell the name by which you
1608were invoked.
1609
1610- It is now recommended to use ``#!/usr/bin/env python'' instead of
1611``#!/usr/local/bin/python'' at the start of executable scripts, except
1612for CGI scripts. It has been determined that the use of /usr/bin/env
1613is more portable than that of /usr/local/bin/python -- scripts almost
1614never have to be edited when the Python interpreter lives in a
1615non-standard place. Note that this doesn't work for CGI scripts since
1616the python executable often doesn't live in the HTTP server's default
1617search path.
Guido van Rossum61000331997-08-15 04:39:58 +00001618
1619- The silly -s command line option and the corresponding
1620PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
1621flag in the Python/C API) are gone.
1622
1623- Most problems on 64-bit platforms should now be fixed. Andrew
1624Kuchling helped. Some uncommon extension modules are still not
1625clean (image and audio ops?).
1626
1627- Fixed a bug where multiple anonymous tuple arguments would be mixed up
1628when using the debugger or profiler (reported by Just van Rossum).
1629The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
1630would print the wrong value when run under the debugger or profiler.
1631
Guido van Rossum2da391f1997-08-18 21:17:32 +00001632- The hacks that the dictionary implementation used to speed up
1633repeated lookups of the same C string were removed; these were a
1634source of subtle problems and don't seem to serve much of a purpose
1635any longer.
1636
1637- All traces of support for the long dead access statement have been
1638removed from the sources.
1639
Guido van Rossum61000331997-08-15 04:39:58 +00001640- Plugged the two-byte memory leak in the tokenizer when reading an
1641interactive EOF.
1642
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001643- There's a -O option to the interpreter that removes SET_LINENO
1644instructions and assert statements (see below); it uses and produces
1645.pyo files instead of .pyc files. The speedup is only a few percent
1646in most cases. The line numbers are still available in the .pyo file,
1647as a separate table (which is also available in .pyc files). However,
1648the removal of the SET_LINENO instructions means that the debugger
1649(pdb) can't set breakpoints on lines in -O mode. The traceback module
1650contains a function to extract a line number from the code object
1651referenced in a traceback object. In the future it should be possible
1652to write external bytecode optimizers that create better optimized
1653.pyo files, and there should be more control over optimization;
1654consider the -O option a "teaser". Without -O, the assert statement
1655actually generates code that first checks __debug__; if this variable
1656is false, the assertion is not checked. __debug__ is a built-in
1657variable whose value is initialized to track the -O flag (it's true
1658iff -O is not specified). With -O, no code is generated for assert
1659statements, nor for code of the form ``if __debug__: <something>''.
1660Sorry, no further constant folding happens.
1661
Guido van Rossum61000331997-08-15 04:39:58 +00001662
1663Performance
1664-----------
1665
Guido van Rossum2da391f1997-08-18 21:17:32 +00001666- It's much faster (almost twice for pystone.py -- see
1667Tools/scripts). See the entry on string interning below.
Guido van Rossum61000331997-08-15 04:39:58 +00001668
1669- Some speedup by using separate free lists for method objects (both
1670the C and the Python variety) and for floating point numbers.
1671
1672- Big speedup by allocating frame objects with a single malloc() call.
1673The Python/C API for frames is changed (you shouldn't be using this
1674anyway).
1675
1676- Significant speedup by inlining some common opcodes for common operand
1677types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
1678
1679- Small speedup by reordering the method tables of some common
1680objects (e.g. list.append is now first).
1681
Guido van Rossum2da391f1997-08-18 21:17:32 +00001682- Big optimization to the read() method of file objects. A read()
1683without arguments now attempts to use fstat to allocate a buffer of
1684the right size; for pipes and sockets, it will fall back to doubling
1685the buffer size. While that the improvement is real on all systems,
1686it is most dramatic on Windows.
1687
Guido van Rossum61000331997-08-15 04:39:58 +00001688
1689Documentation
1690-------------
1691
1692- Many new pieces of library documentation were contributed, mostly by
1693Andrew Kuchling. Even cmath is now documented! There's also a
1694chapter of the library manual, "libundoc.tex", which provides a
1695listing of all undocumented modules, plus their status (e.g. internal,
1696obsolete, or in need of documentation). Also contributions by Sue
1697Williams, Skip Montanaro, and some module authors who succumbed to
1698pressure to document their own contributed modules :-). Note that
1699printing the documentation now kills fewer trees -- the margins have
1700been reduced.
1701
1702- I have started documenting the Python/C API. Unfortunately this project
1703hasn't been completed yet. It will be complete before the final release of
1704Python 1.5, though. At the moment, it's better to read the LaTeX source
1705than to attempt to run it through LaTeX and print the resulting dvi file.
1706
1707- The posix module (and hence os.py) now has doc strings! Thanks to Neil
1708Schemenauer. I received a few other contributions of doc strings. In most
1709other places, doc strings are still wishful thinking...
1710
1711
1712Language changes
1713----------------
1714
1715- Private variables with leading double underscore are now a permanent
1716feature of the language. (These were experimental in release 1.4. I have
1717favorable experience using them; I can't label them "experimental"
1718forever.)
1719
1720- There's new string literal syntax for "raw strings". Prefixing a string
1721literal with the letter r (or R) disables all escape processing in the
1722string; for example, r'\n' is a two-character string consisting of a
1723backslash followed by the letter n. This combines with all forms of string
1724quotes; it is actually useful for triple quoted doc strings which might
1725contain references to \n or \t. An embedded quote prefixed with a
1726backslash does not terminate the string, but the backslash is still
1727included in the string; for example, r'\'' is a two-character string
1728consisting of a backslash and a quote. (Raw strings are also
1729affectionately known as Robin strings, after their inventor, Robin
1730Friedrich.)
1731
Guido van Rossum2da391f1997-08-18 21:17:32 +00001732- There's a simple assert statement, and a new exception
1733AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
1734not foo > 0: raise AssertionError''. Sorry, the text of the asserted
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001735condition is not available; it would be too complicated to generate
1736code for this (since the code is generated from a parse tree).
1737However, the text is displayed as part of the traceback!
1738
1739- The raise statement has a new feature: when using "raise SomeClass,
1740somevalue" where somevalue is not an instance of SomeClass, it
1741instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
1742instance of a *derived* class of SomeClass, the exception class raised
1743is set to somevalue.__class__, and SomeClass is ignored after that.
1744
1745- Duplicate keyword arguments are now detected at compile time;
1746f(a=1,a=2) is now a syntax error.
Guido van Rossum61000331997-08-15 04:39:58 +00001747
1748
1749Changes to builtin features
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001750---------------------------
1751
Guido van Rossum2da391f1997-08-18 21:17:32 +00001752- There's a new exception FloatingPointError (used only by Lee Busby's
1753patches to catch floating point exceptions, at the moment).
1754
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001755- The obsolete exception ConflictError (presumably used by the long
1756obsolete access statement) has been deleted.
Guido van Rossum2da391f1997-08-18 21:17:32 +00001757
Guido van Rossum61000331997-08-15 04:39:58 +00001758- There's a new function sys.exc_info() which returns the tuple
1759(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001760
Guido van Rossum61000331997-08-15 04:39:58 +00001761- There's a new variable sys.executable, pointing to the executable file
1762for the Python interpreter.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001763
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001764- The sort() methods for lists no longer uses the C library qsort(); I
1765wrote my own quicksort implementation, with lots of help (in the form
1766of a kind of competition) from Tim Peters. This solves a bug in
1767dictionary comparisons on some Solaris versions when Python is built
1768with threads, and makes sorting lists even faster.
1769
1770- The semantics of comparing two dictionaries have changed, to make
1771comparison of unequal dictionaries faster. A shorter dictionary is
1772always considered smaller than a larger dictionary. For dictionaries
1773of the same size, the smallest differing element determines the
1774outcome (which yields the same results as before in this case, without
1775explicit sorting). Thanks to Aaron Watters for suggesting something
1776like this.
1777
Guido van Rossum61000331997-08-15 04:39:58 +00001778- The semantics of try-except have changed subtly so that calling a
1779function in an exception handler that itself raises and catches an
1780exception no longer overwrites the sys.exc_* variables. This also
1781alleviates the problem that objects referenced in a stack frame that
1782caught an exception are kept alive until another exception is caught
1783-- the sys.exc_* variables are restored to their previous value when
1784returning from a function that caught an exception.
Guido van Rossumf0b69f01997-08-15 02:50:47 +00001785
Guido van Rossum61000331997-08-15 04:39:58 +00001786- There's a new "buffer" interface. Certain objects (e.g. strings and
1787arrays) now support the "buffer" protocol. Buffer objects are acceptable
1788whenever formerly a string was required for a write operation; mutable
1789buffer objects can be the target of a read operation using the call
1790f.readinto(buffer). A cool feature is that regular expression matching now
1791also work on array objects. Contribution by Jack Jansen. (Needs
1792documentation.)
1793
1794- String interning: dictionary lookups are faster when the lookup
1795string object is the same object as the key in the dictionary, not
1796just a string with the same value. This is done by having a pool of
1797"interned" strings. Most names generated by the interpreter are now
1798automatically interned, and there's a new built-in function intern(s)
1799that returns the interned version of a string. Interned strings are
1800not a different object type, and interning is totally optional, but by
1801interning most keys a speedup of about 15% was obtained for the
1802pystone benchmark.
1803
1804- Dictionary objects have several new methods; clear() and copy() have
1805the obvious semantics, while update(d) merges the contents of another
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001806dictionary d into this one, overriding existing keys. The dictionary
1807implementation file is now called dictobject.c rather than the
1808confusing mappingobject.c.
Guido van Rossum61000331997-08-15 04:39:58 +00001809
Guido van Rossum61000331997-08-15 04:39:58 +00001810- The intrinsic function dir() is much smarter; it looks in __dict__,
1811__members__ and __methods__.
1812
Guido van Rossum2da391f1997-08-18 21:17:32 +00001813- The intrinsic functions int(), long() and float() can now take a
1814string argument and then do the same thing as string.atoi(),
1815string.atol(), and string.atof(). No second 'base' argument is
1816allowed, and complex() does not take a string (nobody cared enough).
1817
Guido van Rossum61000331997-08-15 04:39:58 +00001818- When a module is deleted, its globals are now deleted in two phases.
1819In the first phase, all variables whose name begins with exactly one
1820underscore are replaced by None; in the second phase, all variables
1821are deleted. This makes it possible to have global objects whose
1822destructors depend on other globals. The deletion order within each
1823phase is still random.
1824
1825- It is no longer an error for a function to be called without a
1826global variable __builtins__ -- an empty directory will be provided
1827by default.
1828
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001829- Guido's corollary to the "Don Beaudry hook": it is now possible to
1830do metaprogramming by using an instance as a base class. Not for the
Guido van Rossum61000331997-08-15 04:39:58 +00001831faint of heart; and undocumented as yet, but basically if a base class
1832is an instance, its class will be instantiated to create the new
1833class. Jim Fulton will love it -- it also works with instances of his
1834"extension classes", since it is triggered by the presence of a
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001835__class__ attribute on the purported base class. See
1836Demo/metaclasses/index.html for an explanation and see that directory
1837for examples.
1838
1839- Another change is that the Don Beaudry hook is now invoked when
1840*any* base class is special. (Up to 1.5a3, the *last* special base
1841class is used; in 1.5a4, the more rational choice of the *first*
1842special base class is used.)
Guido van Rossum61000331997-08-15 04:39:58 +00001843
Guido van Rossum2da391f1997-08-18 21:17:32 +00001844- New optional parameter to the readlines() method of file objects.
1845This indicates the number of bytes to read (the actual number of bytes
1846read will be somewhat larger due to buffering reading until the end of
1847the line). Some optimizations have also been made to speed it up (but
1848not as much as read()).
1849
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001850- Complex numbers no longer have the ".conj" pseudo attribute; use
1851z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
1852now *do* support the __members__ and __methods__ special attributes.
1853
1854- The complex() function now looks for a __complex__() method on class
1855instances before giving up.
1856
1857- Long integers now support arbitrary shift counts, so you can now
1858write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
1859shift count for this.)
1860
1861- The hex() and oct() functions have been changed so that for regular
1862integers, they never emit a minus sign. For example, on a 32-bit
1863machine, oct(-1) now returns '037777777777' and hex(-1) returns
1864'0xffffffff'. While this may seem inconsistent, it is much more
1865useful. (For long integers, a minus sign is used as before, to fit
1866the result in memory :-)
1867
1868- The hash() function computes better hashes for several data types,
1869including strings, floating point numbers, and complex numbers.
1870
Guido van Rossum61000331997-08-15 04:39:58 +00001871
1872New extension modules
1873---------------------
1874
1875- New extension modules cStringIO.c and cPickle.c, written by Jim
1876Fulton and other folks at Digital Creations. These are much more
1877efficient than their Python counterparts StringIO.py and pickle.py,
1878but don't support subclassing. cPickle.c clocks up to 1000 times
Guido van Rossum2da391f1997-08-18 21:17:32 +00001879faster than pickle.py; cStringIO.c's improvement is less dramatic but
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001880still significant.
Guido van Rossum61000331997-08-15 04:39:58 +00001881
1882- New extension module zlibmodule.c, interfacing to the free zlib
1883library (gzip compatible compression). There's also a module gzip.py
1884which provides a higher level interface. Written by Andrew Kuchling
1885and Jeremy Hylton.
1886
1887- New module readline; see the "miscellaneous" section above.
1888
1889- New Unix extension module resource.c, by Jeremy Hylton, provides
1890access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
1891related symbolic constants.
1892
1893- New extension puremodule.c, by Barry Warsaw, which interfaces to the
1894Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
1895possible to enable Purify by simply setting the PURIFY Makefile
1896variable in the Modules/Setup file.
1897
1898
1899Changes in extension modules
1900----------------------------
1901
1902- The struct extension module has several new features to control byte
1903order and word size. It supports reading and writing IEEE floats even
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001904on platforms where this is not the native format. It uses uppercase
1905format codes for unsigned integers of various sizes (always using
1906Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
1907and 'p' for "Pascal strings" (with a leading length byte, included in
Guido van Rossum92664b81997-10-07 00:12:43 +00001908the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
1909big-endian data and '<' forces little-endian data; these also select
1910standard data sizes and disable automatic alignment (use pad bytes as
1911needed).
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001912
1913- The array module supports uppercase format codes for unsigned data
1914formats (like the struct module).
Guido van Rossum61000331997-08-15 04:39:58 +00001915
1916- The fcntl extension module now exports the needed symbolic
1917constants. (Formerly these were in FCNTL.py which was not available
1918or correct for all platforms.)
1919
1920- The extension modules dbm, gdbm and bsddb now check that the
1921database is still open before making any new calls.
1922
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001923- The dbhash module is no more. Use bsddb instead. (There's a third
1924party interface for the BSD 2.x code somewhere on the web; support for
1925bsddb will be deprecated.)
1926
1927- The gdbm module now supports a sync() method.
1928
1929- The socket module now has some new functions: getprotobyname(), and
1930the set {ntoh,hton}{s,l}().
1931
Guido van Rossum61000331997-08-15 04:39:58 +00001932- Various modules now export their type object: socket.SocketType,
1933array.ArrayType.
1934
Guido van Rossum2da391f1997-08-18 21:17:32 +00001935- The socket module's accept() method now returns unknown addresses as
1936a tuple rather than raising an exception. (This can happen in
1937promiscuous mode.) Theres' also a new function getprotobyname().
1938
Guido van Rossum61000331997-08-15 04:39:58 +00001939- The pthread support for the thread module now works on most platforms.
1940
1941- STDWIN is now officially obsolete. Support for it will eventually
1942be removed from the distribution.
1943
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001944- The binascii extension module is now hopefully fully debugged.
1945(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
1946received.)
Guido van Rossum61000331997-08-15 04:39:58 +00001947
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001948- audioop.c: added a ratecv() function; better handling of overflow in
1949add().
Guido van Rossum2da391f1997-08-18 21:17:32 +00001950
1951- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
1952Windows, also O_TEXT and O_BINARY. The 'error' variable (the
1953exception is raises) is renamed -- its string value is now "os.error",
1954so newbies don't believe they have to import posix (or nt) to catch
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001955it when they see os.error reported as posix.error. The execve()
1956function now accepts any mapping object for the environment.
Guido van Rossum2da391f1997-08-18 21:17:32 +00001957
1958- A new version of the al (audio library) module for SGI was
1959contributed by Sjoerd Mullender.
1960
1961- The regex module has a new function get_syntax() which retrieves the
1962syntax setting set by set_syntax(). The code was also sanitized,
1963removing worries about unclean error handling. See also below for its
1964successor, re.py.
1965
1966- The "new" module (which creates new objects of various types) once
1967again has a fully functioning new.function() method. Dangerous as
Guido van Rossum1f83cce1997-10-06 21:04:35 +00001968ever! Also, new.code() has several new arguments.
1969
1970- A problem has been fixed in the rotor module: on systems with signed
1971characters, rotor-encoded data was not portable when the key contained
19728-bit characters. Also, setkey() now requires its argument rather
1973than having broken code to default it.
1974
1975- The sys.builtin_module_names variable is now a tuple. Another new
1976variables in sys is sys.executable (the full path to the Python
1977binary, if known).
1978
1979- The specs for time.strftime() have undergone some revisions. It
1980appears that not all format characters are supported in the same way
1981on all platforms. Rather than reimplement it, we note these
1982differences in the documentation, and emphasize the shared set of
1983features. There's also a thorough test set (that occasionally finds
1984problems in the C library implementation, e.g. on some Linuxes),
1985thanks to Skip Montanaro.
1986
1987- The nis module seems broken when used with NIS+; unfortunately
1988nobody knows how to fix it. It should still work with old NIS.
Guido van Rossum2da391f1997-08-18 21:17:32 +00001989
Guido van Rossum61000331997-08-15 04:39:58 +00001990
1991New library modules
1992-------------------
1993
1994- New (still experimental) Perl-style regular expression module,
1995re.py, which uses a new interface for matching as well as a new
1996syntax; the new interface avoids the thread-unsafety of the regex
1997interface. This comes with a helper extension reopmodule.c and vastly
1998rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
1999Peters, and Andrew Kuchling. See the documentation libre.tex. In
20001.5, the old regex module is still fully supported; in the future, it
2001will become obsolete.
2002
2003- New module gzip.py; see zlib above.
2004
2005- New module keyword.py exports knowledge about Python's built-in
2006keywords. (New version by Ka-Ping Yee.)
2007
2008- New module pprint.py (with documentation) which supports
2009pretty-printing of lists, tuples, & dictionaries recursively. By Fred
2010Drake.
2011
2012- New module code.py. The function code.compile_command() can
2013determine whether an interactively entered command is complete or not,
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002014distinguishing incomplete from invalid input. (XXX Unfortunately,
2015this seems broken at this moment, and I don't have the time to fix
2016it. It's probably better to add an explicit interface to the parser
2017for this.)
Guido van Rossum61000331997-08-15 04:39:58 +00002018
Guido van Rossum522578e1997-08-28 03:43:21 +00002019- There is now a library module xdrlib.py which can read and write the
Guido van Rossum61000331997-08-15 04:39:58 +00002020XDR data format as used by Sun RPC, for example. It uses the struct
2021module.
2022
2023
2024Changes in library modules
2025--------------------------
2026
2027- Module codehack.py is now completely obsolete.
2028
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002029- The pickle.py module has been updated to make it compatible with the
2030new binary format that cPickle.c produces. By default it produces the
2031old all-ASCII format compatible with the old pickle.py, still much
2032faster than pickle.py; it will read both formats automatically. A few
2033other updates have been made.
2034
2035- A new helper module, copy_reg.py, is provided to register extensions
2036to the pickling code.
2037
Guido van Rossum61000331997-08-15 04:39:58 +00002038- Revamped module tokenize.py is much more accurate and has an
2039interface that makes it a breeze to write code to colorize Python
2040source code. Contributed by Ka-Ping Yee.
2041
2042- In ihooks.py, ModuleLoader.load_module() now closes the file under
2043all circumstances.
2044
2045- The tempfile.py module has a new class, TemporaryFile, which creates
2046an open temporary file that will be deleted automatically when
2047closed. This works on Windows and MacOS as well as on Unix. (Jim
2048Fulton.)
2049
2050- Changes to the cgi.py module: Most imports are now done at the
2051top of the module, which provides a speedup when using ni (Jim
2052Fulton). The problem with file upload to a Windows platform is solved
2053by using the new tempfile.TemporaryFile class; temporary files are now
2054always opened in binary mode (Jim Fulton). The cgi.escape() function
2055now takes an optional flag argument that quotes '"' to '&quot;'. It
2056is now possible to invoke cgi.py from a command line script, to test
2057cgi scripts more easily outside an http server. There's an optional
2058limit to the size of uploads to POST (Skip Montanaro). Added a
2059'strict_parsing' option to all parsing functions (Jim Fulton). The
2060function parse_qs() now uses urllib.unquote() on the name as well as
Guido van Rossum2da391f1997-08-18 21:17:32 +00002061the value of fields (Clarence Gardner). The FieldStorage class now
2062has a __len__() method.
Guido van Rossum61000331997-08-15 04:39:58 +00002063
2064- httplib.py: the socket object is no longer closed; all HTTP/1.*
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002065responses are now accepted; and it is now thread-safe (by not using
2066the regex module).
Guido van Rossum61000331997-08-15 04:39:58 +00002067
2068- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
2069
2070- The popen2.py module is now rewritten using a class, which makes
2071access to the standard error stream and the process id of the
2072subprocess possible.
2073
Guido van Rossum2da391f1997-08-18 21:17:32 +00002074- Added timezone support to the rfc822.py module, in the form of a
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002075getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
2076Also added recognition of some non-standard date formats, by Lars
2077Wirzenius, and RFC 850 dates (Chris Lawrence).
Guido van Rossum61000331997-08-15 04:39:58 +00002078
2079- mhlib.py: various enhancements, including almost compatible parsing
2080of message sequence specifiers without invoking a subprocess. Also
2081added a createmessage() method by Lars Wirzenius.
2082
2083- The StringIO.StringIO class now supports readline(nbytes). (Lars
2084Wirzenius.) (Of course, you should be using cStringIO for performance.)
2085
2086- UserDict.py supports the new dictionary methods as well.
2087
2088- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
2089speed it up, and replace 0 seed values by 1 to avoid degeneration.
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002090A bug was fixed in the test for invalid arguments.
Guido van Rossum61000331997-08-15 04:39:58 +00002091
Guido van Rossum2da391f1997-08-18 21:17:32 +00002092- Module ftplib.py: added support for parsing a .netrc file (Fred
2093Drake). Also added an ntransfercmd() method to the FTP class, which
2094allows access to the expected size of a transfer when available, and a
2095parse150() function to the module which parses the corresponding 150
2096response.
Guido van Rossum61000331997-08-15 04:39:58 +00002097
2098- urllib.py: the ftp cache is now limited to 10 entries. Added
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002099quote_plus() and unquote_plus() functions which are like quote() and
2100unquote() but also replace spaces with '+' or vice versa, for
2101encoding/decoding CGI form arguments. Catch all errors from the ftp
2102module. HTTP requests now add the Host: header line. The proxy
Guido van Rossum2da391f1997-08-18 21:17:32 +00002103variable names are now mapped to lower case, for Windows. The
2104spliturl() function no longer erroneously throws away all data past
2105the first newline. The basejoin() function now intereprets "../"
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002106correctly. I *believe* that the problems with "exception raised in
2107__del__" under certain circumstances have been fixed (mostly by
2108changes elsewher in the interpreter).
2109
2110- In urlparse.py, there is a cache for results in urlparse.urlparse();
2111its size limit is set to 20. Also, new URL schemes shttp, https, and
2112snews are "supported".
Guido van Rossum61000331997-08-15 04:39:58 +00002113
Guido van Rossum2da391f1997-08-18 21:17:32 +00002114- shelve.py: use cPickle and cStringIO when available. Also added
2115a sync() method, which calls the database's sync() method if there is
2116one.
Guido van Rossum61000331997-08-15 04:39:58 +00002117
2118- The mimetools.py module now uses the available Python modules for
2119decoding quoted-printable, uuencode and base64 formats, rather than
2120creating a subprocess.
2121
2122- The python debugger (pdb.py, and its base class bdb.py) now support
2123conditional breakpoints. See the docs.
2124
2125- The modules base64.py, uu.py and quopri.py can now be used as simple
2126command line utilities.
2127
2128- Various small fixes to the nntplib.py module that I can't bother to
2129document in detail.
2130
Guido van Rossum61000331997-08-15 04:39:58 +00002131- Sjoerd Mullender's mimify.py module now supports base64 encoding and
2132includes functions to handle the funny encoding you sometimes see in mail
2133headers. It is now documented.
2134
Guido van Rossum2da391f1997-08-18 21:17:32 +00002135- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
2136gotten from the environment.
2137
2138- Many more modules now correctly open files in binary mode when this
2139is necessary on non-Unix platforms.
2140
2141- The copying functions in the undocumented module shutil.py are
2142smarter.
2143
2144- The Writer classes in the formatter.py module now have a flush()
2145method.
2146
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002147- The sgmllib.py module accepts hyphens and periods in the middle of
2148attribute names. While this is against the SGML standard, there is
2149some HTML out there that uses this...
2150
2151- The interface for the Python bytecode disassembler module, dis.py,
2152has been enhanced quite a bit. There's now one main function,
2153dis.dis(), which takes almost any kind of object (function, module,
2154class, instance, method, code object) and disassembles it; without
2155arguments it disassembles the last frame of the last traceback. The
2156other functions have changed slightly, too.
Guido van Rossum2da391f1997-08-18 21:17:32 +00002157
2158- The imghdr.py module recognizes new image types: BMP, PNG.
2159
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002160- The string.py module has a new function replace(str, old, new,
Guido van Rossum2da391f1997-08-18 21:17:32 +00002161[maxsplit]) which does substring replacements. It is actually
2162implemented in C in the strop module. The functions [r]find() an
2163[r]index() have an optional 4th argument indicating the end of the
2164substring to search, alsoo implemented by their strop counterparts.
2165(Remember, never import strop -- import string uses strop when
2166available with zero overhead.)
2167
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002168- The string.join() function now accepts any sequence argument, not
2169just lists and tuples.
2170
2171- The string.maketrans() requires its first two arguments to be
2172present. The old version didn't require them, but there's not much
2173point without them, and the documentation suggests that they are
2174required, so we fixed the code to match the documentation.
2175
2176- The regsub.py module has a function clear_cache(), which clears its
2177internal cache of compiled regular expressions. Also, the cache now
2178takes the current syntax setting into account. (However, this module
2179is now obsolete -- use the sub() or subn() functions or methods in the
2180re module.)
2181
2182- The undocumented module Complex.py has been removed, now that Python
2183has built-in complex numbers. A similar module remains as
2184Demo/classes/Complex.py, as an example.
2185
Guido van Rossum61000331997-08-15 04:39:58 +00002186
2187Changes to the build process
2188----------------------------
2189
2190- The way GNU readline is configured is totally different. The
2191--with-readline configure option is gone. It is now an extension
2192module, which may be loaded dynamically. You must enable it (and
2193specify the correct linraries to link with) in the Modules/Setup file.
2194Importing the module installs some hooks which enable command line
2195editing. When the interpreter shell is invoked interactively, it
2196attempts to import the readline module; when this fails, the default
2197input mechanism is used. The hook variables are PyOS_InputHook and
2198PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
2199ideas from William Magro.)
2200
2201- New build procedure: a single library, libpython1.5.a, is now built,
2202which contains absolutely everything except for a one-line main()
2203program (which calls Py_Main(argc, argv) to start the interpreter
2204shell). This makes life much simpler for applications that need to
2205embed Python. The serial number of the build is now included in the
2206version string (sys.version).
2207
2208- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
2209emits a single warning any more when compiling Python.
2210
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002211- A number of new Makefile variables have been added for special
2212situations, e.g. LDLAST is appended to the link command. These are
2213used by editing the Makefile or passing them on the make command
2214line.
2215
Guido van Rossum61000331997-08-15 04:39:58 +00002216- A set of patches from Lee Busby has been integrated that make it
2217possible to catch floating point exceptions. Use the configure option
2218--with-fpectl to enable the patches; the extension modules fpectl and
2219fpetest provide control to enable/disable and test the feature,
2220respectively.
2221
2222- The support for shared libraries under AIX is now simpler and more
2223robust. Thanks to Vladimir Marangozov for revamping his own patches!
2224
2225- The Modules/makesetup script now reads a file Setup.local as well as
2226a file Setup. Most changes to the Setup script can be done by editing
2227Setup.local instead, which makes it easier to carry a particular setup
2228over from one release to the next.
2229
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002230- The Modules/makesetup script now copies any "include" lines it
2231encounters verbatim into the output Makefile. It also recognizes .cxx
2232and .cpp as C++ source files.
2233
Guido van Rossum61000331997-08-15 04:39:58 +00002234- The configure script is smarter about C compiler options; e.g. with
2235gcc it uses -O2 and -g when possible, and on some other platforms it
2236uses -Olimit 1500 to avoid a warning from the optimizer about the main
2237loop in ceval.c (which has more than 1000 basic blocks).
2238
2239- The configure script now detects whether malloc(0) returns a NULL
2240pointer or a valid block (of length zero). This avoids the nonsense
2241of always adding one byte to all malloc() arguments on most platforms.
2242
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002243- The configure script has a new option, --with-dec-threads, to enable
2244DEC threads on DEC Alpha platforms. Also, --with-threads is now an
2245alias for --with-thread (this was the Most Common Typo in configure
2246arguments).
2247
2248- Many changes in Doc/Makefile; amongst others, latex2html is now used
2249to generate HTML from all latex documents.
2250
Guido van Rossum61000331997-08-15 04:39:58 +00002251
2252Change to the Python/C API
2253--------------------------
2254
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002255- Because some interfaces have changed, the PYTHON_API macro has been
2256bumped. Most extensions built for the old API version will still run,
2257but I can't guarantee this. Python prints a warning message on
2258version mismatches; it dumps core when the version mismatch causes a
2259serious problem :-)
2260
Guido van Rossum2da391f1997-08-18 21:17:32 +00002261- I've completed the Grand Renaming, with the help of Roger Masse and
2262Barry Warsaw. This makes reading or debugging the code much easier.
2263Many other unrelated code reorganizations have also been carried out.
2264The allobjects.h header file is gone; instead, you would have to
2265include Python.h followed by rename2.h. But you're better off running
2266Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
2267the rename2.h; it will disappear in the next release.
2268
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002269- Various and sundry small bugs in the "abstract" interfaces have been
2270fixed. Thanks to all the (involuntary) testers of the Python 1.4
2271version! Some new functions have been added, e.g. PySequence_List(o),
2272equivalent to list(o) in Python.
2273
2274- New API functions PyLong_FromUnsignedLong() and
2275PyLong_AsUnsignedLong().
2276
Guido van Rossum2da391f1997-08-18 21:17:32 +00002277- The API functions in the file cgensupport.c are no longer
2278supported. This file has been moved to Modules and is only ever
2279compiled when the SGI specific 'gl' module is built.
Guido van Rossum61000331997-08-15 04:39:58 +00002280
2281- PyObject_Compare() can now raise an exception. Check with
2282PyErr_Occurred(). The comparison function in an object type may also
2283raise an exception.
2284
2285- The slice interface uses an upper bound of INT_MAX when no explicit
2286upper bound is given (e.x. for a[1:]). It used to ask the object for
2287its length and do the calculations.
2288
2289- Support for multiple independent interpreters. See Doc/api.tex,
2290functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
2291documentation is incomplete, also see the new Demo/pysvr example
2292(which shows how to use these in a threaded application) and the
2293source code.
2294
2295- There is now a Py_Finalize() function which "de-initializes"
2296Python. It is possible to completely restart the interpreter
2297repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
2298change of functionality in Py_Initialize() means that it is now a
2299fatal error to call it while the interpreter is already initialized.
2300The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
2301is deprecated (it is nothing more than Py_Finalize() followed by
2302exit()).
2303
Guido van Rossum2da391f1997-08-18 21:17:32 +00002304- There are no known memory leaks left. While Py_Finalize() doesn't
2305free *all* allocated memory (some of it is hard to track down),
2306repeated calls to Py_Finalize() and Py_Initialize() do not create
2307unaccessible heap blocks.
Guido van Rossum61000331997-08-15 04:39:58 +00002308
2309- There is now explicit per-thread state. (Inspired by, but not the
2310same as, Greg Stein's free threading patches.)
2311
2312- There is now better support for threading C applications. There are
2313now explicit APIs to manipulate the interpreter lock. Read the source
2314or the Demo/pysvr example; the new functions are
2315PyEval_{Acquire,Release}{Lock,Thread}().
2316
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002317- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
2318with other libraries' DEBUG macros. Likewise for any other test
2319macros that didn't yet start with Py_.
2320
Guido van Rossum61000331997-08-15 04:39:58 +00002321- New wrappers around malloc() and friends: Py_Malloc() etc. call
2322malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
2323just malloc(). Use of these wrappers could be essential if multiple
2324memory allocators exist (e.g. when using certain DLL setups under
2325Windows). (Idea by Jim Fulton.)
2326
2327- New C API PyImport_Import() which uses whatever __import__() hook
2328that is installed for the current execution environment. By Jim
2329Fulton.
2330
2331- It is now possible for an extension module's init function to fail
2332non-fatally, by calling one of the PyErr_* functions and returning.
2333
2334- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
2335argument to the proper type, like the similar PyString macros already
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002336did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
2337and PyList_GET_ITEM.
Guido van Rossum61000331997-08-15 04:39:58 +00002338
2339- Some of the Py_Get* function, like Py_GetVersion() (but not yet
2340Py_GetPath()) are now declared as returning a const char *. (More
2341should follow.)
2342
2343- Changed the run-time library to check for exceptions after object
2344comparisons. PyObject_Compare() can now return an exception; use
2345PyErr_Occurred() to check (there is *no* special return value).
2346
2347- PyFile_WriteString() and Py_Flushline() now return error indicators
2348instead of clearing exceptions. This fixes an obscure bug where using
2349these would clear a pending exception, discovered by Just van Rossum.
2350
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002351- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
2352an argument list including keyword arguments. Contributed by Geoff
2353Philbrick.
2354
Guido van Rossum2da391f1997-08-18 21:17:32 +00002355- PyArg_GetInt() is gone.
2356
2357- It's no longer necessary to include graminit.h when calling one of
2358the extended parser API functions. The three public grammar start
2359symbols are now in Python.h as Py_single_input, Py_file_input, and
2360Py_eval_input.
2361
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002362- The CObject interface has a new function,
2363PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
2364on the object referenced by "module.name".
2365
Guido van Rossum61000331997-08-15 04:39:58 +00002366
2367Tkinter
2368-------
2369
Guido van Rossum2da391f1997-08-18 21:17:32 +00002370- On popular demand, _tkinter once again installs a hook for readline
2371that processes certain Tk events while waiting for the user to type
2372(using PyOS_InputHook).
2373
2374- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
2375caused by command definitions referencing widget objects beyond their
2376lifetime.
2377
2378- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
2379tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002380with the new Tk dialog scripts, and provide more "native platform"
2381style file selection dialog boxes on some platforms. Contributed by
2382Fredrik Lundh.
Guido van Rossum61000331997-08-15 04:39:58 +00002383
2384- Tkinter.py: when the first Tk object is destroyed, it sets the
2385hiddel global _default_root to None, so that when another Tk object is
2386created it becomes the new default root. Other miscellaneous
2387changes and fixes.
2388
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002389- The Image class now has a configure method.
2390
2391- Added a bunch of new winfo options to Tkinter.py; we should now be
2392up to date with Tk 4.2. The new winfo options supported are:
2393mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
2394visualsavailable.
2395
2396- The broken bind() method on Canvas objects defined in the Canvas.py
2397module has been fixed. The CanvasItem and Group classes now also have
2398an unbind() method.
2399
2400- The problem with Tkinter.py falling back to trying to import
2401"tkinter" when "_tkinter" is not found has been fixed -- it no longer
2402tries "tkinter", ever. This makes diagnosing the problem "_tkinter
2403not configured" much easier and will hopefully reduce the newsgroup
2404traffic on this topic.
2405
2406- The ScrolledText module once again supports the 'cnf' parameter, to
2407be compatible with the examples in Mark Lutz' book (I know, I know,
2408too late...)
2409
Guido van Rossum61000331997-08-15 04:39:58 +00002410- The _tkinter.c extension module has been revamped. It now support
2411Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
2412works well under Windows and Mac (with the latest Tk ports to those
2413platforms). It also supports threading -- it is safe for one
2414(Python-created) thread to be blocked in _tkinter.mainloop() while
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002415other threads modify widgets. To make the changes visible, those
2416threads must use update_idletasks()method. (The patch for threading
2417in 1.5a3 was broken; in 1.5a4, it is back in a different version,
2418which requires access to the Tcl sources to get it to work -- hence it
2419is disabled by default.)
2420
2421- A bug in _tkinter.c has been fixed, where Split() with a string
2422containing an unmatched '"' could cause an exception or core dump.
2423
2424- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
2425CreateFileHandler, so _tkinter.createfilehandler is not available on
2426those platforms when using Tk 8.0 or later. I will have to rethink
2427how to interface with Tcl's lower-level event mechanism, or with its
2428channels (which are like Python's file-like objects). Jack Jansen has
2429provided a fix for the Mac, so createfilehandler *is* actually
2430supported there; maybe I can adapt his fix for Windows.
Guido van Rossum61000331997-08-15 04:39:58 +00002431
2432
2433Tools and Demos
2434---------------
2435
2436- A new regression test suite is provided, which tests most of the
2437standard and built-in modules. The regression test is run by invoking
2438the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
2439he and Roger Masse contributed most of the new tests.
2440
2441- New tool: faqwiz -- the CGI script that is used to maintain the
2442Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
2443Tools/faqwiz.
2444
2445- New tool: webchecker -- a simple extensible web robot that, when
2446aimed at a web server, checks that server for dead links. Available
2447are a command line utility as well as a Tkinter based GUI version. In
2448Tools/webchecker. A simplified version of this program is dissected
2449in my article in O'Reilly's WWW Journal, the issue on Scripting
2450Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
2451Includes a parser for robots.txt files by Skip Montanaro.
2452
2453- New small tools: cvsfiles.py (prints a list of all files under CVS
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002454n a particular directory tree), treesync.py (a rather Guido-specific
Guido van Rossum61000331997-08-15 04:39:58 +00002455script to synchronize two source trees, one on Windows NT, the other
2456one on Unix under CVS but accessible from the NT box), and logmerge.py
2457(sort a collection of RCS or CVS logs by date). In Tools/scripts.
2458
2459- The freeze script now also works under Windows (NT). Another
2460feature allows the -p option to be pointed at the Python source tree
2461instead of the installation prefix. This was loosely based on part of
2462xfreeze by Sam Rushing and Bill Tutt.
2463
2464- New examples (Demo/extend) that show how to use the generic
2465extension makefile (Misc/Makefile.pre.in).
2466
2467- Tools/scripts/h2py.py now supports C++ comments.
2468
Guido van Rossum2da391f1997-08-18 21:17:32 +00002469- Tools/scripts/pystone.py script is upgraded to version 1.1; there
2470was a bug in version 1.0 (distributed with Python 1.4) that leaked
2471memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
2472
2473- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
Guido van Rossum61000331997-08-15 04:39:58 +00002474
2475
2476Windows (NT and 95)
2477-------------------
2478
2479- New project files for Developer Studio (Visual C++) 5.0 for Windows
2480NT (the old VC++ 4.2 Makefile is also still supported, but will
2481eventually be withdrawn due to its bulkiness).
2482
2483- See the note on the new module search path in the "Miscellaneous" section
2484above.
2485
2486- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
2487basically withdrawn. If it still works for you, you're lucky.
2488
2489- There's a new extension module, msvcrt.c, which provides various
2490low-level operations defined in the Microsoft Visual C++ Runtime Library.
2491These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
2492console I/O functions like kbhit(), getch() and putch().
2493
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002494- The -u option not only sets the standard I/O streams to unbuffered
2495status, but also sets them in binary mode. (This can also be done
2496using msvcrt.setmode(), by the way.)
Guido van Rossum61000331997-08-15 04:39:58 +00002497
2498- The, sys.prefix and sys.exec_prefix variables point to the directory
2499where Python is installed, or to the top of the source tree, if it was run
2500from there.
2501
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002502- The various os.path modules (posixpath, ntpath, macpath) now support
2503passing more than two arguments to the join() function, so
2504os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
2505c)).
2506
Guido van Rossum61000331997-08-15 04:39:58 +00002507- The ntpath module (normally used as os.path) supports ~ to $HOME
2508expansion in expanduser().
2509
2510- The freeze tool now works on Windows.
2511
Guido van Rossum2da391f1997-08-18 21:17:32 +00002512- See also the Tkinter category for a sad note on
2513_tkinter.createfilehandler().
2514
2515- The truncate() method for file objects now works on Windows.
2516
2517- Py_Initialize() is no longer called when the DLL is loaded. You
Guido van Rossumb68b77f1997-10-07 19:12:50 +00002518must call it yourself.
Guido van Rossum61000331997-08-15 04:39:58 +00002519
Guido van Rossum1f83cce1997-10-06 21:04:35 +00002520- The time module's clock() function now has good precision through
2521the use of the Win32 API QueryPerformanceCounter().
2522
2523- Mark Hammond will release Python 1.5 versions of PythonWin and his
2524other Windows specific code: the win32api extensions, COM/ActiveX
2525support, and the MFC interface.
2526
Guido van Rossum61000331997-08-15 04:39:58 +00002527
2528Mac
2529---
2530
Guido van Rossum2da391f1997-08-18 21:17:32 +00002531- As always, the Macintosh port will be done by Jack Jansen. He will
2532make a separate announcement for the Mac specific source code and the
2533binary distribution(s) when these are ready.
Guido van Rossum61000331997-08-15 04:39:58 +00002534
2535
Guido van Rossum92664b81997-10-07 00:12:43 +00002536======================================================================