4 This file contains the release messages for previous Python releases.
5 As you read on you go back to the dark ages of Python's history.
8 ======================================================================
11 What's New in Python 2.1 (final)?
12 =================================
14 We only changed a few things since the last release candidate, all in
17 - A bug in the locale module was fixed that affected locales which
18 define no grouping for numeric formatting.
20 - A few bugs in the weakref module's implementations of weak
21 dictionaries (WeakValueDictionary and WeakKeyDictionary) were fixed,
22 and the test suite was updated to check for these bugs.
24 - An old bug in the os.path.walk() function (introduced in Python
25 2.0!) was fixed: a non-existent file would cause an exception
26 instead of being ignored.
28 - Fixed a few bugs in the new symtable module found by Neil Norwitz's
32 What's New in Python 2.1c2?
33 ===========================
35 A flurry of small changes, and one showstopper fixed in the nick of
36 time made it necessary to release another release candidate. The list
37 here is the *complete* list of patches (except version updates):
41 - Tim discovered a nasty bug in the dictionary code, caused by
42 PyDict_Next() calling dict_resize(), and the GC code's use of
43 PyDict_Next() violating an assumption in dict_items(). This was
44 fixed with considerable amounts of band-aid, but the net effect is a
45 saner and more robust implementation.
47 - Made a bunch of symbols static that were accidentally global.
51 - The setup.py script didn't check for a new enough version of zlib
52 (1.1.3 is needed). Now it does.
54 - Changed "make clean" target to also remove shared libraries.
56 - Added a more general warning about the SGI Irix optimizer to README.
60 - Fix a bug in urllib.basejoin("http://host", "../file.html") which
61 omitted the slash between host and file.html.
63 - The mailbox module's _Mailbox class contained a completely broken
64 and undocumented seek() method. Ripped it out.
66 - Fixed a bunch of typos in various library modules (urllib2, smtpd,
67 sgmllib, netrc, chunk) found by Neil Norwitz's PyChecker.
69 - Fixed a few last-minute bugs in unittest.
73 - Reverted the patch to the OpenSSL code in socketmodule.c to support
74 RAND_status() and the EGD, and the subsequent patch that tried to
75 fix it for pre-0.9.5 versions; the problem with the patch is that on
76 some systems it issues a warning whenever socket is imported, and
81 - Fixed the pickle tests to work with "import test.test_pickle".
83 - Tweaked test_locale.py to actually run the test Windows.
85 - In distutils/archive_util.py, call zipfile.ZipFile() with mode "w",
86 not "wb" (which is not a valid mode at all).
88 - Fix pstats browser crashes. Import readline if it exists to make
89 the user interface nicer.
91 - Add "import thread" to the top of test modules that import the
92 threading module (test_asynchat and test_threadedtempfile). This
93 prevents test failures caused by a broken threading module resulting
94 from a previously caught failed import.
96 - Changed test_asynchat.py to set the SO_REUSEADDR option; this was
97 needed on some platforms (e.g. Solaris 8) when the tests are run
100 - Skip rather than fail test_sunaudiodev if no audio device is found.
103 What's New in Python 2.1c1?
104 ===========================
106 This list was significantly updated when 2.1c2 was released; the 2.1c1
107 release didn't mention most changes that were actually part of 2.1c1:
111 - Copyright was assigned to the Python Software Foundation (PSF) and a
112 PSF license (very similar to the CNRI license) was added.
114 - The CNRI copyright notice was updated to include 2001.
118 - After a public outcry, assignment to __debug__ is no longer illegal;
119 instead, a warning is issued. It will become illegal in 2.2.
121 - Fixed a core dump with "%#x" % 0, and changed the semantics so that
122 "%#x" now always prepends "0x", even if the value is zero.
124 - Fixed some nits in the bytecode compiler.
126 - Fixed core dumps when calling certain kinds of non-functions.
128 - Fixed various core dumps caused by reference count bugs.
132 - Use INSTALL_SCRIPT to install script files.
134 - New port: SCO Unixware 7, by Billy G. Allie.
136 - Updated RISCOS port.
138 - Updated BeOS port and notes.
140 - Various other porting problems resolved.
144 - The TERMIOS and SOCKET modules are now truly obsolete and
145 unnecessary. Their symbols are incorporated in the termios and
148 - Fixed some 64-bit bugs in pickle, cPickle, and struct, and added
149 better tests for pickling.
151 - threading: make Condition.wait() robust against KeyboardInterrupt.
153 - zipfile: add support to zipfile to support opening an archive
154 represented by an open file rather than a file name. Fix bug where
155 the archive was not properly closed. Fixed a bug in this bugfix
156 where flush() was called for a read-only file.
158 - imputil: added an uninstall() method to the ImportManager.
160 - Canvas: fixed bugs in lower() and tkraise() methods.
162 - SocketServer: API change (added overridable close_request() method)
163 so that the TCP server can explicitly close the request.
165 - pstats: Eric Raymond added a simple interactive statistics browser,
166 invoked when the module is run as a script.
168 - locale: fixed a problem in format().
170 - webbrowser: made it work when the BROWSER environment variable has a
171 value like "/usr/bin/netscape". Made it auto-detect Konqueror for
172 KDE 2. Fixed some other nits.
174 - unittest: changes to allow using a different exception than
175 AssertionError, and added a few more function aliases. Some other
178 - urllib, urllib2: fixed redirect problems and a coupleof other nits.
180 - asynchat: fixed a critical bug in asynchat that slipped through the
181 2.1b2 release. Fixed another rare bug.
183 - Fix some unqualified except: clauses (always a bad code example).
187 - pyexpat: new API get_version_string().
189 - Fixed some minidom bugs.
193 - Fixed a core dump in _weakref. Removed the weakref.mapping()
194 function (it adds nothing to the API).
196 - Rationalized the use of header files in the readline module, to make
197 it compile (albeit with some warnings) with the very recent readline
198 4.2, without breaking for earlier versions.
200 - Hopefully fixed a buffering problem in linuxaudiodev.
202 - Attempted a fix to make the OpenSSL support in the socket module
203 work again with pre-0.9.5 versions of OpenSSL.
207 - Added a test case for asynchat and asyncore.
209 - Removed coupling between tests where one test failing could break
214 - Ping added an interactive help browser to pydoc, fixed some nits
215 in the rest of the pydoc code, and added some features to his
218 - An updated python-mode.el version 4.1 which integrates Ken
219 Manheimer's pdbtrack.el. This makes debugging Python code via pdb
220 much nicer in XEmacs and Emacs. When stepping through your program
221 with pdb, in either the shell window or the *Python* window, the
222 source file and line will be tracked by an arrow. Very cool!
224 - IDLE: syntax warnings in interactive mode are changed into errors.
226 - Some improvements to Tools/webchecker (ignore some more URL types,
227 follow some more links).
229 - Brought the Tools/compiler package up to date.
232 What's New in Python 2.1 beta 2?
233 ================================
235 (Unlisted are many fixed bugs, more documentation, etc.)
237 Core language, builtins, and interpreter
239 - The nested scopes work (enabled by "from __future__ import
240 nested_scopes") is completed; in particular, the future now extends
241 into code executed through exec, eval() and execfile(), and into the
242 interactive interpreter.
244 - When calling a base class method (e.g. BaseClass.__init__(self)),
245 this is now allowed even if self is not strictly spoken a class
246 instance (e.g. when using metaclasses or the Don Beaudry hook).
248 - Slice objects are now comparable but not hashable; this prevents
249 dict[:] from being accepted but meaningless.
251 - Complex division is now calculated using less braindead algorithms.
252 This doesn't change semantics except it's more likely to give useful
253 results in extreme cases. Complex repr() now uses full precision
256 - sgmllib.py now calls handle_decl() for simple <!...> declarations.
258 - It is illegal to assign to the name __debug__, which is set when the
259 interpreter starts. It is effectively a compile-time constant.
261 - A warning will be issued if a global statement for a variable
262 follows a use or assignment of that variable.
266 - unittest.py, a unit testing framework by Steve Purcell (PyUNIT,
267 inspired by JUnit), is now part of the standard library. You now
268 have a choice of two testing frameworks: unittest requires you to
269 write testcases as separate code, doctest gathers them from
270 docstrings. Both approaches have their advantages and
273 - A new module Tix was added, which wraps the Tix extension library
274 for Tk. With that module, it is not necessary to statically link
275 Tix with _tkinter, since Tix will be loaded with Tcl's "package
276 require" command. See Demo/tix/.
278 - tzparse.py is now obsolete.
280 - In gzip.py, the seek() and tell() methods are removed -- they were
281 non-functional anyway, and it's better if callers can test for their
282 existence with hasattr().
286 - PyDict_Next(): it is now safe to call PyDict_SetItem() with a key
287 that's already in the dictionary during a PyDict_Next() iteration.
288 This used to fail occasionally when a dictionary resize operation
289 could be triggered that would rehash all the keys. All other
290 modifications to the dictionary are still off-limits during a
291 PyDict_Next() iteration!
293 - New extended APIs related to passing compiler variables around.
295 - New abstract APIs PyObject_IsInstance(), PyObject_IsSubclass()
296 implement isinstance() and issubclass().
298 - Py_BuildValue() now has a "D" conversion to create a Python complex
299 number from a Py_complex C value.
301 - Extensions types which support weak references must now set the
302 field allocated for the weak reference machinery to NULL themselves;
303 this is done to avoid the cost of checking each object for having a
304 weakly referencable type in PyObject_INIT(), since most types are
305 not weakly referencable.
307 - PyFrame_FastToLocals() and PyFrame_LocalsToFast() copy bindings for
308 free variables and cell variables to and from the frame's f_locals.
310 - Variants of several functions defined in pythonrun.h have been added
311 to support the nested_scopes future statement. The variants all end
312 in Flags and take an extra argument, a PyCompilerFlags *; examples:
313 PyRun_AnyFileExFlags(), PyRun_InteractiveLoopFlags(). These
314 variants may be removed in Python 2.2, when nested scopes are
319 - the sdist command now writes a PKG-INFO file, as described in PEP 241,
320 into the release tree.
322 - several enhancements to the bdist_wininst command from Thomas Heller
323 (an uninstaller, more customization of the installer's display)
325 - from Jack Jansen: added Mac-specific code to generate a dialog for
326 users to specify the command-line (because providing a command-line with
327 MacPython is awkward). Jack also made various fixes for the Mac
328 and the Metrowerks compiler.
330 - added 'platforms' and 'keywords' to the set of metadata that can be
331 specified for a distribution.
333 - applied patches from Jason Tishler to make the compiler class work with
337 What's New in Python 2.1 beta 1?
338 ================================
340 Core language, builtins, and interpreter
342 - Following an outcry from the community about the amount of code
343 broken by the nested scopes feature introduced in 2.1a2, we decided
344 to make this feature optional, and to wait until Python 2.2 (or at
345 least 6 months) to make it standard. The option can be enabled on a
346 per-module basis by adding "from __future__ import nested_scopes" at
347 the beginning of a module (before any other statements, but after
348 comments and an optional docstring). See PEP 236 (Back to the
349 __future__) for a description of the __future__ statement. PEP 227
350 (Statically Nested Scopes) has been updated to reflect this change,
351 and to clarify the semantics in a number of endcases.
353 - The nested scopes code, when enabled, has been hardened, and most
354 bugs and memory leaks in it have been fixed.
356 - Compile-time warnings are now generated for a number of conditions
357 that will break or change in meaning when nested scopes are enabled:
359 - Using "from...import *" or "exec" without in-clause in a function
360 scope that also defines a lambda or nested function with one or
361 more free (non-local) variables. The presence of the import* or
362 bare exec makes it impossible for the compiler to determine the
363 exact set of local variables in the outer scope, which makes it
364 impossible to determine the bindings for free variables in the
365 inner scope. To avoid the warning about import *, change it into
366 an import of explicitly name object, or move the import* statement
367 to the global scope; to avoid the warning about bare exec, use
368 exec...in... (a good idea anyway -- there's a possibility that
369 bare exec will be deprecated in the future).
371 - Use of a global variable in a nested scope with the same name as a
372 local variable in a surrounding scope. This will change in
373 meaning with nested scopes: the name in the inner scope will
374 reference the variable in the outer scope rather than the global
375 of the same name. To avoid the warning, either rename the outer
376 variable, or use a global statement in the inner function.
378 - An optional object allocator has been included. This allocator is
379 optimized for Python objects and should be faster and use less memory
380 than the standard system allocator. It is not enabled by default
381 because of possible thread safety problems. The allocator is only
382 protected by the Python interpreter lock and it is possible that some
383 extension modules require a thread safe allocator. The object
384 allocator can be enabled by providing the "--with-pymalloc" option to
389 - pyexpat now detects the expat version if expat.h defines it. A
390 number of additional handlers are provided, which are only available
391 since expat 1.95. In addition, the methods SetParamEntityParsing and
392 GetInputContext of Parser objects are available with 1.95.x
393 only. Parser objects now provide the ordered_attributes and
394 specified_attributes attributes. A new module expat.model was added,
395 which offers a number of additional constants if 1.95.x is used.
397 - xml.dom offers the new functions registerDOMImplementation and
398 getDOMImplementation.
400 - xml.dom.minidom offers a toprettyxml method. A number of DOM
401 conformance issues have been resolved. In particular, Element now
402 has an hasAttributes method, and the handling of namespaces was
405 - Ka-Ping Yee contributed two new modules: inspect.py, a module for
406 getting information about live Python code, and pydoc.py, a module
407 for interactively converting docstrings to HTML or text.
408 Tools/scripts/pydoc, which is now automatically installed into
409 <prefix>/bin, uses pydoc.py to display documentation; try running
410 "pydoc -h" for instructions. "pydoc -g" pops up a small GUI that
411 lets you browse the module docstrings using a web browser.
413 - New library module difflib.py, primarily packaging the SequenceMatcher
414 class at the heart of the popular ndiff.py file-comparison tool.
416 - doctest.py (a framework for verifying Python code examples in docstrings)
417 is now part of the std library.
421 - A new entry in the Start menu, "Module Docs", runs "pydoc -g" -- a
422 small GUI that lets you browse the module docstrings using your
425 - Import is now case-sensitive. PEP 235 (Import on Case-Insensitive
426 Platforms) is implemented. See
428 http://python.sourceforge.net/peps/pep-0235.html
430 for full details, especially the "Current Lower-Left Semantics" section.
431 The new Windows import rules are simpler than before:
433 A. If the PYTHONCASEOK environment variable exists, same as
434 before: silently accept the first case-insensitive match of any
435 kind; raise ImportError if none found.
437 B. Else search sys.path for the first case-sensitive match; raise
438 ImportError if none found.
440 The same rules have been implemented on other platforms with case-
441 insensitive but case-preserving filesystems too (including Cygwin, and
442 several flavors of Macintosh operating systems).
444 - winsound module: Under Win9x, winsound.Beep() now attempts to simulate
445 what it's supposed to do (and does do under NT and 2000) via direct
446 port manipulation. It's unknown whether this will work on all systems,
447 but it does work on my Win98SE systems now and was known to be useless on
448 all Win9x systems before.
450 - Build: Subproject _test (effectively) renamed to _testcapi.
454 - 2.1 should compile and run out of the box under MacOS X, even using HFS+.
455 Thanks to Steven Majewski!
457 - 2.1 should compile and run out of the box on Cygwin. Thanks to Jason
460 - 2.1 contains new files and patches for RISCOS, thanks to Dietmar
461 Schwertberger! See RISCOS/README for more information -- it seems
462 that because of the bizarre filename conventions on RISCOS, no port
463 to that platform is easy.
466 What's New in Python 2.1 alpha 2?
467 =================================
469 Core language, builtins, and interpreter
471 - Scopes nest. If a name is used in a function or class, but is not
472 local, the definition in the nearest enclosing function scope will
473 be used. One consequence of this change is that lambda statements
474 could reference variables in the namespaces where the lambda is
475 defined. In some unusual cases, this change will break code.
477 In all previous version of Python, names were resolved in exactly
478 three namespaces -- the local namespace, the global namespace, and
479 the builtin namespace. According to this old definition, if a
480 function A is defined within a function B, the names bound in B are
481 not visible in A. The new rules make names bound in B visible in A,
482 unless A contains a name binding that hides the binding in B.
484 Section 4.1 of the reference manual describes the new scoping rules
485 in detail. The test script in Lib/test/test_scope.py demonstrates
486 some of the effects of the change.
488 The new rules will cause existing code to break if it defines nested
489 functions where an outer function has local variables with the same
490 name as globals or builtins used by the inner function. Example:
495 if type(str) != type(''):
499 Under the old rules, the name str in helper() is bound to the
500 builtin function str(). Under the new rules, it will be bound to
501 the argument named str and an error will occur when helper() is
504 - The compiler will report a SyntaxError if "from ... import *" occurs
505 in a function or class scope. The language reference has documented
506 that this case is illegal, but the compiler never checked for it.
507 The recent introduction of nested scope makes the meaning of this
508 form of name binding ambiguous. In a future release, the compiler
509 may allow this form when there is no possibility of ambiguity.
511 - repr(string) is easier to read, now using hex escapes instead of octal,
512 and using \t, \n and \r instead of \011, \012 and \015 (respectively):
514 >>> "\texample \r\n" + chr(0) + chr(255)
515 '\texample \r\n\x00\xff' # in 2.1
516 '\011example \015\012\000\377' # in 2.0
518 - Functions are now compared and hashed by identity, not by value, since
519 the func_code attribute is writable.
521 - Weak references (PEP 205) have been added. This involves a few
522 changes in the core, an extension module (_weakref), and a Python
523 module (weakref). The weakref module is the public interface. It
524 includes support for "explicit" weak references, proxy objects, and
525 mappings with weakly held values.
527 - A 'continue' statement can now appear in a try block within the body
528 of a loop. It is still not possible to use continue in a finally
533 - mailbox.py now has a new class, PortableUnixMailbox which is
534 identical to UnixMailbox but uses a more portable scheme for
535 determining From_ separators. Also, the constructors for all the
536 classes in this module have a new optional `factory' argument, which
537 is a callable used when new message classes must be instantiated by
540 - random.py is now self-contained, and offers all the functionality of
541 the now-deprecated whrandom.py. See the docs for details. random.py
542 also supports new functions getstate() and setstate(), for saving
543 and restoring the internal state of the generator; and jumpahead(n),
544 for quickly forcing the internal state to be the same as if n calls to
545 random() had been made. The latter is particularly useful for multi-
546 threaded programs, creating one instance of the random.Random() class for
547 each thread, then using .jumpahead() to force each instance to use a
548 non-overlapping segment of the full period.
550 - random.py's seed() function is new. For bit-for-bit compatibility with
551 prior releases, use the whseed function instead. The new seed function
552 addresses two problems: (1) The old function couldn't produce more than
553 about 2**24 distinct internal states; the new one about 2**45 (the best
554 that can be done in the Wichmann-Hill generator). (2) The old function
555 sometimes produced identical internal states when passed distinct
556 integers, and there was no simple way to predict when that would happen;
557 the new one guarantees to produce distinct internal states for all
558 arguments in [0, 27814431486576L).
560 - The socket module now supports raw packets on Linux. The socket
563 - test_capi.py is a start at running tests of the Python C API. The tests
564 are implemented by the new Modules/_testmodule.c.
566 - A new extension module, _symtable, provides provisional access to the
567 internal symbol table used by the Python compiler. A higher-level
568 interface will be added on top of _symtable in a future release.
570 - Removed the obsolete soundex module.
572 - xml.dom.minidom now uses the standard DOM exceptions. Node supports
573 the isSameNode method; NamedNodeMap the get method.
575 - xml.sax.expatreader supports the lexical handler property; it
576 generates comment, startCDATA, and endCDATA events.
580 - Build procedure: the zlib project is built in a different way that
581 ensures the zlib header files used can no longer get out of synch with
582 the zlib binary used. See PCbuild\readme.txt for details. Your old
583 zlib-related directories can be deleted; you'll need to download fresh
584 source for zlib and unpack it into a new directory.
586 - Build: New subproject _test for the benefit of test_capi.py (see above).
588 - Build: New subproject _symtable, for new DLL _symtable.pyd (a nascent
589 interface to some Python compiler internals).
591 - Build: Subproject ucnhash is gone, since the code was folded into the
592 unicodedata subproject.
594 What's New in Python 2.1 alpha 1?
595 =================================
597 Core language, builtins, and interpreter
599 - There is a new Unicode companion to the PyObject_Str() API
600 called PyObject_Unicode(). It behaves in the same way as the
601 former, but assures that the returned value is an Unicode object
602 (applying the usual coercion if necessary).
604 - The comparison operators support "rich comparison overloading" (PEP
605 207). C extension types can provide a rich comparison function in
606 the new tp_richcompare slot in the type object. The cmp() function
607 and the C function PyObject_Compare() first try the new rich
608 comparison operators before trying the old 3-way comparison. There
609 is also a new C API PyObject_RichCompare() (which also falls back on
610 the old 3-way comparison, but does not constrain the outcome of the
611 rich comparison to a Boolean result).
613 The rich comparison function takes two objects (at least one of
614 which is guaranteed to have the type that provided the function) and
615 an integer indicating the opcode, which can be Py_LT, Py_LE, Py_EQ,
616 Py_NE, Py_GT, Py_GE (for <, <=, ==, !=, >, >=), and returns a Python
617 object, which may be NotImplemented (in which case the tp_compare
618 slot function is used as a fallback, if defined).
620 Classes can overload individual comparison operators by defining one
621 or more of the methods__lt__, __le__, __eq__, __ne__, __gt__,
622 __ge__. There are no explicit "reflected argument" versions of
623 these; instead, __lt__ and __gt__ are each other's reflection,
624 likewise for__le__ and __ge__; __eq__ and __ne__ are their own
625 reflection (similar at the C level). No other implications are
626 made; in particular, Python does not assume that == is the Boolean
627 inverse of !=, or that < is the Boolean inverse of >=. This makes
628 it possible to define types with partial orderings.
630 Classes or types that want to implement (in)equality tests but not
631 the ordering operators (i.e. unordered types) should implement ==
632 and !=, and raise an error for the ordering operators.
634 It is possible to define types whose rich comparison results are not
635 Boolean; e.g. a matrix type might want to return a matrix of bits
636 for A < B, giving elementwise comparisons. Such types should ensure
637 that any interpretation of their value in a Boolean context raises
638 an exception, e.g. by defining __nonzero__ (or the tp_nonzero slot
639 at the C level) to always raise an exception.
641 - Complex numbers use rich comparisons to define == and != but raise
642 an exception for <, <=, > and >=. Unfortunately, this also means
643 that cmp() of two complex numbers raises an exception when the two
644 numbers differ. Since it is not mathematically meaningful to compare
645 complex numbers except for equality, I hope that this doesn't break
648 - The outcome of comparing non-numeric objects of different types is
649 not defined by the language, other than that it's arbitrary but
650 consistent (see the Reference Manual). An implementation detail changed
651 in 2.1a1 such that None now compares less than any other object. Code
652 relying on this new behavior (like code that relied on the previous
653 behavior) does so at its own risk.
655 - Functions and methods now support getting and setting arbitrarily
656 named attributes (PEP 232). Functions have a new __dict__
657 (a.k.a. func_dict) which hold the function attributes. Methods get
658 and set attributes on their underlying im_func. It is a TypeError
659 to set an attribute on a bound method.
661 - The xrange() object implementation has been improved so that
662 xrange(sys.maxint) can be used on 64-bit platforms. There's still a
663 limitation that in this case len(xrange(sys.maxint)) can't be
664 calculated, but the common idiom "for i in xrange(sys.maxint)" will
665 work fine as long as the index i doesn't actually reach 2**31.
666 (Python uses regular ints for sequence and string indices; fixing
667 that is much more work.)
669 - Two changes to from...import:
671 1) "from M import X" now works even if (after loading module M)
672 sys.modules['M'] is not a real module; it's basically a getattr()
673 operation with AttributeError exceptions changed into ImportError.
675 2) "from M import *" now looks for M.__all__ to decide which names to
676 import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
677 filters out names starting with '_' as before. Whether or not
678 __all__ exists, there's no restriction on the type of M.
680 - File objects have a new method, xreadlines(). This is the fastest
681 way to iterate over all lines in a file:
683 for line in file.xreadlines():
684 ...do something to line...
686 See the xreadlines module (mentioned below) for how to do this for
687 other file-like objects.
689 - Even if you don't use file.xreadlines(), you may expect a speedup on
690 line-by-line input. The file.readline() method has been optimized
691 quite a bit in platform-specific ways: on systems (like Linux) that
692 support flockfile(), getc_unlocked(), and funlockfile(), those are
693 used by default. On systems (like Windows) without getc_unlocked(),
694 a complicated (but still thread-safe) method using fgets() is used by
697 You can force use of the fgets() method by #define'ing
698 USE_FGETS_IN_GETLINE at build time (it may be faster than
701 You can force fgets() not to be used by #define'ing
702 DONT_USE_FGETS_IN_GETLINE (this is the first thing to try if std test
703 test_bufio.py fails -- and let us know if it does!).
705 - In addition, the fileinput module, while still slower than the other
706 methods on most platforms, has been sped up too, by using
707 file.readlines(sizehint).
709 - Support for run-time warnings has been added, including a new
710 command line option (-W) to specify the disposition of warnings.
711 See the description of the warnings module below.
713 - Extensive changes have been made to the coercion code. This mostly
714 affects extension modules (which can now implement mixed-type
715 numerical operators without having to use coercion), but
716 occasionally, in boundary cases the coercion semantics have changed
717 subtly. Since this was a terrible gray area of the language, this
718 is considered an improvement. Also note that __rcmp__ is no longer
719 supported -- instead of calling __rcmp__, __cmp__ is called with
722 - In connection with the coercion changes, a new built-in singleton
723 object, NotImplemented is defined. This can be returned for
724 operations that wish to indicate they are not implemented for a
725 particular combination of arguments. From C, this is
728 - The interpreter accepts now bytecode files on the command line even
729 if they do not have a .pyc or .pyo extension. On Linux, after executing
731 import imp,sys,string
732 magic = string.join(["\\x%.2x" % ord(c) for c in imp.get_magic()],"")
733 reg = ':pyc:M::%s::%s:' % (magic, sys.executable)
734 open("/proc/sys/fs/binfmt_misc/register","wb").write(reg)
736 any byte code file can be used as an executable (i.e. as an argument
739 - %[xXo] formats of negative Python longs now produce a sign
740 character. In 1.6 and earlier, they never produced a sign,
741 and raised an error if the value of the long was too large
742 to fit in a Python int. In 2.0, they produced a sign if and
743 only if too large to fit in an int. This was inconsistent
744 across platforms (because the size of an int varies across
745 platforms), and inconsistent with hex() and oct(). Example:
749 'ffffffbe' # in 2.0 and before, on 32-bit machines
751 '-0x42L' # in all versions of Python
753 The behavior of %d formats for negative Python longs remains
754 the same as in 2.0 (although in 1.6 and before, they raised
755 an error if the long didn't fit in a Python int).
757 %u formats don't make sense for Python longs, but are allowed
758 and treated the same as %d in 2.1. In 2.0, a negative long
759 formatted via %u produced a sign if and only if too large to
760 fit in an int. In 1.6 and earlier, a negative long formatted
761 via %u raised an error if it was too big to fit in an int.
763 - Dictionary objects have an odd new method, popitem(). This removes
764 an arbitrary item from the dictionary and returns it (in the form of
765 a (key, value) pair). This can be useful for algorithms that use a
766 dictionary as a bag of "to do" items and repeatedly need to pick one
767 item. Such algorithms normally end up running in quadratic time;
768 using popitem() they can usually be made to run in linear time.
772 - In the time module, the time argument to the functions strftime,
773 localtime, gmtime, asctime and ctime is now optional, defaulting to
774 the current time (in the local timezone).
776 - The ftplib module now defaults to passive mode, which is deemed a
777 more useful default given that clients are often inside firewalls
778 these days. Note that this could break if ftplib is used to connect
779 to a *server* that is inside a firewall, from outside; this is
780 expected to be a very rare situation. To fix that, you can call
783 - The module site now treats .pth files not only for path configuration,
784 but also supports extensions to the initialization code: Lines starting
785 with import are executed.
787 - There's a new module, warnings, which implements a mechanism for
788 issuing and filtering warnings. There are some new built-in
789 exceptions that serve as warning categories, and a new command line
790 option, -W, to control warnings (e.g. -Wi ignores all warnings, -We
791 turns warnings into errors). warnings.warn(message[, category])
792 issues a warning message; this can also be called from C as
793 PyErr_Warn(category, message).
795 - A new module xreadlines was added. This exports a single factory
796 function, xreadlines(). The intention is that this code is the
797 absolutely fastest way to iterate over all lines in an open
801 for line in xreadlines.xreadlines(file):
802 ...do something to line...
804 This is equivalent to the previous the speed record holder using
805 file.readlines(sizehint). Note that if file is a real file object
806 (as opposed to a file-like object), this is equivalent:
808 for line in file.xreadlines():
809 ...do something to line...
811 - The bisect module has new functions bisect_left, insort_left,
812 bisect_right and insort_right. The old names bisect and insort
813 are now aliases for bisect_right and insort_right. XXX_right
814 and XXX_left methods differ in what happens when the new element
815 compares equal to one or more elements already in the list: the
816 XXX_left methods insert to the left, the XXX_right methods to the
817 right. Code that doesn't care where equal elements end up should
818 continue to use the old, short names ("bisect" and "insort").
820 - The new curses.panel module wraps the panel library that forms part
821 of SYSV curses and ncurses. Contributed by Thomas Gellekum.
823 - The SocketServer module now sets the allow_reuse_address flag by
824 default in the TCPServer class.
826 - A new function, sys._getframe(), returns the stack frame pointer of
827 the caller. This is intended only as a building block for
828 higher-level mechanisms such as string interpolation.
830 - The pyexpat module supports a number of new handlers, which are
831 available only in expat 1.2. If invocation of a callback fails, it
832 will report an additional frame in the traceback. Parser objects
833 participate now in garbage collection. If expat reports an unknown
834 encoding, pyexpat will try to use a Python codec; that works only
835 for single-byte charsets. The parser type objects is exposed as
838 - xml.dom now offers standard definitions for symbolic node type and
839 exception code constants, and a hierarchy of DOM exceptions. minidom
840 was adjusted to use them.
842 - The conformance of xml.dom.minidom to the DOM specification was
843 improved. It detects a number of additional error cases; the
844 previous/next relationship works even when the tree is modified;
845 Node supports the normalize() method; NamedNodeMap, DocumentType and
846 DOMImplementation classes were added; Element supports the
847 hasAttribute and hasAttributeNS methods; and Text supports the splitText
852 - For Unix (and Unix-compatible) builds, configuration and building of
853 extension modules is now greatly automated. Rather than having to
854 edit the Modules/Setup file to indicate which modules should be
855 built and where their include files and libraries are, a
856 distutils-based setup.py script now takes care of building most
857 extension modules. All extension modules built this way are built
858 as shared libraries. Only a few modules that must be linked
859 statically are still listed in the Setup file; you won't need to
860 edit their configuration.
862 - Python should now build out of the box on Cygwin. If it doesn't,
863 mail to Jason Tishler (jlt63 at users.sourceforge.net).
865 - Python now always uses its own (renamed) implementation of getopt()
866 -- there's too much variation among C library getopt()
869 - C++ compilers are better supported; the CXX macro is always set to a
870 C++ compiler if one is found.
874 - select module: By default under Windows, a select() call
875 can specify no more than 64 sockets. Python now boosts
876 this Microsoft default to 512. If you need even more than
877 that, see the MS docs (you'll need to #define FD_SETSIZE
878 and recompile Python from source).
880 - Support for Windows 3.1, DOS and OS/2 is gone. The Lib/dos-8x3
881 subdirectory is no more!
884 What's New in Python 2.0?
885 =========================
887 Below is a list of all relevant changes since release 1.6. Older
888 changes are in the file HISTORY. If you are making the jump directly
889 from Python 1.5.2 to 2.0, make sure to read the section for 1.6 in the
890 HISTORY file! Many important changes listed there.
892 Alternatively, a good overview of the changes between 1.5.2 and 2.0 is
893 the document "What's New in Python 2.0" by Kuchling and Moshe Zadka:
894 http://starship.python.net/crew/amk/python/writing/new-python/.
896 --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
898 ======================================================================
900 What's new in 2.0 (since release candidate 1)?
901 ==============================================
905 - The copy_reg module was modified to clarify its intended use: to
906 register pickle support for extension types, not for classes.
907 pickle() will raise a TypeError if it is passed a class.
909 - Fixed a bug in gettext's "normalize and expand" code that prevented
910 it from finding an existing .mo file.
912 - Restored support for HTTP/0.9 servers in httplib.
914 - The math module was changed to stop raising OverflowError in case of
915 underflow, and return 0 instead in underflow cases. Whether Python
916 used to raise OverflowError in case of underflow was platform-
917 dependent (it did when the platform math library set errno to ERANGE
920 - Fixed a bug in StringIO that occurred when the file position was not
921 at the end of the file and write() was called with enough data to
922 extend past the end of the file.
924 - Fixed a bug that caused Tkinter error messages to get lost on
925 Windows. The bug was fixed by replacing direct use of
926 interp->result with Tcl_GetStringResult(interp).
928 - Fixed bug in urllib2 that caused it to fail when it received an HTTP
931 - Several changes were made to distutils: Some debugging code was
932 removed from util. Fixed the installer used when an external zip
933 program (like WinZip) is not found; the source code for this
934 installer is in Misc/distutils. check_lib() was modified to behave
935 more like AC_CHECK_LIB by add other_libraries() as a parameter. The
936 test for whether installed modules are on sys.path was changed to
937 use both normcase() and normpath().
939 - Several minor bugs were fixed in the xml package (the minidom,
940 pulldom, expatreader, and saxutils modules).
942 - The regression test driver (regrtest.py) behavior when invoked with
943 -l changed: It now reports a count of objects that are recognized as
944 garbage but not freed by the garbage collector.
946 - The regression test for the math module was changed to test
947 exceptional behavior when the test is run in verbose mode. Python
948 cannot yet guarantee consistent exception behavior across platforms,
949 so the exception part of test_math is run only in verbose mode, and
950 may fail on your platform.
954 - PyOS_CheckStack() has been disabled on Win64, where it caused
959 - Changed compiler flags, so that gcc is always invoked with -Wall and
960 -Wstrict-prototypes. Users compiling Python with GCC should see
961 exactly one warning, except if they have passed configure the
962 --with-pydebug flag. The expected warning is for getopt() in
963 Modules/main.c. This warning will be fixed for Python 2.1.
965 - Fixed configure to add -threads argument during linking on OSF1.
967 Tools and other miscellany
969 - The compiler in Tools/compiler was updated to support the new
970 language features introduced in 2.0: extended print statement, list
971 comprehensions, and augmented assignments. The new compiler should
972 also be backwards compatible with Python 1.5.2; the compiler will
973 always generate code for the version of the interpreter it runs
976 What's new in 2.0 release candidate 1 (since beta 2)?
977 =====================================================
979 What is release candidate 1?
981 We believe that release candidate 1 will fix all known bugs that we
982 intend to fix for the 2.0 final release. This release should be a bit
983 more stable than the previous betas. We would like to see even more
984 widespread testing before the final release, so we are producing this
985 release candidate. The final release will be exactly the same unless
986 any show-stopping (or brown bag) bugs are found by testers of the
989 All the changes since the last beta release are bug fixes or changes
990 to support building Python for specific platforms.
992 Core language, builtins, and interpreter
994 - A bug that caused crashes when __coerce__ was used with augmented
995 assignment, e.g. +=, was fixed.
997 - Raise ZeroDivisionError when raising zero to a negative number,
998 e.g. 0.0 ** -2.0. Note that math.pow is unrelated to the builtin
999 power operator and the result of math.pow(0.0, -2.0) will vary by
1000 platform. On Linux, it raises a ValueError.
1002 - A bug in Unicode string interpolation was fixed that occasionally
1003 caused errors with formats including "%%". For example, the
1004 following expression "%% %s" % u"abc" no longer raises a TypeError.
1006 - Compilation of deeply nested expressions raises MemoryError instead
1007 of SyntaxError, e.g. eval("[" * 50 + "]" * 50).
1009 - In 2.0b2 on Windows, the interpreter wrote .pyc files in text mode,
1010 rendering them useless. They are now written in binary mode again.
1014 - Keyword arguments are now accepted for most pattern and match object
1015 methods in SRE, the standard regular expression engine.
1017 - In SRE, fixed error with negative lookahead and lookbehind that
1018 manifested itself as a runtime error in patterns like "(?<!abc)(def)".
1020 - Several bugs in the Unicode handling and error handling in _tkinter
1023 - Fix memory management errors in Merge() and Tkapp_Call() routines.
1025 - Several changes were made to cStringIO to make it compatible with
1026 the file-like object interface and with StringIO. If operations are
1027 performed on a closed object, an exception is raised. The truncate
1028 method now accepts a position argument and readline accepts a size
1031 - There were many changes made to the linuxaudiodev module and its
1032 test suite; as a result, a short, unexpected audio sample should now
1033 play when the regression test is run.
1035 Note that this module is named poorly, because it should work
1036 correctly on any platform that supports the Open Sound System
1039 The module now raises exceptions when errors occur instead of
1040 crashing. It also defines the AFMT_A_LAW format (logarithmic A-law
1041 audio) and defines a getptr() method that calls the
1042 SNDCTL_DSP_GETxPTR ioctl defined in the OSS Programmer's Guide.
1044 - The library_version attribute, introduced in an earlier beta, was
1045 removed because it can not be supported with early versions of the C
1046 readline library, which provides no way to determine the version at
1049 - The binascii module is now enabled on Win64.
1051 - tokenize.py no longer suffers "recursion depth" errors when parsing
1052 programs with very long string literals.
1056 - Fixed several buffer overflow vulnerabilities in calculate_path(),
1057 which is called when the interpreter starts up to determine where
1058 the standard library is installed. These vulnerabilities affect all
1059 previous versions of Python and can be exploited by setting very
1060 long values for PYTHONHOME or argv[0]. The risk is greatest for a
1061 setuid Python script, although use of the wrapper in
1062 Misc/setuid-prog.c will eliminate the vulnerability.
1064 - Fixed garbage collection bugs in instance creation that were
1065 triggered when errors occurred during initialization. The solution,
1066 applied in cPickle and in PyInstance_New(), is to call
1067 PyObject_GC_Init() after the initialization of the object's
1068 container attributes is complete.
1070 - pyexpat adds definitions of PyModule_AddStringConstant and
1071 PyModule_AddObject if the Python version is less than 2.0, which
1072 provides compatibility with PyXML on Python 1.5.2.
1074 - If the platform has a bogus definition for LONG_BIT (the number of
1075 bits in a long), an error will be reported at compile time.
1077 - Fix bugs in _PyTuple_Resize() which caused hard-to-interpret garbage
1078 collection crashes and possibly other, unreported crashes.
1080 - Fixed a memory leak in _PyUnicode_Fini().
1084 - configure now accepts a --with-suffix option that specifies the
1085 executable suffix. This is useful for builds on Cygwin and Mac OS
1088 - The mmap.PAGESIZE constant is now initialized using sysconf when
1089 possible, which eliminates a dependency on -lucb for Reliant UNIX.
1091 - The md5 file should now compile on all platforms.
1093 - The select module now compiles on platforms that do not define
1094 POLLRDNORM and related constants.
1096 - Darwin (Mac OS X): Initial support for static builds on this
1099 - BeOS: A number of changes were made to the build and installation
1100 process. ar-fake now operates on a directory of object files.
1101 dl_export.h is gone, and its macros now appear on the mwcc command
1102 line during build on PPC BeOS.
1104 - Platform directory in lib/python2.0 is "plat-beos5" (or
1105 "plat-beos4", if building on BeOS 4.5), rather than "plat-beos".
1107 - Cygwin: Support for shared libraries, Tkinter, and sockets.
1109 - SunOS 4.1.4_JL: Fix test for directory existence in configure.
1111 Tools and other miscellany
1113 - Removed debugging prints from main used with freeze.
1115 - IDLE auto-indent no longer crashes when it encounters Unicode
1118 What's new in 2.0 beta 2 (since beta 1)?
1119 ========================================
1121 Core language, builtins, and interpreter
1123 - Add support for unbounded ints in %d,i,u,x,X,o formats; for example
1124 "%d" % 2L**64 == "18446744073709551616".
1126 - Add -h and -V command line options to print the usage message and
1127 Python version number and exit immediately.
1129 - eval() and exec accept Unicode objects as code parameters.
1131 - getattr() and setattr() now also accept Unicode objects for the
1132 attribute name, which are converted to strings using the default
1133 encoding before lookup.
1135 - Multiplication on string and Unicode now does proper bounds
1136 checking; e.g. 'a' * 65536 * 65536 will raise ValueError, "repeated
1137 string is too long."
1139 - Better error message when continue is found in try statement in a
1143 Standard library and extensions
1145 - socket module: the OpenSSL code now adds support for RAND_status()
1146 and EGD (Entropy Gathering Device).
1148 - array: reverse() method of array now works. buffer_info() now does
1149 argument checking; it still takes no arguments.
1151 - asyncore/asynchat: Included most recent version from Sam Rushing.
1153 - cgi: Accept '&' or ';' as separator characters when parsing form data.
1155 - CGIHTTPServer: Now works on Windows (and perhaps even Mac).
1157 - ConfigParser: When reading the file, options spelled in upper case
1158 letters are now correctly converted to lowercase.
1160 - copy: Copy Unicode objects atomically.
1162 - cPickle: Fail gracefully when copy_reg can't be imported.
1164 - cStringIO: Implemented readlines() method.
1166 - dbm: Add get() and setdefault() methods to dbm object. Add constant
1167 `library' to module that names the library used. Added doc strings
1168 and method names to error messages. Uses configure to determine
1169 which ndbm.h file to include; Berkeley DB's nbdm and GDBM's ndbm is
1170 now available options.
1172 - distutils: Update to version 0.9.3.
1174 - dl: Add several dl.RTLD_ constants.
1176 - fpectl: Now supported on FreeBSD.
1178 - gc: Add DEBUG_SAVEALL option. When enabled all garbage objects
1179 found by the collector will be saved in gc.garbage. This is useful
1180 for debugging a program that creates reference cycles.
1182 - httplib: Three changes: Restore support for set_debuglevel feature
1183 of HTTP class. Do not close socket on zero-length response. Do not
1184 crash when server sends invalid content-length header.
1186 - mailbox: Mailbox class conforms better to qmail specifications.
1188 - marshal: When reading a short, sign-extend on platforms where shorts
1189 are bigger than 16 bits. When reading a long, repair the unportable
1190 sign extension that was being done for 64-bit machines. (It assumed
1191 that signed right shift sign-extends.)
1193 - operator: Add contains(), invert(), __invert__() as aliases for
1194 __contains__(), inv(), and __inv__() respectively.
1196 - os: Add support for popen2() and popen3() on all platforms where
1197 fork() exists. (popen4() is still in the works.)
1199 - os: (Windows only:) Add startfile() function that acts like double-
1200 clicking on a file in Explorer (or passing the file name to the
1201 DOS "start" command).
1203 - os.path: (Windows, DOS:) Treat trailing colon correctly in
1204 os.path.join. os.path.join("a:", "b") yields "a:b".
1206 - pickle: Now raises ValueError when an invalid pickle that contains
1207 a non-string repr where a string repr was expected. This behavior
1210 - posixfile: Remove broken __del__() method.
1212 - py_compile: support CR+LF line terminators in source file.
1214 - readline: Does not immediately exit when ^C is hit when readline and
1215 threads are configured. Adds definition of rl_library_version. (The
1216 latter addition requires GNU readline 2.2 or later.)
1218 - rfc822: Domain literals returned by AddrlistClass method
1219 getdomainliteral() are now properly wrapped in brackets.
1221 - site: sys.setdefaultencoding() should only be called in case the
1222 standard default encoding ("ascii") is changed. This saves quite a
1223 few cycles during startup since the first call to
1224 setdefaultencoding() will initialize the codec registry and the
1227 - socket: Support for size hint in readlines() method of object returned
1230 - sre: Added experimental expand() method to match objects. Does not
1231 use buffer interface on Unicode strings. Does not hang if group id
1232 is followed by whitespace.
1234 - StringIO: Size hint in readlines() is now supported as documented.
1236 - struct: Check ranges for bytes and shorts.
1238 - urllib: Improved handling of win32 proxy settings. Fixed quote and
1239 quote_plus functions so that the always encode a comma.
1241 - Tkinter: Image objects are now guaranteed to have unique ids. Set
1242 event.delta to zero if Tk version doesn't support mousewheel.
1243 Removed some debugging prints.
1245 - UserList: now implements __contains__().
1247 - webbrowser: On Windows, use os.startfile() instead of os.popen(),
1248 which works around a bug in Norton AntiVirus 2000 that leads directly
1249 to a Blue Screen freeze.
1251 - xml: New version detection code allows PyXML to override standard
1252 XML package if PyXML version is greater than 0.6.1.
1254 - xml.dom: DOM level 1 support for basic XML. Includes xml.dom.minidom
1255 (conventional DOM), and xml.dom.pulldom, which allows building the DOM
1256 tree only for nodes which are sufficiently interesting to a specific
1257 application. Does not provide the HTML-specific extensions. Still
1260 - xml.sax: SAX 2 support for Python, including all the handler
1261 interfaces needed to process XML 1.0 compliant XML. Some
1262 documentation is already available.
1264 - pyexpat: Renamed to xml.parsers.expat since this is part of the new,
1265 packagized XML support.
1270 - Add three new convenience functions for module initialization --
1271 PyModule_AddObject(), PyModule_AddIntConstant(), and
1272 PyModule_AddStringConstant().
1274 - Cleaned up definition of NULL in C source code; all definitions were
1275 removed and add #error to Python.h if NULL isn't defined after
1276 #include of stdio.h.
1278 - Py_PROTO() macros that were removed in 2.0b1 have been restored for
1279 backwards compatibility (at the source level) with old extensions.
1281 - A wrapper API was added for signal() and sigaction(). Instead of
1282 either function, always use PyOS_getsig() to get a signal handler
1283 and PyOS_setsig() to set one. A new convenience typedef
1284 PyOS_sighandler_t is defined for the type of signal handlers.
1286 - Add PyString_AsStringAndSize() function that provides access to the
1287 internal data buffer and size of a string object -- or the default
1288 encoded version of a Unicode object.
1290 - PyString_Size() and PyString_AsString() accept Unicode objects.
1292 - The standard header <limits.h> is now included by Python.h (if it
1293 exists). INT_MAX and LONG_MAX will always be defined, even if
1294 <limits.h> is not available.
1296 - PyFloat_FromString takes a second argument, pend, that was
1297 effectively useless. It is now officially useless but preserved for
1298 backwards compatibility. If the pend argument is not NULL, *pend is
1301 - PyObject_GetAttr() and PyObject_SetAttr() now accept Unicode objects
1302 for the attribute name. See note on getattr() above.
1304 - A few bug fixes to argument processing for Unicode.
1305 PyArg_ParseTupleAndKeywords() now accepts "es#" and "es".
1306 PyArg_Parse() special cases "s#" for Unicode objects; it returns a
1307 pointer to the default encoded string data instead of to the raw
1310 - Py_BuildValue accepts B format (for bgen-generated code).
1315 - On Unix, fix code for finding Python installation directory so that
1316 it works when argv[0] is a relative path.
1318 - Added a true unicode_internal_encode() function and fixed the
1319 unicode_internal_decode function() to support Unicode objects directly
1320 rather than by generating a copy of the object.
1322 - Several of the internal Unicode tables are much smaller now, and
1323 the source code should be much friendlier to weaker compilers.
1325 - In the garbage collector: Fixed bug in collection of tuples. Fixed
1326 bug that caused some instances to be removed from the container set
1327 while they were still live. Fixed parsing in gc.set_debug() for
1328 platforms where sizeof(long) > sizeof(int).
1330 - Fixed refcount problem in instance deallocation that only occurred
1331 when Py_REF_DEBUG was defined and Py_TRACE_REFS was not.
1333 - On Windows, getpythonregpath is now protected against null data in
1336 - On Unix, create .pyc/.pyo files with O_EXCL flag to avoid a race
1340 Build and platform-specific issues
1342 - Better support of GNU Pth via --with-pth configure option.
1344 - Python/C API now properly exposed to dynamically-loaded extension
1345 modules on Reliant UNIX.
1347 - Changes for the benefit of SunOS 4.1.4 (really!). mmapmodule.c:
1348 Don't define MS_SYNC to be zero when it is undefined. Added missing
1349 prototypes in posixmodule.c.
1351 - Improved support for HP-UX build. Threads should now be correctly
1352 configured (on HP-UX 10.20 and 11.00).
1354 - Fix largefile support on older NetBSD systems and OpenBSD by adding
1358 Tools and other miscellany
1360 - ftpmirror: Call to main() is wrapped in if __name__ == "__main__".
1362 - freeze: The modulefinder now works with 2.0 opcodes.
1365 Move hackery of sys.argv until after the Tk instance has been
1366 created, which allows the application-specific Tkinter
1367 initialization to be executed if present; also pass an explicit
1368 className parameter to the Tk() constructor.
1371 What's new in 2.0 beta 1?
1372 =========================
1374 Source Incompatibilities
1375 ------------------------
1377 None. Note that 1.6 introduced several incompatibilities with 1.5.2,
1378 such as single-argument append(), connect() and bind(), and changes to
1379 str(long) and repr(float).
1382 Binary Incompatibilities
1383 ------------------------
1385 - Third party extensions built for Python 1.5.x or 1.6 cannot be used
1386 with Python 2.0; these extensions will have to be rebuilt for Python
1389 - On Windows, attempting to import a third party extension built for
1390 Python 1.5.x or 1.6 results in an immediate crash; there's not much we
1391 can do about this. Check your PYTHONPATH environment variable!
1393 - Python bytecode files (*.pyc and *.pyo) are not compatible between
1397 Overview of Changes Since 1.6
1398 -----------------------------
1400 There are many new modules (including brand new XML support through
1401 the xml package, and i18n support through the gettext module); a list
1402 of all new modules is included below. Lots of bugs have been fixed.
1404 The process for making major new changes to the language has changed
1405 since Python 1.6. Enhancements must now be documented by a Python
1406 Enhancement Proposal (PEP) before they can be accepted.
1408 There are several important syntax enhancements, described in more
1411 - Augmented assignment, e.g. x += 1
1413 - List comprehensions, e.g. [x**2 for x in range(10)]
1415 - Extended import statement, e.g. import Module as Name
1417 - Extended print statement, e.g. print >> file, "Hello"
1419 Other important changes:
1421 - Optional collection of cyclical garbage
1423 Python Enhancement Proposal (PEP)
1424 ---------------------------------
1426 PEP stands for Python Enhancement Proposal. A PEP is a design
1427 document providing information to the Python community, or describing
1428 a new feature for Python. The PEP should provide a concise technical
1429 specification of the feature and a rationale for the feature.
1431 We intend PEPs to be the primary mechanisms for proposing new
1432 features, for collecting community input on an issue, and for
1433 documenting the design decisions that have gone into Python. The PEP
1434 author is responsible for building consensus within the community and
1435 documenting dissenting opinions.
1437 The PEPs are available at http://python.sourceforge.net/peps/.
1439 Augmented Assignment
1440 --------------------
1442 This must have been the most-requested feature of the past years!
1443 Eleven new assignment operators were added:
1445 += -= *= /= %= **= <<= >>= &= ^= |=
1455 except that A is evaluated only once (relevant when A is something
1456 like dict[index].attr).
1458 However, if A is a mutable object, A may be modified in place. Thus,
1459 if A is a number or a string, A += B has the same effect as A = A+B
1460 (except A is only evaluated once); but if a is a list, A += B has the
1461 same effect as A.extend(B)!
1463 Classes and built-in object types can override the new operators in
1464 order to implement the in-place behavior; the not-in-place behavior is
1465 used automatically as a fallback when an object doesn't implement the
1466 in-place behavior. For classes, the method name is derived from the
1467 method name for the corresponding not-in-place operator by inserting
1468 an 'i' in front of the name, e.g. __iadd__ implements in-place
1471 Augmented assignment was implemented by Thomas Wouters.
1477 This is a flexible new notation for lists whose elements are computed
1478 from another list (or lists). The simplest form is:
1480 [<expression> for <variable> in <sequence>]
1482 For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9].
1483 This is more efficient than a for loop with a list.append() call.
1485 You can also add a condition:
1487 [<expression> for <variable> in <sequence> if <condition>]
1489 For example, [w for w in words if w == w.lower()] would yield the list
1490 of words that contain no uppercase characters. This is more efficient
1491 than a for loop with an if statement and a list.append() call.
1493 You can also have nested for loops and more than one 'if' clause. For
1494 example, here's a function that flattens a sequence of sequences::
1497 return [x for subseq in seq for x in subseq]
1499 flatten([[0], [1,2,3], [4,5], [6,7,8,9], []])
1503 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
1505 List comprehensions originated as a patch set from Greg Ewing; Skip
1506 Montanaro and Thomas Wouters also contributed. Described by PEP 202.
1509 Extended Import Statement
1510 -------------------------
1512 Many people have asked for a way to import a module under a different
1513 name. This can be accomplished like this:
1519 but this common idiom gets old quickly. A simple extension of the
1520 import statement now allows this to be written as follows:
1524 There's also a variant for 'from ... import':
1526 from foo import bar as spam
1528 This also works with packages; e.g. you can write this:
1530 import test.regrtest as regrtest
1532 Note that 'as' is not a new keyword -- it is recognized only in this
1533 context (this is only possible because the syntax for the import
1534 statement doesn't involve expressions).
1536 Implemented by Thomas Wouters. Described by PEP 221.
1539 Extended Print Statement
1540 ------------------------
1542 Easily the most controversial new feature, this extension to the print
1543 statement adds an option to make the output go to a different file
1544 than the default sys.stdout.
1546 For example, to write an error message to sys.stderr, you can now
1549 print >> sys.stderr, "Error: bad dog!"
1551 As a special feature, if the expression used to indicate the file
1552 evaluates to None, the current value of sys.stdout is used. Thus:
1554 print >> None, "Hello world"
1560 Design and implementation by Barry Warsaw. Described by PEP 214.
1563 Optional Collection of Cyclical Garbage
1564 ---------------------------------------
1566 Python is now equipped with a garbage collector that can hunt down
1567 cyclical references between Python objects. It's no replacement for
1568 reference counting; in fact, it depends on the reference counts being
1569 correct, and decides that a set of objects belong to a cycle if all
1570 their reference counts can be accounted for from their references to
1571 each other. This devious scheme was first proposed by Eric Tiedemann,
1572 and brought to implementation by Neil Schemenauer.
1574 There's a module "gc" that lets you control some parameters of the
1575 garbage collection. There's also an option to the configure script
1576 that lets you enable or disable the garbage collection. In 2.0b1,
1577 it's on by default, so that we (hopefully) can collect decent user
1578 experience with this new feature. There are some questions about its
1579 performance. If it proves to be too much of a problem, we'll turn it
1580 off by default in the final 2.0 release.
1586 A new function zip() was added. zip(seq1, seq2, ...) is equivalent to
1587 map(None, seq1, seq2, ...) when the sequences have the same length;
1588 i.e. zip([1,2,3], [10,20,30]) returns [(1,10), (2,20), (3,30)]. When
1589 the lists are not all the same length, the shortest list wins:
1590 zip([1,2,3], [10,20]) returns [(1,10), (2,20)]. See PEP 201.
1592 sys.version_info is a tuple (major, minor, micro, level, serial).
1594 Dictionaries have an odd new method, setdefault(key, default).
1595 dict.setdefault(key, default) returns dict[key] if it exists; if not,
1596 it sets dict[key] to default and returns that value. Thus:
1598 dict.setdefault(key, []).append(item)
1600 does the same work as this common idiom:
1602 if not dict.has_key(key):
1604 dict[key].append(item)
1606 There are two new variants of SyntaxError that are raised for
1607 indentation-related errors: IndentationError and TabError.
1609 Changed \x to consume exactly two hex digits; see PEP 223. Added \U
1610 escape that consumes exactly eight hex digits.
1612 The limits on the size of expressions and file in Python source code
1613 have been raised from 2**16 to 2**32. Previous versions of Python
1614 were limited because the maximum argument size the Python VM accepted
1615 was 2**16. This limited the size of object constructor expressions,
1616 e.g. [1,2,3] or {'a':1, 'b':2}, and the size of source files. This
1617 limit was raised thanks to a patch by Charles Waldman that effectively
1618 fixes the problem. It is now much more likely that you will be
1619 limited by available memory than by an arbitrary limit in Python.
1621 The interpreter's maximum recursion depth can be modified by Python
1622 programs using sys.getrecursionlimit and sys.setrecursionlimit. This
1623 limit is the maximum number of recursive calls that can be made by
1624 Python code. The limit exists to prevent infinite recursion from
1625 overflowing the C stack and causing a core dump. The default value is
1626 1000. The maximum safe value for a particular platform can be found
1627 by running Misc/find_recursionlimit.py.
1629 New Modules and Packages
1630 ------------------------
1632 atexit - for registering functions to be called when Python exits.
1634 imputil - Greg Stein's alternative API for writing custom import
1637 pyexpat - an interface to the Expat XML parser, contributed by Paul
1640 xml - a new package with XML support code organized (so far) in three
1641 subpackages: xml.dom, xml.sax, and xml.parsers. Describing these
1642 would fill a volume. There's a special feature whereby a
1643 user-installed package named _xmlplus overrides the standard
1644 xmlpackage; this is intended to give the XML SIG a hook to distribute
1645 backwards-compatible updates to the standard xml package.
1647 webbrowser - a platform-independent API to launch a web browser.
1653 array -- new methods for array objects: count, extend, index, pop, and
1656 binascii -- new functions b2a_hex and a2b_hex that convert between
1657 binary data and its hex representation
1659 calendar -- Many new functions that support features including control
1660 over which day of the week is the first day, returning strings instead
1661 of printing them. Also new symbolic constants for days of week,
1662 e.g. MONDAY, ..., SUNDAY.
1664 cgi -- FieldStorage objects have a getvalue method that works like a
1665 dictionary's get method and returns the value attribute of the object.
1667 ConfigParser -- The parser object has new methods has_option,
1668 remove_section, remove_option, set, and write. They allow the module
1669 to be used for writing config files as well as reading them.
1671 ftplib -- ntransfercmd(), transfercmd(), and retrbinary() all now
1672 optionally support the RFC 959 REST command.
1674 gzip -- readline and readlines now accept optional size arguments
1676 httplib -- New interfaces and support for HTTP/1.1 by Greg Stein. See
1677 the module doc strings for details.
1679 locale -- implement getdefaultlocale for Win32 and Macintosh
1681 marshal -- no longer dumps core when marshaling deeply nested or
1682 recursive data structures
1684 os -- new functions isatty, seteuid, setegid, setreuid, setregid
1686 os/popen2 -- popen2/popen3/popen4 support under Windows. popen2/popen3
1689 os/pty -- support for openpty and forkpty
1691 os.path -- fix semantics of os.path.commonprefix
1693 smtplib -- support for sending very long messages
1695 socket -- new function getfqdn()
1697 readline -- new functions to read, write and truncate history files.
1698 The readline section of the library reference manual contains an
1701 select -- add interface to poll system call
1703 shutil -- new copyfileobj function
1705 SimpleHTTPServer, CGIHTTPServer -- Fix problems with buffering in the
1708 Tkinter -- optimization of function flatten
1710 urllib -- scans environment variables for proxy configuration,
1713 whichdb -- recognizes dumbdbm format
1719 None. However note that 1.6 made a whole slew of modules obsolete:
1720 stdwin, soundex, cml, cmpcache, dircache, dump, find, grep, packmail,
1721 poly, zmod, strop, util, whatsound.
1724 Changed, New, Obsolete Tools
1725 ----------------------------
1733 Several cleanup jobs were carried out throughout the source code.
1735 All C code was converted to ANSI C; we got rid of all uses of the
1736 Py_PROTO() macro, which makes the header files a lot more readable.
1738 Most of the portability hacks were moved to a new header file,
1739 pyport.h; several other new header files were added and some old
1740 header files were removed, in an attempt to create a more rational set
1741 of header files. (Few of these ever need to be included explicitly;
1742 they are all included by Python.h.)
1744 Trent Mick ensured portability to 64-bit platforms, under both Linux
1745 and Win64, especially for the new Intel Itanium processor. Mick also
1746 added large file support for Linux64 and Win64.
1748 The C APIs to return an object's size have been update to consistently
1749 use the form PyXXX_Size, e.g. PySequence_Size and PyDict_Size. In
1750 previous versions, the abstract interfaces used PyXXX_Length and the
1751 concrete interfaces used PyXXX_Size. The old names,
1752 e.g. PyObject_Length, are still available for backwards compatibility
1753 at the API level, but are deprecated.
1755 The PyOS_CheckStack function has been implemented on Windows by
1756 Fredrik Lundh. It prevents Python from failing with a stack overflow
1759 The GC changes resulted in creation of two new slots on object,
1760 tp_traverse and tp_clear. The augmented assignment changes result in
1761 the creation of a new slot for each in-place operator.
1763 The GC API creates new requirements for container types implemented in
1764 C extension modules. See Include/objimpl.h for details.
1766 PyErr_Format has been updated to automatically calculate the size of
1767 the buffer needed to hold the formatted result string. This change
1768 prevents crashes caused by programmer error.
1770 New C API calls: PyObject_AsFileDescriptor, PyErr_WriteUnraisable.
1772 PyRun_AnyFileEx, PyRun_SimpleFileEx, PyRun_FileEx -- New functions
1773 that are the same as their non-Ex counterparts except they take an
1774 extra flag argument that tells them to close the file when done.
1776 XXX There were other API changes that should be fleshed out here.
1782 New popen2/popen3/peopen4 in os module (see Changed Modules above).
1784 os.popen is much more usable on Windows 95 and 98. See Microsoft
1785 Knowledge Base article Q150956. The Win9x workaround described there
1786 is implemented by the new w9xpopen.exe helper in the root of your
1787 Python installation. Note that Python uses this internally; it is not
1788 a standalone program.
1790 Administrator privileges are no longer required to install Python
1791 on Windows NT or Windows 2000. If you have administrator privileges,
1792 Python's registry info will be written under HKEY_LOCAL_MACHINE.
1793 Otherwise the installer backs off to writing Python's registry info
1794 under HKEY_CURRENT_USER. The latter is sufficient for all "normal"
1795 uses of Python, but will prevent some advanced uses from working
1796 (for example, running a Python script as an NT service, or possibly
1799 [This was new in 1.6] The installer no longer runs a separate Tcl/Tk
1800 installer; instead, it installs the needed Tcl/Tk files directly in the
1801 Python directory. If you already have a Tcl/Tk installation, this
1802 wastes some disk space (about 4 Megs) but avoids problems with
1803 conflicting Tcl/Tk installations, and makes it much easier for Python
1804 to ensure that Tcl/Tk can find all its files.
1806 [This was new in 1.6] The Windows installer now installs by default in
1807 \Python20\ on the default volume, instead of \Program Files\Python-2.0\.
1810 Updates to the changes between 1.5.2 and 1.6
1811 --------------------------------------------
1813 The 1.6 NEWS file can't be changed after the release is done, so here
1814 is some late-breaking news:
1816 New APIs in locale.py: normalize(), getdefaultlocale(), resetlocale(),
1817 and changes to getlocale() and setlocale().
1819 The new module is now enabled per default.
1821 It is not true that the encodings codecs cannot be used for normal
1822 strings: the string.encode() (which is also present on 8-bit strings
1823 !) allows using them for 8-bit strings too, e.g. to convert files from
1824 cp1252 (Windows) to latin-1 or vice-versa.
1826 Japanese codecs are available from Tamito KAJIYAMA:
1827 http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/
1830 ======================================================================
1833 =======================================
1834 ==> Release 1.6 (September 5, 2000) <==
1835 =======================================
1837 What's new in release 1.6?
1838 ==========================
1840 Below is a list of all relevant changes since release 1.5.2.
1843 Source Incompatibilities
1844 ------------------------
1846 Several small incompatible library changes may trip you up:
1848 - The append() method for lists can no longer be invoked with more
1849 than one argument. This used to append a single tuple made out of
1850 all arguments, but was undocumented. To append a tuple, use
1851 e.g. l.append((a, b, c)).
1853 - The connect(), connect_ex() and bind() methods for sockets require
1854 exactly one argument. Previously, you could call s.connect(host,
1855 port), but this was undocumented. You must now write
1856 s.connect((host, port)).
1858 - The str() and repr() functions are now different more often. For
1859 long integers, str() no longer appends a 'L'. Thus, str(1L) == '1',
1860 which used to be '1L'; repr(1L) is unchanged and still returns '1L'.
1861 For floats, repr() now gives 17 digits of precision, to ensure no
1862 precision is lost (on all current hardware).
1864 - The -X option is gone. Built-in exceptions are now always
1865 classes. Many more library modules also have been converted to
1866 class-based exceptions.
1869 Binary Incompatibilities
1870 ------------------------
1872 - Third party extensions built for Python 1.5.x cannot be used with
1873 Python 1.6; these extensions will have to be rebuilt for Python 1.6.
1875 - On Windows, attempting to import a third party extension built for
1876 Python 1.5.x results in an immediate crash; there's not much we can do
1877 about this. Check your PYTHONPATH environment variable!
1880 Overview of Changes since 1.5.2
1881 -------------------------------
1883 For this overview, I have borrowed from the document "What's New in
1884 Python 2.0" by Andrew Kuchling and Moshe Zadka:
1885 http://starship.python.net/crew/amk/python/writing/new-python/.
1887 There are lots of new modules and lots of bugs have been fixed. A
1888 list of all new modules is included below.
1890 Probably the most pervasive change is the addition of Unicode support.
1891 We've added a new fundamental datatype, the Unicode string, a new
1892 build-in function unicode(), an numerous C APIs to deal with Unicode
1893 and encodings. See the file Misc/unicode.txt for details, or
1894 http://starship.python.net/crew/lemburg/unicode-proposal.txt.
1896 Two other big changes, related to the Unicode support, are the
1897 addition of string methods and (yet another) new regular expression
1900 - String methods mean that you can now say s.lower() etc. instead of
1901 importing the string module and saying string.lower(s) etc. One
1902 peculiarity is that the equivalent of string.join(sequence,
1903 delimiter) is delimiter.join(sequence). Use " ".join(sequence) for
1904 the effect of string.join(sequence); to make this more readable, try
1905 space=" " first. Note that the maxsplit argument defaults in
1906 split() and replace() have changed from 0 to -1.
1908 - The new regular expression engine, SRE by Fredrik Lundh, is fully
1909 backwards compatible with the old engine, and is in fact invoked
1910 using the same interface (the "re" module). You can explicitly
1911 invoke the old engine by import pre, or the SRE engine by importing
1912 sre. SRE is faster than pre, and supports Unicode (which was the
1913 main reason to put effort in yet another new regular expression
1914 engine -- this is at least the fourth!).
1920 Other changes that won't break code but are nice to know about:
1922 Deleting objects is now safe even for deeply nested data structures.
1924 Long/int unifications: long integers can be used in seek() calls, as
1927 String formatting (s % args) has a new formatting option, '%r', which
1928 acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in
1931 Greg Ward's "distutils" package is included: this will make
1932 installing, building and distributing third party packages much
1935 There's now special syntax that you can use instead of the apply()
1936 function. f(*args, **kwds) is equivalent to apply(f, args, kwds).
1937 You can also use variations f(a1, a2, *args, **kwds) and you can leave
1938 one or the other out: f(*args), f(**kwds).
1940 The built-ins int() and long() take an optional second argument to
1941 indicate the conversion base -- of course only if the first argument
1942 is a string. This makes string.atoi() and string.atol() obsolete.
1943 (string.atof() was already obsolete).
1945 When a local variable is known to the compiler but undefined when
1946 used, a new exception UnboundLocalError is raised. This is a class
1947 derived from NameError so code catching NameError should still work.
1948 The purpose is to provide better diagnostics in the following example:
1953 This used to raise a NameError on the print statement, which confused
1954 even experienced Python programmers (especially if there are several
1955 hundreds of lines of code between the reference and the assignment to
1958 You can now override the 'in' operator by defining a __contains__
1959 method. Note that it has its arguments backwards: x in a causes
1960 a.__contains__(x) to be called. That's why the name isn't __in__.
1962 The exception AttributeError will have a more friendly error message,
1963 e.g.: <code>'Spam' instance has no attribute 'eggs'</code>. This may
1964 <b>break code</b> that expects the message to be exactly the attribute
1971 UserString - base class for deriving from the string type.
1973 distutils - tools for distributing Python modules.
1975 robotparser - parse a robots.txt file, for writing web spiders.
1976 (Moved from Tools/webchecker/.)
1978 linuxaudiodev - audio for Linux.
1980 mmap - treat a file as a memory buffer. (Windows and Unix.)
1982 sre - regular expressions (fast, supports unicode). Currently, this
1983 code is very rough. Eventually, the re module will be reimplemented
1984 using sre (without changes to the re API).
1986 filecmp - supersedes the old cmp.py and dircmp.py modules.
1988 tabnanny - check Python sources for tab-width dependance. (Moved from
1991 urllib2 - new and improved but incompatible version of urllib (still
1994 zipfile - read and write zip archives.
1996 codecs - support for Unicode encoders/decoders.
1998 unicodedata - provides access to the Unicode 3.0 database.
2000 _winreg - Windows registry access.
2002 encodings - package which provides a large set of standard codecs --
2003 currently only for the new Unicode support. It has a drop-in extension
2004 mechanism which allows you to add new codecs by simply copying them
2005 into the encodings package directory. Asian codec support will
2006 probably be made available as separate distribution package built upon
2007 this technique and the new distutils package.
2013 readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc,
2014 chunk, wave, random, shelve, nntplib - minor enhancements.
2016 socket, httplib, urllib - optional OpenSSL support (Unix only).
2018 _tkinter - support for 8.0 up to 8.3. Support for versions older than
2019 8.0 has been dropped.
2021 string - most of this module is deprecated now that strings have
2022 methods. This no longer uses the built-in strop module, but takes
2023 advantage of the new string methods to provide transparent support for
2024 both Unicode and ordinary strings.
2030 The installer no longer runs a separate Tcl/Tk installer; instead, it
2031 installs the needed Tcl/Tk files directly in the Python directory. If
2032 you already have a Tcl/Tk installation, this wastes some disk space
2033 (about 4 Megs) but avoids problems with conflincting Tcl/Tk
2034 installations, and makes it much easier for Python to ensure that
2035 Tcl/Tk can find all its files. Note: the alpha installers don't
2036 include the documentation.
2038 The Windows installer now installs by default in \Python16\ on the
2039 default volume, instead of \Program Files\Python-1.6\.
2045 IDLE - complete overhaul. See the <a href="../idle/">IDLE home
2046 page</a> for more information. (Python 1.6 alpha 1 will come with
2049 Tools/i18n/pygettext.py - Python equivalent of xgettext(1). A message
2050 text extraction tool used for internationalizing applications written
2057 stdwin and everything that uses it. (Get Python 1.5.2 if you need
2060 soundex. (Skip Montanaro has a version in Python but it won't be
2061 included in the Python release.)
2063 cmp, cmpcache, dircmp. (Replaced by filecmp.)
2067 find. (Easily coded using os.walk().)
2069 grep. (Not very useful as a library module.)
2071 packmail. (No longer has any use.)
2073 poly, zmod. (These were poor examples at best.)
2075 strop. (No longer needed by the string module.)
2077 util. (This functionality was long ago built in elsewhere).
2079 whatsound. (Use sndhdr.)
2082 Detailed Changes from 1.6b1 to 1.6
2083 ----------------------------------
2085 - Slight changes to the CNRI license. A copyright notice has been
2086 added; the requirement to indicate the nature of modifications now
2087 applies when making a derivative work available "to others" instead of
2088 just "to the public"; the version and date are updated. The new
2089 license has a new handle.
2091 - Added the Tools/compiler package. This is a project led by Jeremy
2092 Hylton to write the Python bytecode generator in Python.
2094 - The function math.rint() is removed.
2096 - In Python.h, "#define _GNU_SOURCE 1" was added.
2098 - Version 0.9.1 of Greg Ward's distutils is included (instead of
2101 - A new version of SRE is included. It is more stable, and more
2102 compatible with the old RE module. Non-matching ranges are indicated
2103 by -1, not None. (The documentation said None, but the PRE
2104 implementation used -1; changing to None would break existing code.)
2106 - The winreg module has been renamed to _winreg. (There are plans for
2107 a higher-level API called winreg, but this has not yet materialized in
2108 a form that is acceptable to the experts.)
2110 - The _locale module is enabled by default.
2112 - Fixed the configuration line for the _curses module.
2114 - A few crashes have been fixed, notably <file>.writelines() with a
2115 list containing non-string objects would crash, and there were
2116 situations where a lost SyntaxError could dump core.
2118 - The <list>.extend() method now accepts an arbitrary sequence
2121 - If __str__() or __repr__() returns a Unicode object, this is
2122 converted to an 8-bit string.
2124 - Unicode string comparisons is no longer aware of UTF-16
2125 encoding peculiarities; it's a straight 16-bit compare.
2127 - The Windows installer now installs the LICENSE file and no longer
2128 registers the Python DLL version in the registry (this is no longer
2129 needed). It now uses Tcl/Tk 8.3.2.
2131 - A few portability problems have been fixed, in particular a
2132 compilation error involving socklen_t.
2134 - The PC configuration is slightly friendlier to non-Microsoft
2138 ======================================================================
2141 ======================================
2142 ==> Release 1.5.2 (April 13, 1999) <==
2143 ======================================
2145 From 1.5.2c1 to 1.5.2 (final)
2146 =============================
2148 Tue Apr 13 15:44:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2150 * PCbuild/python15.wse: Bump version to 1.5.2 (final)
2152 * PCbuild/python15.dsp: Added shamodule.c
2154 * PC/config.c: Added sha module!
2156 * README, Include/patchlevel.h: Prepare for final release.
2159 More (Cameron Laird is honorary; the others are 1.5.2c1 testers).
2161 * Python/thread_solaris.h:
2162 While I can't really test this thoroughly, Pat Knight and the Solaris
2163 man pages suggest that the proper thing to do is to add THR_NEW_LWP to
2164 the flags on thr_create(), and that there really isn't a downside, so
2168 Bunch of new names who helped iron out the last wrinkles of 1.5.2.
2171 Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3.
2172 (I can't even display this on NT, maybe Win/98 can?)
2175 Fix mysterious references to jprofile that were in the source since
2176 its creation. I'm assuming these were once valid references to "Jim
2177 Roskind's profile"...
2179 * Lib/Attic/threading_api.py:
2180 Removed; since long subsumed in Doc/lib/libthreading.tex
2182 * Modules/socketmodule.c:
2183 Put back __osf__ support for gethostbyname_r(); the real bug was that
2184 it was being used even without threads. This of course might be an
2185 all-platform problem so now we only use the _r variant when we are
2188 Mon Apr 12 22:51:20 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2190 * Modules/cPickle.c:
2191 Fix accidentally reversed NULL test in load_mark(). Suggested by
2192 Tamito Kajiyama. (This caused a bug only on platforms where malloc(0)
2196 Add note about popen2 problem on Linux noticed by Pablo Bleyer.
2198 * README: Add note about -D_REENTRANT for HP-UX 10.20.
2200 * Modules/Makefile.pre.in: 'clean' target should remove hassignal.
2202 * PC/Attic/vc40.mak, PC/readme.txt:
2203 Remove all VC++ info (except VC 1.5) from readme.txt;
2204 remove the VC++ 4.0 project file; remove the unused _tkinter extern defs.
2206 * README: Clarify PC build instructions (point to PCbuild).
2208 * Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port).
2210 * Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py:
2211 Forgot to add this file. CDROM device parameters.
2213 * Lib/gzip.py: Two different changes.
2215 1. Jack Jansen reports that on the Mac, the time may be negative, and
2216 solves this by adding a write32u() function that writes an unsigned
2219 2. On 64-bit platforms the CRC comparison fails; I've fixed this by
2220 casting both values to be compared to "unsigned long" i.e. modulo
2223 Sat Apr 10 18:42:02 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2225 * PC/Attic/_tkinter.def: No longer needed.
2227 * Misc/ACKS: Correct missed character in Andrew Dalke's name.
2229 * README: Add DEC Ultrix notes (from Donn Cave's email).
2231 * configure: The usual
2234 Quote a bunch of shell variables used in test, related to long-long.
2236 * Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c:
2237 casts for picky compilers.
2239 * Modules/socketmodule.c:
2240 3-arg gethostbyname_r doesn't really work on OSF/1.
2242 * PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py:
2243 Avoid totally empty files.
2245 Fri Apr 9 14:56:35 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2247 * Tools/scripts/fixps.py: Use re instead of regex.
2248 Don't rewrite the file in place.
2249 (Reported by Andy Dustman.)
2251 * Lib/netrc.py, Lib/shlex.py: Get rid of #! line
2253 Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2255 * PCbuild/python15.wse: Use the Tcl 8.0.5 installer.
2256 Add a variable %_TCL_% that makes it easier to switch to a different version.
2259 ======================================================================
2262 From 1.5.2b2 to 1.5.2c1
2263 =======================
2265 Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2267 * PCbuild/python15.wse:
2268 Release 1.5.2c1. Add IDLE and Uninstall to program group.
2269 Don't distribute zlib.dll. Tweak some comments.
2271 * PCbuild/zlib.dsp: Now using static zlib 1.1.3
2273 * Lib/dos-8x3/userdict.py, Lib/dos-8x3/userlist.py, Lib/dos-8x3/test_zli.py, Lib/dos-8x3/test_use.py, Lib/dos-8x3/test_pop.py, Lib/dos-8x3/test_pic.py, Lib/dos-8x3/test_ntp.py, Lib/dos-8x3/test_gzi.py, Lib/dos-8x3/test_fcn.py, Lib/dos-8x3/test_cpi.py, Lib/dos-8x3/test_bsd.py, Lib/dos-8x3/posixfil.py, Lib/dos-8x3/mimetype.py, Lib/dos-8x3/nturl2pa.py, Lib/dos-8x3/compilea.py, Lib/dos-8x3/exceptio.py, Lib/dos-8x3/basehttp.py:
2276 * Include/patchlevel.h: Release 1.5.2c1
2278 * README: Release 1.5.2c1.
2280 * Misc/NEWS: News for the 1.5.2c1 release.
2282 * Lib/test/test_strftime.py:
2283 On Windows, we suddenly find, strftime() may return "" for an
2284 unsupported format string. (I guess this is because the logic for
2285 deciding whether to reallocate the buffer or not has been improved.)
2286 This caused the test code to crash on result[0]. Fix this by assuming
2287 an empty result also means the format is not supported.
2289 * Demo/tkinter/matt/window-creation-w-location.py:
2290 This demo imported some private code from Matt. Make it cripple along.
2292 * Lib/lib-tk/Tkinter.py:
2293 Delete an accidentally checked-in feature that actually broke more
2294 than was worth it: when deleting a canvas item, it would try to
2295 automatically delete the bindings for that item. Since there's
2296 nothing that says you can't reuse the tag and still have the bindings,
2297 this is not correct. Also, it broke at least one demo
2298 (Demo/tkinter/matt/rubber-band-box-demo-1.py).
2300 * Python/thread_wince.h: Win/CE thread support by Mark Hammond.
2302 Wed Apr 7 20:23:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2304 * Modules/zlibmodule.c:
2305 Patch by Andrew Kuchling to unflush() (flush() for deflating).
2306 Without this, if inflate() returned Z_BUF_ERROR asking for more output
2307 space, we would report the error; now, we increase the buffer size and
2308 try again, just as for Z_OK.
2310 * Lib/test/test_gzip.py: Use binary mode for all gzip files we open.
2312 * Tools/idle/ChangeLog: New change log.
2314 * Tools/idle/README.txt, Tools/idle/NEWS.txt: New version.
2316 * Python/pythonrun.c:
2317 Alas, get rid of the Win specific hack to ask the user to press Return
2318 before exiting when an error happened. This didn't work right when
2319 Python is invoked from a daemon.
2321 * Tools/idle/idlever.py: Version bump awaiting impending new release.
2322 (Not much has changed :-( )
2324 * Lib/lib-tk/Tkinter.py:
2325 lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
2326 so the preferred name for them is tag_lower, tag_raise
2327 (similar to tag_bind, and similar to the Text widget);
2328 unfortunately can't delete the old ones yet (maybe in 1.6)
2330 * Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c:
2331 Changes by Mark Hammond for Windows CE. Mostly of the form
2332 #ifdef DONT_HAVE_header_H ... #endif around #include <header.h>.
2334 * Python/bltinmodule.c:
2335 Remove unused variable from complex_from_string() code.
2337 * Include/patchlevel.h:
2338 Add the possibility of a gamma release (release candidate).
2339 Add '+' to string version number to indicate we're beyond b2 now.
2341 * Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x.
2343 * Lib/smtplib.py: Changes by Per Cederquist and The Dragon.
2348 The application where Signum Support uses smtplib needs to be able to
2349 report good error messages to the user when sending email fails. To
2350 help in diagnosing problems it is useful to be able to report the
2351 entire message sent by the server, not only the SMTP error code of the
2354 A lot of the functions in sendmail.py unfortunately discards the
2355 message, leaving only the code. The enclosed patch fixes that
2358 The enclosed patch also introduces a base class for exceptions that
2359 include an SMTP error code and error message, and make the code and
2360 message available on separate attributes, so that surrounding code can
2361 deal with them in whatever way it sees fit. I've also added some
2362 documentation to the exception classes.
2364 The constructor will now raise an exception if it cannot connect to
2367 The data() method will raise an SMTPDataError if it doesn't receive
2368 the expected 354 code in the middle of the exchange.
2370 According to section 5.2.10 of RFC 1123 a smtp client must accept "any
2371 text, including no text at all" after the error code. If the response
2372 of a HELO command contains no text self.helo_resp will be set to the
2373 empty string (""). The patch fixes the test in the sendmail() method
2374 so that helo_resp is tested against None; if it has the empty string
2375 as value the sendmail() method would invoke the helo() method again.
2377 The code no longer accepts a -1 reply from the ehlo() method in
2380 [Text about removing SMTPRecipientsRefused deleted --GvR]
2386 smtplib.py appends an extra blank line to the outgoing mail if the
2387 `msg' argument to the sendmail method already contains a trailing
2388 newline. This patch should fix the problem.
2394 Mostly I just re-added the SMTPRecipientsRefused exception
2395 (the exeption object now has the appropriate info in it ) [Per had
2396 removed this in his patch --GvR] and tweaked the behavior of the
2397 sendmail method whence it throws the newly added SMTPHeloException (it
2398 was closing the connection, which it shouldn't. whatever catches the
2399 exception should do that. )
2401 I pondered the change of the return values to tuples all around,
2402 and after some thinking I decided that regularizing the return values was
2403 too much of the Right Thing (tm) to not do.
2405 My one concern is that code expecting an integer & getting a tuple
2408 (i.e. if it's doing :
2410 x.somemethod() >= 400:
2411 expecting an integer, the expression will always be true if it gets a
2414 However, most smtplib code I've seen only really uses the
2415 sendmail() method, so this wouldn't bother it. Usually code I've seen
2416 that calls the other methods usually only calls helo() and ehlo() for
2417 doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
2418 and thus I would think not much code uses it yet.
2421 Tue Apr 6 19:38:18 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2423 * Lib/test/test_ntpath.py:
2424 Fix the tests now that splitdrive() no longer treats UNC paths special.
2425 (Some tests converted to splitunc() tests.)
2428 Withdraw the UNC support from splitdrive(). Instead, a new function
2429 splitunc() parses UNC paths. The contributor of the UNC parsing in
2430 splitdrive() doesn't like it, but I haven't heard a good reason to
2431 keep it, and it causes some problems. (I think there's a
2432 philosophical problem -- to me, the split*() functions are purely
2433 syntactical, and the fact that \\foo is not a valid path doesn't mean
2434 that it shouldn't be considered an absolute path.)
2436 Also (quite separately, but strangely related to the philosophical
2437 issue above) fix abspath() so that if win32api exists, it doesn't fail
2438 when the path doesn't actually exist -- if GetFullPathName() fails,
2439 fall back on the old strategy (join with getcwd() if neccessary, and
2440 then use normpath()).
2442 * configure.in, configure, config.h.in, acconfig.h:
2443 For BeOS PowerPC. Chris Herborth.
2445 Mon Apr 5 21:54:14 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2447 * Modules/timemodule.c:
2448 Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on
2449 #else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
2452 Bunch of new contributors, including 9 who contributed to the Docs,
2455 Mon Apr 5 18:37:59 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
2458 Oops, missed mode parameter to open().
2461 Made the default mode 'rb' instead of 'r', for better cross-platform
2462 support. (Based on comment on the documentation by Bernhard Reiter
2463 <bernhard@csd.uwm.edu>).
2465 Fri Apr 2 22:18:25 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2467 * Tools/scripts/dutree.py:
2468 For reasons I dare not explain, this script should always execute
2469 main() when imported (in other words, it is not usable as a module).
2471 Thu Apr 1 15:32:30 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2473 * Lib/test/test_cpickle.py: Jonathan Giddy write:
2475 In test_cpickle.py, the module os got imported, but the line to remove
2476 the temp file has gone missing.
2478 Tue Mar 30 20:17:31 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2480 * Lib/BaseHTTPServer.py: Per Cederqvist writes:
2482 If you send something like "PUT / HTTP/1.0" to something derived from
2483 BaseHTTPServer that doesn't define do_PUT, you will get a response
2484 that begins like this:
2486 HTTP/1.0 501 Unsupported method ('do_PUT')
2487 Server: SimpleHTTP/0.3 Python/1.5
2488 Date: Tue, 30 Mar 1999 18:53:53 GMT
2490 The server should complain about 'PUT' instead of 'do_PUT'. This
2491 patch should fix the problem.
2493 Mon Mar 29 20:33:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2495 * Lib/smtplib.py: Patch by Per Cederqvist, who writes:
2498 - It needlessly used the makefile() method for each response that is
2499 read from the SMTP server.
2501 - If the remote SMTP server closes the connection unexpectedly the
2502 code raised an IndexError. It now raises an SMTPServerDisconnected
2505 - The code now checks that all lines in a multiline response actually
2506 contains an error code.
2509 The Dragon approves.
2511 Mon Mar 29 20:25:40 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
2513 * Lib/compileall.py:
2514 When run as a script, report failures in the exit code as well.
2515 Patch largely based on changes by Andrew Dalke, as discussed in the
2518 Mon Mar 29 20:23:41 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2521 Hack so that if a 302 or 301 redirect contains a relative URL, the
2522 right thing "just happens" (basejoin() with old URL).
2524 * Modules/cPickle.c:
2525 Protection against picling to/from closed (real) file.
2526 The problem was reported by Moshe Zadka.
2528 * Lib/test/test_cpickle.py:
2529 Test protection against picling to/from closed (real) file.
2531 * Modules/timemodule.c: Chris Lawrence writes:
2534 The GNU folks, in their infinite wisdom, have decided not to implement
2535 altzone in libc6; this would not be horrible, except that timezone
2536 (which is implemented) includes the current DST setting (i.e. timezone
2537 for Central is 18000 in summer and 21600 in winter). So Python's
2538 timezone and altzone variables aren't set correctly during DST.
2540 Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone
2541 show the "right" thing on Linux (by using the tm_gmtoff stuff
2542 available in BSD, which is how the GLIBC manual claims things should
2543 be done) and (b) should cope with the southern hemisphere. In pursuit
2544 of (b), I also took the liberty of renaming the "summer" and "winter"
2545 variables to "july" and "jan". This patch should also make certain
2546 time calculations on Linux actually work right (like the tz-aware
2547 functions in the rfc822 module).
2549 (It's hard to find DST that's currently being used in the southern
2550 hemisphere; I tested using Africa/Windhoek.)
2553 * Lib/test/output/test_gzip:
2554 Jonathan Giddy discovered this file was missing.
2556 * Modules/shamodule.c:
2557 Avoid warnings from AIX compiler. Reported by Vladimir (AIX is my
2558 middlename) Marangozov, patch coded by Greg Stein.
2560 * Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py:
2561 At Tim Peters' recommendation, add a dummy flush() method to PseudoFile.
2563 Sun Mar 28 17:55:32 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2565 * Tools/scripts/ndiff.py: Tim Peters writes:
2567 I should have waited overnight <wink/sigh>. Nothing wrong with the one I
2568 sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options
2569 for recreating the original files from ndiff's output. That's attached, if
2570 you're game! Us Windows guys don't usually have a sed sitting around
2573 Sat Mar 27 13:34:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2575 * Tools/scripts/ndiff.py: Tim Peters writes:
2577 Attached is a cleaned-up version of ndiff (added useful module
2578 docstring, now echo'ed in case of cmd line mistake); added -q option
2579 to suppress initial file identification lines; + other minor cleanups,
2580 & a slightly faster match engine.
2582 Fri Mar 26 22:36:00 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
2584 * Tools/scripts/dutree.py:
2585 During display, if EPIPE is raised, it's probably because a pager was
2586 killed. Discard the error in that case, but propogate it otherwise.
2588 Fri Mar 26 16:20:45 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2590 * Lib/test/output/test_userlist, Lib/test/test_userlist.py:
2591 Test suite for UserList.
2593 * Lib/UserList.py: Use isinstance() where appropriate.
2594 Reformatted with 4-space indent.
2596 Fri Mar 26 16:11:40 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
2598 * Tools/pynche/PyncheWidget.py:
2599 Helpwin.__init__(): The text widget should get focus.
2601 * Tools/pynche/pyColorChooser.py:
2602 Removed unnecessary import `from PyncheWidget import PyncheWidget'
2604 Fri Mar 26 15:32:05 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2606 * Lib/test/output/test_userdict, Lib/test/test_userdict.py:
2607 Test suite for UserDict
2609 * Lib/UserDict.py: Improved a bunch of things.
2610 The constructor now takes an optional dictionary.
2611 Use isinstance() where appropriate.
2613 Thu Mar 25 22:38:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2615 * Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py:
2616 Basic regr tests for pickle/cPickle
2619 Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
2620 points out) it doesn't work in JPython Applets.
2622 Thu Mar 25 21:50:27 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
2624 * Lib/test/test_gzip.py:
2625 Added a simple test suite for gzip. It simply opens a temp file,
2626 writes a chunk of compressed data, closes it, writes another chunk, and
2627 reads the contents back to verify that they are the same.
2630 Based on a suggestion from bruce@hams.com, make a trivial change to
2631 allow using the 'a' flag as a mode for opening a GzipFile. gzip
2632 files, surprisingly enough, can be concatenated and then decompressed;
2633 the effect is to concatenate the two chunks of data.
2635 If we support it on writing, it should also be supported on reading.
2636 This *wasn't* trivial, and required rearranging the code in the
2637 reading path, particularly the _read() method.
2639 Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
2640 and 'Unknown compression method'
2642 Thu Mar 25 21:25:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2644 * Lib/test/test_b1.py:
2645 Add tests for float() and complex() with string args (Nick/Stephanie
2648 Thu Mar 25 21:21:08 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
2650 * Modules/zlibmodule.c:
2651 Add an .unused_data attribute to decompressor objects. If .unused_data
2652 is not an empty string, this means that you have arrived at the
2653 end of the stream of compressed data, and the contents of .unused_data are
2654 whatever follows the compressed stream.
2656 Thu Mar 25 21:16:07 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2658 * Python/bltinmodule.c:
2659 Patch by Nick and Stephanie Lockwood to implement complex() with a string
2660 argument. This closes TODO item 2.19.
2662 Wed Mar 24 19:09:00 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2664 * Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker.
2665 Unfortunately his code breaks wcgui.py in a way that's not easy
2666 to fix. I expect that this is a temporary situation --
2667 eventually Sam's changes will be merged back in.
2668 (The changes add a -t option to specify exceptions to the -x
2669 option, and explicit checking for #foo style fragment ids.)
2671 * Objects/dictobject.c:
2672 Vladimir Marangozov contributed updated comments.
2674 * Objects/bufferobject.c: Folded long lines.
2676 * Lib/test/output/test_sha, Lib/test/test_sha.py:
2677 Added Jeremy's test code for the sha module.
2679 * Modules/shamodule.c, Modules/Setup.in:
2680 Added Greg Stein and Andrew Kuchling's sha module.
2681 Fix comments about zlib version and URL.
2683 * Lib/test/test_bsddb.py: Remove the temp file when we're done.
2685 * Include/pythread.h: Conform to standard boilerplate.
2687 * configure.in, configure, BeOS/linkmodule, BeOS/ar-fake:
2688 Chris Herborth: the new compiler in R4.1 needs some new options to work...
2690 * Modules/socketmodule.c:
2691 Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
2692 data struct before calling gethostby{name,addr}_r(); (2) ignore the
2693 3/5/6 args determinations made by the configure script and switch on
2694 platform identifiers instead:
2696 AIX, OSF have 3 args
2697 Sun, SGI have 5 args
2700 On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
2702 * Modules/socketmodule.c:
2703 Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.
2706 Add readlines() to _Subfile class. Not clear who would need it, but
2707 Chris Lawrence sent me a broken version; this one is a tad simpler and
2708 more conforming to the standard.
2710 Tue Mar 23 23:05:34 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
2712 * Lib/gzip.py: use struct instead of bit-manipulate in Python
2714 Tue Mar 23 19:00:55 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2716 * Modules/Makefile.pre.in:
2717 Add $(EXE) to various occurrences of python so it will work on Cygwin
2718 with egcs (after setting EXE=.exe). Patch by Norman Vine.
2720 * configure, configure.in:
2721 Ack! It never defined HAVE_GETHOSTBYNAME_R so that code was never tested!
2723 Mon Mar 22 22:25:39 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2726 Adding thread.h -- unused but for b/w compatibility.
2727 As requested by Bill Janssen.
2729 * configure.in, configure:
2730 Add code to test for all sorts of gethostbyname_r variants,
2731 donated by David Arnold.
2733 * config.h.in, acconfig.h:
2734 Add symbols for gethostbyname_r variants (sigh).
2736 * Modules/socketmodule.c: Clean up pass for the previous patches.
2738 - Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
2741 - If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
2742 don't know what code should be used.
2744 - New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
2746 - Modify the gethostbyaddr() code to also hold on to the lock until
2747 after it is safe to release, overlapping with the Python lock.
2749 (Note: I think that it could in theory be possible that Python code
2750 executed while gethostbyname_lock is held could attempt to reacquire
2751 the lock -- e.g. in a signal handler or destructor. I will simply say
2752 "don't do that then.")
2754 * Modules/socketmodule.c: Jonathan Giddy writes:
2756 Here's a patch to fix the race condition, which wasn't fixed by Rob's
2757 patch. It holds the gethostbyname lock until the results are copied out,
2758 which means that this lock and the Python global lock are held at the same
2759 time. This shouldn't be a problem as long as the gethostbyname lock is
2760 always acquired when the global lock is not held.
2762 Mon Mar 22 19:25:30 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
2764 * Modules/zlibmodule.c:
2765 Fixed the flush() method of compression objects; the test for
2766 the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
2767 Logic cleaned up and commented.
2769 * Lib/test/test_zlib.py:
2770 Added simple test for the flush() method of compression objects, trying the
2771 different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
2773 Mon Mar 22 15:28:08 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2776 Bug reported by Tobias Thelen: missing "self." in assignment target.
2778 Fri Mar 19 21:50:11 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2780 * Modules/arraymodule.c:
2781 Use an unsigned cast to avoid a warning in VC++.
2783 * Lib/dospath.py, Lib/ntpath.py:
2784 New code for split() by Tim Peters, behaves more like posixpath.split().
2786 * Objects/floatobject.c:
2787 Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
2788 a block cannot be freed, add its free items back to the free list.
2789 This is necessary to avoid leaking when Python is reinitialized later.
2791 * Objects/intobject.c:
2792 Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
2793 a block cannot be freed, add its free items back to the free list, and
2794 add its valid ints back to the small_ints array if they are in range.
2795 This is necessary to avoid leaking when Python is reinitialized later.
2798 Added BufferType, the type returned by the new builtin buffer(). Greg Stein.
2800 * Python/bltinmodule.c:
2801 New builtin buffer() creates a derived read-only buffer from any
2802 object that supports the buffer interface (e.g. strings, arrays).
2804 * Objects/bufferobject.c:
2805 Added check for negative offset for PyBuffer_FromObject and check for
2806 negative size for PyBuffer_FromMemory. Greg Stein.
2808 Thu Mar 18 15:10:44 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2810 * Lib/urlparse.py: Sjoerd Mullender writes:
2812 If a filename on Windows starts with \\, it is converted to a URL
2813 which starts with ////. If this URL is passed to urlparse.urlparse
2814 you get a path that starts with // (and an empty netloc). If you pass
2815 the result back to urlparse.urlunparse, you get a URL that starts with
2816 //, which is parsed differently by urlparse.urlparse. The fix is to
2817 add the (empty) netloc with accompanying slashes if the path in
2818 urlunparse starts with //. Do this for all schemes that use a netloc.
2820 * Lib/nturl2path.py: Sjoerd Mullender writes:
2822 Pathnames of files on other hosts in the same domain
2823 (\\host\path\to\file) are not translated correctly to URLs and back.
2824 The URL should be something like file:////host/path/to/file.
2825 Note that a combination of drive letter and remote host is not
2828 Wed Mar 17 22:30:10 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2831 Delete non-standard-conforming code in urljoin() that would use the
2832 netloc from the base url as the default netloc for the resulting url
2833 even if the schemes differ.
2835 Once upon a time, when the web was wild, this was a valuable hack
2836 because some people had a URL referencing an ftp server colocated with
2837 an http server without having the host in the ftp URL (so they could
2838 replicate it or change the hostname easily).
2840 More recently, after the file: scheme got added back to the list of
2841 schemes that accept a netloc, it turns out that this caused weirdness
2842 when joining an http: URL with a file: URL -- the resulting file: URL
2843 would always inherit the host from the http: URL because the file:
2844 scheme supports a netloc but in practice never has one.
2846 There are two reasons to get rid of the old, once-valuable hack,
2847 instead of removing the file: scheme from the uses_netloc list. One,
2848 the RFC says that file: uses the netloc syntax, and does not endorse
2849 the old hack. Two, neither netscape 4.5 nor IE 4.0 support the old
2852 * Include/ceval.h, Include/abstract.h:
2853 Add DLL level b/w compat for PySequence_In and PyEval_CallObject
2855 Tue Mar 16 21:54:50 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2857 * Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson:
2859 An attempt to execute grid_slaves with arguments (0,0) results in
2860 *all* of the slaves being returned, not just the slave associated with
2861 row 0, column 0. This is because the test for arguments in the method
2862 does not test to see if row (and column) does not equal None, but
2863 rather just whether is evaluates to non-false. A value of 0 fails
2866 Tue Mar 16 14:17:48 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
2868 * Modules/cmathmodule.c:
2869 Docstring fix: acosh() returns the hyperbolic arccosine, not the
2870 hyperbolic cosine. Problem report via David Ascher by one of his
2873 Mon Mar 15 21:40:59 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2876 Should test for gethost*by*name_r, not for gethostname_r (which
2877 doesn't exist and doesn't make sense).
2879 * Modules/socketmodule.c:
2880 Patch by Rob Riggs for Linux -- glibc2 has a different argument
2881 converntion for gethostbyname_r() etc. than Solaris!
2883 * Python/thread_pthread.h: Rob Riggs wrote:
2886 Spec says that on success pthread_create returns 0. It does not say
2887 that an error code will be < 0. Linux glibc2 pthread_create() returns
2888 ENOMEM (12) when one exceed process limits. (It looks like it should
2889 return EAGAIN, but that's another story.)
2892 http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
2895 [I have a feeling that similar bugs were fixed before; perhaps someone
2896 could check that all error checks no check for != 0?]
2898 * Tools/bgen/bgen/bgenObjectDefinition.py:
2899 New mixin class that defines cmp and hash that use
2900 the ob_itself pointer. This allows (when using the mixin)
2901 different Python objects pointing to the same C object and
2902 behaving well as dictionary keys.
2904 Or so sez Jack Jansen...
2906 * Lib/urllib.py: Yet another patch by Sjoerd Mullender:
2908 Don't convert URLs to URLs using pathname2url.
2910 Fri Mar 12 22:15:43 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2912 * Lib/cmd.py: Patch by Michael Scharf. He writes:
2914 The module cmd requires for each do_xxx command a help_xxx
2915 function. I think this is a little old fashioned.
2917 Here is a patch: use the docstring as help if no help_xxx
2918 function can be found.
2920 [I'm tempted to rip out all the help_* functions from pdb, but I'll
2921 resist it. Any takers? --Guido]
2923 * Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes:
2925 Under Windows, python freeze.py -o hello hello.py
2926 creates all the correct files in the hello subdirectory, but the
2927 Makefile has the directory prefix in it for frozen_extensions.c
2928 nmake fails because it tries to locate hello/frozen_extensions.c
2930 (His fix adds a call to os.path.basename() in the appropriate place.)
2932 * Objects/floatobject.c, Objects/intobject.c:
2933 Vladimir has restructured his code somewhat so that the blocks are now
2934 represented by an explicit structure. (There are still too many casts
2935 in the code, but that may be unavoidable.)
2937 Also added code so that with -vv it is very chatty about what it does.
2939 * Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py:
2940 Change #! line to modern usage; also chmod +x
2942 * Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump:
2943 Change #! line to modern usage
2945 * Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender
2947 The filename to URL conversion didn't properly quote special
2949 The URL to filename didn't properly unquote special chatacters.
2951 * Objects/floatobject.c:
2952 OK, try again. Vladimir gave me a fix for the alignment bus error,
2953 so here's his patch again. This time it works (at least on Solaris,
2956 Thu Mar 11 23:21:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2958 * Tools/idle/PathBrowser.py:
2959 Don't crash when sys.path contains an empty string.
2961 * Tools/idle/PathBrowser.py:
2962 - Don't crash in the case where a superclass is a string instead of a
2963 pyclbr.Class object; this can happen when the superclass is
2964 unrecognizable (to pyclbr), e.g. when module renaming is used.
2966 - Show a watch cursor when calling pyclbr (since it may take a while
2967 recursively parsing imported modules!).
2969 Thu Mar 11 16:04:04 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
2972 Added .rdf and .xsl as application/xml types. (.rdf is for the
2973 Resource Description Framework, a metadata encoding, and .xsl is for
2974 the Extensible Stylesheet Language.)
2976 Thu Mar 11 13:26:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2978 * Lib/test/output/test_popen2, Lib/test/test_popen2.py:
2979 Test for popen2 module, by Chris Tismer.
2981 * Objects/floatobject.c:
2982 Alas, Vladimir's patch caused a bus error (probably double
2983 alignment?), and I didn't test it. Withdrawing it for now.
2985 Wed Mar 10 22:55:47 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2987 * Objects/floatobject.c:
2988 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
2989 floats on finalization.
2991 * Objects/intobject.c:
2992 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
2993 integers on finalization.
2995 * Tools/idle/EditorWindow.py, Tools/idle/Bindings.py:
2996 Add PathBrowser to File module
2998 * Tools/idle/PathBrowser.py:
2999 "Path browser" - 4 scrolled lists displaying:
3000 directories on sys.path
3001 modules in selected directory
3002 classes in selected module
3003 methods of selected class
3005 Sinlge clicking in a directory, module or class item updates the next
3006 column with info about the selected item. Double clicking in a
3007 module, class or method item opens the file (and selects the clicked
3008 item if it is a class or method).
3010 I guess eventually I should be using a tree widget for this, but the
3011 ones I've seen don't work well enough, so for now I use the old
3012 Smalltalk or NeXT style multi-column hierarchical browser.
3014 * Tools/idle/MultiScrolledLists.py:
3015 New utility: multiple scrolled lists in parallel
3017 * Tools/idle/ScrolledList.py: - White background.
3018 - Display "(None)" (or text of your choosing) when empty.
3019 - Don't set the focus.
3021 Tue Mar 9 19:31:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
3024 open_http also had the 'data is None' test backwards. don't call with the
3025 extra argument if data is None.
3027 * Demo/embed/demo.c:
3028 Call Py_SetProgramName() instead of redefining getprogramname(),
3029 reflecting changes in the runtime around 1.5 or earlier.
3032 Always test for an error return (usually NULL or -1) without setting
3035 * Modules/timemodule.c: Patch by Chris Herborth for BeOS code.
3038 I had an off-by-1000 error in floatsleep(),
3039 and the problem with time.clock() is that it's not implemented properly
3040 on QNX... ANSI says it's supposed to return _CPU_ time used by the
3041 process, but on QNX it returns the amount of real time used... so I was
3044 * Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen.
3045 Test for self.returntype behaving like OSErr rather than being it.
3047 Thu Feb 25 16:14:58 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
3050 http_error had the 'data is None' test backwards. don't call with the
3051 extra argument if data is None.
3053 * Lib/urllib.py: change indentation from 8 spaces to 4 spaces
3055 * Lib/urllib.py: pleasing the tabnanny
3057 Thu Feb 25 14:26:02 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
3060 Oops, one more "x, y, z" to convert...
3063 Adjusted comment at the top to be less confusing, following Fredrik
3066 Converted comment to docstring.
3068 Wed Feb 24 18:49:15 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
3071 Use sndhdr instead of the obsolete whatsound module.
3073 Wed Feb 24 18:42:38 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
3076 When performing a POST request, i.e. when the second argument to
3077 urlopen is used to specify form data, make sure the second argument is
3078 threaded through all of the http_error_NNN calls. This allows error
3079 handlers like the redirect and authorization handlers to properly
3080 re-start the connection.
3082 Wed Feb 24 16:25:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
3084 * Lib/mhlib.py: Patch by Lars Wirzenius:
3086 o the initial comment is wrong: creating messages is already
3089 o Message.getbodytext: if the mail or it's part contains an
3090 empty content-transfer-encoding header, the code used to
3091 break; the change below treats an empty encoding value the same
3092 as the other types that do not need decoding
3094 o SubMessage.getbodytext was missing the decode argument; the
3095 change below adds it; I also made it unconditionally return
3096 the raw text if decoding was not desired, because my own
3097 routines needed that (and it was easier than rewriting my
3100 Wed Feb 24 00:35:43 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
3102 * Python/bltinmodule.c (initerrors):
3103 Make sure that the exception tuples ("base-classes" when
3104 string-based exceptions are used) reflect the real class hierarchy,
3105 i.e. that SystemExit derives from Exception not StandardError.
3107 * Lib/exceptions.py:
3108 Document the correct class hierarchy for SystemExit. It is not an
3109 error and so it derives from Exception and not SystemError. The
3110 docstring was incorrect but the implementation was fine.
3112 Tue Feb 23 23:07:51 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
3115 Add import sys, needed by reference to sys.exc_info() in rmtree().
3116 Discovered by Mitch Chapman.
3119 Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol
3120 disappears. It wasn't used anywhere anyway...
3122 * Modules/arraymodule.c:
3123 Carefully check for overflow when allocating the memory for fromfile
3124 -- someone tried to pass in sys.maxint and got bitten by the bogus
3128 Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with
3129 LIBM (from --with-libm=...); this actually broke the customizability
3130 offered by the latter option. Thanks go to Clay Spence for reporting
3133 * Lib/test/test_dl.py:
3134 1. Print the error message (carefully) when a dl.open() fails in verbose mode.
3135 2. When no test case worked, raise ImportError instead of failing.
3137 * Python/bltinmodule.c:
3138 Patch by Tim Peters to improve the range checks for range() and
3139 xrange(), especially for platforms where int and long are different
3140 sizes (so sys.maxint isn't actually the theoretical limit for the
3141 length of a list, but the largest C int is -- sys.maxint is the
3142 largest Python int, which is actually a C long).
3145 1. Augment the DG/UX rule so it doesn't break the BeOS build.
3146 2. Add $(EXE) to various occurrences of python so it will work on
3147 Cygwin with egcs (after setting EXE=.exe). These patches by
3151 According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
3152 list (of bsd variants that have a different lock structure).
3154 * Lib/test/test_fcntl.py:
3155 According to Jeffrey Honig, bsd/os 4.0 should be added to the list.
3157 * Modules/timemodule.c:
3158 Patch by Tadayoshi Funaba (with some changes) to be smarter about
3159 guessing what happened when strftime() returns 0. Is it buffer
3160 overflow or was the result simply 0 bytes long? (This happens for an
3161 empty format string, or when the format string is a single %Z and the
3162 timezone is unknown.) if the buffer is at least 256 times as long as
3163 the format, assume the latter.
3165 Mon Feb 22 19:01:42 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
3168 As Des Barry points out, we need to call pathname2url(file) in two
3169 calls to addinfourl() in open_file().
3171 * Modules/Setup.in: Document *static* -- in two places!
3173 * Modules/timemodule.c:
3174 We don't support leap seconds, so the seconds field of a time 9-tuple
3175 should be in the range [0-59]. Noted by Tadayoshi Funaba.
3177 * Modules/stropmodule.c:
3178 In atoi(), don't use isxdigit() to test whether the last character
3179 converted was a "digit" -- use isalnum(). This test is there only to
3180 guard against "+" or "-" being interpreted as a valid int literal.
3181 Reported by Takahiro Nakayama.
3184 As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
3185 so they don't need to be treated specially here.
3187 Mon Feb 22 15:38:58 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
3190 Typo: "apparentlt" --> "apparently"
3192 Mon Feb 22 15:38:46 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
3194 * Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc.
3196 * Modules/posixmodule.c:
3197 The docstring for ttyname(..) claims a second "mode" argument. The
3198 actual code does not allow such an argument. (Finn Bock.)
3200 * Lib/lib-old/poly.py:
3201 Dang. Even though this is obsolete code, somebody found a bug, and I
3204 Thu Feb 18 20:51:50 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
3207 Bow to font-lock at the end of the docstring, since it throws stuff
3210 Make sure the path paramter to readmodule() is a list before adding it
3211 with sys.path, or the addition could fail.
3214 ======================================================================
3217 From 1.5.2b1 to 1.5.2b2
3218 =======================
3223 - Many memory leaks fixed.
3225 - Many small bugs fixed.
3227 - Command line option -OO (or -O -O) suppresses inclusion of doc
3228 strings in resulting bytecode.
3230 Windows-specific changes
3231 ------------------------
3233 - New built-in module winsound provides an interface to the Win32
3236 - Re-enable the audioop module in the config.c file.
3238 - On Windows, support spawnv() and associated P_* symbols.
3240 - Fixed the conversion of times() return values on Windows.
3242 - Removed freeze from the installer -- it doesn't work without the
3243 source tree. (See FAQ 8.11.)
3245 - On Windows 95/98, the Tkinter module now is smart enough to find
3246 Tcl/Tk even when the PATH environment variable hasn't been set -- when
3247 the import of _tkinter fails, it searches in a standard locations,
3248 patches os.environ["PATH"], and tries again. When it still fails, a
3249 clearer error message is produced. This should avoid most
3250 installation problems with Tkinter use (e.g. in IDLE).
3252 - The -i option doesn't make any calls to set[v]buf() for stdin --
3253 this apparently screwed up _kbhit() and the _tkinter main loop.
3255 - The ntpath module (and hence, os.path on Windows) now parses out UNC
3256 paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
3257 splitdrive() will \\host\mountpoint as the drive and \dir\file as the
3258 path. ** EXPERIMENTAL **
3260 - Added a hack to the exit code so that if (1) the exit status is
3261 nonzero and (2) we think we have our own DOS box (i.e. we're not
3262 started from a command line shell), we print a message and wait for
3263 the user to hit a key before the DOS box is closed.
3265 - Updated the installer to WISE 5.0g. Added a dialog warning about
3266 the imminent Tcl installation. Added a dialog to specify the program
3267 group name in the start menu. Upgraded the Tcl installer to Tcl
3270 Changes to intrinsics
3271 ---------------------
3273 - The repr() or str() of a module object now shows the __file__
3274 attribute (i.e., the file which it was loaded), or the string
3275 "(built-in)" if there is no __file__ attribute.
3277 - The range() function now avoids overflow during its calculations (if
3280 - New info string sys.hexversion, which is an integer encoding the
3281 version in hexadecimal. In other words, hex(sys.hexversion) ==
3282 0x010502b2 for Python 1.5.2b2.
3284 New or improved ports
3285 ---------------------
3287 - Support for Nextstep descendants (future Mac systems).
3289 - Improved BeOS support.
3291 - Support dynamic loading of shared libraries on NetBSD platforms that
3292 use ELF (i.e., MIPS and Alpha systems).
3294 Configuration/build changes
3295 ---------------------------
3297 - The Lib/test directory is no longer included in the default module
3298 search path (sys.path) -- "test" has been a package ever since 1.5.
3300 - Now using autoconf 2.13.
3305 - New library modules asyncore and asynchat: these form Sam Rushing's
3306 famous asynchronous socket library. Sam has gracefully allowed me to
3307 incorporate these in the standard Python library.
3309 - New module statvfs contains indexing constants for [f]statvfs()
3312 Changes to the library
3313 ----------------------
3315 - The wave module (platform-independent support for Windows sound
3316 files) has been fixed to actually make it work.
3318 - The sunau module (platform-independent support for Sun/NeXT sound
3319 files) has been fixed to work across platforms. Also, a weird
3320 encoding bug in the header of the audio test data file has been
3323 - Fix a bug in the urllib module that occasionally tripped up
3324 webchecker and other ftp retrieves.
3326 - ConfigParser's get() method now accepts an optional keyword argument
3327 (vars) that is substituted on top of the defaults that were setup in
3328 __init__. You can now also have recusive references in your
3331 - Some improvements to the Queue module, including a put_nowait()
3332 module and an optional "block" second argument, to get() and put(),
3335 - The updated xmllib module is once again compatible with the version
3336 present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
3338 - The bdb module (base class for the debugger) now supports
3339 canonicalizing pathnames used in breakpoints. The derived class must
3340 override the new canonical() method for this to work. Also changed
3341 clear_break() to the backwards compatible old signature, and added
3342 clear_bpbynumber() for the new functionality.
3344 - In sgmllib (and hence htmllib), recognize attributes even if they
3345 don't have space in front of them. I.e. '<a
3346 name="foo"href="bar.html">' will now have two attributes recognized.
3348 - In the debugger (pdb), change clear syntax to support three
3349 alternatives: clear; clear file:line; clear bpno bpno ...
3351 - The os.path module now pretends to be a submodule within the os
3352 "package", so you can do things like "from os.path import exists".
3354 - The standard exceptions now have doc strings.
3356 - In the smtplib module, exceptions are now classes. Also avoid
3357 inserting a non-standard space after "TO" in rcpt() command.
3359 - The rfc822 module's getaddrlist() method now uses all occurrences of
3360 the specified header instead of just the first. Some other bugfixes
3361 too (to handle more weird addresses found in a very large test set,
3362 and to avoid crashes on certain invalid dates), and a small test
3363 module has been added.
3365 - Fixed bug in urlparse in the common-case code for HTTP URLs; it
3366 would lose the query, fragment, and/or parameter information.
3368 - The sndhdr module no longer supports whatraw() -- it depended on a
3369 rare extenral program.
3371 - The UserList module/class now supports the extend() method, like
3374 - The uu module now deals better with trailing garbage generated by
3375 some broke uuencoders.
3377 - The telnet module now has an my_interact() method which uses threads
3378 instead of select. The interact() method uses this by default on
3379 Windows (where the single-threaded version doesn't work).
3381 - Add a class to mailbox.py for dealing with qmail directory
3382 mailboxes. The test code was extended to notice these being used as
3385 Changes to extension modules
3386 ----------------------------
3388 - Support for the [f]statvfs() system call, where it exists.
3390 - Fixed some bugs in cPickle where bad input could cause it to dump
3393 - Fixed cStringIO to make the writelines() function actually work.
3395 - Added strop.expandtabs() so string.expandtabs() is now much faster.
3397 - Added fsync() and fdatasync(), if they appear to exist.
3399 - Support for "long files" (64-bit seek pointers).
3401 - Fixed a bug in the zlib module's flush() function.
3403 - Added access() system call. It returns 1 if access granted, 0 if
3406 - The curses module implements an optional nlines argument to
3407 w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
3412 - Some changes to IDLE; see Tools/idle/NEWS.txt.
3414 - Latest version of Misc/python-mode.el included.
3419 - Avoid tracebacks when an image is deleted after its root has been
3422 Changes to the Python/C API
3423 ---------------------------
3425 - When parentheses are used in a PyArg_Parse[Tuple]() call, any
3426 sequence is now accepted, instead of requiring a tuple. This is in
3427 line with the general trend towards accepting arbitrary sequences.
3429 - Added PyModule_GetFilename().
3431 - In PyNumber_Power(), remove unneeded and even harmful test for float
3432 to the negative power (which is already and better done in
3435 - New version identification symbols; read patchlevel.h for info. The
3436 version numbers are now exported by Python.h.
3438 - Rolled back the API version change -- it's back to 1007!
3440 - The frozenmain.c function calls PyInitFrozenExtensions().
3442 - Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
3446 ======================================================================
3449 From 1.5.2a2 to 1.5.2b1
3450 =======================
3452 Changes to intrinsics
3453 ---------------------
3455 - New extension NotImplementedError, derived from RuntimeError. Not
3456 used, but recommended use is for "abstract" methods to raise this.
3458 - The parser will now spit out a warning or error when -t or -tt is
3459 used for parser input coming from a string, too.
3461 - The code generator now inserts extra SET_LINENO opcodes when
3462 compiling multi-line argument lists.
3464 - When comparing bound methods, use identity test on the objects, not
3467 New or improved ports
3468 ---------------------
3470 - Chris Herborth has redone his BeOS port; it now works on PowerPC
3471 (R3/R4) and x86 (R4 only). Threads work too in this port.
3476 - Thanks to Chris Herborth, the thread primitives now have proper Py*
3477 names in the source code (they already had those for the linker,
3478 through some smart macros; but the source still had the old, un-Py
3481 Configuration/build changes
3482 ---------------------------
3484 - Improved support for FreeBSD/3.
3486 - Check for pthread_detach instead of pthread_create in libc.
3488 - The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
3490 - Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
3491 Otherwise modules such as thread didn't get incorporated in extensions.
3496 - shlex.py by Eric Raymond provides a lexical analyzer class for
3497 simple shell-like syntaxes.
3499 - netrc.py by Eric Raymond provides a parser for .netrc files. (The
3500 undocumented Netrc class in ftplib.py is now obsolete.)
3502 - codeop.py is a new module that contains the compile_command()
3503 function that was previously in code.py. This is so that JPython can
3504 provide its own version of this function, while still sharing the
3505 higher-level classes in code.py.
3507 - turtle.py is a new module for simple turtle graphics. I'm still
3508 working on it; let me know if you use this to teach Python to children
3509 or other novices without prior programming experience.
3511 Obsoleted library modules
3512 -------------------------
3514 - poly.py and zmod.py have been moved to Lib/lib-old to emphasize
3515 their status of obsoleteness. They don't do a particularly good job
3516 and don't seem particularly relevant to the Python core.
3521 - I've added IDLE: my Integrated DeveLopment Environment for Python.
3522 Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should
3523 work on Macintosh, but I haven't been able to test it there; it does
3524 depend on new features in 1.5.2 and perhaps even new features in
3525 1.5.2b1, especially the new code module). This is very much a work in
3526 progress. I'd like to hear how people like it compared to PTUI (or
3527 any other IDE they are familiar with).
3529 - New tools by Barry Warsaw:
3531 = audiopy: controls the Solaris Audio device
3532 = pynche: The PYthonically Natural Color and Hue Editor
3533 = world: Print mappings between country names and DNS country codes
3538 - Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
3541 - Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
3542 Tkinter. (By Fredrik Lundh -- not by me!)
3544 Changes to the library
3545 ----------------------
3547 - compileall.py now avoids recompiling .py files that haven't changed;
3548 it adds a -f option to force recompilation.
3550 - New version of xmllib.py by Sjoerd Mullender (0.2 with latest
3553 - nntplib.py: statparse() no longer lowercases the message-id.
3555 - types.py: use type(__stdin__) for FileType.
3557 - urllib.py: fix translations for filenames with "funny" characters.
3558 Patch by Sjoerd Mullender. Note that if you subclass one of the
3559 URLopener classes, and you have copied code from the old urllib.py,
3560 your subclass may stop working. A long-term solution is to provide
3561 more methods so that you don't have to copy code.
3563 - cgi.py: In read_multi, allow a subclass to override the class we
3564 instantiate when we create a recursive instance, by setting the class
3565 variable 'FieldStorageClass' to the desired class. By default, this
3566 is set to None, in which case we use self.__class__ (as before).
3567 Also, a patch by Jim Fulton to pass additional arguments to recursive
3568 calls to the FieldStorage constructor from its read_multi method.
3570 - UserList.py: In __getslice__, use self.__class__ instead of
3573 - In SimpleHTTPServer.py, the server specified in test() should be
3574 BaseHTTPServer.HTTPServer, in case the request handler should want to
3575 reference the two attributes added by BaseHTTPServer.server_bind. (By
3576 Jeff Rush, for Bobo). Also open the file in binary mode, so serving
3577 images from a Windows box might actually work.
3579 - In CGIHTTPServer.py, the list of acceptable formats is -split-
3580 on spaces but -joined- on commas, resulting in double commas
3581 in the joined text. (By Jeff Rush.)
3583 - SocketServer.py, patch by Jeff Bauer: a minor change to declare two
3584 new threaded versions of Unix Server classes, using the ThreadingMixIn
3585 class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
3587 - bdb.py: fix bomb on deleting a temporary breakpoint: there's no
3588 method do_delete(); do_clear() was meant. By Greg Ward.
3590 - getopt.py: accept a non-list sequence for the long options (request
3591 by Jack Jansen). Because it might be a common mistake to pass a
3592 single string, this situation is treated separately. Also added
3593 docstrings (copied from the library manual) and removed the (now
3594 redundant) module comments.
3596 - tempfile.py: improvements to avoid security leaks.
3598 - code.py: moved compile_command() to new module codeop.py.
3600 - pickle.py: support pickle format 1.3 (binary float added). By Jim
3601 Fulton. Also get rid of the undocumented obsolete Pickler dump_special
3604 - uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
3606 - imaplib.py: fix problem with some versions of IMAP4 servers that
3607 choose to mix the case in their CAPABILITIES response.
3609 - cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted
3612 Changes to extension modules
3613 ----------------------------
3615 - More doc strings for several modules were contributed by Chris
3616 Petrilli: math, cmath, fcntl.
3618 - Fixed a bug in zlibmodule.c that could cause core dumps on
3619 decompression of rarely occurring input.
3621 - cPickle.c: new version from Jim Fulton, with Open Source copyright
3622 notice. Also, initialize self->safe_constructors early on to prevent
3623 crash in early dealloc.
3625 - cStringIO.c: new version from Jim Fulton, with Open Source copyright
3626 notice. Also fixed a core dump in cStringIO.c when doing seeks.
3628 - mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
3630 - readline.c: Bernard Herzog pointed out that rl_parse_and_bind
3631 modifies its argument string (bad function!), so we make a temporary
3634 - sunaudiodev.c: Barry Warsaw added more smarts to get the device and
3635 control pseudo-device, per audio(7I).
3640 - New, improved version of Barry Warsaw's Misc/python-mode.el (editing
3643 - tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
3644 only the names of offending files to be printed.
3646 - freeze: when printing missing modules, also print the module they
3649 - untabify.py: patch by Detlef Lannert to implement -t option
3655 - grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
3658 - _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
3659 doesn't work when running in a non-threaded environment. He added
3660 some #ifdefs that fix this.
3662 Changes to the Python/C API
3663 ---------------------------
3665 - Bumped API version number to 1008 -- enough things have changed!
3667 - There's a new macro, PyThreadState_GET(), which does the same work
3668 as PyThreadState_Get() without the overhead of a function call (it
3669 also avoids the error check). The two top calling locations of
3670 PyThreadState_Get() have been changed to use this macro.
3672 - All symbols intended for export from a DLL or shared library are now
3673 marked as such (with the DL_IMPORT() macro) in the header file that
3674 declares them. This was needed for the BeOS port, and should also
3675 make some other ports easier. The PC port no longer needs the file
3676 with exported symbols (PC/python_nt.def). There's also a DL_EXPORT
3677 macro which is only used for init methods in extension modules, and
3680 Invisible changes to internals
3681 ------------------------------
3683 - Fixed a bug in new_buffersize() in fileobject.c which could
3684 return a buffer size that was way too large.
3686 - Use PySys_WriteStderr instead of fprintf in most places.
3688 - dictobject.c: remove dead code discovered by Vladimir Marangozov.
3690 - tupleobject.c: make tuples less hungry -- an extra item was
3691 allocated but never used. Tip by Vladimir Marangozov.
3693 - mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack
3696 - import.c: Jim Fulton fixes a reference count bug in
3699 - glmodule.c: check in the changed version after running the stubber
3700 again -- this solves the conflict with curses over the 'clear' entry
3701 point much nicer. (Jack Jansen had checked in the changes to cstubs
3702 eons ago, but I never regenrated glmodule.c :-( )
3704 - frameobject.c: fix reference count bug in PyFrame_New. Vladimir
3707 - stropmodule.c: add a missing DECREF in an error exit. Submitted by
3711 ======================================================================
3714 From 1.5.2a1 to 1.5.2a2
3715 =======================
3720 - It is now a syntax error to have a function argument without a
3721 default following one with a default.
3723 - __file__ is now set to the .py file if it was parsed (it used to
3724 always be the .pyc/.pyo file).
3726 - Don't exit with a fatal error during initialization when there's a
3727 problem with the exceptions.py module.
3729 - New environment variable PYTHONOPTIMIZE can be used to set -O.
3731 - New version of python-mode.el for Emacs.
3733 Miscellaneous fixed bugs
3734 ------------------------
3736 - No longer print the (confusing) error message about stack underflow
3739 - Some threading and locking bugs fixed.
3741 - When errno is zero, report "Error", not "Success".
3746 - Documentation will be released separately.
3748 - Doc strings added to array and md5 modules by Chris Petrilli.
3750 Ports and build procedure
3751 -------------------------
3753 - Stop installing when a move or copy fails.
3755 - New version of the OS/2 port code by Jeff Rush.
3757 - The makesetup script handles absolute filenames better.
3759 - The 'new' module is now enabled by default in the Setup file.
3761 - I *think* I've solved the problem with the Linux build blowing up
3762 sometimes due to a conflict between sigcheck/intrcheck and
3768 - The second argument to apply() can now be any sequence, not just a
3774 - Lists have a new method: L1.extend(L2) is equivalent to the common
3775 idiom L1[len(L1):] = L2.
3777 - Better error messages when a sequence is indexed with a non-integer.
3779 - Bettter error message when calling a non-callable object (include
3780 the type in the message).
3785 - New version of cPickle.c fixes some bugs.
3787 - pickle.py: improved instantiation error handling.
3789 - code.py: reworked quite a bit. New base class
3790 InteractiveInterpreter and derived class InteractiveConsole. Fixed
3791 several problems in compile_command().
3793 - py_compile.py: print error message and continue on syntax errors.
3794 Also fixed an old bug with the fstat code (it was never used).
3796 - pyclbr.py: support submodules of packages.
3801 - StringIO.py: raise the right exception (ValueError) for attempted
3802 I/O on closed StringIO objects.
3804 - re.py: fixed a bug in subn(), which caused .groups() to fail inside
3805 the replacement function called by sub().
3807 - The struct module has a new format 'P': void * in native mode.
3812 - Module time: Y2K robustness. 2-digit year acceptance depends on
3813 value of time.accept2dyear, initialized from env var PYTHONY2K,
3814 default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
3815 (POSIX or X/Open recommendation).
3817 - os.path: normpath(".//x") should return "x", not "/x".
3819 - getpass.py: fall back on default_getpass() when sys.stdin.fileno()
3822 - tempfile.py: regenerate the template after a fork() call.
3824 Optional OS Services
3825 --------------------
3827 - In the signal module, disable restarting interrupted system calls
3828 when we have siginterrupt().
3833 - No longer set __args__; this feature is no longer supported and can
3834 affect the debugged code.
3836 - cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
3837 added aliases and some other useful new features, e.g. much better
3838 breakpoint support: temporary breakpoint, disabled breakpoints,
3839 breakpoints with ignore counts, and conditions; breakpoints can be set
3840 on a file before it is loaded.
3845 - Changes so that JPython can use it. Also fix the calibration code
3846 so it actually works again
3848 Internet Protocols and Support
3849 ------------------------------
3851 - imaplib.py: new version from Piers Lauder.
3853 - smtplib.py: change sendmail() method to accept a single string or a
3854 list or strings as the destination (commom newbie mistake).
3856 - poplib.py: LIST with a msg argument fixed.
3858 - urlparse.py: some optimizations for common case (http).
3860 - urllib.py: support content-length in info() for ftp protocol;
3861 support for a progress meter through a third argument to
3862 urlretrieve(); commented out gopher test (the test site is dead).
3864 Internet Data handling
3865 ----------------------
3867 - sgmllib.py: support tags with - or . in their name.
3869 - mimetypes.py: guess_type() understands 'data' URLs.
3871 Restricted Execution
3872 --------------------
3874 - The classes rexec.RModuleLoader and rexec.RModuleImporter no
3880 - When reporting an exception, store its info in sys.last_*. Also,
3881 write all of it to stderr.
3883 - Added NS, EW, and NSEW constants, for grid's sticky option.
3885 - Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
3887 - Make bind variants without a sequence return a tuple of sequences
3888 (formerly it returned a string, which wasn't very convenient).
3890 - Add image commands to the Text widget (these are new in Tk 8.0).
3892 - Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
3894 - Improved the thread code (but you still can't call update() from
3895 another thread on Windows).
3897 - Fixed unnecessary references to _default_root in the new dialog
3900 - Miscellaneous problems fixed.
3906 - Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
3907 search for dependent dlls in the directory containing the .pyd.
3909 - In debugging mode, call DebugBreak() in Py_FatalError().
3914 - Install zlib.dll in the DLLs directory instead of in the win32
3915 system directory, to avoid conflicts with other applications that have
3921 - test_long.py: new test for long integers, by Tim Peters.
3923 - regrtest.py: improved so it can be used for other test suites as
3926 - test_strftime.py: use re to compare test results, to support legal
3927 variants (e.g. on Linux).
3932 - Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
3933 remove/add Windows style '\r\n' line endings), untabify.py (to remove
3934 tabs), and rgrep.yp (reverse grep).
3936 - Improvements to Tools/freeze/. Each Python module is now written to
3937 its own C file. This prevents some compilers or assemblers from
3938 blowing up on large frozen programs, and saves recompilation time if
3939 only a few modules are changed. Other changes too, e.g. new command
3940 line options -x and -i.
3942 - Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
3947 - New mechanism to support extensions of the type object while
3948 remaining backward compatible with extensions compiled for previous
3949 versions of Python 1.5. A flags field indicates presence of certain
3952 - Addition to the buffer API to differentiate access to bytes and
3953 8-bit characters (in anticipation of Unicode characters).
3955 - New argument parsing format t# ("text") to indicate 8-bit
3956 characters; s# simply means 8-bit bytes, for backwards compatibility.
3958 - New object type, bufferobject.c is an example and can be used to
3959 create buffers from memory.
3961 - Some support for 64-bit longs, including some MS platforms.
3963 - Many calls to fprintf(stderr, ...) have been replaced with calls to
3964 PySys_WriteStderr(...).
3966 - The calling context for PyOS_Readline() has changed: it must now be
3967 called with the interpreter lock held! It releases the lock around
3968 the call to the function pointed to by PyOS_ReadlineFunctionPointer
3969 (default PyOS_StdioReadline()).
3971 - New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
3973 - Renamed header file "thread.h" to "pythread.h".
3975 - The code string of code objects may now be anything that supports the
3979 ======================================================================
3982 From 1.5.1 to 1.5.2a1
3983 =====================
3988 - When searching for the library, a landmark that is a compiled module
3989 (string.pyc or string.pyo) is also accepted.
3991 - When following symbolic links to the python executable, use a loop
3992 so that a symlink to a symlink can work.
3994 - Added a hack so that when you type 'quit' or 'exit' at the
3995 interpreter, you get a friendly explanation of how to press Ctrl-D (or
3998 - New and improved Misc/python-mode.el (Python mode for Emacs).
4000 - Revert a new feature in Unix dynamic loading: for one or two
4001 revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
4002 out to be a bad idea.
4004 Miscellaneous fixed bugs
4005 ------------------------
4007 - All patches on the patch page have been integrated. (But much more
4010 - Several memory leaks plugged (e.g. the one for classes with a
4011 __getattr__ method).
4013 - Removed the only use of calloc(). This triggered an obscure bug on
4014 multiprocessor Sparc Solaris 2.6.
4016 - Fix a peculiar bug that would allow "import sys.time" to succeed
4017 (believing the built-in time module to be a part of the sys package).
4019 - Fix a bug in the overflow checking when converting a Python long to
4020 a C long (failed to convert -2147483648L, and some other cases).
4025 - Doc strings have been added to many extension modules: __builtin__,
4026 errno, select, signal, socket, sys, thread, time. Also to methods of
4027 list objects (try [].append.__doc__). A doc string on a type will now
4028 automatically be propagated to an instance if the instance has methods
4029 that are accessed in the usual way.
4031 - The documentation has been expanded and the formatting improved.
4032 (Remember that the documentation is now unbundled and has its own
4033 release cycle though; see http://www.python.org/doc/.)
4035 - Added Misc/Porting -- a mini-FAQ on porting to a new platform.
4037 Ports and build procedure
4038 -------------------------
4040 - The BeOS port is now integrated. Courtesy Chris Herborth.
4042 - Symbol files for FreeBSD 2.x and 3.x have been contributed
4043 (Lib/plat-freebsd[23]/*).
4045 - Support HPUX 10.20 DCE threads.
4047 - Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
4048 works, it won't also use -Olimit 1500 (which gives a warning for every
4049 file). Also support the SGI_ABI environment variable better.
4051 - The makesetup script now understands absolute pathnames ending in .o
4052 in the module -- it assumes it's a file for which we have no source.
4054 - Other miscellaneous improvements to the configure script and
4057 - The test suite now uses a different sound sample.
4062 - Better checks for invalid input to int(), long(), string.atoi(),
4063 string.atol(). (Formerly, a sign without digits would be accepted as
4064 a legal ways to spell zero.)
4066 - Changes to map() and filter() to use the length of a sequence only
4067 as a hint -- if an IndexError happens earlier, take that. (Formerly,
4068 this was considered an error.)
4070 - Experimental feature in getattr(): a third argument can specify a
4071 default (instead of raising AttributeError).
4073 - Implement round() slightly different, so that for negative ndigits
4074 no additional errors happen in the last step.
4076 - The open() function now adds the filename to the exception when it
4082 - New standard exceptions EnvironmentError and PosixError.
4083 EnvironmentError is the base class for IOError and PosixError;
4084 PosixError is the same as os.error. All this so that either exception
4085 class can be instantiated with a third argument indicating a filename.
4086 The built-in function open() and most os/posix functions that take a
4087 filename argument now use this.
4092 - List objects now have an experimental pop() method; l.pop() returns
4093 and removes the last item; l.pop(i) returns and removes the item at
4094 i. Also, the sort() method is faster again. Sorting is now also
4095 safer: it is impossible for the sorting function to modify the list
4096 while the sort is going on (which could cause core dumps).
4098 - Changes to comparisons: numbers are now smaller than any other type.
4099 This is done to prevent the circularity where [] < 0L < 1 < [] is
4100 true. As a side effect, cmp(None, 0) is now positive instead of
4101 negative. This *shouldn't* affect any working code, but I've found
4102 that the change caused several "sleeping" bugs to become active, so
4105 - Instance methods may now have other callable objects than just
4106 Python functions as their im_func. Use new.instancemethod() or write
4107 your own C code to create them; new.instancemethod() may be called
4108 with None for the instance to create an unbound method.
4110 - Assignment to __name__, __dict__ or __bases__ of a class object is
4111 now allowed (with stringent type checks); also allow assignment to
4112 __getattr__ etc. The cached values for __getattr__ etc. are
4113 recomputed after such assignments (but not for derived classes :-( ).
4115 - Allow assignment to some attributes of function objects: func_code,
4116 func_defaults and func_doc / __doc__. (With type checks except for
4117 __doc__ / func_doc .)
4122 - New tests (in Lib/test): reperf.py (regular expression benchmark),
4123 sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
4124 for the MimeWriter module).
4126 - Generalized test/regrtest.py so that it is useful for testing other
4129 - The ihooks.py module now understands package imports.
4131 - In code.py, add a class that subsumes Fredrik Lundh's
4132 PythonInterpreter class. The interact() function now uses this.
4134 - In rlcompleter.py, in completer(), return None instead of raising an
4135 IndexError when there are no more completions left.
4137 - Fixed the marshal module to test for certain common kinds of invalid
4138 input. (It's still not foolproof!)
4140 - In the operator module, add an alias (now the preferred name)
4141 "contains" for "sequenceincludes".
4146 - In the string and strop modules, in the replace() function, treat an
4147 empty pattern as an error (since it's not clear what was meant!).
4149 - Some speedups to re.py, especially the string substitution and split
4150 functions. Also added new function/method findall(), to find all
4151 occurrences of a given substring.
4153 - In cStringIO, add better argument type checking and support the
4154 readonly 'closed' attribute (like regular files).
4156 - In the struct module, unsigned 1-2 byte sized formats no longer
4157 result in long integer values.
4159 Miscellaneous services
4160 ----------------------
4162 - In whrandom.py, added new method and function randrange(), same as
4163 choice(range(start, stop, step)) but faster. This addresses the
4164 problem that randint() was accidentally defined as taking an inclusive
4165 range. Also, randint(a, b) is now redefined as randrange(a, b+1),
4166 adding extra range and type checking to its arguments!
4168 - Add some semi-thread-safety to random.gauss() (it used to be able to
4169 crash when invoked from separate threads; now the worst it can do is
4170 give a duplicate result occasionally).
4172 - Some restructuring and generalization done to cmd.py.
4174 - Major upgrade to ConfigParser.py; converted to using 're', added new
4175 exceptions, support underscore in section header and option name. No
4176 longer add 'name' option to every section; instead, add '__name__'.
4178 - In getpass.py, don't use raw_input() to ask for the password -- we
4179 don't want it to show up in the readline history! Also don't catch
4180 interrupts (the try-finally already does all necessary cleanup).
4185 - New functions in os.py: makedirs(), removedirs(), renames(). New
4186 variable: linesep (the line separator as found in binary files,
4187 i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
4188 this with files opened in (default) text mode; the line separator used
4189 will always be '\n'!
4191 - Changes to the 'os.path' submodule of os.py: added getsize(),
4192 getmtime(), getatime() -- these fetch the most popular items from the
4195 - In the time module, add strptime(), if it exists. (This parses a
4196 time according to a format -- the inverse of strftime().) Also,
4197 remove the call to mktime() from strftime() -- it messed up the
4198 formatting of some non-local times.
4200 - In the socket module, added a new function gethostbyname_ex().
4201 Also, don't use #ifdef to test for some symbols that are enums on some
4202 platforms (and should exist everywhere).
4204 Optional OS Services
4205 --------------------
4207 - Some fixes to gzip.py. In particular, the readlines() method now
4208 returns the lines *with* trailing newline characters, like readlines()
4209 of regular file objects. Also, it didn't work together with cPickle;
4212 - In whichdb.py, support byte-swapped dbhash (bsddb) files.
4214 - In anydbm.py, look at the type of an existing database to determine
4215 which module to use to open it. (The anydbm.error exception is now a
4221 - In the termios module, in tcsetattr(), initialize the structure vy
4222 calling tcgetattr().
4224 - Added some of the "wait status inspection" macros as functions to
4225 the posix module (and thus to the os module): WEXITSTATUS(),
4226 WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
4228 - In the syslog module, make the default facility more intuitive
4229 (matching the docs).
4234 - In pdb.py, support for setting breaks on files/modules that haven't
4237 Internet Protocols and Support
4238 ------------------------------
4240 - Changes in urllib.py; sped up unquote() and quote(). Fixed an
4241 obscure bug in quote_plus(). Added urlencode(dict) -- convenience
4242 function for sending a POST request with urlopen(). Use the getpass
4243 module to ask for a password. Rewrote the (test) main program so that
4244 when used as a script, it can retrieve one or more URLs to stdout.
4245 Use -t to run the self-test. Made the proxy code work again.
4247 - In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
4248 fail when someone asks for their HEAD. Also, for POST, set the
4249 default content-type to application/x-www-form-urlencoded. Also, in
4250 FieldStorage.__init__(), when method='GET', always get the query
4251 string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
4252 explicitly passed in fp.
4254 - The smtplib.py module now supports ESMTP and has improved standard
4255 compliance, for picky servers.
4257 - Improved imaplib.py.
4259 - Fixed UDP support in SocketServer.py (it never worked).
4261 - Fixed a small bug in CGIHTTPServer.py.
4263 Internet Data handling
4264 ----------------------
4266 - In rfc822.py, add a new class AddressList. Also support a new
4267 overridable method, isheader(). Also add a get() method similar to
4268 dictionaries (and make getheader() an alias for it). Also, be smarter
4269 about seekable (test whether fp.tell() works) and test for presence of
4270 unread() method before trying seeks.
4272 - In sgmllib.py, restore the call to report_unbalanced() that was lost
4273 long ago. Also some other improvements: handle <? processing
4274 instructions >, allow . and - in entity names, and allow \r\n as line
4277 - Some restructuring and generalization done to multifile.py; support
4280 Restricted Execution
4281 --------------------
4283 - Improvements to rexec.py: package support; support a (minimal)
4284 sys.exc_info(). Also made the (test) main program a bit fancier (you
4285 can now use it to run arbitrary Python scripts in restricted mode).
4290 - On Unix, Tkinter can now safely be used from a multi-threaded
4291 application. (Formerly, no threads would make progress while
4292 Tkinter's mainloop() was active, because it didn't release the Python
4293 interpreter lock.) Unfortunately, on Windows, threads other than the
4294 main thread should not call update() or update_idletasks() because
4295 this will deadlock the application.
4297 - An interactive interpreter that uses readline and Tkinter no longer
4298 uses up all available CPU time.
4300 - Even if readline is not used, Tk windows created in an interactive
4301 interpreter now get continuously updated. (This even works in Windows
4302 as long as you don't hit a key.)
4304 - New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
4306 - No longer register Tcl_finalize() as a low-level exit handler. It
4307 may call back into Python, and that's a bad idea.
4309 - Allow binding of Tcl commands (given as a string).
4311 - Some minor speedups; replace explicitly coded getint() with int() in
4314 - In FileDialog.py, remember the directory of the selected file, if
4317 - Change the names of all methods in the Wm class: they are now
4318 wm_title(), etc. The old names (title() etc.) are still defined as
4321 - Add a new method of interpreter objects, interpaddr(). This returns
4322 the address of the Tcl interpreter object, as an integer. Not very
4323 useful for the Python programmer, but this can be called by another C
4324 extension that needs to make calls into the Tcl/Tk C API and needs to
4325 get the address of the Tcl interpreter object. A simple cast of the
4326 return value to (Tcl_Interp *) will do the trick.
4331 - Don't insist on proper case for module source files if the filename
4332 is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
4333 doesn't). This should address problems with this feature on
4334 oldfashioned filesystems (Novell servers?).
4339 - os.environ is now all uppercase, but accesses are case insensitive,
4340 and the putenv() calls made as a side effect of changing os.environ
4341 are case preserving.
4343 - Removed samefile(), sameopenfile(), samestat() from os.path (aka
4344 ntpath.py) -- these cannot be made to work reliably (at least I
4347 - Fixed os.pipe() so that it returns file descriptors acceptable to
4348 os.read() and os.write() (like it does on Unix), rather than Windows
4351 - Added a table of WSA error codes to socket.py.
4353 - In the select module, put the (huge) file descriptor arrays on the
4356 - The getpass module now raises KeyboardInterrupt when it sees ^C.
4358 - In mailbox.py, fix tell/seek when using files opened in text mode.
4360 - In rfc822.py, fix tell/seek when using files opened in text mode.
4362 - In the msvcrt extension module, release the interpreter lock for
4363 calls that may block: _locking(), _getch(), _getche(). Also fix a
4364 bogus error return when open_osfhandle() doesn't have the right
4370 - The registry key used is now "1.5" instead of "1.5.x" -- so future
4371 versions of 1.5 and Mark Hammond's win32all installer don't need to be
4377 - Several improvements to freeze specifically for Windows.
4379 Windows Build Procedure
4380 -----------------------
4382 - The VC++ project files and the WISE installer have been moved to the
4383 PCbuild subdirectory, so they are distributed in the same subdirectory
4384 where they must be used. This avoids confusion.
4386 - New project files for Windows 3.1 port by Jim Ahlstrom.
4388 - Got rid of the obsolete subdirectory PC/setup_nt/.
4390 - The projects now use distinct filenames for the .exe, .dll, .lib and
4391 .pyd files built in debug mode (by appending "_d" to the base name,
4392 before the extension). This makes it easier to switch between the two
4393 and get the right versions. There's a pragma in config.h that directs
4394 the linker to include the appropriate .lib file (so python15.lib no
4395 longer needs to be explicit in your project).
4397 - The installer now installs more files (e.g. config.h). The idea is
4398 that you shouldn't need the source distribution if you want build your
4399 own extensions in C or C++.
4404 - New script nm2def.py by Marc-Andre Lemburg, to construct
4405 PC/python_nt.def automatically (some hand editing still required).
4407 - New tool ndiff.py: Tim Peters' text diffing tool.
4409 - Various and sundry improvements to the freeze script.
4411 - The script texi2html.py (which was part of the Doc tree but is no
4412 longer used there) has been moved to the Tools/scripts subdirectory.
4414 - Some generalizations in the webchecker code. There's now a
4415 primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
4417 - The ftpmirror.py script now handles symbolic links properly, and
4418 also files with multiple spaces in their names.
4420 - The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
4421 last line is both indented and lacks a newline. This is now fixed.
4426 - Added missing prototypes for PyEval_CallFunction() and
4427 PyEval_CallMethod().
4429 - New macro PyList_SET_ITEM().
4431 - New macros to access object members for PyFunction, PyCFunction
4434 - New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
4435 dynamically add one or many entries to the table of built-in modules.
4437 - New macro Py_InitModule3(name, methods, doc) which calls
4438 Py_InitModule4() with appropriate arguments. (The -4 variant requires
4439 you to pass an obscure version number constant which is always the same.)
4441 - New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
4442 sys.stdout or sys.stderr using a printf-like interface. (Used in
4443 _tkinter.c, for example.)
4445 - New APIs for conversion between Python longs and C 'long long' if
4446 your compiler supports it.
4448 - PySequence_In() is now called PySequence_Contains().
4449 (PySequence_In() is still supported for b/w compatibility; it is
4450 declared obsolete because its argument order is confusing.)
4452 - PyDict_GetItem() and PyDict_GetItemString() are changed so that they
4453 *never* raise an exception -- (even if the hash() fails, simply clear
4454 the error). This was necessary because there is lots of code out
4455 there that already assumes this.
4457 - Changes to PySequence_Tuple() and PySequence_List() to use the
4458 length of a sequence only as a hint -- if an IndexError happens
4459 earlier, take that. (Formerly, this was considered an error.)
4461 - Reformatted abstract.c to give it a more familiar "look" and fixed
4462 many error checking bugs.
4464 - Add NULL pointer checks to all calls of a C function through a type
4465 object and extensions (e.g. nb_add).
4467 - The code that initializes sys.path now calls Py_GetPythonHome()
4468 instead of getenv("PYTHONHOME"). This, together with the new API
4469 Py_SetPythonHome(), makes it easier for embedding applications to
4470 change the notion of Python's "home" directory (where the libraries
4473 - Fixed a very old bug in the parsing of "O?" format specifiers.
4476 ======================================================================
4479 ========================================
4480 ==> Release 1.5.1 (October 31, 1998) <==
4481 ========================================
4489 - The documentation is now unbundled. It has also been extensively
4490 modified (mostly to implement a new and more uniform formatting
4491 style). We figure that most people will prefer to download one of the
4492 preformatted documentation sets (HTML, PostScript or PDF) and that
4493 only a minority have a need for the LaTeX or FrameMaker sources. Of
4494 course, the unbundled documentation sources still released -- just not
4495 in the same archive file, and perhaps not on the same date.
4497 - All bugs noted on the errors page (and many unnoted) are fixed. All
4498 new bugs take their places.
4500 - No longer a core dump when attempting to print (or repr(), or str())
4501 a list or dictionary that contains an instance of itself; instead, the
4502 recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
4503 Py_ReprLeave() below. Comparisons of such objects still go beserk,
4504 since this requires a different kind of fix; fortunately, this is a
4505 less common scenario in practice.
4510 - The raise statement can now be used without arguments, to re-raise
4511 a previously set exception. This should be used after catching an
4512 exception with an except clause only, either in the except clause or
4513 later in the same function.
4515 Import and module handling
4516 --------------------------
4518 - The implementation of import has changed to use a mutex (when
4519 threading is supported). This means that when two threads
4520 simultaneously import the same module, the import statements are
4521 serialized. Recursive imports are not affected.
4523 - Rewrote the finalization code almost completely, to be much more
4524 careful with the order in which modules are destroyed. Destructors
4525 will now generally be able to reference built-in names such as None
4528 - Case-insensitive platforms such as Mac and Windows require the case
4529 of a module's filename to match the case of the module name as
4530 specified in the import statement (see below).
4532 - The code for figuring out the default path now distinguishes between
4533 files, modules, executable files, and directories. When expecting a
4534 module, we also look for the .pyc or .pyo file.
4536 Parser/tokenizer changes
4537 ------------------------
4539 - The tokenizer can now warn you when your source code mixes tabs and
4540 spaces for indentation in a manner that depends on how much a tab is
4541 worth in spaces. Use "python -t" or "python -v" to enable this
4542 option. Use "python -tt" to turn the warnings into errors. (See also
4543 tabnanny.py and tabpolice.py below.)
4545 - Return unsigned characters from tok_nextc(), so '\377' isn't
4546 mistaken for an EOF character.
4548 - Fixed two pernicious bugs in the tokenizer that only affected AIX.
4549 One was actually a general bug that was triggered by AIX's smaller I/O
4550 buffer size. The other was a bug in the AIX optimizer's loop
4551 unrolling code; swapping two statements made the problem go away.
4553 Tools, demos and miscellaneous files
4554 ------------------------------------
4556 - There's a new version of Misc/python-mode.el (the Emacs mode for
4557 Python) which is much smarter about guessing the indentation style
4558 used in a particular file. Lots of other cool features too!
4560 - There are two new tools in Tools/scripts: tabnanny.py and
4561 tabpolice.py, implementing two different ways of checking whether a
4562 file uses indentation in a way that is sensitive to the interpretation
4563 of a tab. The preferred module is tabnanny.py (by Tim Peters).
4565 - Some new demo programs:
4567 Demo/tkinter/guido/paint.py -- Dave Mitchell
4568 Demo/sockets/unixserver.py -- Piet van Oostrum
4571 - Much better freeze support. The freeze script can now freeze
4572 hierarchical module names (with a corresponding change to import.c),
4573 and has a few extra options (e.g. to suppress freezing specific
4574 modules). It also does much more on Windows NT.
4576 - Version 1.0 of the faq wizard is included (only very small changes
4577 since version 0.9.0).
4579 - New feature for the ftpmirror script: when removing local files
4580 (i.e., only when -r is used), do a recursive delete.
4582 Configuring and building Python
4583 -------------------------------
4585 - Get rid of the check for -linet -- recent Sequent Dynix systems don't
4586 need this any more and apparently it screws up their configuration.
4588 - Some changes because gcc on SGI doesn't support '-all'.
4590 - Changed the build rules to use $(LIBRARY) instead of
4591 -L.. -lpython$(VERSION)
4592 since the latter trips up the SunOS 4.1.x linker (sigh).
4594 - Fix the bug where the '# dgux is broken' comment in the Makefile
4595 tripped over Make on some platforms.
4597 - Changes for AIX: install the python.exp file; properly use
4598 $(srcdir); the makexp_aix script now removes C++ entries of the form
4601 - Deleted some Makefile targets only used by the (long obsolete)
4607 - Performance and threading improvements to the socket and bsddb
4608 modules, by Christopher Lindblad of Infoseek.
4610 - Added operator.__not__ and operator.not_.
4612 - In the thread module, when a thread exits due to an unhandled
4613 exception, don't store the exception information in sys.last_*; it
4614 prevents proper calling of destructors of local variables.
4616 - Fixed a number of small bugs in the cPickle module.
4618 - Changed find() and rfind() in the strop module so that
4619 find("x","",2) returns -1, matching the implementation in string.py.
4621 - In the time module, be more careful with the result of ctime(), and
4622 test for HAVE_MKTIME before usinmg mktime().
4624 - Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
4627 - Added the LOG_SYSLOG constant to the syslog module, if defined.
4629 Standard library modules
4630 ------------------------
4632 - All standard library modules have been converted to an indentation
4633 style using either only tabs or only spaces -- never a mixture -- if
4634 they weren't already consistent according to tabnanny. This means
4635 that the new -t option (see above) won't complain about standard
4638 - New standard library modules:
4640 threading -- GvR and the thread-sig
4641 Java style thread objects -- USE THIS!!!
4643 getpass -- Piers Lauder
4644 simple utilities to prompt for a password and to
4645 retrieve the current username
4647 imaplib -- Piers Lauder
4648 interface for the IMAP4 protocol
4650 poplib -- David Ascher, Piers Lauder
4651 interface for the POP3 protocol
4653 smtplib -- Dragon De Monsyne
4654 interface for the SMTP protocol
4656 - Some obsolete modules moved to a separate directory (Lib/lib-old)
4657 which is *not* in the default module search path:
4669 - New version of the PCRE code (Perl Compatible Regular Expressions --
4670 the re module and the supporting pcre extension) by Andrew Kuchling.
4671 Incompatible new feature in re.sub(): the handling of escapes in the
4672 replacement string has changed.
4674 - Interface change in the copy module: a __deepcopy__ method is now
4675 called with the memo dictionary as an argument.
4677 - Feature change in the tokenize module: differentiate between NEWLINE
4678 token (an official newline) and NL token (a newline that the grammar
4681 - Several bugfixes to the urllib module. It is now truly thread-safe,
4682 and several bugs and a portability problem have been fixed. New
4683 features, all due to Sjoerd Mullender: When creating a temporary file,
4684 it gives it an appropriate suffix. Support the "data:" URL scheme.
4685 The open() method uses the tempcache.
4687 - New version of the xmllib module (this time with a test suite!) by
4690 - Added debugging code to the telnetlib module, to be able to trace
4693 - In the rfc822 module, added support for deleting a header (still no
4694 support for adding headers, though). Also fixed a bug where an
4695 illegal address would cause a crash in getrouteaddr(), fixed a
4696 sign reversal in mktime_tz(), and use the local timezone by default
4697 (the latter two due to Bill van Melle).
4699 - The normpath() function in the dospath and ntpath modules no longer
4700 does case normalization -- for that, use the separate function
4701 normcase() (which always existed); normcase() has been sped up and
4702 fixed (it was the cause of a crash in Mark Hammond's installer in
4705 - New command supported by the ftplib module: rmd(); also fixed some
4708 - The profile module now uses a different timer function by default --
4709 time.clock() is generally better than os.times(). This makes it work
4710 better on Windows NT, too.
4712 - The tempfile module now recovers when os.getcwd() raises an
4715 - Fixed some bugs in the random module; gauss() was subtly wrong, and
4716 vonmisesvariate() should return a full circle. Courtesy Mike Miller,
4717 Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
4719 - Better default seed in the whrandom module, courtesy Andrew Kuchling.
4721 - Fix slow close() in shelve module.
4723 - The Unix mailbox class in the mailbox module is now more robust when
4724 a line begins with the string "From " but is definitely not the start
4725 of a new message. The pattern used can be changed by overriding a
4726 method or class variable.
4728 - Added a rmtree() function to the copy module.
4730 - Fixed several typos in the pickle module. Also fixed problems when
4731 unpickling in restricted execution environments.
4733 - Added docstrings and fixed a typo in the py_compile and compileall
4734 modules. At Mark Hammond's repeated request, py_compile now append a
4735 newline to the source if it needs one. Both modules support an extra
4736 parameter to specify the purported source filename (to be used in
4739 - Some performance tweaks by Jeremy Hylton to the gzip module.
4741 - Fixed a bug in the merge order of dictionaries in the ConfigParser
4742 module. Courtesy Barry Warsaw.
4744 - In the multifile module, support the optional second parameter to
4745 seek() when possible.
4747 - Several fixes to the gopherlib module by Lars Marius Garshol. Also,
4748 urlparse now correctly handles Gopher URLs with query strings.
4750 - Fixed a tiny bug in format_exception() in the traceback module.
4751 Also rewrite tb_lineno() to be compatible with JPython (and not
4752 disturb the current exception!); by Jim Hugunin.
4754 - The httplib module is more robust when servers send a short response
4755 -- courtesy Tim O'Malley.
4760 - Various typos and bugs fixed.
4762 - New module Tkdnd implements a drag-and-drop protocol (within one
4765 - The event_*() widget methods have been restructured slightly -- they
4766 no longer use the default root.
4768 - The interfaces for the bind*() and unbind() widget methods have been
4769 redesigned; the bind*() methods now return the name of the Tcl command
4770 created for the callback, and this can be passed as a optional
4771 argument to unbind() in order to delete the command (normally, such
4772 commands are automatically unbound when the widget is destroyed, but
4773 for some applications this isn't enough).
4775 - Variable objects now have trace methods to interface to Tcl's
4776 variable tracing facilities.
4778 - Image objects now have an optional keyword argument, 'master', to
4779 specify a widget (tree) to which they belong. The image_names() and
4780 image_types() calls are now also widget methods.
4782 - There's a new global call, Tkinter.NoDefaultRoot(), which disables
4783 all use of the default root by the Tkinter library. This is useful to
4784 debug applications that are in the process of being converted from
4785 relying on the default root to explicit specification of the root
4788 - The 'exit' command is deleted from the Tcl interpreter, since it
4789 provided a loophole by which one could (accidentally) exit the Python
4790 interpreter without invoking any cleanup code.
4792 - Tcl_Finalize() is now registered as a Python low-level exit handle,
4793 so Tcl will be finalized when Python exits.
4798 - New function PyThreadState_GetDict() returns a per-thread dictionary
4799 intended for storing thread-local global variables.
4801 - New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
4802 dictionary to allow recursive container types to detect recursion in
4803 their repr(), str() and print implementations.
4805 - New function PyObject_Not(x) calculates (not x) according to Python's
4806 standard rules (basically, it negates the outcome PyObject_IsTrue(x).
4808 - New function _PyModule_Clear(), which clears a module's dictionary
4809 carefully without removing the __builtins__ entry. This is implied
4810 when a module object is deallocated (this used to clear the dictionary
4813 - New function PyImport_ExecCodeModuleEx(), which extends
4814 PyImport_ExecCodeModule() by adding an extra parameter to pass it the
4817 - New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
4818 allow embedded applications to force a different value for PYTHONHOME.
4820 - New global flag Py_FrozenFlag is set when this is a "frozen" Python
4821 binary; it suppresses warnings about not being able to find the
4822 standard library directories.
4824 - New global flag Py_TabcheckFlag is incremented by the -t option and
4825 causes the tokenizer to issue warnings or errors about inconsistent
4826 mixing of tabs and spaces for indentation.
4828 Miscellaneous minor changes and bug fixes
4829 -----------------------------------------
4831 - Improved the error message when an attribute of an attribute-less
4832 object is requested -- include the name of the attribute and the type
4833 of the object in the message.
4835 - Sped up int(), long(), float() a bit.
4837 - Fixed a bug in list.sort() that would occasionally dump core.
4839 - Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
4840 when taken tothe real power.
4842 - Fixed a number of bugs in the file reading code, at least one of
4843 which could cause a core dump on NT, and one of which would
4844 occasionally cause file.read() to return less than the full contents
4847 - Performance hack by Vladimir Marangozov for stack frame creation.
4849 - Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
4854 - The .lib files are now part of the distribution; they are collected
4855 in the subdirectory "libs" of the installation directory.
4857 - The extension modules (.pyd files) are now collected in a separate
4858 subdirectory of the installation directory named "DLLs".
4860 - The case of a module's filename must now match the case of the
4861 module name as specified in the import statement. This is an
4862 experimental feature -- if it turns out to break in too many
4863 situations, it will be removed (or disabled by default) in the future.
4864 It can be disabled on a per-case basis by setting the environment
4865 variable PYTHONCASEOK (to any value).
4868 ======================================================================
4871 =====================================
4872 ==> Release 1.5 (January 3, 1998) <==
4873 =====================================
4879 - Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
4881 - Added doc strings to string.py, stropmodule.c, structmodule.c,
4882 thanks to Charles Waldman.
4884 - Many nits fixed in the manuals, thanks to Fred Drake and many others
4885 (especially Rob Hooft and Andrew Kuchling). The HTML version now uses
4886 HTML markup instead of inline GIF images for tables; only two images
4887 are left (for obsure bits of math). The index of the HTML version has
4888 also been much improved. Finally, it is once again possible to
4889 generate an Emacs info file from the library manual (but I don't
4890 commit to supporting this in future versions).
4892 - New module: telnetlib.py (a simple telnet client library).
4894 - New tool: Tools/versioncheck/, by Jack Jansen.
4896 - Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
4897 DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
4900 - Many small changes again to Tkinter.py -- mostly bugfixes and adding
4901 missing routines. Thanks to Greg McFarlane for reporting a bunch of
4902 problems and proofreading my fixes.
4904 - The re module and its documentation are up to date with the latest
4905 version released to the string-sig (Dec. 22).
4907 - Stop test_grp.py from failing when the /etc/group file is empty
4908 (yes, this happens!).
4910 - Fix bug in integer conversion (mystrtoul.c) that caused
4911 4294967296==0 to be true!
4913 - The VC++ 4.2 project file should be complete again.
4915 - In tempfile.py, use a better template on NT, and add a new optional
4916 argument "suffix" with default "" to specify a specific extension for
4917 the temporary filename (needed sometimes on NT but perhaps also handy
4920 - Fixed some bugs in the FAQ wizard, and converted it to use re
4923 - Fixed a mysteriously undetected error in dlmodule.c (it was using a
4924 totally bogus routine name to raise an exception).
4926 - Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
4928 - Hopefully harmless changes to the build process to support shared
4929 libraries on DG/UX. This adds a target to create
4930 libpython$(VERSION).so; however this target is *only* for DG/UX.
4932 - Fixed a bug in the new format string error checking in getargs.c.
4934 - A simple fix for infinite recursion when printing __builtins__:
4935 reset '_' to None before printing and set it to the printed variable
4936 *after* printing (and only when printing is successful).
4938 - Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
4939 parent window is not (Skip Montanaro).
4941 - Fixed the two most annoying problems with ftp URLs in
4942 urllib.urlopen(); an empty file now correctly raises an error, and it
4943 is no longer required to explicitly close the returned "file" object
4944 before opening another ftp URL to the same host and directory.
4947 ======================================================================
4953 - Fixed a bug in cPickle.c that caused it to crash right away because
4954 the version string had a different format.
4956 - Changes in pickle.py and cPickle.c: when unpickling an instance of a
4957 class that doesn't define the __getinitargs__() method, the __init__()
4958 constructor is no longer called. This makes a much larger group of
4959 classes picklable by default, but may occasionally change semantics.
4960 To force calling __init__() on unpickling, define a __getinitargs__()
4961 method. Other changes too, in particular cPickle now handles classes
4962 defined in packages correctly. The same change applies to copying
4963 instances with copy.py. The cPickle.c changes and some pickle.py
4964 changes are courtesy Jim Fulton.
4966 - Locale support in he "re" (Perl regular expressions) module. Use
4967 the flag re.L (or re.LOCALE) to enable locale-specific matching
4968 rules for \w and \b. The in-line syntax for this flag is (?L).
4970 - The built-in function isinstance(x, y) now also succeeds when y is
4971 a type object and type(x) is y.
4973 - repr() and str() of class and instance objects now reflect the
4974 package/module in which the class is defined.
4976 - Module "ni" has been removed. (If you really need it, it's been
4977 renamed to "ni1". Let me know if this causes any problems for you.
4978 Package authors are encouraged to write __init__.py files that
4979 support both ni and 1.5 package support, so the same version can be
4980 used with Python 1.4 as well as 1.5.)
4982 - The thread module is now automatically included when threads are
4983 configured. (You must remove it from your existing Setup file,
4984 since it is now in its own Setup.thread file.)
4986 - New command line option "-x" to skip the first line of the script;
4987 handy to make executable scripts on non-Unix platforms.
4989 - In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
4990 haven't checked how this affects things, but it should make symbols
4991 in one shared library available to the next one.
4993 - The Windows installer now installs in the "Program Files" folder on
4994 the proper volume by default.
4996 - The Windows configuration adds a new main program, "pythonw", and
4997 registers a new extension, ".pyw" that invokes this. This is a
4998 pstandard Python interpreter that does not pop up a console window;
4999 handy for pure Tkinter applications. All output to the original
5000 stdout and stderr is lost; reading from the original stdin yields
5001 EOF. Also, both python.exe and pythonw.exe now have a pretty icon
5002 (a green snake in a box, courtesy Mark Hammond).
5004 - Lots of improvements to emacs-mode.el again. See Barry's web page:
5005 http://www.python.org/ftp/emacs/pmdetails.html.
5007 - Lots of improvements and additions to the library reference manual;
5010 - Doc strings for the following modules: rfc822.py, posixpath.py,
5011 ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
5013 - Some more regression testing.
5015 - An optional 4th (maxsplit) argument to strop.replace().
5017 - Fixed handling of maxsplit in string.splitfields().
5019 - Tweaked os.environ so it can be pickled and copied.
5021 - The portability problems caused by indented preprocessor commands
5022 and C++ style comments should be gone now.
5024 - In random.py, added Pareto and Weibull distributions.
5026 - The crypt module is now disabled in Modules/Setup.in by default; it
5027 is rarely needed and causes errors on some systems where users often
5028 don't know how to deal with those.
5030 - Some improvements to the _tkinter build line suggested by Case Roole.
5032 - A full suite of platform specific files for NetBSD 1.x, submitted by
5035 - New Solaris specific header STROPTS.py.
5037 - Moved a confusing occurrence of *shared* from the comments in
5038 Modules/Setup.in (people would enable this one instead of the real
5039 one, and get disappointing results).
5041 - Changed the default mode for directories to be group-writable when
5042 the installation process creates them.
5044 - Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
5045 shared libraries for both.
5047 - Support FreeBSD and NetBSD in posixfile.py.
5049 - Support for the "event" command, new in Tk 4.2. By Case Roole.
5051 - Add Tix_SafeInit() support to tkappinit.c.
5053 - Various bugs fixed in "re.py" and "pcre.c".
5055 - Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
5057 - In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
5060 - Provide default blocksize for retrbinary in ftplib.py (Skip
5063 - In NT, pick the username up from different places in user.py (Jeff
5066 - Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
5068 - Many small improvements to Jeff Rush' OS/2 support.
5070 - ospath.py is gone; it's been obsolete for so many years now...
5072 - The reference manual is now set up to prepare better HTML (still
5073 using webmaker, alas).
5075 - Add special handling to /Tools/freeze for Python modules that are
5076 imported implicitly by the Python runtime: 'site' and 'exceptions'.
5078 - Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
5079 inside <PRE>, by "Scott".
5081 - Added ConfigParser.py, a generic parser for sectioned configuration
5084 - In _localemodule.c, LC_MESSAGES is not always defined; put it
5087 - Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
5089 - Demo/scripts/newslist.py: Fix the way the version number is gotten
5090 out of the RCS revision.
5092 - PyArg_Parse[Tuple] now explicitly check for bad characters at the
5093 end of the format string.
5095 - Revamped PC/example_nt to support VC++ 5.x.
5097 - <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
5098 after studying the GNU libg++ quicksort. This should be much faster
5099 if there are lots of duplicates, and otherwise at least as good.
5101 - Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
5102 uudecode bug where it complaints about trailing garbage is still there
5105 - pickle.py requires integers in text mode to be in decimal notation
5106 (it used to accept octal and hex, even though it would only generate
5109 - In string.atof(), don't fail when the "re" module is unavailable.
5110 Plug the ensueing security leak by supplying an empty __builtins__
5111 directory to eval().
5113 - A bunch of small fixes and improvements to Tkinter.py.
5115 - Fixed a buffer overrun in PC/getpathp.c.
5118 ======================================================================
5124 - The Windows NT/95 installer now includes full HTML of all manuals.
5125 It also has a checkbox that lets you decide whether to install the
5126 interpreter and library. The WISE installer script for the installer
5127 is included in the source tree as PC/python15.wse, and so are the
5128 icons used for Python files. The config.c file for the Windows build
5129 is now complete with the pcre module.
5131 - sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
5132 evaluated for the prompt.
5134 - The reference manual is brought up to date (more or less -- it still
5135 needs work, e.g. in the area of package import).
5137 - The icons used by latex2html are now included in the Doc
5138 subdirectory (mostly so that tarring up the HTML files can be fully
5139 automated). A simple index.html is also added to Doc (it only works
5140 after you have successfully run latex2html).
5142 - For all you would-be proselytizers out there: a new version of
5143 Misc/BLURB describes Python more concisely, and Misc/comparisons
5144 compares Python to several other languages. Misc/BLURB.WINDOWS
5145 contains a blurb specifically aimed at Windows programmers (by Mark
5148 - A new version of the Python mode for Emacs is included as
5149 Misc/python-mode.el. There are too many new features to list here.
5150 See http://www.python.org/ftp/emacs/pmdetails.html for more info.
5152 - New module fileinput makes iterating over the lines of a list of
5153 files easier. (This still needs some more thinking to make it more
5156 - There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
5157 version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
5158 Age C++ compiler. I expect that Jeff will also provide a binary
5159 release for this platform.
5161 - On Linux, the configure script now uses '-Xlinker -export-dynamic'
5162 instead of '-rdynamic' to link the main program so that it exports its
5163 symbols to shared libraries it loads dynamically. I hope this doesn't
5164 break on older Linux versions; it is needed for mklinux and appears to
5165 work on Linux 2.0.30.
5167 - Some Tkinter resstructuring: the geometry methods that apply to a
5168 master are now properly usable on toplevel master widgets. There's a
5169 new (internal) widget class, BaseWidget. New, longer "official" names
5170 for the geometry manager methods have been added,
5171 e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
5172 shorter names still work, and where there's ambiguity, pack wins over
5173 place wins over grid. Also, the bind_class method now returns its
5176 - New, RFC-822 conformant parsing of email addresses and address lists
5177 in the rfc822 module, courtesy Ben Escoto.
5179 - New, revamped tkappinit.c with support for popular packages (PIL,
5180 TIX, BLT, TOGL). For the last three, you need to execute the Tcl
5181 command "load {} Tix" (or Blt, or Togl) to gain access to them.
5182 The Modules/Setup line for the _tkinter module has been rewritten
5183 using the cool line-breaking feature of most Bourne shells.
5185 - New socket method connect_ex() returns the error code from connect()
5186 instead of raising an exception on errors; this makes the logic
5187 required for asynchronous connects simpler and more efficient.
5189 - New "locale" module with (still experimental) interface to the
5190 standard C library locale interface, courtesy Martin von Loewis. This
5191 does not repeat my mistake in 1.5a4 of always calling
5192 setlocale(LC_ALL, ""). In fact, we've pretty much decided that
5193 Python's standard numerical formatting operations should always use
5194 the conventions for the C locale; the locale module contains utility
5195 functions to format numbers according to the user specified locale.
5196 (All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
5197 "C") after locale-changing calls.) See the library manual. (Alas, the
5198 promised changes to the "re" module for locale support have not been
5199 materialized yet. If you care, volunteer!)
5201 - Memory leak plugged in Py_BuildValue when building a dictionary.
5203 - Shared modules can now live inside packages (hierarchical module
5204 namespaces). No changes to the shared module itself are needed.
5206 - Improved policy for __builtins__: this is a module in __main__ and a
5207 dictionary everywhere else.
5209 - Python no longer catches SIGHUP and SIGTERM by default. This was
5210 impossible to get right in the light of thread contexts. If you want
5211 your program to clean up when a signal happens, use the signal module
5212 to set up your own signal handler.
5214 - New Python/C API PyNumber_CoerceEx() does not return an exception
5215 when no coercion is possible. This is used to fix a problem where
5216 comparing incompatible numbers for equality would raise an exception
5217 rather than return false as in Python 1.4 -- it once again will return
5220 - The errno module is changed again -- the table of error messages
5221 (errorstr) is removed. Instead, you can use os.strerror(). This
5222 removes redundance and a potential locale dependency.
5224 - New module xmllib, to parse XML files. By Sjoerd Mullender.
5226 - New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
5227 It resets the signal module's notion of what the current process ID
5228 and thread are, so that signal handlers will work after (and across)
5231 - Fixed most occurrences of fatal errors due to missing thread state.
5233 - For vgrind (a flexible source pretty printer) fans, there's a simple
5234 Python definition in Misc/vgrindefs, courtesy Neale Pickett.
5236 - Fixed memory leak in exec statement.
5238 - The test.pystone module has a new function, pystones(loops=LOOPS),
5239 which returns a (benchtime, stones) tuple. The main() function now
5240 calls this and prints the report.
5242 - Package directories now *require* the presence of an __init__.py (or
5243 __init__.pyc) file before they are considered as packages. This is
5244 done to prevent accidental subdirectories with common names from
5245 overriding modules with the same name.
5247 - Fixed some strange exceptions in __del__ methods in library modules
5248 (e.g. urllib). This happens because the builtin names are already
5249 deleted by the time __del__ is called. The solution (a hack, but it
5250 works) is to set some instance variables to 0 instead of None.
5252 - The table of built-in module initializers is replaced by a pointer
5253 variable. This makes it possible to switch to a different table at
5254 run time, e.g. when a collection of modules is loaded from a shared
5255 library. (No example code of how to do this is given, but it is
5256 possible.) The table is still there of course, its name prefixed with
5257 an underscore and used to initialize the pointer.
5259 - The warning about a thread still having a frame now only happens in
5262 - Change the signal finialization so that it also resets the signal
5263 handlers. After this has been called, our signal handlers are no
5266 - New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
5267 literals. There's now also a test fort this module.
5269 - The copy module now also uses __dict__.update(state) instead of
5270 going through individual attribute assignments, for class instances
5271 without a __setstate__ method.
5273 - New module reconvert translates old-style (regex module) regular
5274 expressions to new-style (re module, Perl-style) regular expressions.
5276 - Most modules that used to use the regex module now use the re
5277 module. The grep module has a new pgrep() function which uses
5278 Perl-style regular expressions.
5280 - The (very old, backwards compatibility) regexp.py module has been
5283 - Restricted execution (rexec): added the pcre module (support for the
5284 re module) to the list of trusted extension modules.
5286 - New version of Jim Fulton's CObject object type, adds
5287 PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
5289 - Some patches to Lee Busby's fpectl mods that accidentally didn't
5292 - In the string module, add an optional 4th argument to count(),
5293 matching find() etc.
5295 - Patch for the nntplib module by Charles Waldman to add optional user
5296 and password arguments to NNTP.__init__(), for nntp servers that need
5299 - The str() function for class objects now returns
5300 "modulename.classname" instead of returning the same as repr().
5302 - The parsing of \xXX escapes no longer relies on sscanf().
5304 - The "sharedmodules" subdirectory of the installation is renamed to
5305 "lib-dynload". (You may have to edit your Modules/Setup file to fix
5306 this in an existing installation!)
5308 - Fixed Don Beaudry's mess-up with the OPT test in the configure
5309 script. Certain SGI platforms will still issue a warning for each
5310 compile; there's not much I can do about this since the compiler's
5311 exit status doesn't indicate that I was using an obsolete option.
5313 - Fixed Barry's mess-up with {}.get(), and added test cases for it.
5315 - Shared libraries didn't quite work under AIX because of the change
5316 in status of the GNU readline interface. Fix due to by Vladimir
5320 ======================================================================
5326 - faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
5327 feature; better install instructions; removed faqmain.py (which was an
5330 - nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
5331 about the treatment of lines starting with '.'. Added a minimal test
5334 - struct module: ignore most whitespace in format strings.
5336 - urllib.py: close the socket and temp file in URLopener.retrieve() so
5337 that multiple retrievals using the same connection work.
5339 - All standard exceptions are now classes by default; use -X to make
5340 them strings (for backward compatibility only).
5342 - There's a new standard exception hierarchy, defined in the standard
5343 library module exceptions.py (which you never need to import
5345 http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
5348 - Three new C API functions:
5350 - int PyErr_GivenExceptionMatches(obj1, obj2)
5352 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
5353 instance of type obj2, or of a class derived from obj2
5355 - int PyErr_ExceptionMatches(obj)
5357 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
5358 PyErr_Occurred() as obj1. This will be the more commonly called
5361 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
5363 Normalizes exceptions, and places the normalized values in the
5364 arguments. If type is not a class, this does nothing. If type is a
5365 class, then it makes sure that value is an instance of the class by:
5367 1. if instance is of the type, or a class derived from type, it does
5370 2. otherwise it instantiates the class, using the value as an
5371 argument. If value is None, it uses an empty arg tuple, and if
5372 the value is a tuple, it uses just that.
5374 - Another new C API function: PyErr_NewException() creates a new
5375 exception class derived from Exception; when -X is given, it creates a
5376 new string exception.
5378 - core interpreter: remove the distinction between tuple and list
5379 unpacking; allow an arbitrary sequence on the right hand side of any
5380 unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
5381 thing, which should really be called UNPACK_SEQUENCE.)
5383 - classes: Allow assignments to an instance's __dict__ or __class__,
5384 so you can change ivars (including shared ivars -- shock horror) and
5385 change classes dynamically. Also make the check on read-only
5386 attributes of classes less draconic -- only the specials names
5387 __dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
5390 - Two new built-in functions: issubclass() and isinstance(). Both
5391 take classes as their second arguments. The former takes a class as
5392 the first argument and returns true iff first is second, or is a
5393 subclass of second. The latter takes any object as the first argument
5394 and returns true iff first is an instance of the second, or any
5397 - configure: Added configuration tests for presence of alarm(),
5398 pause(), and getpwent().
5400 - Doc/Makefile: changed latex2html targets.
5402 - classes: Reverse the search order for the Don Beaudry hook so that
5403 the first class with an applicable hook wins. Makes more sense.
5405 - Changed the checks made in Py_Initialize() and Py_Finalize(). It is
5406 now legal to call these more than once. The first call to
5407 Py_Initialize() initializes, the first call to Py_Finalize()
5408 finalizes. There's also a new API, Py_IsInitalized() which checks
5409 whether we are already initialized (in case you want to leave things
5412 - Completely disable the declarations for malloc(), realloc() and
5413 free(). Any 90's C compiler has these in header files, and the tests
5414 to decide whether to suppress the declarations kept failing on some
5417 - *Before* (instead of after) signalmodule.o is added, remove both
5418 intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
5419 ld on various systems.
5421 - Added reop to PC/config.c
5423 - configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
5424 Removed outdated HP-UX comments from README. Added Cray T3E comments.
5426 - Various renames of statically defined functions that had name
5427 conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
5428 roundup (sys/types.h).
5430 - urllib.py: Interpret three slashes in file: URL as local file (for
5431 Netscape on Windows/Mac).
5433 - copy.py: Make sure the objects returned by __getinitargs__() are
5434 kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
5435 easily reproducable because it requires a later call to
5436 __getinitargs__() to return a tuple that happens to be allocated at
5439 - Added definition of AR to toplevel Makefile. Renamed @buildno temp
5442 - Moved Include/assert.h to Parser/assert.h, which seems to be the
5443 only place where it's needed.
5445 - Tweaked the dictionary lookup code again for some more speed
5446 (Vladimir Marangozov).
5448 - NT build: Changed the way python15.lib is included in the other
5449 projects. Per Mark Hammond's suggestion, add it to the extra libs in
5450 Settings instead of to the project's source files.
5452 - regrtest.py: Change default verbosity so that there are only three
5453 levels left: -q, default and -v. In default mode, the name of each
5454 test is now printed. -v is the same as the old -vv. -q is more quiet
5455 than the old default mode.
5457 - Removed the old FAQ from the distribution. You now have to get it
5460 - Removed the PC/make_nt.in file from the distribution; it is no
5463 - Changed the build sequence so that shared modules are built last.
5464 This fixes things for AIX and doesn't hurt elsewhere.
5466 - Improved test for GNU MP v1 in mpzmodule.c
5468 - fileobject.c: ftell() on Linux discards all buffered data; changed
5469 read() code to use lseek() instead to get the same effect
5471 - configure.in, configure, importdl.c: NeXT sharedlib fixes
5473 - tupleobject.c: PyTuple_SetItem asserts refcnt==1
5475 - resource.c: Different strategy regarding whether to declare
5476 getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
5477 conflicting decls in its headers. Choice: only declare the return
5478 type, not the argument prototype, and not on Linux.
5480 - importdl.c, configure*: set sharedlib extensions properly for NeXT
5482 - configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
5483 fixed; moved addition of PURIFY to LINKCC to configure
5485 - reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
5486 added to shup up various compilers.
5488 - _tkinter.c: removed buggy mac #ifndef
5490 - Doc: various Mac documentation changes, added docs for 'ic' module
5492 - PC/make_nt.in: deleted
5494 - test_time.py, test_strftime.py: tweaks to catch %Z (which may return
5497 - test_rotor.py: print b -> print `b`
5499 - Tkinter.py: (tagOrId) -> (tagOrId,)
5501 - Tkinter.py: the Tk class now also has a configure() method and
5502 friends (they have been moved to the Misc class to accomplish this).
5504 - dict.get(key[, default]) returns dict[key] if it exists, or default
5505 if it doesn't. The default defaults to None. This is quicker for
5506 some applications than using either has_key() or try:...except
5509 - Tools/webchecker/: some small changes to webchecker.py; added
5510 websucker.py (a simple web site mirroring script).
5512 - Dictionary objects now have a get() method (also in UserDict.py).
5513 dict.get(key, default) returns dict[key] if it exists and default
5514 otherwise; default defaults to None.
5516 - Tools/scripts/logmerge.py: print the author, too.
5518 - Changes to import: support for "import a.b.c" is now built in. See
5519 http://grail.cnri.reston.va.us/python/essays/packages.html
5520 for more info. Most important deviations from "ni.py": __init__.py is
5521 executed in the package's namespace instead of as a submodule; and
5522 there's no support for "__" or "__domain__". Note that "ni.py" is not
5523 changed to match this -- it is simply declared obsolete (while at the
5524 same time, it is documented...:-( ).
5525 Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
5526 for an example implementation of hierarchical module import written in
5529 - More changes to import: the site.py module is now imported by
5530 default when Python is initialized; use -S to disable it. The site.py
5531 module extends the path with several more directories: site-packages
5532 inside the lib/python1.5/ directory, site-python in the lib/
5533 directory, and pathnames mentioned in *.pth files found in either of
5534 those directories. See
5535 http://grail.cnri.reston.va.us/python/essays/packages.html
5538 - Changes to standard library subdirectory names: those subdirectories
5539 that are not packages have been renamed with a hypen in their name,
5540 e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
5541 The test suite is now a package -- to run a test, you must now use
5542 "import test.test_foo".
5544 - A completely new re.py module is provided (thanks to Andrew
5545 Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
5546 "pcre" re compiler and engine. For a while, the "old" re.py (which
5547 was new in 1.5a3!) will be kept around as re1.py. The "old" regex
5548 module and underlying parser and engine are still present -- while
5549 regex is now officially obsolete, it will probably take several major
5550 release cycles before it can be removed.
5552 - The posix module now has a strerror() function which translates an
5553 error code to a string.
5555 - The emacs.py module (which was long obsolete) has been removed.
5557 - The universal makefile Misc/Makefile.pre.in now features an
5558 "install" target. By default, installed shared libraries go into
5559 $exec_prefix/lib/python$VERSION/site-packages/.
5561 - The install-sh script is installed with the other configuration
5562 specific files (in the config/ subdirectory).
5564 - It turns out whatsound.py and sndhdr.py were identical modules.
5565 Since there's also an imghdr.py file, I propose to make sndhdr.py the
5566 official one. For compatibility, whatsound.py imports * from
5569 - Class objects have a new attribute, __module__, giving the name of
5570 the module in which they were declared. This is useful for pickle and
5571 for printing the full name of a class exception.
5573 - Many extension modules no longer issue a fatal error when their
5574 initialization fails; the importing code now checks whether an error
5575 occurred during module initialization, and correctly propagates the
5576 exception to the import statement.
5578 - Most extension modules now raise class-based exceptions (except when
5581 - Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
5582 thread state -- just don't manipulate the lock if it isn't there.
5584 - Fixed a bug in Python/getopt.c that made it do the wrong thing when
5585 an option was a single '-'. Thanks to Andrew Kuchling.
5587 - New module mimetypes.py will guess a MIME type from a filename's
5590 - Windows: the DLL version is now settable via a resource rather than
5591 being hardcoded. This can be used for "branding" a binary Python
5594 - urllib.py is now threadsafe -- it now uses re instead of regex, and
5595 sys.exc_info() instead of sys.exc_{type,value}.
5597 - Many other library modules that used to use
5598 sys.exc_{type,value,traceback} are now more thread-safe by virtue of
5599 using sys.exc_info().
5601 - The functions in popen2 have an optional buffer size parameter.
5602 Also, the command argument can now be either a string (passed to the
5603 shell) or a list of arguments (passed directly to execv).
5605 - Alas, the thread support for _tkinter released with 1.5a3 didn't
5606 work. It's been rewritten. The bad news is that it now requires a
5607 modified version of a file in the standard Tcl distribution, which you
5608 must compile with a -I option pointing to the standard Tcl source
5609 tree. For this reason, the thread support is disabled by default.
5611 - The errno extension module adds two tables: errorcode maps errno
5612 numbers to errno names (e.g. EINTR), and errorstr maps them to
5613 message strings. (The latter is redundant because the new call
5614 posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
5616 - The readline extension module now provides some interfaces to
5617 internal readline routines that make it possible to write a completer
5618 in Python. An example completer, rlcompleter.py, is provided.
5620 When completing a simple identifier, it completes keywords,
5621 built-ins and globals in __main__; when completing
5622 NAME.NAME..., it evaluates (!) the expression up to the last
5623 dot and completes its attributes.
5625 It's very cool to do "import string" type "string.", hit the
5626 completion key (twice), and see the list of names defined by
5629 Tip: to use the tab key as the completion key, call
5631 readline.parse_and_bind("tab: complete")
5633 - The traceback.py module has a new function tb_lineno() by Marc-Andre
5634 Lemburg which extracts the line number from the linenumber table in
5635 the code object. Apparently the traceback object doesn't contains the
5636 right linenumber when -O is used. Rather than guessing whether -O is
5637 on or off, the module itself uses tb_lineno() unconditionally.
5639 - Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
5640 to tag_bind() so it works again.
5642 - The pystone script is now a standard library module. Example use:
5643 "import test.pystone; test.pystone.main()".
5645 - The import of the readline module in interactive mode is now also
5646 attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
5647 Lemburg, who asked for this. :-)
5649 - rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
5650 Mullender, to be closer to the standard. This fixes the getaddr()
5651 method. Unfortunately, getaddrlist() is as broken as ever, since it
5652 splits on commas without regard for RFC 822 quoting conventions.
5654 - pprint.py: correctly emit trailing "," in singleton tuples.
5656 - _tkinter.c: export names for its type objects, TkappType and
5659 - pickle.py: use __module__ when defined; fix a particularly hard to
5660 reproduce bug that confuses the memo when temporary objects are
5661 returned by custom pickling interfaces; and a semantic change: when
5662 unpickling the instance variables of an instance, use
5663 inst.__dict__.update(value) instead of a for loop with setattr() over
5664 the value.keys(). This is more consistent (the pickling doesn't use
5665 getattr() either but pickles inst.__dict__) and avoids problems with
5666 instances that have a __setattr__ hook. But it *is* a semantic change
5667 (because the setattr hook is no longer used). So beware!
5669 - config.h is now installed (at last) in
5670 $exec_prefix/include/python1.5/. For most sites, this means that it
5671 is actually in $prefix/include/python1.5/, with all the other Python
5672 include files, since $prefix and $exec_prefix are the same by
5675 - The imp module now supports parts of the functionality to implement
5676 import of hierarchical module names. It now supports find_module()
5677 and load_module() for all types of modules. Docstrings have been
5678 added for those functions in the built-in imp module that are still
5679 relevant (some old interfaces are obsolete). For a sample
5680 implementation of hierarchical module import in Python, see the new
5681 library module knee.py.
5683 - The % operator on string objects now allows arbitrary nested parens
5684 in a %(...)X style format. (Brad Howes)
5686 - Reverse the order in which Setup and Setup.local are passed to the
5687 makesetup script. This allows variable definitions in Setup.local to
5688 override definitions in Setup. (But you'll still have to edit Setup
5689 if you want to disable modules that are enabled by default, or if such
5690 modules need non-standard options.)
5692 - Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
5693 is like PyImport_ImporModule(name) but receives the globals and locals
5694 dict and the fromlist arguments as well. (The name is a char*; the
5695 others are PyObject*s).
5697 - The 'p' format in the struct extension module alloded to above is
5700 - The types.py module now uses try-except in a few places to make it
5701 more likely that it can be imported in restricted mode. Some type
5702 names are undefined in that case, e.g. CodeType (inaccessible),
5703 FileType (not always accessible), and TracebackType and FrameType
5706 - In urllib.py: added separate administration of temporary files
5707 created y URLopener.retrieve() so cleanup() can properly remove them.
5708 The old code removed everything in tempcache which was a bad idea if
5709 the user had passed a non-temp file into it. Also, in basejoin(),
5710 interpret relative paths starting in "../". This is necessary if the
5711 server uses symbolic links.
5713 - The Windows build procedure and project files are now based on
5714 Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
5715 directory. It is much more robust, and properly builds separate Debug
5716 and Release versions. (The installer will be added shortly.)
5718 - Added casts and changed some return types in regexpr.c to avoid
5719 compiler warnings or errors on some platforms.
5721 - The AIX build tools for shared libraries now supports VPATH. (Donn
5724 - By default, disable the "portable" multimedia modules audioop,
5725 imageop, and rgbimg, since they don't work on 64-bit platforms.
5727 - Fixed a nasty bug in cStringIO.c when code was actually using the
5728 close() method (the destructors would try to free certain fields a
5731 - For those who think they need it, there's a "user.py" module. This
5732 is *not* imported by default, but can be imported to run user-specific
5733 setup commands, ~/.pythonrc.py.
5735 - Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
5736 Vladimir Marangozov, and others.
5738 - Added os.altsep; this is '/' on DOS/Windows, and None on systems
5739 with a sane filename syntax.
5741 - os.py: Write out the dynamic OS choice, to avoid exec statements.
5742 Adding support for a new OS is now a bit more work, but I bet that
5743 'dos' or 'nt' will cover most situations...
5745 - The obsolete exception AccessError is now really gone.
5747 - Tools/faqwiz/: New installation instructions show how to maintain
5748 multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
5749 Added instructions to bootstrap script, too. Version bumped to 0.8.1.
5750 Added <html>...</html> feature suggested by Skip Montanaro. Added
5751 leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
5754 - Documentation for the relatively new modules "keyword" and "symbol"
5755 has been added (to the end of the section on the parser extension
5758 - In module bisect.py, but functions have two optional argument 'lo'
5759 and 'hi' which allow you to specify a subsequence of the array to
5762 - In ftplib.py, changed most methods to return their status (even when
5763 it is always "200 OK") rather than swallowing it.
5765 - main() now calls setlocale(LC_ALL, ""), if setlocale() and
5766 <locale.h> are defined.
5768 - Changes to configure.in, the configure script, and both
5769 Makefile.pre.in files, to support SGI's SGI_ABI platform selection
5770 environment variable.
5773 ======================================================================
5782 - If you are using the setuid script C wrapper (Misc/setuid-prog.c),
5783 please use the new version. The old version has a huge security leak.
5788 - Because of various (small) incompatible changes in the Python
5789 bytecode interpreter, the magic number for .pyc files has changed
5792 - The default module search path is now much saner. Both on Unix and
5793 Windows, it is essentially derived from the path to the executable
5794 (which can be overridden by setting the environment variable
5795 $PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
5796 front of the default path, like in Unix (instead of overriding the
5797 default path). On Windows, the directory containing the executable is
5798 added to the end of the path.
5800 - A new version of python-mode.el for Emacs has been included. Also,
5801 a new file ccpy-style.el has been added to configure Emacs cc-mode for
5802 the preferred style in Python C sources.
5804 - On Unix, when using sys.argv[0] to insert the script directory in
5805 front of sys.path, expand a symbolic link. You can now install a
5806 program in a private directory and have a symbolic link to it in a
5807 public bin directory, and it will put the private directory in the
5808 module search path. Note that the symlink is expanded in sys.path[0]
5809 but not in sys.argv[0], so you can still tell the name by which you
5812 - It is now recommended to use ``#!/usr/bin/env python'' instead of
5813 ``#!/usr/local/bin/python'' at the start of executable scripts, except
5814 for CGI scripts. It has been determined that the use of /usr/bin/env
5815 is more portable than that of /usr/local/bin/python -- scripts almost
5816 never have to be edited when the Python interpreter lives in a
5817 non-standard place. Note that this doesn't work for CGI scripts since
5818 the python executable often doesn't live in the HTTP server's default
5821 - The silly -s command line option and the corresponding
5822 PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
5823 flag in the Python/C API) are gone.
5825 - Most problems on 64-bit platforms should now be fixed. Andrew
5826 Kuchling helped. Some uncommon extension modules are still not
5827 clean (image and audio ops?).
5829 - Fixed a bug where multiple anonymous tuple arguments would be mixed up
5830 when using the debugger or profiler (reported by Just van Rossum).
5831 The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
5832 would print the wrong value when run under the debugger or profiler.
5834 - The hacks that the dictionary implementation used to speed up
5835 repeated lookups of the same C string were removed; these were a
5836 source of subtle problems and don't seem to serve much of a purpose
5839 - All traces of support for the long dead access statement have been
5840 removed from the sources.
5842 - Plugged the two-byte memory leak in the tokenizer when reading an
5845 - There's a -O option to the interpreter that removes SET_LINENO
5846 instructions and assert statements (see below); it uses and produces
5847 .pyo files instead of .pyc files. The speedup is only a few percent
5848 in most cases. The line numbers are still available in the .pyo file,
5849 as a separate table (which is also available in .pyc files). However,
5850 the removal of the SET_LINENO instructions means that the debugger
5851 (pdb) can't set breakpoints on lines in -O mode. The traceback module
5852 contains a function to extract a line number from the code object
5853 referenced in a traceback object. In the future it should be possible
5854 to write external bytecode optimizers that create better optimized
5855 .pyo files, and there should be more control over optimization;
5856 consider the -O option a "teaser". Without -O, the assert statement
5857 actually generates code that first checks __debug__; if this variable
5858 is false, the assertion is not checked. __debug__ is a built-in
5859 variable whose value is initialized to track the -O flag (it's true
5860 iff -O is not specified). With -O, no code is generated for assert
5861 statements, nor for code of the form ``if __debug__: <something>''.
5862 Sorry, no further constant folding happens.
5868 - It's much faster (almost twice for pystone.py -- see
5869 Tools/scripts). See the entry on string interning below.
5871 - Some speedup by using separate free lists for method objects (both
5872 the C and the Python variety) and for floating point numbers.
5874 - Big speedup by allocating frame objects with a single malloc() call.
5875 The Python/C API for frames is changed (you shouldn't be using this
5878 - Significant speedup by inlining some common opcodes for common operand
5879 types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
5881 - Small speedup by reordering the method tables of some common
5882 objects (e.g. list.append is now first).
5884 - Big optimization to the read() method of file objects. A read()
5885 without arguments now attempts to use fstat to allocate a buffer of
5886 the right size; for pipes and sockets, it will fall back to doubling
5887 the buffer size. While that the improvement is real on all systems,
5888 it is most dramatic on Windows.
5894 - Many new pieces of library documentation were contributed, mostly by
5895 Andrew Kuchling. Even cmath is now documented! There's also a
5896 chapter of the library manual, "libundoc.tex", which provides a
5897 listing of all undocumented modules, plus their status (e.g. internal,
5898 obsolete, or in need of documentation). Also contributions by Sue
5899 Williams, Skip Montanaro, and some module authors who succumbed to
5900 pressure to document their own contributed modules :-). Note that
5901 printing the documentation now kills fewer trees -- the margins have
5904 - I have started documenting the Python/C API. Unfortunately this project
5905 hasn't been completed yet. It will be complete before the final release of
5906 Python 1.5, though. At the moment, it's better to read the LaTeX source
5907 than to attempt to run it through LaTeX and print the resulting dvi file.
5909 - The posix module (and hence os.py) now has doc strings! Thanks to Neil
5910 Schemenauer. I received a few other contributions of doc strings. In most
5911 other places, doc strings are still wishful thinking...
5917 - Private variables with leading double underscore are now a permanent
5918 feature of the language. (These were experimental in release 1.4. I have
5919 favorable experience using them; I can't label them "experimental"
5922 - There's new string literal syntax for "raw strings". Prefixing a string
5923 literal with the letter r (or R) disables all escape processing in the
5924 string; for example, r'\n' is a two-character string consisting of a
5925 backslash followed by the letter n. This combines with all forms of string
5926 quotes; it is actually useful for triple quoted doc strings which might
5927 contain references to \n or \t. An embedded quote prefixed with a
5928 backslash does not terminate the string, but the backslash is still
5929 included in the string; for example, r'\'' is a two-character string
5930 consisting of a backslash and a quote. (Raw strings are also
5931 affectionately known as Robin strings, after their inventor, Robin
5934 - There's a simple assert statement, and a new exception
5935 AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
5936 not foo > 0: raise AssertionError''. Sorry, the text of the asserted
5937 condition is not available; it would be too complicated to generate
5938 code for this (since the code is generated from a parse tree).
5939 However, the text is displayed as part of the traceback!
5941 - The raise statement has a new feature: when using "raise SomeClass,
5942 somevalue" where somevalue is not an instance of SomeClass, it
5943 instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
5944 instance of a *derived* class of SomeClass, the exception class raised
5945 is set to somevalue.__class__, and SomeClass is ignored after that.
5947 - Duplicate keyword arguments are now detected at compile time;
5948 f(a=1,a=2) is now a syntax error.
5951 Changes to builtin features
5952 ---------------------------
5954 - There's a new exception FloatingPointError (used only by Lee Busby's
5955 patches to catch floating point exceptions, at the moment).
5957 - The obsolete exception ConflictError (presumably used by the long
5958 obsolete access statement) has been deleted.
5960 - There's a new function sys.exc_info() which returns the tuple
5961 (sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
5963 - There's a new variable sys.executable, pointing to the executable file
5964 for the Python interpreter.
5966 - The sort() methods for lists no longer uses the C library qsort(); I
5967 wrote my own quicksort implementation, with lots of help (in the form
5968 of a kind of competition) from Tim Peters. This solves a bug in
5969 dictionary comparisons on some Solaris versions when Python is built
5970 with threads, and makes sorting lists even faster.
5972 - The semantics of comparing two dictionaries have changed, to make
5973 comparison of unequal dictionaries faster. A shorter dictionary is
5974 always considered smaller than a larger dictionary. For dictionaries
5975 of the same size, the smallest differing element determines the
5976 outcome (which yields the same results as before in this case, without
5977 explicit sorting). Thanks to Aaron Watters for suggesting something
5980 - The semantics of try-except have changed subtly so that calling a
5981 function in an exception handler that itself raises and catches an
5982 exception no longer overwrites the sys.exc_* variables. This also
5983 alleviates the problem that objects referenced in a stack frame that
5984 caught an exception are kept alive until another exception is caught
5985 -- the sys.exc_* variables are restored to their previous value when
5986 returning from a function that caught an exception.
5988 - There's a new "buffer" interface. Certain objects (e.g. strings and
5989 arrays) now support the "buffer" protocol. Buffer objects are acceptable
5990 whenever formerly a string was required for a write operation; mutable
5991 buffer objects can be the target of a read operation using the call
5992 f.readinto(buffer). A cool feature is that regular expression matching now
5993 also work on array objects. Contribution by Jack Jansen. (Needs
5996 - String interning: dictionary lookups are faster when the lookup
5997 string object is the same object as the key in the dictionary, not
5998 just a string with the same value. This is done by having a pool of
5999 "interned" strings. Most names generated by the interpreter are now
6000 automatically interned, and there's a new built-in function intern(s)
6001 that returns the interned version of a string. Interned strings are
6002 not a different object type, and interning is totally optional, but by
6003 interning most keys a speedup of about 15% was obtained for the
6006 - Dictionary objects have several new methods; clear() and copy() have
6007 the obvious semantics, while update(d) merges the contents of another
6008 dictionary d into this one, overriding existing keys. The dictionary
6009 implementation file is now called dictobject.c rather than the
6010 confusing mappingobject.c.
6012 - The intrinsic function dir() is much smarter; it looks in __dict__,
6013 __members__ and __methods__.
6015 - The intrinsic functions int(), long() and float() can now take a
6016 string argument and then do the same thing as string.atoi(),
6017 string.atol(), and string.atof(). No second 'base' argument is
6018 allowed, and complex() does not take a string (nobody cared enough).
6020 - When a module is deleted, its globals are now deleted in two phases.
6021 In the first phase, all variables whose name begins with exactly one
6022 underscore are replaced by None; in the second phase, all variables
6023 are deleted. This makes it possible to have global objects whose
6024 destructors depend on other globals. The deletion order within each
6025 phase is still random.
6027 - It is no longer an error for a function to be called without a
6028 global variable __builtins__ -- an empty directory will be provided
6031 - Guido's corollary to the "Don Beaudry hook": it is now possible to
6032 do metaprogramming by using an instance as a base class. Not for the
6033 faint of heart; and undocumented as yet, but basically if a base class
6034 is an instance, its class will be instantiated to create the new
6035 class. Jim Fulton will love it -- it also works with instances of his
6036 "extension classes", since it is triggered by the presence of a
6037 __class__ attribute on the purported base class. See
6038 Demo/metaclasses/index.html for an explanation and see that directory
6041 - Another change is that the Don Beaudry hook is now invoked when
6042 *any* base class is special. (Up to 1.5a3, the *last* special base
6043 class is used; in 1.5a4, the more rational choice of the *first*
6044 special base class is used.)
6046 - New optional parameter to the readlines() method of file objects.
6047 This indicates the number of bytes to read (the actual number of bytes
6048 read will be somewhat larger due to buffering reading until the end of
6049 the line). Some optimizations have also been made to speed it up (but
6050 not as much as read()).
6052 - Complex numbers no longer have the ".conj" pseudo attribute; use
6053 z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
6054 now *do* support the __members__ and __methods__ special attributes.
6056 - The complex() function now looks for a __complex__() method on class
6057 instances before giving up.
6059 - Long integers now support arbitrary shift counts, so you can now
6060 write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
6061 shift count for this.)
6063 - The hex() and oct() functions have been changed so that for regular
6064 integers, they never emit a minus sign. For example, on a 32-bit
6065 machine, oct(-1) now returns '037777777777' and hex(-1) returns
6066 '0xffffffff'. While this may seem inconsistent, it is much more
6067 useful. (For long integers, a minus sign is used as before, to fit
6068 the result in memory :-)
6070 - The hash() function computes better hashes for several data types,
6071 including strings, floating point numbers, and complex numbers.
6074 New extension modules
6075 ---------------------
6077 - New extension modules cStringIO.c and cPickle.c, written by Jim
6078 Fulton and other folks at Digital Creations. These are much more
6079 efficient than their Python counterparts StringIO.py and pickle.py,
6080 but don't support subclassing. cPickle.c clocks up to 1000 times
6081 faster than pickle.py; cStringIO.c's improvement is less dramatic but
6084 - New extension module zlibmodule.c, interfacing to the free zlib
6085 library (gzip compatible compression). There's also a module gzip.py
6086 which provides a higher level interface. Written by Andrew Kuchling
6089 - New module readline; see the "miscellaneous" section above.
6091 - New Unix extension module resource.c, by Jeremy Hylton, provides
6092 access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
6093 related symbolic constants.
6095 - New extension puremodule.c, by Barry Warsaw, which interfaces to the
6096 Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
6097 possible to enable Purify by simply setting the PURIFY Makefile
6098 variable in the Modules/Setup file.
6101 Changes in extension modules
6102 ----------------------------
6104 - The struct extension module has several new features to control byte
6105 order and word size. It supports reading and writing IEEE floats even
6106 on platforms where this is not the native format. It uses uppercase
6107 format codes for unsigned integers of various sizes (always using
6108 Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
6109 and 'p' for "Pascal strings" (with a leading length byte, included in
6110 the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
6111 big-endian data and '<' forces little-endian data; these also select
6112 standard data sizes and disable automatic alignment (use pad bytes as
6115 - The array module supports uppercase format codes for unsigned data
6116 formats (like the struct module).
6118 - The fcntl extension module now exports the needed symbolic
6119 constants. (Formerly these were in FCNTL.py which was not available
6120 or correct for all platforms.)
6122 - The extension modules dbm, gdbm and bsddb now check that the
6123 database is still open before making any new calls.
6125 - The dbhash module is no more. Use bsddb instead. (There's a third
6126 party interface for the BSD 2.x code somewhere on the web; support for
6127 bsddb will be deprecated.)
6129 - The gdbm module now supports a sync() method.
6131 - The socket module now has some new functions: getprotobyname(), and
6132 the set {ntoh,hton}{s,l}().
6134 - Various modules now export their type object: socket.SocketType,
6137 - The socket module's accept() method now returns unknown addresses as
6138 a tuple rather than raising an exception. (This can happen in
6139 promiscuous mode.) Theres' also a new function getprotobyname().
6141 - The pthread support for the thread module now works on most platforms.
6143 - STDWIN is now officially obsolete. Support for it will eventually
6144 be removed from the distribution.
6146 - The binascii extension module is now hopefully fully debugged.
6147 (XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
6150 - audioop.c: added a ratecv() function; better handling of overflow in
6153 - posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
6154 Windows, also O_TEXT and O_BINARY. The 'error' variable (the
6155 exception is raises) is renamed -- its string value is now "os.error",
6156 so newbies don't believe they have to import posix (or nt) to catch
6157 it when they see os.error reported as posix.error. The execve()
6158 function now accepts any mapping object for the environment.
6160 - A new version of the al (audio library) module for SGI was
6161 contributed by Sjoerd Mullender.
6163 - The regex module has a new function get_syntax() which retrieves the
6164 syntax setting set by set_syntax(). The code was also sanitized,
6165 removing worries about unclean error handling. See also below for its
6168 - The "new" module (which creates new objects of various types) once
6169 again has a fully functioning new.function() method. Dangerous as
6170 ever! Also, new.code() has several new arguments.
6172 - A problem has been fixed in the rotor module: on systems with signed
6173 characters, rotor-encoded data was not portable when the key contained
6174 8-bit characters. Also, setkey() now requires its argument rather
6175 than having broken code to default it.
6177 - The sys.builtin_module_names variable is now a tuple. Another new
6178 variables in sys is sys.executable (the full path to the Python
6181 - The specs for time.strftime() have undergone some revisions. It
6182 appears that not all format characters are supported in the same way
6183 on all platforms. Rather than reimplement it, we note these
6184 differences in the documentation, and emphasize the shared set of
6185 features. There's also a thorough test set (that occasionally finds
6186 problems in the C library implementation, e.g. on some Linuxes),
6187 thanks to Skip Montanaro.
6189 - The nis module seems broken when used with NIS+; unfortunately
6190 nobody knows how to fix it. It should still work with old NIS.
6196 - New (still experimental) Perl-style regular expression module,
6197 re.py, which uses a new interface for matching as well as a new
6198 syntax; the new interface avoids the thread-unsafety of the regex
6199 interface. This comes with a helper extension reopmodule.c and vastly
6200 rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
6201 Peters, and Andrew Kuchling. See the documentation libre.tex. In
6202 1.5, the old regex module is still fully supported; in the future, it
6203 will become obsolete.
6205 - New module gzip.py; see zlib above.
6207 - New module keyword.py exports knowledge about Python's built-in
6208 keywords. (New version by Ka-Ping Yee.)
6210 - New module pprint.py (with documentation) which supports
6211 pretty-printing of lists, tuples, & dictionaries recursively. By Fred
6214 - New module code.py. The function code.compile_command() can
6215 determine whether an interactively entered command is complete or not,
6216 distinguishing incomplete from invalid input. (XXX Unfortunately,
6217 this seems broken at this moment, and I don't have the time to fix
6218 it. It's probably better to add an explicit interface to the parser
6221 - There is now a library module xdrlib.py which can read and write the
6222 XDR data format as used by Sun RPC, for example. It uses the struct
6226 Changes in library modules
6227 --------------------------
6229 - Module codehack.py is now completely obsolete.
6231 - The pickle.py module has been updated to make it compatible with the
6232 new binary format that cPickle.c produces. By default it produces the
6233 old all-ASCII format compatible with the old pickle.py, still much
6234 faster than pickle.py; it will read both formats automatically. A few
6235 other updates have been made.
6237 - A new helper module, copy_reg.py, is provided to register extensions
6238 to the pickling code.
6240 - Revamped module tokenize.py is much more accurate and has an
6241 interface that makes it a breeze to write code to colorize Python
6242 source code. Contributed by Ka-Ping Yee.
6244 - In ihooks.py, ModuleLoader.load_module() now closes the file under
6247 - The tempfile.py module has a new class, TemporaryFile, which creates
6248 an open temporary file that will be deleted automatically when
6249 closed. This works on Windows and MacOS as well as on Unix. (Jim
6252 - Changes to the cgi.py module: Most imports are now done at the
6253 top of the module, which provides a speedup when using ni (Jim
6254 Fulton). The problem with file upload to a Windows platform is solved
6255 by using the new tempfile.TemporaryFile class; temporary files are now
6256 always opened in binary mode (Jim Fulton). The cgi.escape() function
6257 now takes an optional flag argument that quotes '"' to '"'. It
6258 is now possible to invoke cgi.py from a command line script, to test
6259 cgi scripts more easily outside an http server. There's an optional
6260 limit to the size of uploads to POST (Skip Montanaro). Added a
6261 'strict_parsing' option to all parsing functions (Jim Fulton). The
6262 function parse_qs() now uses urllib.unquote() on the name as well as
6263 the value of fields (Clarence Gardner). The FieldStorage class now
6264 has a __len__() method.
6266 - httplib.py: the socket object is no longer closed; all HTTP/1.*
6267 responses are now accepted; and it is now thread-safe (by not using
6270 - BaseHTTPModule.py: treat all HTTP/1.* versions the same.
6272 - The popen2.py module is now rewritten using a class, which makes
6273 access to the standard error stream and the process id of the
6274 subprocess possible.
6276 - Added timezone support to the rfc822.py module, in the form of a
6277 getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
6278 Also added recognition of some non-standard date formats, by Lars
6279 Wirzenius, and RFC 850 dates (Chris Lawrence).
6281 - mhlib.py: various enhancements, including almost compatible parsing
6282 of message sequence specifiers without invoking a subprocess. Also
6283 added a createmessage() method by Lars Wirzenius.
6285 - The StringIO.StringIO class now supports readline(nbytes). (Lars
6286 Wirzenius.) (Of course, you should be using cStringIO for performance.)
6288 - UserDict.py supports the new dictionary methods as well.
6290 - Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
6291 speed it up, and replace 0 seed values by 1 to avoid degeneration.
6292 A bug was fixed in the test for invalid arguments.
6294 - Module ftplib.py: added support for parsing a .netrc file (Fred
6295 Drake). Also added an ntransfercmd() method to the FTP class, which
6296 allows access to the expected size of a transfer when available, and a
6297 parse150() function to the module which parses the corresponding 150
6300 - urllib.py: the ftp cache is now limited to 10 entries. Added
6301 quote_plus() and unquote_plus() functions which are like quote() and
6302 unquote() but also replace spaces with '+' or vice versa, for
6303 encoding/decoding CGI form arguments. Catch all errors from the ftp
6304 module. HTTP requests now add the Host: header line. The proxy
6305 variable names are now mapped to lower case, for Windows. The
6306 spliturl() function no longer erroneously throws away all data past
6307 the first newline. The basejoin() function now intereprets "../"
6308 correctly. I *believe* that the problems with "exception raised in
6309 __del__" under certain circumstances have been fixed (mostly by
6310 changes elsewher in the interpreter).
6312 - In urlparse.py, there is a cache for results in urlparse.urlparse();
6313 its size limit is set to 20. Also, new URL schemes shttp, https, and
6314 snews are "supported".
6316 - shelve.py: use cPickle and cStringIO when available. Also added
6317 a sync() method, which calls the database's sync() method if there is
6320 - The mimetools.py module now uses the available Python modules for
6321 decoding quoted-printable, uuencode and base64 formats, rather than
6322 creating a subprocess.
6324 - The python debugger (pdb.py, and its base class bdb.py) now support
6325 conditional breakpoints. See the docs.
6327 - The modules base64.py, uu.py and quopri.py can now be used as simple
6328 command line utilities.
6330 - Various small fixes to the nntplib.py module that I can't bother to
6333 - Sjoerd Mullender's mimify.py module now supports base64 encoding and
6334 includes functions to handle the funny encoding you sometimes see in mail
6335 headers. It is now documented.
6337 - mailbox.py: Added BabylMailbox. Improved the way the mailbox is
6338 gotten from the environment.
6340 - Many more modules now correctly open files in binary mode when this
6341 is necessary on non-Unix platforms.
6343 - The copying functions in the undocumented module shutil.py are
6346 - The Writer classes in the formatter.py module now have a flush()
6349 - The sgmllib.py module accepts hyphens and periods in the middle of
6350 attribute names. While this is against the SGML standard, there is
6351 some HTML out there that uses this...
6353 - The interface for the Python bytecode disassembler module, dis.py,
6354 has been enhanced quite a bit. There's now one main function,
6355 dis.dis(), which takes almost any kind of object (function, module,
6356 class, instance, method, code object) and disassembles it; without
6357 arguments it disassembles the last frame of the last traceback. The
6358 other functions have changed slightly, too.
6360 - The imghdr.py module recognizes new image types: BMP, PNG.
6362 - The string.py module has a new function replace(str, old, new,
6363 [maxsplit]) which does substring replacements. It is actually
6364 implemented in C in the strop module. The functions [r]find() an
6365 [r]index() have an optional 4th argument indicating the end of the
6366 substring to search, alsoo implemented by their strop counterparts.
6367 (Remember, never import strop -- import string uses strop when
6368 available with zero overhead.)
6370 - The string.join() function now accepts any sequence argument, not
6371 just lists and tuples.
6373 - The string.maketrans() requires its first two arguments to be
6374 present. The old version didn't require them, but there's not much
6375 point without them, and the documentation suggests that they are
6376 required, so we fixed the code to match the documentation.
6378 - The regsub.py module has a function clear_cache(), which clears its
6379 internal cache of compiled regular expressions. Also, the cache now
6380 takes the current syntax setting into account. (However, this module
6381 is now obsolete -- use the sub() or subn() functions or methods in the
6384 - The undocumented module Complex.py has been removed, now that Python
6385 has built-in complex numbers. A similar module remains as
6386 Demo/classes/Complex.py, as an example.
6389 Changes to the build process
6390 ----------------------------
6392 - The way GNU readline is configured is totally different. The
6393 --with-readline configure option is gone. It is now an extension
6394 module, which may be loaded dynamically. You must enable it (and
6395 specify the correct linraries to link with) in the Modules/Setup file.
6396 Importing the module installs some hooks which enable command line
6397 editing. When the interpreter shell is invoked interactively, it
6398 attempts to import the readline module; when this fails, the default
6399 input mechanism is used. The hook variables are PyOS_InputHook and
6400 PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
6401 ideas from William Magro.)
6403 - New build procedure: a single library, libpython1.5.a, is now built,
6404 which contains absolutely everything except for a one-line main()
6405 program (which calls Py_Main(argc, argv) to start the interpreter
6406 shell). This makes life much simpler for applications that need to
6407 embed Python. The serial number of the build is now included in the
6408 version string (sys.version).
6410 - As far as I can tell, neither gcc -Wall nor the Microsoft compiler
6411 emits a single warning any more when compiling Python.
6413 - A number of new Makefile variables have been added for special
6414 situations, e.g. LDLAST is appended to the link command. These are
6415 used by editing the Makefile or passing them on the make command
6418 - A set of patches from Lee Busby has been integrated that make it
6419 possible to catch floating point exceptions. Use the configure option
6420 --with-fpectl to enable the patches; the extension modules fpectl and
6421 fpetest provide control to enable/disable and test the feature,
6424 - The support for shared libraries under AIX is now simpler and more
6425 robust. Thanks to Vladimir Marangozov for revamping his own patches!
6427 - The Modules/makesetup script now reads a file Setup.local as well as
6428 a file Setup. Most changes to the Setup script can be done by editing
6429 Setup.local instead, which makes it easier to carry a particular setup
6430 over from one release to the next.
6432 - The Modules/makesetup script now copies any "include" lines it
6433 encounters verbatim into the output Makefile. It also recognizes .cxx
6434 and .cpp as C++ source files.
6436 - The configure script is smarter about C compiler options; e.g. with
6437 gcc it uses -O2 and -g when possible, and on some other platforms it
6438 uses -Olimit 1500 to avoid a warning from the optimizer about the main
6439 loop in ceval.c (which has more than 1000 basic blocks).
6441 - The configure script now detects whether malloc(0) returns a NULL
6442 pointer or a valid block (of length zero). This avoids the nonsense
6443 of always adding one byte to all malloc() arguments on most platforms.
6445 - The configure script has a new option, --with-dec-threads, to enable
6446 DEC threads on DEC Alpha platforms. Also, --with-threads is now an
6447 alias for --with-thread (this was the Most Common Typo in configure
6450 - Many changes in Doc/Makefile; amongst others, latex2html is now used
6451 to generate HTML from all latex documents.
6454 Change to the Python/C API
6455 --------------------------
6457 - Because some interfaces have changed, the PYTHON_API macro has been
6458 bumped. Most extensions built for the old API version will still run,
6459 but I can't guarantee this. Python prints a warning message on
6460 version mismatches; it dumps core when the version mismatch causes a
6463 - I've completed the Grand Renaming, with the help of Roger Masse and
6464 Barry Warsaw. This makes reading or debugging the code much easier.
6465 Many other unrelated code reorganizations have also been carried out.
6466 The allobjects.h header file is gone; instead, you would have to
6467 include Python.h followed by rename2.h. But you're better off running
6468 Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
6469 the rename2.h; it will disappear in the next release.
6471 - Various and sundry small bugs in the "abstract" interfaces have been
6472 fixed. Thanks to all the (involuntary) testers of the Python 1.4
6473 version! Some new functions have been added, e.g. PySequence_List(o),
6474 equivalent to list(o) in Python.
6476 - New API functions PyLong_FromUnsignedLong() and
6477 PyLong_AsUnsignedLong().
6479 - The API functions in the file cgensupport.c are no longer
6480 supported. This file has been moved to Modules and is only ever
6481 compiled when the SGI specific 'gl' module is built.
6483 - PyObject_Compare() can now raise an exception. Check with
6484 PyErr_Occurred(). The comparison function in an object type may also
6487 - The slice interface uses an upper bound of INT_MAX when no explicit
6488 upper bound is given (e.x. for a[1:]). It used to ask the object for
6489 its length and do the calculations.
6491 - Support for multiple independent interpreters. See Doc/api.tex,
6492 functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
6493 documentation is incomplete, also see the new Demo/pysvr example
6494 (which shows how to use these in a threaded application) and the
6497 - There is now a Py_Finalize() function which "de-initializes"
6498 Python. It is possible to completely restart the interpreter
6499 repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
6500 change of functionality in Py_Initialize() means that it is now a
6501 fatal error to call it while the interpreter is already initialized.
6502 The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
6503 is deprecated (it is nothing more than Py_Finalize() followed by
6506 - There are no known memory leaks left. While Py_Finalize() doesn't
6507 free *all* allocated memory (some of it is hard to track down),
6508 repeated calls to Py_Finalize() and Py_Initialize() do not create
6509 unaccessible heap blocks.
6511 - There is now explicit per-thread state. (Inspired by, but not the
6512 same as, Greg Stein's free threading patches.)
6514 - There is now better support for threading C applications. There are
6515 now explicit APIs to manipulate the interpreter lock. Read the source
6516 or the Demo/pysvr example; the new functions are
6517 PyEval_{Acquire,Release}{Lock,Thread}().
6519 - The test macro DEBUG has changed to Py_DEBUG, to avoid interference
6520 with other libraries' DEBUG macros. Likewise for any other test
6521 macros that didn't yet start with Py_.
6523 - New wrappers around malloc() and friends: Py_Malloc() etc. call
6524 malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
6525 just malloc(). Use of these wrappers could be essential if multiple
6526 memory allocators exist (e.g. when using certain DLL setups under
6527 Windows). (Idea by Jim Fulton.)
6529 - New C API PyImport_Import() which uses whatever __import__() hook
6530 that is installed for the current execution environment. By Jim
6533 - It is now possible for an extension module's init function to fail
6534 non-fatally, by calling one of the PyErr_* functions and returning.
6536 - The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
6537 argument to the proper type, like the similar PyString macros already
6538 did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
6539 and PyList_GET_ITEM.
6541 - Some of the Py_Get* function, like Py_GetVersion() (but not yet
6542 Py_GetPath()) are now declared as returning a const char *. (More
6545 - Changed the run-time library to check for exceptions after object
6546 comparisons. PyObject_Compare() can now return an exception; use
6547 PyErr_Occurred() to check (there is *no* special return value).
6549 - PyFile_WriteString() and Py_Flushline() now return error indicators
6550 instead of clearing exceptions. This fixes an obscure bug where using
6551 these would clear a pending exception, discovered by Just van Rossum.
6553 - There's a new function, PyArg_ParseTupleAndKeywords(), which parses
6554 an argument list including keyword arguments. Contributed by Geoff
6557 - PyArg_GetInt() is gone.
6559 - It's no longer necessary to include graminit.h when calling one of
6560 the extended parser API functions. The three public grammar start
6561 symbols are now in Python.h as Py_single_input, Py_file_input, and
6564 - The CObject interface has a new function,
6565 PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
6566 on the object referenced by "module.name".
6572 - On popular demand, _tkinter once again installs a hook for readline
6573 that processes certain Tk events while waiting for the user to type
6574 (using PyOS_InputHook).
6576 - A patch by Craig McPheeters plugs the most obnoxious memory leaks,
6577 caused by command definitions referencing widget objects beyond their
6580 - New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
6581 tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
6582 with the new Tk dialog scripts, and provide more "native platform"
6583 style file selection dialog boxes on some platforms. Contributed by
6586 - Tkinter.py: when the first Tk object is destroyed, it sets the
6587 hiddel global _default_root to None, so that when another Tk object is
6588 created it becomes the new default root. Other miscellaneous
6591 - The Image class now has a configure method.
6593 - Added a bunch of new winfo options to Tkinter.py; we should now be
6594 up to date with Tk 4.2. The new winfo options supported are:
6595 mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
6598 - The broken bind() method on Canvas objects defined in the Canvas.py
6599 module has been fixed. The CanvasItem and Group classes now also have
6602 - The problem with Tkinter.py falling back to trying to import
6603 "tkinter" when "_tkinter" is not found has been fixed -- it no longer
6604 tries "tkinter", ever. This makes diagnosing the problem "_tkinter
6605 not configured" much easier and will hopefully reduce the newsgroup
6606 traffic on this topic.
6608 - The ScrolledText module once again supports the 'cnf' parameter, to
6609 be compatible with the examples in Mark Lutz' book (I know, I know,
6612 - The _tkinter.c extension module has been revamped. It now support
6613 Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
6614 works well under Windows and Mac (with the latest Tk ports to those
6615 platforms). It also supports threading -- it is safe for one
6616 (Python-created) thread to be blocked in _tkinter.mainloop() while
6617 other threads modify widgets. To make the changes visible, those
6618 threads must use update_idletasks()method. (The patch for threading
6619 in 1.5a3 was broken; in 1.5a4, it is back in a different version,
6620 which requires access to the Tcl sources to get it to work -- hence it
6621 is disabled by default.)
6623 - A bug in _tkinter.c has been fixed, where Split() with a string
6624 containing an unmatched '"' could cause an exception or core dump.
6626 - Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
6627 CreateFileHandler, so _tkinter.createfilehandler is not available on
6628 those platforms when using Tk 8.0 or later. I will have to rethink
6629 how to interface with Tcl's lower-level event mechanism, or with its
6630 channels (which are like Python's file-like objects). Jack Jansen has
6631 provided a fix for the Mac, so createfilehandler *is* actually
6632 supported there; maybe I can adapt his fix for Windows.
6638 - A new regression test suite is provided, which tests most of the
6639 standard and built-in modules. The regression test is run by invoking
6640 the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
6641 he and Roger Masse contributed most of the new tests.
6643 - New tool: faqwiz -- the CGI script that is used to maintain the
6644 Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
6647 - New tool: webchecker -- a simple extensible web robot that, when
6648 aimed at a web server, checks that server for dead links. Available
6649 are a command line utility as well as a Tkinter based GUI version. In
6650 Tools/webchecker. A simplified version of this program is dissected
6651 in my article in O'Reilly's WWW Journal, the issue on Scripting
6652 Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
6653 Includes a parser for robots.txt files by Skip Montanaro.
6655 - New small tools: cvsfiles.py (prints a list of all files under CVS
6656 n a particular directory tree), treesync.py (a rather Guido-specific
6657 script to synchronize two source trees, one on Windows NT, the other
6658 one on Unix under CVS but accessible from the NT box), and logmerge.py
6659 (sort a collection of RCS or CVS logs by date). In Tools/scripts.
6661 - The freeze script now also works under Windows (NT). Another
6662 feature allows the -p option to be pointed at the Python source tree
6663 instead of the installation prefix. This was loosely based on part of
6664 xfreeze by Sam Rushing and Bill Tutt.
6666 - New examples (Demo/extend) that show how to use the generic
6667 extension makefile (Misc/Makefile.pre.in).
6669 - Tools/scripts/h2py.py now supports C++ comments.
6671 - Tools/scripts/pystone.py script is upgraded to version 1.1; there
6672 was a bug in version 1.0 (distributed with Python 1.4) that leaked
6673 memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
6675 - Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
6681 - New project files for Developer Studio (Visual C++) 5.0 for Windows
6682 NT (the old VC++ 4.2 Makefile is also still supported, but will
6683 eventually be withdrawn due to its bulkiness).
6685 - See the note on the new module search path in the "Miscellaneous" section
6688 - Support for Win32s (the 32-bit Windows API under Windows 3.1) is
6689 basically withdrawn. If it still works for you, you're lucky.
6691 - There's a new extension module, msvcrt.c, which provides various
6692 low-level operations defined in the Microsoft Visual C++ Runtime Library.
6693 These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
6694 console I/O functions like kbhit(), getch() and putch().
6696 - The -u option not only sets the standard I/O streams to unbuffered
6697 status, but also sets them in binary mode. (This can also be done
6698 using msvcrt.setmode(), by the way.)
6700 - The, sys.prefix and sys.exec_prefix variables point to the directory
6701 where Python is installed, or to the top of the source tree, if it was run
6704 - The various os.path modules (posixpath, ntpath, macpath) now support
6705 passing more than two arguments to the join() function, so
6706 os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
6709 - The ntpath module (normally used as os.path) supports ~ to $HOME
6710 expansion in expanduser().
6712 - The freeze tool now works on Windows.
6714 - See also the Tkinter category for a sad note on
6715 _tkinter.createfilehandler().
6717 - The truncate() method for file objects now works on Windows.
6719 - Py_Initialize() is no longer called when the DLL is loaded. You
6720 must call it yourself.
6722 - The time module's clock() function now has good precision through
6723 the use of the Win32 API QueryPerformanceCounter().
6725 - Mark Hammond will release Python 1.5 versions of PythonWin and his
6726 other Windows specific code: the win32api extensions, COM/ActiveX
6727 support, and the MFC interface.
6733 - As always, the Macintosh port will be done by Jack Jansen. He will
6734 make a separate announcement for the Mac specific source code and the
6735 binary distribution(s) when these are ready.
6738 ======================================================================
6741 =====================================
6742 ==> Release 1.4 (October 25 1996) <==
6743 =====================================
6745 (Starting in reverse chronological order:)
6747 - Changed disclaimer notice.
6749 - Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions
6750 default to the user's login shell.
6752 - In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text
6753 widget, and bogus bspace() function.
6755 - In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated
6758 - Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all
6759 subprojects, and to remove the (broken) experimental NumPy
6762 - In Lib/py_compile.py, cast mtime to long() so it will work on Mac
6763 (where os.stat() returns mtimes as floats.)
6764 - Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to
6765 fix POST in CGIHTTPServer.py.
6767 - Version 2.83 of Misc/python-mode.el for Emacs is included.
6769 - In Modules/regexmodule.c, fixed symcomp() to correctly handle a new
6770 group starting immediately after a group tag.
6772 - In Lib/SocketServer.py, changed the mode for rfile to unbuffered.
6774 - In Objects/stringobject.c, fixed the compare function to do the
6775 first char comparison in unsigned mode, for consistency with the way
6776 other characters are compared by memcmp().
6778 - In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats.
6780 - In Lib/urllib.py, fix another case where openedurl wasn't set.
6782 (XXX Sorry, the rest is in totally random order. No time to fix it.)
6784 - SyntaxError exceptions detected during code generation
6785 (e.g. assignment to an expression) now include a line number.
6787 - Don't leave trailing / or \ in script directory inserted in front of
6790 - Added a note to Tools/scripts/classfix.py abouts its historical
6793 - Added Misc/Makefile.pre.in, a universal Makefile for extensions
6794 built outside the distribution.
6796 - Rewritten Misc/faq2html.py, by Ka-Ping Yee.
6798 - Install shared modules with mode 555 (needed for performance on some
6801 - Some changes to standard library modules to avoid calling append()
6802 with more than one argument -- while supported, this should be
6803 outlawed, and I don't want to set a bad example.
6805 - bdb.py (and hence pdb.py) supports calling run() with a code object
6806 instead of a code string.
6808 - Fixed an embarrassing bug cgi.py which prevented correct uploading
6809 of binary files from Netscape (which doesn't distinguish between
6810 binary and text files). Also added dormant logging support, which
6811 makes it easier to debug the cgi module itself.
6813 - Added default writer to constructor of NullFormatter class.
6815 - Use binary mode for socket.makefile() calls in ftplib.py.
6817 - The ihooks module no longer "installs" itself upon import -- this
6818 was an experimental feature that helped ironing out some bugs but that
6819 slowed down code that imported it without the need to install it
6820 (e.g. the rexec module). Also close the file in some cases and add
6821 the __file__ attribute to loaded modules.
6823 - The test program for mailbox.py is now more useful.
6825 - Added getparamnames() to Message class in mimetools.py -- it returns
6826 the names of parameters to the content-type header.
6828 - Fixed a typo in ni that broke the loop stripping "__." from names.
6830 - Fix sys.path[0] for scripts run via pdb.py's new main program.
6832 - profile.py can now also run a script, like pdb.
6834 - Fix a small bug in pyclbr -- don't add names starting with _ when
6835 emulating from ... import *.
6837 - Fixed a series of embarrassing typos in rexec's handling of standard
6838 I/O redirection. Added some more "safe" built-in modules: cmath,
6841 - Fixed embarrassing typo in shelve.py.
6843 - Added SliceType and EllipsisType to types.py.
6845 - In urllib.py, added handling for error 301 (same as 302); added
6846 geturl() method to get the URL after redirection.
6848 - Fixed embarrassing typo in xdrlib.py. Also fixed typo in Setup.in
6849 for _xdrmodule.c and removed redundant #include from _xdrmodule.c.
6851 - Fixed bsddbmodule.c to add binary mode indicator on platforms that
6852 have it. This should make it working on Windows NT.
6854 - Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32,
6855 whatever applies. Also rationalized some other tests for various MS
6858 - Added the sources for the NT installer script used for Python
6859 1.4beta3. Not tested with this release, but better than nothing.
6861 - A compromise in pickle's defenses against Trojan horses: a
6862 user-defined function is now okay where a class is expected. A
6863 built-in function is not okay, to prevent pickling something that
6864 will execute os.system("rm -f *") when unpickling.
6866 - dis.py will print the name of local variables referenced by local
6867 load/store/delete instructions.
6869 - Improved portability of SimpleHTTPServer module to non-Unix
6872 - The thread.h interface adds an extra argument to down_sema(). This
6873 only affects other C code that uses thread.c; the Python thread module
6874 doesn't use semaphores (which aren't provided on all platforms where
6875 Python threads are supported). Note: on NT, this change is not
6878 - Fixed some typos in abstract.h; corrected signature of
6879 PyNumber_Coerce, added PyMapping_DelItem. Also fixed a bug in
6880 abstract.c's PyObject_CallMethod().
6882 - apply(classname, (), {}) now works even if the class has no
6885 - Implemented complex remainder and divmod() (these would dump core!).
6886 Conversion of complex numbers to int, long int or float now raises an
6887 exception, since there is no meaningful way to do it without losing
6890 - Fixed bug in built-in complex() function which gave the wrong result
6891 for two real arguments.
6893 - Change the hash algorithm for strings -- the multiplier is now
6894 1000003 instead of 3, which gives better spread for short strings.
6896 - New default path for Windows NT, the registry structure now supports
6897 default paths for different install packages. (Mark Hammond -- the
6898 next PythonWin release will use this.)
6900 - Added more symbols to the python_nt.def file.
6902 - When using GNU readline, set rl_readline_name to "python".
6904 - The Ellipses built-in name has been renamed to Ellipsis -- this is
6905 the correct singular form. Thanks to Ka-Ping Yee, who saved us from
6906 eternal embarrassment.
6908 - Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses ->
6909 Ellipsis name change.
6911 - Updated the library reference manual. Added documentation of
6912 restricted mode (rexec, Bastion) and the formatter module (for use
6913 with the htmllib module). Fixed the documentation of htmllib
6916 - The reference manual is now maintained in FrameMaker.
6918 - Upgraded scripts Doc/partparse.py and Doc/texi2html.py.
6920 - Slight improvements to Doc/Makefile.
6922 - Added fcntl.lockf(). This should be used for Unix file locking
6923 instead of the posixfile module; lockf() is more portable.
6925 - The getopt module now supports long option names, thanks to Lars
6928 - Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake
6931 - Use more bits of time.time() in whrandom's default seed().
6933 - Performance hack for regex module's regs attribute.
6935 - Don't close already closed socket in socket module.
6937 - Correctly handle separators containing embedded nulls in
6938 strop.split, strop.find and strop.rfind. Also added more detail to
6939 error message for strop.atoi and friends.
6941 - Moved fallback definition for hypot() to Python/hypot.c.
6943 - Added fallback definition for strdup, in Python/strdup.c.
6945 - Fixed some bugs where a function would return 0 to indicate an error
6946 where it should return -1.
6948 - Test for error returned by time.localtime(), and rationalized its MS
6951 - Added Modules/Setup.local file, which is processed after Setup.
6953 - Corrected bug in toplevel Makefile.in -- execution of regen script
6954 would not use the right PATH and PYTHONPATH.
6956 - Various and sundry NeXT configuration changes (sigh).
6958 - Support systems where libreadline needs neither termcap nor curses.
6960 - Improved ld_so_aix script and python.exp file (for AIX).
6962 - More stringent test for working <stdarg.h> in configure script.
6964 - Removed Demo/www subdirectory -- it was totally out of date.
6966 - Improved demos and docs for Fred Drake's parser module; fixed one
6967 typo in the module itself.
6970 =========================================
6971 ==> Release 1.4beta3 (August 26 1996) <==
6972 =========================================
6975 (XXX This is less readable that it should. I promise to restructure
6976 it for the final 1.4 release.)
6979 What's new in 1.4beta3 (since beta2)?
6980 -------------------------------------
6982 - Name mangling to implement a simple form of class-private variables.
6983 A name of the form "__spam" can't easily be used outside the class.
6984 (This was added in 1.4beta3, but left out of the 1.4beta3 release
6987 - In urllib.urlopen(): HTTP URLs containing user:passwd@host are now
6988 handled correctly when using a proxy server.
6990 - In ntpath.normpath(): don't truncate to 8+3 format.
6992 - In mimetools.choose_boundary(): don't die when getuid() or getpid()
6995 - Module urllib: some optimizations to (un)quoting.
6997 - New module MimeWriter for writing MIME documents.
6999 - More changes to formatter module.
7001 - The freeze script works once again and is much more robust (using
7002 sys.prefix etc.). It also supports a -o option to specify an
7005 - New module whichdb recognizes dbm, gdbm and bsddb/dbhash files.
7007 - The Doc/Makefile targets have been reorganized somewhat to remove the
7008 insistence on always generating PostScript.
7010 - The texinfo to html filter (Doc/texi2html.py) has been improved somewhat.
7012 - "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing
7013 name conflict on the Mac.
7015 - Linking a module compiled with a different setting for Py_TRACE_REFS now
7016 generates a linker error rather than a core dump.
7018 - The cgi module has a new convenience function print_exception(), which
7019 formats a python exception using HTML. It also fixes a bug in the
7020 compatibility code and adds a dubious feature which makes it possible to
7021 have two query strings, one in the URL and one in the POST data.
7023 - A subtle change in the unpickling of class instances makes it possible
7024 to unpickle in restricted execution mode, where the __dict__ attribute is
7025 not available (but setattr() is).
7027 - Documentation for os.path.splitext() (== posixpath.splitext()) has been
7028 cleared up. It splits at the *last* dot.
7030 - posixfile locking is now also correctly supported on AIX.
7032 - The tempfile module once again honors an initial setting of tmpdir. It
7033 now works on Windows, too.
7035 - The traceback module has some new functions to extract, format and print
7038 - Some translation functions in the urllib module have been made a little
7041 - The addtag_* methods for Canvas widgets in Tkinter as well as in the
7042 separate Canvas class have been fixed so they actually do something
7045 - A tiny _test() function has been added to Tkinter.py.
7047 - A generic Makefile for dynamically loaded modules is provided in the Misc
7048 subdirectory (Misc/gMakefile).
7050 - A new version of python-mode.el for Emacs is provided. See
7051 http://www.python.org/ftp/emacs/pmdetails.html for details. The
7052 separate file pyimenu.el is no longer needed, imenu support is folded
7053 into python-mode.el.
7055 - The configure script can finally correctly find the readline library in a
7056 non-standard location. The LDFLAGS variable is passed on the the Makefiles
7057 from the configure script.
7059 - Shared libraries are now installed as programs (i.e. with executable
7060 permission). This is required on HP-UX and won't hurt on other systems.
7062 - The objc.c module is no longer part of the distribution. Objective-C
7063 support may become available as contributed software on the ftp site.
7065 - The sybase module is no longer part of the distribution. A much
7066 improved sybase module is available as contributed software from the
7069 - _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and
7070 Mac (don't use unpatched Tcl/Tk!). The default line in the Setup.in file
7071 now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0.
7073 - In Setup, you can now write "*shared*" instead of "*noconfig*", and you
7074 can use *.so and *.sl as shared libraries.
7076 - Some more fidgeting for AIX shared libraries.
7078 - The mpz module is now compatible with GMP 2.x. (Not tested by me.)
7079 (Note -- a complete replacement by Niels Mo"ller, called gpmodule, is
7080 available from the contrib directory on the ftp site.)
7082 - A warning is written to sys.stderr when a __del__ method raises an
7083 exception (formerly, such exceptions were completely ignored).
7085 - The configure script now defines HAVE_OLD_CPP if the C preprocessor is
7086 incapable of ANSI style token concatenation and stringification.
7088 - All source files (except a few platform specific modules) are once again
7089 compatible with K&R C compilers as well as ANSI compilers. In particular,
7090 ANSI-isms have been removed or made conditional in complexobject.c,
7091 getargs.c and operator.c.
7093 - The abstract object API has three new functions, PyObject_DelItem,
7094 PySequence_DelItem, and PySequence_DelSlice.
7096 - The operator module has new functions delitem and delslice, and the
7097 functions "or" and "and" are renamed to "or_" and "and_" (since "or" and
7098 "and" are reserved words). ("__or__" and "__and__" are unchanged.)
7100 - The environment module is no longer supported; putenv() is now a function
7101 in posixmodule (also under NT).
7103 - Error in filter(<function>, "") has been fixed.
7105 - Unrecognized keyword arguments raise TypeError, not KeyError.
7107 - Better portability, fewer bugs and memory leaks, fewer compiler warnings,
7108 some more documentation.
7110 - Bug in float power boundary case (0.0 to the negative integer power)
7113 - The test of negative number to the float power has been moved from the
7114 built-in pow() functin to floatobject.c (so complex numbers can yield the
7117 - The bug introduced in beta2 where shared libraries loaded (using
7118 dlopen()) from the current directory would fail, has been fixed.
7120 - Modules imported as shared libraries now also have a __file__ attribute,
7121 giving the filename from which they were loaded. The only modules without
7122 a __file__ attribute now are built-in modules.
7124 - On the Mac, dynamically loaded modules can end in either ".slb" or
7125 ".<platform>.slb" where <platform> is either "CFM68K" or "ppc". The ".slb"
7126 extension should only be used for "fat" binaries.
7128 - C API addition: marshal.c now supports
7129 PyMarshal_WriteObjectToString(object).
7131 - C API addition: getargs.c now supports
7132 PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...)
7133 to parse keyword arguments.
7135 - The PC versioning scheme (sys.winver) has changed once again. the
7136 version number is now "<digit>.<digit>.<digit>.<apiversion>", where the
7137 first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4,
7138 "1.4.1" for Python 1.4.1 -- the beta level is not included) and
7139 <apiversion> is the four-digit PYTHON_API_VERSION (currently 1005).
7141 - h2py.py accepts whitespace before the # in CPP directives
7143 - On Solaris 2.5, it should now be possible to use either Posix threads or
7144 Solaris threads (XXX: how do you select which is used???). (Note: the
7145 Python pthreads interface doesn't fully support semaphores yet -- anyone
7148 - Thread support should now work on AIX, using either DCE threads or
7151 - New file Demo/sockets/unicast.py
7153 - Working Mac port, with CFM68K support, with Tk 4.1 support (though not
7156 - New project setup for PC port, now compatible with PythonWin, with
7157 _tkinter and NumPy support (XXX)
7159 - New module site.py (XXX)
7161 - New module xdrlib.py and optional support module _xdrmodule.c (XXX)
7163 - parser module adapted to new grammar, complete w/ Doc & Demo (XXX)
7165 - regen script fixed (XXX)
7167 - new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX)
7169 - testall now also tests math module (XXX)
7171 - string.atoi c.s. now raise an exception for an empty input string.
7173 - At last, it is no longer necessary to define HAVE_CONFIG_H in order to
7174 have config.h included at various places.
7176 - Unrecognized keyword arguments now raise TypeError rather than KeyError.
7178 - The makesetup script recognizes files with extension .so or .sl as
7181 - 'access' is no longer a reserved word, and all code related to its
7182 implementation is gone (or at least #ifdef'ed out). This should make
7183 Python a little speedier too!
7185 - Performance enhancements suggested by Sjoerd Mullender. This includes
7186 the introduction of two new optional function pointers in type object,
7187 getattro and setattro, which are like getattr and setattr but take a
7188 string object instead of a C string pointer.
7190 - New operations in string module: lstrip(s) and rstrip(s) strip whitespace
7191 only on the left or only on the right, A new optional third argument to
7192 split() specifies the maximum number of separators honored (so
7193 splitfields(s, sep, n) returns a list of at most n+1 elements). (Since
7194 1.3, splitfields(s, None) is totally equivalent to split(s).)
7195 string.capwords() has an optional second argument specifying the
7196 separator (which is passed to split()).
7198 - regsub.split() has the same addition as string.split(). regsub.splitx(s,
7199 sep, maxsep) implements the functionality that was regsub.split(s, 1) in
7200 1.4beta2 (return a list containing the delimiters as well as the words).
7202 - Final touch for AIX loading, rewritten Misc/AIX-NOTES.
7204 - In Modules/_tkinter.c, when using Tk 4.1 or higher, use className
7205 argument to _tkinter.create() to set Tcl's argv0 variable, so X
7206 resources use the right resource class again.
7208 - Add #undef fabs to Modules/mathmodule.c for macintosh.
7210 - Added some macro renames for AIX in Modules/operator.c.
7212 - Removed spurious 'E' from Doc/liberrno.tex.
7214 - Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new
7215 Misc/gMakefile and new version of Misc/python-mode.el.
7217 - Fixed typo in Lib/ntpath.py (islink has "return false" which gives a
7220 - Added missing "from types import *" to Lib/tkinter/Canvas.py.
7222 - Added hint about using default args for __init__ to pickle docs.
7224 - Corrected typo in Inclide/abstract.h: PySequence_Lenth ->
7227 - Some improvements to Doc/texi2html.py.
7229 - In Python/import.c, Cast unsigned char * in struct _frozen to char *
7230 in calls to rds_object().
7232 - In doc/ref4.tex, added note about scope of lambda bodies.
7234 What's new in 1.4beta2 (since beta1)?
7235 -------------------------------------
7237 - Portability bug in the md5.h header solved.
7239 - The PC build procedure now really works, and sets sys.platform to a
7240 meaningful value (a few things were botched in beta 1). Lib/dos_8x3
7241 is now a standard part of the distribution (alas).
7243 - More improvements to the installation procedure. Typing "make install"
7244 now inserts the version number in the pathnames of almost everything
7245 installed, and creates the machine dependent modules (FCNTL.py etc.) if not
7246 supplied by the distribution. (XXX There's still a problem with the latter
7247 because the "regen" script requires that Python is installed. Some manual
7248 intervention may still be required.) (This has been fixed in 1.4beta3.)
7250 - New modules: errno, operator (XXX).
7252 - Changes for use with Numerical Python: builtin function slice() and
7253 Ellipses object, and corresponding syntax:
7255 x[lo:hi:stride] == x[slice(lo, hi, stride)]
7256 x[a, ..., z] == x[(a, Ellipses, z)]
7258 - New documentation for errno and cgi mdoules.
7260 - The directory containing the script passed to the interpreter is
7261 inserted in from of sys.path; "." is no longer a default path
7264 - Optional third string argument to string.translate() specifies
7265 characters to delete. New function string.maketrans() creates a
7266 translation table for translate() or for regex.compile().
7268 - Module posix (and hence module os under Unix) now supports putenv().
7269 Moreover, module os is enhanced so that if putenv() is supported,
7270 assignments to os.environ entries make the appropriate putenv() call.
7271 (XXX the putenv() implementation can leak a small amount of memory per
7274 - pdb.py can now be invoked from the command line to debug a script:
7275 python pdb.py <script> <arg> ...
7277 - Much improved parseaddr() in rfc822.
7279 - In cgi.py, you can now pass an alternative value for environ to
7280 nearly all functions.
7282 - You can now assign to instance variables whose name begins and ends
7285 - New version of Fred Drake's parser module and associates (token,
7288 - New PYTHON_API_VERSION value and .pyc file magic number (again!).
7290 - The "complex" internal structure type is now called "Py_complex" to
7291 avoid name conflicts.
7293 - Numerous small bugs fixed.
7295 - Slight pickle speedups.
7297 - Some slight speedups suggested by Sjoerd (more coming in 1.4 final).
7299 - NeXT portability mods by Bill Bumgarner integrated.
7301 - Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been
7302 converted to new naming style.
7305 What's new in 1.4beta1 (since 1.3)?
7306 -----------------------------------
7308 - Added sys.platform and sys.exec_platform for Bill Janssen.
7310 - Installation has been completely overhauled. "make install" now installs
7311 everything, not just the python binary. Installation uses the install-sh
7312 script (borrowed from X11) to install each file.
7314 - New functions in the posix module: mkfifo, plock, remove (== unlink),
7315 and ftruncate. More functions are also available under NT.
7317 - New function in the fcntl module: flock.
7319 - Shared library support for FreeBSD.
7321 - The --with-readline option can now be used without a DIRECTORY argument,
7322 for systems where libreadline.* is in one of the standard places. It is
7323 also possible for it to be a shared library.
7325 - The extension tkinter has been renamed to _tkinter, to avoid confusion
7326 with Tkinter.py oncase insensitive file systems. It now supports Tk 4.1 as
7329 - Author's change of address from CWI in Amsterdam, The Netherlands, to
7330 CNRI in Reston, VA, USA.
7332 - The math.hypot() function is now always available (if it isn't found in
7333 the C math library, Python provides its own implementation).
7335 - The latex documentation is now compatible with latex2e, thanks to David
7338 - The expression x**y is now equivalent to pow(x, y).
7340 - The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)].
7342 - Complex numbers are now supported. Imaginary constants are written with
7343 a 'j' or 'J' prefix, general complex numbers can be formed by adding a real
7344 part to an imaginary part, like 3+4j. Complex numbers are always stored in
7345 floating point form, so this is equivalent to 3.0+4.0j. It is also
7346 possible to create complex numbers with the new built-in function
7347 complex(re, [im]). For the footprint-conscious, complex number support can
7348 be disabled by defining the symbol WITHOUT_COMPLEX.
7350 - New built-in function list() is the long-awaited counterpart of tuple().
7352 - There's a new "cmath" module which provides the same functions as the
7353 "math" library but with complex arguments and results. (There are very
7354 good reasons why math.sqrt(-1) still raises an exception -- you have to use
7355 cmath.sqrt(-1) to get 1j for an answer.)
7357 - The Python.h header file (which is really the same as allobjects.h except
7358 it disables support for old style names) now includes several more files,
7359 so you have to have fewer #include statements in the average extension.
7361 - The NDEBUG symbol is no longer used. Code that used to be dependent on
7362 the presence of NDEBUG is now present on the absence of DEBUG. TRACE_REFS
7363 and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG,
7364 respectively. At long last, the source actually compiles and links without
7365 errors when this symbol is defined.
7367 - Several symbols that didn't follow the new naming scheme have been
7368 renamed (usually by adding to rename2.h) to use a Py or _Py prefix. There
7369 are no external symbols left without a Py or _Py prefix, not even those
7370 defined by sources that were incorporated from elsewhere (regexpr.c,
7371 md5c.c). (Macros are a different story...)
7373 - There are now typedefs for the structures defined in config.c and
7376 - New PYTHON_API_VERSION value and .pyc file magic number.
7378 - New module Bastion. (XXX)
7380 - Improved performance of StringIO module.
7382 - UserList module now supports + and * operators.
7384 - The binhex and binascii modules now actually work.
7386 - The cgi module has been almost totally rewritten and documented.
7387 It now supports file upload and a new data type to handle forms more
7390 - The formatter module (for use with htmllib) has been overhauled (again).
7392 - The ftplib module now supports passive mode and has doc strings.
7394 - In (ideally) all places where binary files are read or written, the file
7395 is now correctly opened in binary mode ('rb' or 'wb') so the code will work
7398 - Dummy versions of os.path.expandvars() and expanduser() are now provided
7399 on non-Unix platforms.
7401 - Module urllib now has two new functions url2pathname and pathname2url
7402 which turn local filenames into "file:..." URLs using the same rules as
7403 Netscape (why be different). it also supports urlretrieve() with a
7404 pathname parameter, and honors the proxy environment variables (http_proxy
7405 etc.). The URL parsing has been improved somewhat, too.
7407 - Micro improvements to urlparse. Added urlparse.urldefrag() which
7408 removes a trailing ``#fragment'' if any.
7410 - The mailbox module now supports MH style message delimiters as well.
7412 - The mhlib module contains some new functionality: setcontext() to set the
7413 current folder and parsesequence() to parse a sequence as commonly passed
7414 to MH commands (e.g. 1-10 or last:5).
7416 - New module mimify for conversion to and from MIME format of email
7419 - Module ni now automatically installs itself when first imported -- this
7420 is against the normal rule that modules should define classes and functions
7421 but not invoke them, but appears more useful in the case that two
7422 different, independent modules want to use ni's features.
7424 - Some small performance enhancements in module pickle.
7426 - Small interface change to the profile.run*() family of functions -- more
7427 sensible handling of return values.
7429 - The officially registered Mac creator for Python files is 'Pyth'. This
7430 replaces 'PYTH' which was used before but never registered.
7432 - Added regsub.capwords(). (XXX)
7434 - Added string.capwords(), string.capitalize() and string.translate().
7437 - Fixed an interface bug in the rexec module: it was impossible to pass a
7438 hooks instance to the RExec class. rexec now also supports the dynamic
7439 loading of modules from shared libraries. Some other interfaces have been
7442 - Module rfc822 now caches the headers in a dictionary for more efficient
7445 - The sgmllib module now understands a limited number of SGML "shorthands"
7446 like <A/.../ for <A>...</A>. (It's not clear that this was a good idea...)
7448 - The tempfile module actually tries a number of different places to find a
7449 usable temporary directory. (This was prompted by certain Linux
7450 installations that appear to be missing a /usr/tmp directory.) [A bug in
7451 the implementation that would ignore a pre-existing tmpdir global has been
7454 - Much improved and enhanved FileDialog module for Tkinter.
7456 - Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as
7459 - New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and
7460 s.dup(). Sockets now work correctly on Windows. On Windows, the built-in
7461 extension is called _socket and a wrapper module win/socket.py provides
7462 "makefile()" and "dup()" functionality. On Windows, the select module
7463 works only with socket objects.
7465 - Bugs in bsddb module fixed (e.g. missing default argument values).
7467 - The curses extension now includes <ncurses.h> when available.
7469 - The gdbm module now supports opening databases in "fast" mode by
7470 specifying 'f' as the second character or the mode string.
7472 - new variables sys.prefix and sys.exec_prefix pass corresponding
7473 configuration options / Makefile variables to the Python programmer.
7475 - The ``new'' module now supports creating new user-defined classes as well
7476 as instances thereof.
7478 - The soundex module now sports get_soundex() to get the soundex value for an
7479 arbitrary string (formerly it would only do soundex-based string
7480 comparison) as well as doc strings.
7482 - New object type "cobject" to safely wrap void pointers for passing them
7483 between various extension modules.
7485 - More efficient computation of float**smallint.
7487 - The mysterious bug whereby "x.x" (two occurrences of the same
7488 one-character name) typed from the commandline would sometimes fail
7491 - The initialization of the readline function can now be invoked by a C
7492 extension through PyOS_ReadlineInit().
7494 - There's now an externally visible pointer PyImport_FrozenModules which
7495 can be changed by an embedding application.
7497 - The argument parsing functions now support a new format character 'D' to
7498 specify complex numbers.
7500 - Various memory leaks plugged and bugs fixed.
7502 - Improved support for posix threads (now that real implementations are
7503 beginning to apepar). Still no fully functioning semaphores.
7505 - Some various and sundry improvements and new entries in the Tools
7509 =====================================
7510 ==> Release 1.3 (13 October 1995) <==
7511 =====================================
7516 Two words: Keyword Arguments. See the first section of Chapter 12 of
7519 (The rest of this file is textually the same as the remaining sections
7523 Changes to the WWW and Internet tools
7524 =====================================
7526 The "htmllib" module has been rewritten in an incompatible fashion.
7527 The new version is considerably more complete (HTML 2.0 except forms,
7528 but including all ISO-8859-1 entity definitions), and easy to use.
7529 Small changes to "sgmllib" have also been made, to better match the
7530 tokenization of HTML as recognized by other web tools.
7532 A new module "formatter" has been added, for use with the new
7535 The "urllib"and "httplib" modules have been changed somewhat to allow
7536 overriding unknown URL types and to support authentication. They now
7537 use "mimetools.Message" instead of "rfc822.Message" to parse headers.
7538 The "endrequest()" method has been removed from the HTTP class since
7539 it breaks the interaction with some servers.
7541 The "rfc822.Message" class has been changed to allow a flag to be
7542 passed in that says that the file is unseekable.
7544 The "ftplib" module has been fixed to be (hopefully) more robust on
7547 Several new operations that are optionally supported by servers have
7548 been added to "nntplib": "xover", "xgtitle", "xpath" and "date".
7550 Other Language Changes
7551 ======================
7553 The "raise" statement now takes an optional argument which specifies
7554 the traceback to be used when printing the exception's stack trace.
7555 This must be a traceback object, such as found in "sys.exc_traceback".
7556 When omitted or given as "None", the old behavior (to generate a stack
7557 trace entry for the current stack frame) is used.
7559 The tokenizer is now more tolerant of alien whitespace. Control-L in
7560 the leading whitespace of a line resets the column number to zero,
7561 while Control-R just before the end of the line is ignored.
7563 Changes to Built-in Operations
7564 ==============================
7566 For file objects, "f.read(0)" and "f.readline(0)" now return an empty
7567 string rather than reading an unlimited number of bytes. For the
7568 latter, omit the argument altogether or pass a negative value.
7570 A new system variable, "sys.platform", has been added. It specifies
7571 the current platform, e.g. "sunos5" or "linux1".
7573 The built-in functions "input()" and "raw_input()" now use the GNU
7574 readline library when it has been configured (formerly, only
7575 interactive input to the interpreter itself was read using GNU
7576 readline). The GNU readline library provides elaborate line editing
7577 and history. The Python debugger ("pdb") is the first beneficiary of
7580 Two new built-in functions, "globals()" and "locals()", provide access
7581 to dictionaries containming current global and local variables,
7582 respectively. (These augment rather than replace "vars()", which
7583 returns the current local variables when called without an argument,
7584 and a module's global variables when called with an argument of type
7587 The built-in function "compile()" now takes a third possible value for
7588 the kind of code to be compiled: specifying "'single'" generates code
7589 for a single interactive statement, which prints the output of
7590 expression statements that evaluate to something else than "None".
7595 There are new module "ni" and "ihooks" that support importing modules
7596 with hierarchical names such as "A.B.C". This is enabled by writing
7597 "import ni; ni.ni()" at the very top of the main program. These
7598 modules are amply documented in the Python source.
7600 The module "rexec" has been rewritten (incompatibly) to define a class
7601 and to use "ihooks".
7603 The "string.split()" and "string.splitfields()" functions are now the
7604 same function (the presence or absence of the second argument
7605 determines which operation is invoked); similar for "string.join()"
7606 and "string.joinfields()".
7608 The "Tkinter" module and its helper "Dialog" have been revamped to use
7609 keyword arguments. Tk 4.0 is now the standard. A new module
7610 "FileDialog" has been added which implements standard file selection
7613 The optional built-in modules "dbm" and "gdbm" are more coordinated
7614 --- their "open()" functions now take the same values for their "flag"
7615 argument, and the "flag" and "mode" argument have default values (to
7616 open the database for reading only, and to create the database with
7617 mode "0666" minuse the umask, respectively). The memory leaks have
7620 A new dbm-like module, "bsddb", has been added, which uses the BSD DB
7621 package's hash method.
7623 A portable (though slow) dbm-clone, implemented in Python, has been
7624 added for systems where none of the above is provided. It is aptly
7627 The module "anydbm" provides a unified interface to "bsddb", "gdbm",
7628 "dbm", and "dumbdbm", choosing the first one available.
7630 A new extension module, "binascii", provides a variety of operations
7631 for conversion of text-encoded binary data.
7633 There are three new or rewritten companion modules implemented in
7634 Python that can encode and decode the most common such formats: "uu"
7635 (uuencode), "base64" and "binhex".
7637 A module to handle the MIME encoding quoted-printable has also been
7640 The parser module (which provides an interface to the Python parser's
7641 abstract syntax trees) has been rewritten (incompatibly) by Fred
7642 Drake. It now lets you change the parse tree and compile the result!
7644 The \code{syslog} module has been upgraded and documented.
7649 The dynamic module loader recognizes the fact that different filenames
7650 point to the same shared library and loads the library only once, so
7651 you can have a single shared library that defines multiple modules.
7652 (SunOS / SVR4 style shared libraries only.)
7654 Jim Fulton's ``abstract object interface'' has been incorporated into
7655 the run-time API. For more detailes, read the files
7656 "Include/abstract.h" and "Objects/abstract.c".
7658 The Macintosh version is much more robust now.
7660 Numerous things I have forgotten or that are so obscure no-one will
7661 notice them anyway :-)
7664 ===================================
7665 ==> Release 1.2 (13 April 1995) <==
7666 ===================================
7668 - Changes to Misc/python-mode.el:
7669 - Wrapping and indentation within triple quote strings should work
7671 - `Standard' bug reporting mechanism (use C-c C-b)
7672 - py-mark-block was moved to C-c C-m
7673 - C-c C-v shows you the python-mode version
7674 - a basic python-font-lock-keywords has been added for Emacs 19
7675 font-lock colorizations.
7676 - proper interaction with pending-del and del-sel modes.
7677 - New py-electric-colon (:) command for improved outdenting. Also
7678 py-indent-line (TAB) should handle outdented lines better.
7679 - New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
7681 - The Library Reference has been restructured, and many new and
7682 existing modules are now documented, in particular the debugger and
7683 the profiler, as well as the persistency and the WWW/Internet support
7686 - All known bugs have been fixed. For example the pow(2,2,3L) bug on
7687 Linux has been fixed. Also the re-entrancy problems with __del__ have
7690 - All known memory leaks have been fixed.
7692 - Phase 2 of the Great Renaming has been executed. The header files
7693 now use the new names (PyObject instead of object, etc.). The linker
7694 also sees the new names. Most source files still use the old names,
7695 by virtue of the rename2.h header file. If you include Python.h, you
7696 only see the new names. Dynamically linked modules have to be
7697 recompiled. (Phase 3, fixing the rest of the sources, will be
7698 executed gradually with the release later versions.)
7700 - The hooks for implementing "safe-python" (better called "restricted
7701 execution") are in place. Specifically, the import statement is
7702 implemented by calling the built-in function __import__, and the
7703 built-in names used in a particular scope are taken from the
7704 dictionary __builtins__ in that scope's global dictionary. See also
7705 the new (unsupported, undocumented) module rexec.py.
7707 - The import statement now supports the syntax "import a.b.c" and
7708 "from a.b.c import name". No officially supported implementation
7709 exists, but one can be prototyped by replacing the built-in __import__
7710 function. A proposal by Ken Manheimer is provided as newimp.py.
7712 - All machinery used by the import statement (or the built-in
7713 __import__ function) is now exposed through the new built-in module
7714 "imp" (see the library reference manual). All dynamic loading
7715 machinery is moved to the new file importdl.c.
7717 - Persistent storage is supported through the use of the modules
7718 "pickle" and "shelve" (implemented in Python). There's also a "copy"
7719 module implementing deepcopy and normal (shallow) copy operations.
7720 See the library reference manual.
7722 - Documentation strings for many objects types are accessible through
7723 the __doc__ attribute. Modules, classes and functions support special
7724 syntax to initialize the __doc__ attribute: if the first statement
7725 consists of just a string literal, that string literal becomes the
7726 value of the __doc__ attribute. The default __doc__ attribute is
7727 None. Documentation strings are also supported for built-in
7728 functions, types and modules; however this feature hasn't been widely
7729 used yet. See the 'new' module for an example. (Basically, the type
7730 object's tp_doc field contains the doc string for the type, and the
7731 4th member of the methodlist structure contains the doc string for the
7734 - The __coerce__ and __cmp__ methods for user-defined classes once
7735 again work as expected. As an example, there's a new standard class
7736 Complex in the library.
7738 - The functions posix.popen() and posix.fdopen() now have an optional
7739 third argument to specify the buffer size, and default their second
7740 (mode) argument to 'r' -- in analogy to the builtin open() function.
7741 The same applies to posixfile.open() and the socket method makefile().
7743 - The thread.exit_thread() function now raises SystemExit so that
7744 'finally' clauses are honored and a memory leak is plugged.
7746 - Improved X11 and Motif support, by Sjoerd Mullender. This extension
7747 is being maintained and distributed separately.
7749 - Improved support for the Apple Macintosh, in part by Jack Jansen,
7750 e.g. interfaces to (a few) resource mananger functions, get/set file
7751 type and creator, gestalt, sound manager, speech manager, MacTCP, comm
7752 toolbox, and the think C console library. This is being maintained
7753 and distributed separately.
7755 - Improved version for Windows NT, by Mark Hammond. This is being
7756 maintained and distributed separately.
7758 - Used autoconf 2.0 to generate the configure script. Adapted
7759 configure.in to use the new features in autoconf 2.0.
7761 - It now builds on the NeXT without intervention, even on the 3.3
7764 - Characters passed to isspace() and friends are masked to nonnegative
7767 - Correctly compute pow(-3.0, 3).
7769 - Fix portability problems with getopt (configure now checks for a
7772 - Don't add frozenmain.o to libPython.a.
7774 - Exceptions can now be classes. ALl built-in exceptions are still
7775 string objects, but this will change in the future.
7777 - The socket module exports a long list of socket related symbols.
7778 (More built-in modules will export their symbolic constants instead of
7779 relying on a separately generated Python module.)
7781 - When a module object is deleted, it clears out its own dictionary.
7782 This fixes a circularity in the references between functions and
7783 their global dictionary.
7785 - Changed the error handling by [new]getargs() e.g. for "O&".
7787 - Dynamic loading of modules using shared libraries is supported for
7788 several new platforms.
7790 - Support "O&", "[...]" and "{...}" in mkvalue().
7792 - Extension to findmethod(): findmethodinchain() (where a chain is a
7793 linked list of methodlist arrays). The calling interface for
7794 findmethod() has changed: it now gets a pointer to the (static!)
7795 methodlist structure rather than just to the function name -- this
7796 saves copying flags etc. into the (short-lived) method object.
7798 - The callable() function is now public.
7800 - Object types can define a few new operations by setting function
7801 pointers in the type object structure: tp_call defines how an object
7802 is called, and tp_str defines how an object's str() is computed.
7805 ===================================
7806 ==> Release 1.1.1 (10 Nov 1994) <==
7807 ===================================
7809 This is a pure bugfix release again. See the ChangeLog file for details.
7811 One exception: a few new features were added to tkinter.
7814 =================================
7815 ==> Release 1.1 (11 Oct 1994) <==
7816 =================================
7818 This release adds several new features, improved configuration and
7819 portability, and fixes more bugs than I can list here (including some
7822 The source compiles and runs out of the box on more platforms than
7823 ever -- including Windows NT. Makefiles or projects for a variety of
7824 non-UNIX platforms are provided.
7826 APOLOGY: some new features are badly documented or not at all. I had
7827 the choice -- postpone the new release indefinitely, or release it
7828 now, with working code but some undocumented areas. The problem with
7829 postponing the release is that people continue to suffer from existing
7830 bugs, and send me patches based on the previous release -- which I
7831 can't apply directly because my own source has changed. Also, some
7832 new modules (like signal) have been ready for release for quite some
7833 time, and people are anxiously waiting for them. In the case of
7834 signal, the interface is simple enough to figure out without
7835 documentation (if you're anxious enough :-). In this case it was not
7836 simple to release the module on its own, since it relies on many small
7837 patches elsewhere in the source.
7839 For most new Python modules, the source code contains comments that
7840 explain how to use them. Documentation for the Tk interface, written
7841 by Matt Conway, is available as tkinter-doc.tar.gz from the Python
7842 home and mirror ftp sites (see Misc/FAQ for ftp addresses). For the
7843 new operator overloading facilities, have a look at Demo/classes:
7844 Complex.py and Rat.py show how to implement a numeric type without and
7845 with __coerce__ method. Also have a look at the end of the Tutorial
7846 document (Doc/tut.tex). If you're still confused: use the newsgroup
7850 New language features:
7852 - More flexible operator overloading for user-defined classes
7853 (INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial.
7855 - Classes can define methods named __getattr__, __setattr__ and
7856 __delattr__ to trap attribute accesses. See end of tutorial.
7858 - Classes can define method __call__ so instances can be called
7859 directly. See end of tutorial.
7862 New support facilities:
7864 - The Makefiles (for the base interpreter as well as for extensions)
7865 now support creating dynamically loadable modules if the platform
7866 supports shared libraries.
7868 - Passing the interpreter a .pyc file as script argument will execute
7869 the code in that file. (On the Mac such files can be double-clicked!)
7871 - New Freeze script, to create independently distributable "binaries"
7872 of Python programs -- look in Demo/freeze
7874 - Improved h2py script (in Demo/scripts) follows #includes and
7875 supports macros with one argument
7877 - New module compileall generates .pyc files for all modules in a
7878 directory (tree) without also executing them
7880 - Threads should work on more platforms
7883 New built-in modules:
7885 - tkinter (support for Tcl's Tk widget set) is now part of the base
7888 - signal allows catching or ignoring UNIX signals (unfortunately still
7889 undocumented -- any taker?)
7891 - termios provides portable access to POSIX tty settings
7893 - curses provides an interface to the System V curses library
7895 - syslog provides an interface to the (BSD?) syslog daemon
7897 - 'new' provides interfaces to create new built-in object types
7898 (e.g. modules and functions)
7900 - sybase provides an interface to SYBASE database
7903 New/obsolete built-in methods:
7905 - callable(x) tests whether x can be called
7907 - sockets now have a setblocking() method
7909 - sockets no longer have an allowbroadcast() method
7911 - socket methods send() and sendto() return byte count
7914 New standard library modules:
7916 - types.py defines standard names for built-in types, e.g. StringType
7918 - urlparse.py parses URLs according to the latest Internet draft
7920 - uu.py does uuencode/uudecode (not the fastest in the world, but
7921 quicker than installing uuencode on a non-UNIX machine :-)
7923 - New, faster and more powerful profile module.py
7925 - mhlib.py provides interface to MH folders and messages
7928 New facilities for extension writers (unfortunately still
7931 - newgetargs() supports optional arguments and improved error messages
7933 - O!, O& O? formats for getargs allow more versatile type checking of
7936 - can register pending asynchronous callback, to be called the next
7937 time the Python VM begins a new instruction (Py_AddPendingCall)
7939 - can register cleanup routines to be called when Python exits
7942 - makesetup script understands C++ files in Setup file (use file.C
7945 - Make variable OPT is passed on to sub-Makefiles
7947 - An init<module>() routine may signal an error by not entering
7948 the module in the module table and raising an exception instead
7950 - For long module names, instead of foobarbletchmodule.c you can
7953 - getintvalue() and getfloatvalue() try to convert any object
7954 instead of requiring an "intobject" or "floatobject"
7956 - All the [new]getargs() formats that retrieve an integer value
7957 will now also work if a float is passed
7959 - C function listtuple() converts list to tuple, fast
7961 - You should now call sigcheck() instead of intrcheck();
7962 sigcheck() also sets an exception when it returns nonzero
7965 ====================================
7966 ==> Release 1.0.3 (14 July 1994) <==
7967 ====================================
7969 This release consists entirely of bug fixes to the C sources; see the
7970 head of ../ChangeLog for a complete list. Most important bugs fixed:
7972 - Sometimes the format operator (string%expr) would drop the last
7973 character of the format string
7975 - Tokenizer looped when last line did not end in \n
7977 - Bug when triple-quoted string ended in quote plus newline
7979 - Typo in socketmodule (listen) (== instead of =)
7981 - typing vars() at the >>> prompt would cause recursive output
7984 ==================================
7985 ==> Release 1.0.2 (4 May 1994) <==
7986 ==================================
7988 Overview of the most visible changes. Bug fixes are not listed. See
7994 * String literals follow Standard C rules: they may be continued on
7995 the next line using a backslash; adjacent literals are concatenated
7998 * A new kind of string literals, surrounded by triple quotes (""" or
7999 '''), can be continued on the next line without a backslash.
8004 * Function arguments may have a default value, e.g. def f(a, b=1);
8005 defaults are evaluated at function definition time. This also applies
8008 * The try-except statement has an optional else clause, which is
8009 executed when no exception occurs in the try clause.
8014 * The result of a statement-level expression is no longer printed,
8015 except_ for expressions entered interactively. Consequently, the -k
8016 command line option is gone.
8018 * The result of the last printed interactive expression is assigned to
8021 * Access to implicit global variables has been speeded up by removing
8022 an always-failing dictionary lookup in the dictionary of local
8023 variables (mod suggested by Steve Makewski and Tim Peters).
8025 * There is a new command line option, -u, to force stdout and stderr
8028 * Incorporated Steve Majewski's mods to import.c for dynamic loading
8031 * Fewer chances of dumping core when trying to reload or re-import
8032 static built-in, dynamically loaded built-in, or frozen modules.
8034 * Loops over sequences now don't ask for the sequence's length when
8035 they start, but try to access items 0, 1, 2, and so on until they hit
8036 an IndexError. This makes it possible to create classes that generate
8037 infinite or indefinite sequences a la Steve Majewski. This affects
8038 for loops, the (not) in operator, and the built-in functions filter(),
8039 map(), max(), min(), reduce().
8041 Changed Built-in operations
8042 ---------------------------
8044 * The '%' operator on strings (printf-style formatting) supports a new
8045 feature (adapted from a patch by Donald Beaudry) to allow
8046 '%(<key>)<format>' % {...} to take values from a dictionary by name
8047 instead of from a tuple by position (see also the new function
8050 * The '%s' formatting operator is changed to accept any type and
8051 convert it to a string using str().
8053 * Dictionaries with more than 20,000 entries can now be created
8054 (thanks to Steve Kirsch).
8056 New Built-in Functions
8057 ----------------------
8059 * vars() returns a dictionary containing the local variables; vars(m)
8060 returns a dictionary containing the variables of module m. Note:
8061 dir(x) is now equivalent to vars(x).keys().
8063 Changed Built-in Functions
8064 --------------------------
8066 * open() has an optional third argument to specify the buffer size: 0
8067 for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
8070 * open()'s second argument is now optional; it defaults to "r".
8072 * apply() now checks that its second argument is indeed a tuple.
8074 New Built-in Modules
8075 --------------------
8077 Changed Built-in Modules
8078 ------------------------
8080 The thread module no longer supports exit_prog().
8085 * Module addpack contains a standard interface to modify sys.path to
8086 find optional packages (groups of related modules).
8088 * Module urllib contains a number of functions to access
8089 World-Wide-Web files specified by their URL.
8091 * Module httplib implements the client side of the HTTP protocol used
8092 by World-Wide-Web servers.
8094 * Module gopherlib implements the client side of the Gopher protocol.
8096 * Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
8097 style mailbox files.
8099 * Module random contains various random distributions, e.g. gauss().
8101 * Module lockfile locks and unlocks open files using fcntl (inspired
8102 by a similar module by Andy Bensky).
8104 * Module ntpath (by Jaap Vermeulen) implements path operations for
8107 * Module test_thread (in Lib/test) contains a small test set for the
8110 Changed Python Modules
8111 ----------------------
8113 * The string module's expandvars() function is now documented and is
8114 implemented in Python (using regular expressions) instead of forking
8115 off a shell process.
8117 * Module rfc822 now supports accessing the header fields using the
8118 mapping/dictionary interface, e.g. h['subject'].
8120 * Module pdb now makes it possible to set a break on a function
8121 (syntax: break <expression>, where <expression> yields a function
8127 * The Demo/scripts/freeze.py script is working again (thanks to Jaap
8133 * Demo/threads/Generator.py is a proposed interface for restartable
8134 functions a la Tim Peters.
8136 * Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
8137 directory full of HTML pages which between them contain links to all
8138 the newsgroups available on your server.
8140 * Demo/dns contains a DNS (Domain Name Server) client.
8142 * Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
8143 nice enhanced Python shell!!!).
8145 * Demo/turing contains a Turing machine by Amrit Prem.
8150 * Documented new language features mentioned above (but not all new
8153 * Added a chapter to the Tutorial describing recent additions to
8156 * Clarified some sentences in the reference manual,
8157 e.g. break/continue, local/global scope, slice assignment.
8162 * Moved Include/tokenizer.h to Parser/tokenizer.h.
8164 * Added Python/getopt.c for systems that don't have it.
8169 * Indentation of continuated lines is done more intelligently;
8170 consequently the variable py-continuation-offset is gone.
8173 ========================================
8174 ==> Release 1.0.1 (15 February 1994) <==
8175 ========================================
8177 * Many portability fixes should make it painless to build Python on
8178 several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
8180 * Fixed test for <stdarg.h> -- this broke on some platforms.
8182 * Fixed test for shared library dynalic loading -- this broke on SunOS
8183 4.x using the GNU loader.
8185 * Changed order and number of SVR4 networking libraries (it is now
8186 -lsocket -linet -lnsl, if these libraries exist).
8188 * Installing the build intermediate stages with "make libainstall" now
8189 also installs config.c.in, Setup and makesetup, which are used by the
8190 new Extensions mechanism.
8192 * Improved README file contains more hints and new troubleshooting
8195 * The built-in module strop now defines fast versions of three more
8196 functions of the standard string module: atoi(), atol() and atof().
8197 The strop versions of atoi() and atol() support an optional second
8198 argument to specify the base (default 10). NOTE: you don't have to
8199 explicitly import strop to use the faster versions -- the string
8200 module contains code to let versions from stop override the default
8203 * There is now a working Lib/dospath.py for those who use Python under
8204 DOS (or Windows). Thanks, Jaap!
8206 * There is now a working Modules/dosmodule.c for DOS (or Windows)
8209 * Lib.os.py has been reorganized (making it ready for more operating
8212 * Lib/ospath.py is now obsolete (use os.path instead).
8214 * Many fixes to the tutorial to make it match Python 1.0. Thanks,
8217 * Fixed Doc/Makefile, Doc/README and various scripts there.
8219 * Added missing description of fdopen to Doc/libposix.tex.
8221 * Made cleanup() global, for the benefit of embedded applications.
8223 * Added parsing of addresses and dates to Lib/rfc822.py.
8225 * Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
8228 * New module Lib/wave.py reads RIFF (*.wav) audio files.
8230 * Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
8233 * New options and comments for Modules/makesetup (used by new
8234 Extension mechanism).
8236 * Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
8239 * Fixed coredump in filter(None, 'abcdefg').
8242 =======================================
8243 ==> Release 1.0.0 (26 January 1994) <==
8244 =======================================
8246 As is traditional, so many things have changed that I can't pretend to
8247 be complete in these release notes, but I'll try anyway :-)
8249 Note that the very last section is labeled "remaining bugs".
8252 Source organization and build process
8253 -------------------------------------
8255 * The sources have finally been split: instead of a single src
8256 subdirectory there are now separate directories Include, Parser,
8257 Grammar, Objects, Python and Modules. Other directories also start
8258 with a capital letter: Misc, Doc, Lib, Demo.
8260 * A few extensions (notably Amoeba and X support) have been moved to a
8261 separate subtree Extensions, which is no longer in the core
8262 distribution, but separately ftp'able as extensions.tar.Z. (The
8263 distribution contains a placeholder Ext-dummy with a description of
8264 the Extensions subtree as well as the most recent versions of the
8265 scripts used there.)
8267 * A few large specialized demos (SGI video and www) have been
8268 moved to a separate subdirectory Demo2, which is no longer in the core
8269 distribution, but separately ftp'able as demo2.tar.Z.
8271 * Parts of the standard library have been moved to subdirectories:
8272 there are now standard subdirectories stdwin, test, sgi and sun4.
8274 * The configuration process has radically changed: I now use GNU
8275 autoconf. This makes it much easier to build on new Unix flavors, as
8276 well as fully supporting VPATH (if your Make has it). The scripts
8277 Configure.py and Addmodule.sh are no longer needed. Many source files
8278 have been adapted in order to work with the symbols that the configure
8279 script generated by autoconf defines (or not); the resulting source is
8280 much more portable to different C compilers and operating systems,
8281 even non Unix systems (a Mac port was done in an afternoon). See the
8282 toplevel README file for a description of the new build process.
8284 * GNU readline (a slightly newer version) is now a subdirectory of the
8285 Python toplevel. It is still not automatically configured (being
8286 totally autoconf-unaware :-). One problem has been solved: typing
8287 Control-C to a readline prompt will now work. The distribution no
8288 longer contains a "super-level" directory (above the python toplevel
8289 directory), and dl, dl-dld and GNU dld are no longer part of the
8290 Python distribution (you can still ftp them from
8291 ftp.cwi.nl:/pub/dynload).
8293 * The DOS functions have been taken out of posixmodule.c and moved
8294 into a separate file dosmodule.c.
8296 * There's now a separate file version.c which contains nothing but
8299 * The actual main program is now contained in config.c (unless NO_MAIN
8300 is defined); pythonmain.c now contains a function realmain() which is
8301 called from config.c's main().
8303 * All files needed to use the built-in module md5 are now contained in
8304 the distribution. The module has been cleaned up considerably.
8310 * The library manual has been split into many more small latex files,
8311 so it is easier to edit Doc/lib.tex file to create a custom library
8312 manual, describing only those modules supported on your system. (This
8313 is not automated though.)
8315 * A fourth manual has been added, titled "Extending and Embedding the
8316 Python Interpreter" (Doc/ext.tex), which collects information about
8317 the interpreter which was previously spread over several files in the
8320 * The entire documentation is now also available on-line for those who
8321 have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL
8322 "http://www.cwi.nl/~guido/Python.html".
8328 * Strings may now be enclosed in double quotes as well as in single
8329 quotes. There is no difference in interpretation. The repr() of
8330 string objects will use double quotes if the string contains a single
8331 quote and no double quotes. Thanks to Amrit Prem for these changes!
8333 * There is a new keyword 'exec'. This replaces the exec() built-in
8334 function. If a function contains an exec statement, local variable
8335 optimization is not performed for that particular function, thus
8336 making assignment to local variables in exec statements less
8337 confusing. (As a consequence, os.exec and python.exec have been
8340 * There is a new keyword 'lambda'. An expression of the form
8342 lambda <parameters> : <expression>
8344 yields an anonymous function. This is really only syntactic sugar;
8345 you can just as well define a local function using
8347 def some_temporary_name(<parameters>): return <expression>
8349 Lambda expressions are particularly useful in combination with map(),
8350 filter() and reduce(), described below. Thanks to Amrit Prem for
8351 submitting this code (as well as map(), filter(), reduce() and
8358 * The built-in module containing the built-in functions is called
8359 __builtin__ instead of builtin.
8361 * New built-in functions map(), filter() and reduce() perform standard
8362 functional programming operations (though not lazily):
8364 - map(f, seq) returns a new sequence whose items are the items from
8365 seq with f() applied to them.
8367 - filter(f, seq) returns a subsequence of seq consisting of those
8368 items for which f() is true.
8370 - reduce(f, seq, initial) returns a value computed as follows:
8372 for item in seq: acc = f(acc, item)
8375 * New function xrange() creates a "range object". Its arguments are
8376 the same as those of range(), and when used in a for loop a range
8377 objects also behaves identical. The advantage of xrange() over
8378 range() is that its representation (if the range contains many
8379 elements) is much more compact than that of range(). The disadvantage
8380 is that the result cannot be used to initialize a list object or for
8381 the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern
8382 architectures, benchmarks have shown that "for i in range(...): ..."
8383 actually executes *faster* than "for i in xrange(...): ...", but on
8384 memory starved machines like PCs running DOS range(100000) may be just
8385 too big to be represented at all...
8387 * Built-in function exec() has been replaced by the exec statement --
8394 * Syntax errors are now not printed to stderr by the parser, but
8395 rather the offending line and other relevant information are packed up
8396 in the SyntaxError exception argument. When the main loop catches a
8397 SyntaxError exception it will print the error in the same format as
8398 previously, but at the proper position in the stack traceback.
8400 * You can now set a maximum to the number of traceback entries
8401 printed by assigning to sys.tracebacklimit. The default is 1000.
8403 * The version number in .pyc files has changed yet again.
8405 * It is now possible to have a .pyc file without a corresponding .py
8406 file. (Warning: this may break existing installations if you have an
8407 old .pyc file lingering around somewhere on your module search path
8408 without a corresponding .py file, when there is a .py file for a
8409 module of the same name further down the path -- the new interpreter
8410 will find the first .pyc file and complain about it, while the old
8411 interpreter would ignore it and use the .py file further down.)
8413 * The list sys.builtin_module_names is now sorted and also contains
8414 the names of a few hardwired built-in modules (sys, __main__ and
8417 * A module can now find its own name by accessing the global variable
8418 __name__. Assigning to this variable essentially renames the module
8419 (it should also be stored under a different key in sys.modules).
8420 A neat hack follows from this: a module that wants to execute a main
8421 program when called as a script no longer needs to compare
8422 sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
8424 * When an object is printed by the print statement, its implementation
8425 of str() is used. This means that classes can define __str__(self) to
8426 direct how their instances are printed. This is different from
8427 __repr__(self), which should define an unambigous string
8428 representation of the instance. (If __str__() is not defined, it
8429 defaults to __repr__().)
8431 * Functions and code objects can now be compared meaningfully.
8433 * On systems supporting SunOS or SVR4 style shared libraries, dynamic
8434 loading of modules using shared libraries is automatically configured.
8435 Thanks to Bill Jansen and Denis Severson for contributing this change!
8441 * File objects have acquired a new method writelines() which is the
8442 reverse of readlines(). (It does not actually write lines, just a
8443 list of strings, but the symmetry makes the choice of name OK.)
8449 * Socket objects no longer support the avail() method. Use the select
8450 module instead, or use this function to replace it:
8454 return f in select.select([f], [], [], 0)[0]
8456 * Initialization of stdwin is done differently. It actually modifies
8457 sys.argv (taking out the options the X version of stdwin recognizes)
8458 the first time it is imported.
8460 * A new built-in module parser provides a rudimentary interface to the
8461 python parser. Corresponding standard library modules token and symbol
8462 defines the numeric values of tokens and non-terminal symbols.
8464 * The posix module has aquired new functions setuid(), setgid(),
8465 execve(), and exec() has been renamed to execv().
8467 * The array module is extended with 8-byte object swaps, the 'i'
8468 format character, and a reverse() method. The read() and write()
8469 methods are renamed to fromfile() and tofile().
8471 * The rotor module has freed of portability bugs. This introduces a
8472 backward compatibility problem: strings encoded with the old rotor
8473 module can't be decoded by the new version.
8475 * For select.select(), a timeout (4th) argument of None means the same
8476 as leaving the timeout argument out.
8478 * Module strop (and hence standard library module string) has aquired
8479 a new function: rindex(). Thanks to Amrit Prem!
8481 * Module regex defines a new function symcomp() which uses an extended
8482 regular expression syntax: parenthesized subexpressions may be labeled
8483 using the form "\(<labelname>...\)", and the group() method can return
8484 sub-expressions by name. Thanks to Tracy Tims for these changes!
8486 * Multiple threads are now supported on Solaris 2. Thanks to Sjoerd
8490 Standard library modules
8491 ------------------------
8493 * The library is now split in several subdirectories: all stuff using
8494 stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
8495 is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
8496 test modules are in Lib/test. The default module search path will
8497 include all relevant subdirectories by default.
8499 * Module os now knows about trying to import dos. It defines
8500 functions execl(), execle(), execlp() and execvp().
8502 * New module dospath (should be attacked by a DOS hacker though).
8504 * All modules defining classes now define __init__() constructors
8505 instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE!
8507 * Some minor changes and bugfixes module ftplib (mostly Steve
8508 Majewski's suggestions); the debug() method is renamed to
8511 * Some new test modules (not run automatically by testall though):
8512 test_audioop, test_md5, test_rgbimg, test_select.
8514 * Module string now defines rindex() and rfind() in analogy of index()
8515 and find(). It also defines atof() and atol() (and corresponding
8516 exceptions) in analogy to atoi().
8518 * Added help() functions to modules profile and pdb.
8520 * The wdb debugger (now in Lib/stdwin) now shows class or instance
8521 variables on a double click. Thanks to Sjoerd Mullender!
8523 * The (undocumented) module lambda has gone -- you couldn't import it
8524 any more, and it was basically more a demo than a library module...
8527 Multimedia extensions
8528 ---------------------
8530 * The optional built-in modules audioop and imageop are now standard
8531 parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen
8532 for contributing this code!
8534 * There's a new operation in audioop: minmax().
8536 * There's a new built-in module called rgbimg which supports portable
8537 efficient reading of SGI RCG image files. Thanks also to Paul
8538 Haeberli for the original code! (Who will contribute a GIF reader?)
8540 * The module aifc is gone -- you should now always use aifc, which has
8541 received a facelift.
8543 * There's a new module sunau., for reading Sun (and NeXT) audio files.
8545 * There's a new module audiodev which provides a uniform interface to
8546 (SGI Indigo and Sun Sparc) audio hardware.
8548 * There's a new module sndhdr which recognizes various sound files by
8549 looking in their header and checking for various magic words.
8555 * Most optimizations below can be configured by compile-time flags.
8556 Thanks to Sjoerd Mullender for submitting these optimizations!
8558 * Small integers (default -1..99) are shared -- i.e. if two different
8559 functions compute the same value it is possible (but not
8560 guaranteed!!!) that they return the same *object*. Python programs
8561 can detect this but should *never* rely on it.
8563 * Empty tuples (which all compare equal) are shared in the same
8566 * Tuples of size up to 20 (default) are put in separate free lists
8569 * There is a compile-time option to cache a string's hash function,
8570 but this appeared to have a negligeable effect, and as it costs 4
8571 bytes per string it is disabled by default.
8577 * The initialization interface has been simplified somewhat. You now
8578 only call "initall()" to initialize the interpreter.
8580 * The previously announced renaming of externally visible identifiers
8581 has not been carried out. It will happen in a later release. Sorry.
8584 Miscellaneous bugs that have been fixed
8585 ---------------------------------------
8587 * All known portability bugs.
8589 * Version 0.9.9 dumped core in <listobject>.sort() which has been
8590 fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix
8591 on the mailing list while I was away!
8593 * Core dump on a format string ending in '%', e.g. in the expression
8596 * The array module yielded a bogus result for concatenation (a+b would
8599 * Some serious memory leaks in strop.split() and strop.splitfields().
8601 * Several problems with the nis module.
8603 * Subtle problem when copying a class method from another class
8604 through assignment (the method could not be called).
8610 * One problem with 64-bit machines remains -- since .pyc files are
8611 portable and use only 4 bytes to represent an integer object, 64-bit
8612 integer literals are silently truncated when written into a .pyc file.
8613 Work-around: use eval('123456789101112').
8615 * The freeze script doesn't work any more. A new and more portable
8616 one can probably be cooked up using tricks from Extensions/mkext.py.
8618 * The dos support hasn't been tested yet. (Really Soon Now we should
8619 have a PC with a working C compiler!)
8622 ===================================
8623 ==> Release 0.9.9 (29 Jul 1993) <==
8624 ===================================
8626 I *believe* these are the main user-visible changes in this release,
8627 but there may be others. SGI users may scan the {src,lib}/ChangeLog
8628 files for improvements of some SGI specific modules, e.g. aifc and
8629 cl. Developers of extension modules should also read src/ChangeLog.
8632 Naming of C symbols used by the Python interpreter
8633 --------------------------------------------------
8635 * This is the last release using the current naming conventions. New
8636 naming conventions are explained in the file misc/NAMING.
8637 Summarizing, all externally visible symbols get (at least) a "Py"
8638 prefix, and most functions are renamed to the standard form
8639 PyModule_FunctionName.
8641 * Writers of extensions are urged to start using the new naming
8642 conventions. The next release will use the new naming conventions
8643 throughout (it will also have a different source directory
8646 * As a result of the preliminary work for the great renaming, many
8647 functions that were accidentally global have been made static.
8653 * There are now modules interfacing to the X11 Toolkit Intrinsics, the
8654 Athena widgets, and the Motif 1.1 widget set. These are not yet
8655 documented except through the examples and README file in the demo/x11
8656 directory. It is expected that this interface will be replaced by a
8657 more powerful and correct one in the future, which may or may not be
8658 backward compatible. In other words, this part of the code is at most
8659 BETA level software! (Note: the rest of Python is rock solid as ever!)
8661 * I understand that the above may be a bit of a disappointment,
8662 however my current schedule does not allow me to change this situation
8663 before putting the release out of the door. By releasing it
8664 undocumented and buggy, at least some of the (working!) demo programs,
8665 like itr (my Internet Talk Radio browser) become available to a larger
8668 * There are also modules interfacing to SGI's "Glx" widget (a GL
8669 window wrapped in a widget) and to NCSA's "HTML" widget (which can
8670 format HyperText Markup Language, the document format used by the
8673 * I've experienced some problems when building the X11 support. In
8674 particular, the Xm and Xaw widget sets don't go together, and it
8675 appears that using X11R5 is better than using X11R4. Also the threads
8676 module and its link time options may spoil things. My own strategy is
8677 to build two Python binaries: one for use with X11 and one without
8678 it, which can contain a richer set of built-in modules. Don't even
8679 *think* of loading the X11 modules dynamically...
8682 Environmental changes
8683 ---------------------
8685 * Compiled files (*.pyc files) created by this Python version are
8686 incompatible with those created by the previous version. Both
8687 versions detect this and silently create a correct version, but it
8688 means that it is not a good idea to use the same library directory for
8689 an old and a new interpreter, since they will start to "fight" over
8692 * When a stack trace is printed, the exception is printed last instead
8693 of first. This means that if the beginning of the stack trace
8694 scrolled out of your window you can still see what exception caused
8697 * Sometimes interrupting a Python operation does not work because it
8698 hangs in a blocking system call. You can now kill the interpreter by
8699 interrupting it three times. The second time you interrupt it, a
8700 message will be printed telling you that the third interrupt will kill
8701 the interpreter. The "sys.exitfunc" feature still makes limited
8702 clean-up possible in this case.
8705 Changes to the command line interface
8706 -------------------------------------
8708 * The python usage message is now much more informative.
8710 * New option -i enters interactive mode after executing a script --
8711 useful for debugging.
8713 * New option -k raises an exception when an expression statement
8714 yields a value other than None.
8716 * For each option there is now also a corresponding environment
8720 Using Python as an embedded language
8721 ------------------------------------
8723 * The distribution now contains (some) documentation on the use of
8724 Python as an "embedded language" in other applications, as well as a
8725 simple example. See the file misc/EMBEDDING and the directory embed/.
8731 * Function local variables are now generally stored in an array and
8732 accessed using an integer indexing operation, instead of through a
8733 dictionary lookup. (This compensates the somewhat slower dictionary
8734 lookup caused by the generalization of the dictionary module.)
8737 Changes to the syntax
8738 ---------------------
8740 * Continuation lines can now *sometimes* be written without a
8741 backslash: if the continuation is contained within nesting (), [] or
8742 {} brackets the \ may be omitted. There's a much improved
8743 python-mode.el in the misc directory which knows about this as well.
8745 * You can no longer use an empty set of parentheses to define a class
8746 without base classes. That is, you no longer write this:
8748 class Foo(): # syntax error
8751 You must write this instead:
8756 This was already the preferred syntax in release 0.9.8 but many
8757 people seemed not to have picked it up. There's a Python script that
8758 fixes old code: demo/scripts/classfix.py.
8760 * There's a new reserved word: "access". The syntax and semantics are
8761 still subject of of research and debate (as well as undocumented), but
8762 the parser knows about the keyword so you must not use it as a
8763 variable, function, or attribute name.
8766 Changes to the semantics of the language proper
8767 -----------------------------------------------
8769 * The following compatibility hack is removed: if a function was
8770 defined with two or more arguments, and called with a single argument
8771 that was a tuple with just as many arguments, the items of this tuple
8772 would be used as the arguments. This is no longer supported.
8775 Changes to the semantics of classes and instances
8776 -------------------------------------------------
8778 * Class variables are now also accessible as instance variables for
8779 reading (assignment creates an instance variable which overrides the
8780 class variable of the same name though).
8782 * If a class attribute is a user-defined function, a new kind of
8783 object is returned: an "unbound method". This contains a pointer to
8784 the class and can only be called with a first argument which is a
8785 member of that class (or a derived class).
8787 * If a class defines a method __init__(self, arg1, ...) then this
8788 method is called when a class instance is created by the classname()
8789 construct. Arguments passed to classname() are passed to the
8790 __init__() method. The __init__() methods of base classes are not
8791 automatically called; the derived __init__() method must call these if
8792 necessary (this was done so the derived __init__() method can choose
8793 the call order and arguments for the base __init__() methods).
8795 * If a class defines a method __del__(self) then this method is called
8796 when an instance of the class is about to be destroyed. This makes it
8797 possible to implement clean-up of external resources attached to the
8798 instance. As with __init__(), the __del__() methods of base classes
8799 are not automatically called. If __del__ manages to store a reference
8800 to the object somewhere, its destruction is postponed; when the object
8801 is again about to be destroyed its __del__() method will be called
8804 * Classes may define a method __hash__(self) to allow their instances
8805 to be used as dictionary keys. This must return a 32-bit integer.
8811 * Function and class objects now know their name (the name given in
8812 the 'def' or 'class' statement that created them).
8814 * Class instances now know their class name.
8817 Additions to built-in operations
8818 --------------------------------
8820 * The % operator with a string left argument implements formatting
8821 similar to sprintf() in C. The right argument is either a single
8822 value or a tuple of values. All features of Standard C sprintf() are
8823 supported except %p.
8825 * Dictionaries now support almost any key type, instead of just
8826 strings. (The key type must be an immutable type or must be a class
8827 instance where the class defines a method __hash__(), in order to
8828 avoid losing track of keys whose value may change.)
8830 * Built-in methods are now compared properly: when comparing x.meth1
8831 and y.meth2, if x is equal to y and the methods are defined by the
8832 same function, x.meth1 compares equal to y.meth2.
8835 Additions to built-in functions
8836 -------------------------------
8838 * str(x) returns a string version of its argument. If the argument is
8839 a string it is returned unchanged, otherwise it returns `x`.
8841 * repr(x) returns the same as `x`. (Some users found it easier to
8842 have this as a function.)
8844 * round(x) returns the floating point number x rounded to an whole
8845 number, represented as a floating point number. round(x, n) returns x
8846 rounded to n digits.
8848 * hasattr(x, name) returns true when x has an attribute with the given
8851 * hash(x) returns a hash code (32-bit integer) of an arbitrary
8852 immutable object's value.
8854 * id(x) returns a unique identifier (32-bit integer) of an arbitrary
8857 * compile() compiles a string to a Python code object.
8859 * exec() and eval() now support execution of code objects.
8862 Changes to the documented part of the library (standard modules)
8863 ----------------------------------------------------------------
8865 * os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
8866 the border case '/foo/..' returns '/' instead of ''.
8868 * A new function string.find() is added with similar semantics to
8869 string.index(); however when it does not find the given substring it
8870 returns -1 instead of raising string.index_error.
8873 Changes to built-in modules
8874 ---------------------------
8876 * New optional module 'array' implements operations on sequences of
8877 integers or floating point numbers of a particular size. This is
8878 useful to manipulate large numerical arrays or to read and write
8879 binary files consisting of numerical data.
8881 * Regular expression objects created by module regex now support a new
8882 method named group(), which returns one or more \(...\) groups by number.
8883 The number of groups is increased from 10 to 100.
8885 * Function compile() in module regex now supports an optional mapping
8886 argument; a variable casefold is added to the module which can be used
8887 as a standard uppercase to lowercase mapping.
8889 * Module time now supports many routines that are defined in the
8890 Standard C time interface (<time.h>): gmtime(), localtime(),
8891 asctime(), ctime(), mktime(), as well as these variables (taken from
8892 System V): timezone, altzone, daylight and tzname. (The corresponding
8893 functions in the undocumented module calendar have been removed; the
8894 undocumented and unfinished module tzparse is now obsolete and will
8895 disappear in a future release.)
8897 * Module strop (the fast built-in version of standard module string)
8898 now uses C's definition of whitespace instead of fixing it to space,
8899 tab and newline; in practice this usually means that vertical tab,
8900 form feed and return are now also considered whitespace. It exports
8901 the string of characters that are considered whitespace as well as the
8902 characters that are considered lowercase or uppercase.
8904 * Module sys now defines the variable builtin_module_names, a list of
8905 names of modules built into the current interpreter (including not
8906 yet imported, but excluding two special modules that always have to be
8907 defined -- sys and builtin).
8909 * Objects created by module sunaudiodev now also support flush() and
8912 * Socket objects created by module socket now support an optional
8913 flags argument for their methods sendto() and recvfrom().
8915 * Module marshal now supports dumping to and loading from strings,
8916 through the functions dumps() and loads().
8918 * Module stdwin now supports some new functionality. You may have to
8919 ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
8925 * Fixed comparison of negative long integers.
8927 * The tokenizer no longer botches input lines longer than BUFSIZ.
8929 * Fixed several severe memory leaks in module select.
8931 * Fixed memory leaks in modules socket and sv.
8933 * Fixed memory leak in divmod() for long integers.
8935 * Problems with definition of floatsleep() on Suns fixed.
8937 * Many portability bugs fixed (and undoubtedly new ones added :-).
8940 Changes to the build procedure
8941 ------------------------------
8943 * The Makefile supports some new targets: "make default" and "make
8944 all". Both are by normally equivalent to "make python".
8946 * The Makefile no longer uses $> since it's not supported by all
8949 * The header files now all contain #ifdef constructs designed to make
8950 it safe to include the same header file twice, as well as support for
8951 inclusion from C++ programs (automatic extern "C" { ... } added).
8954 Freezing Python scripts
8955 -----------------------
8957 * There is now some support for "freezing" a Python script as a
8958 stand-alone executable binary file. See the script
8959 demo/scripts/freeze.py. It will require some site-specific tailoring
8960 of the script to get this working, but is quite worthwhile if you write
8961 Python code for other who may not have built and installed Python.
8967 * A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks,
8968 Marcel van der Peijl! This requires fewer compatibility hacks in
8969 posixmodule.c. The executable is not yet available but will be soon
8970 (check the mailing list).
8972 * The default PYTHONPATH has changed.
8975 Changes for developers of extension modules
8976 -------------------------------------------
8978 * Read src/ChangeLog for full details.
8981 SGI specific changes
8982 --------------------
8984 * Read src/ChangeLog for full details.
8987 ==================================
8988 ==> Release 0.9.8 (9 Jan 1993) <==
8989 ==================================
8991 I claim no completeness here, but I've tried my best to scan the log
8992 files throughout my source tree for interesting bits of news. A more
8993 complete account of the changes is to be found in the various
8994 ChangeLog files. See also "News for release 0.9.7beta" below if you're
8995 still using release 0.9.6, and the file HISTORY if you have an even
9001 Changes to the language proper
9002 ------------------------------
9004 There's only one big change: the conformance checking for function
9005 argument lists (of user-defined functions only) is stricter. Earlier,
9006 you could get away with the following:
9008 (a) define a function of one argument and call it with any
9009 number of arguments; if the actual argument count wasn't
9010 one, the function would receive a tuple containing the
9011 arguments arguments (an empty tuple if there were none).
9013 (b) define a function of two arguments, and call it with more
9014 than two arguments; if there were more than two arguments,
9015 the second argument would be passed as a tuple containing
9016 the second and further actual arguments.
9018 (Note that an argument (formal or actual) that is a tuple is counted as
9019 one; these rules don't apply inside such tuples, only at the top level
9020 of the argument list.)
9022 Case (a) was needed to accommodate variable-length argument lists;
9023 there is now an explicit "varargs" feature (precede the last argument
9024 with a '*'). Case (b) was needed for compatibility with old class
9025 definitions: up to release 0.9.4 a method with more than one argument
9026 had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
9027 Version 0.9.6 provide better ways to handle both casees, bot provided
9028 backward compatibility; version 0.9.8 retracts the compatibility hacks
9029 since they also cause confusing behavior if a function is called with
9030 the wrong number of arguments.
9032 There's a script that helps converting classes that still rely on (b),
9033 provided their methods' first argument is called "self":
9034 demo/scripts/methfix.py.
9036 If this change breaks lots of code you have developed locally, try
9037 #defining COMPAT_HACKS in ceval.c.
9039 (There's a third compatibility hack, which is the reverse of (a): if a
9040 function is defined with two or more arguments, and called with a
9041 single argument that is a tuple with just as many arguments, the items
9042 of this tuple will be used as the arguments. Although this can (and
9043 should!) be done using the built-in function apply() instead, it isn't
9047 One minor change: comparing instance methods works like expected, so
9048 that if x is an instance of a user-defined class and has a method m,
9049 then (x.m==x.m) yields 1.
9052 The following was already present in 0.9.7beta, but not explicitly
9053 mentioned in the NEWS file: user-defined classes can now define types
9054 that behave in almost allrespects like numbers. See
9055 demo/classes/Rat.py for a simple example.
9058 Changes to the build process
9059 ----------------------------
9061 The Configure.py script and the Makefile has been made somewhat more
9062 bullet-proof, after reports of (minor) trouble on certain platforms.
9064 There is now a script to patch Makefile and config.c to add a new
9065 optional built-in module: Addmodule.sh. Read the script before using!
9067 Useing Addmodule.sh, all optional modules can now be configured at
9068 compile time using Configure.py, so there are no modules left that
9069 require dynamic loading.
9071 The Makefile has been fixed to make it easier to use with the VPATH
9072 feature of some Make versions (e.g. SunOS).
9075 Changes affecting portability
9076 -----------------------------
9078 Several minor portability problems have been solved, e.g. "malloc.h"
9079 has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
9080 the system now tolerates malloc(0) returning 0.
9082 For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
9083 distributed with Python. This solves several minor problems, in
9084 particular scripts invoked using #! can now use dynamic loading.
9087 Changes to the interpreter interface
9088 ------------------------------------
9090 On popular demand, there's finally a "profile" feature for interactive
9091 use of the interpreter. If the environment variable $PYTHONSTARTUP is
9092 set to the name of an existing file, Python statements in this file
9093 are executed when the interpreter is started in interactive mode.
9095 There is a new clean-up mechanism, complementing try...finally: if you
9096 assign a function object to sys.exitfunc, it will be called when
9097 Python exits or receives a SIGTERM or SIGHUP signal.
9099 The interpreter is now generally assumed to live in
9100 /usr/local/bin/python (as opposed to /usr/local/python). The script
9101 demo/scripts/fixps.py will update old scripts in place (you can easily
9102 modify it to do other similar changes).
9104 Most I/O that uses sys.stdin/stdout/stderr will now use any object
9105 assigned to those names as long as the object supports readline() or
9108 The parser stack has been increased to 500 to accommodate more
9109 complicated expressions (7 levels used to be the practical maximum,
9112 The limit on the size of the *run-time* stack has completely been
9113 removed -- this means that tuple or list displays can contain any
9114 number of elements (formerly more than 50 would crash the
9118 Changes to existing built-in functions and methods
9119 --------------------------------------------------
9121 The built-in functions int(), long(), float(), oct() and hex() now
9122 also apply to class instalces that define corresponding methods
9126 New built-in functions
9127 ----------------------
9129 The new functions str() and repr() convert any object to a string.
9130 The function repr(x) is in all respects equivalent to `x` -- some
9131 people prefer a function for this. The function str(x) does the same
9132 except if x is already a string -- then it returns x unchanged
9133 (repr(x) adds quotes and escapes "funny" characters as octal escapes).
9135 The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
9138 Changes to general built-in modules
9139 -----------------------------------
9141 The time module's functions are more general: time() returns a
9142 floating point number and sleep() accepts one. Their accuracies
9143 depends on the precision of the system clock. Millisleep is no longer
9144 needed (although it still exists for now), but millitimer is still
9145 needed since on some systems wall clock time is only available with
9146 seconds precision, while a source of more precise time exists that
9147 isn't synchronized with the wall clock. (On UNIX systems that support
9148 the BSD gettimeofday() function, time.time() is as time.millitimer().)
9150 The string representation of a file object now includes an address:
9151 '<file 'filename', mode 'r' at #######>' where ###### is a hex number
9152 (the object's address) to make it unique.
9154 New functions added to posix: nice(), setpgrp(), and if your system
9155 supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
9157 Improvements to the socket module: socket objects have new methods
9158 getpeername() and getsockname(), and the {get,set}sockopt methods can
9159 now get/set any kind of option using strings built with the new struct
9160 module. And there's a new function fromfd() which creates a socket
9161 object given a file descriptor (useful for servers started by inetd,
9162 which have a socket connected to stdin and stdout).
9165 Changes to SGI-specific built-in modules
9166 ----------------------------------------
9168 The FORMS library interface (fl) now requires FORMS 2.1a. Some new
9169 functions have been added and some bugs have been fixed.
9171 Additions to al (audio library interface): added getname(),
9172 getdefault() and getminmax().
9174 The gl modules doesn't call "foreground()" when initialized (this
9175 caused some problems) like it dit in 0.9.7beta (but not before).
9176 There's a new gl function 'gversion() which returns a version string.
9178 The interface to sv (Indigo video interface) has totally changed.
9179 (Sorry, still no documentation, but see the examples in
9180 demo/sgi/{sv,video}.)
9183 Changes to standard library modules
9184 -----------------------------------
9186 Most functions in module string are now much faster: they're actually
9187 implemented in C. The module containing the C versions is called
9188 "strop" but you should still import "string" since strop doesn't
9189 provide all the interfaces defined in string (and strop may be renamed
9190 to string when it is complete in a future release).
9192 string.index() now accepts an optional third argument giving an index
9193 where to start searching in the first argument, so you can find second
9194 and further occurrences (this is similar to the regular expression
9195 functions in regex).
9197 The definition of what string.splitfields(anything, '') should return
9198 is changed for the last time: it returns a singleton list containing
9199 its whole first argument unchanged. This is compatible with
9200 regsub.split() which also ignores empty delimiter matches.
9202 posixpath, macpath: added dirname() and normpath() (and basename() to
9205 The mainloop module (for use with stdwin) can now demultiplex input
9206 from other sources, as long as they can be polled with select().
9209 New built-in modules
9210 --------------------
9212 Module struct defines functions to pack/unpack values to/from strings
9213 representing binary values in native byte order.
9215 Module strop implements C versions of many functions from string (see
9218 Optional module fcntl defines interfaces to fcntl() and ioctl() --
9219 UNIX only. (Not yet properly documented -- see however src/fcntl.doc.)
9221 Optional module mpz defines an interface to an altaernative long
9222 integer implementation, the GNU MPZ library.
9224 Optional module md5 uses the GNU MPZ library to calculate MD5
9225 signatures of strings.
9227 There are also optional new modules specific to SGI machines: imageop
9228 defines some simple operations to images represented as strings; sv
9229 interfaces to the Indigo video board; cl interfaces to the (yet
9230 unreleased) compression library.
9233 New standard library modules
9234 ----------------------------
9236 (Unfortunately the following modules are not all documented; read the
9237 sources to find out more about them!)
9239 autotest: run testall without showing any output unless it differs
9240 from the expected output
9242 bisect: use bisection to insert or find an item in a sorted list
9244 colorsys: defines conversions between various color systems (e.g. RGB
9247 nntplib: a client interface to NNTP servers
9249 pipes: utility to construct pipeline from templates, e.g. for
9250 conversion from one file format to another using several utilities.
9252 regsub: contains three functions that are more or less compatible with
9253 awk functions of the same name: sub() and gsub() do string
9254 substitution, split() splits a string using a regular expression to
9255 define how separators are define.
9257 test_types: test operations on the built-in types of Python
9259 toaiff: convert various audio file formats to AIFF format
9261 tzparse: parse the TZ environment parameter (this may be less general
9262 than it could be, let me know if you fix it).
9264 (Note that the obsolete module "path" no longer exists.)
9267 New SGI-specific library modules
9268 --------------------------------
9270 CL: constants for use with the built-in compression library interface (cl)
9272 Queue: a multi-producer, multi-consumer queue class implemented for
9273 use with the built-in thread module
9275 SOCKET: constants for use with built-in module socket, e.g. to set/get
9276 socket options. This is SGI-specific because the constants to be
9277 passed are system-dependent. You can generate a version for your own
9278 system by running the script demo/scripts/h2py.py with
9279 /usr/include/sys/socket.h as input.
9281 cddb: interface to the database used the the CD player
9283 torgb: convert various image file types to rgb format (requires pbmplus)
9289 There's an experimental interface to define Sun RPC clients and
9290 servers in demo/rpc.
9292 There's a collection of interfaces to WWW, WAIS and Gopher (both
9293 Python classes and program providing a user interface) in demo/www.
9294 This includes a program texi2html.py which converts texinfo files to
9295 HTML files (the format used hy WWW).
9297 The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
9299 For SGI systems, there's a whole collection of programs and classes
9300 that make use of the Indigo video board in demo/sgi/{sv,video}. This
9301 represents a significant amount of work that we're giving away!
9303 There are demos "rsa" and "md5test" that exercise the mpz and md5
9304 modules, respectively. The rsa demo is a complete implementation of
9305 the RSA public-key cryptosystem!
9307 A bunch of games and examples submitted by Stoffel Erasmus have been
9308 included in demo/stoffel.
9310 There are miscellaneous new files in some existing demo
9311 subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
9312 sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
9314 There are also many minor changes to existing files, but I'm too lazy
9315 to run a diff and note the differences -- you can do this yourself if
9316 you save the old distribution's demos. One highlight: the
9317 stdwin/python.py demo is much improved!
9320 Changes to the documentation
9321 ----------------------------
9323 The LaTeX source for the library uses different macros to enable it to
9324 be converted to texinfo, and from there to INFO or HTML format so it
9325 can be browsed as a hypertext. The net result is that you can now
9326 read the Python library documentation in Emacs info mode!
9329 Changes to the source code that affect C extension writers
9330 ----------------------------------------------------------
9332 The function strdup() no longer exists (it was used only in one places
9333 and is somewhat of a a portability problem sice some systems have the
9334 same function in their C library.
9336 The functions NEW() and RENEW() allocate one spare byte to guard
9337 against a NULL return from malloc(0) being taken for an error, but
9338 this should not be relied upon.
9341 =========================
9342 ==> Release 0.9.7beta <==
9343 =========================
9346 Changes to the language proper
9347 ------------------------------
9349 User-defined classes can now implement operations invoked through
9350 special syntax, such as x[i] or `x` by defining methods named
9351 __getitem__(self, i) or __repr__(self), etc.
9354 Changes to the build process
9355 ----------------------------
9357 Instead of extensive manual editing of the Makefile to select
9358 compile-time options, you can now run a Configure.py script.
9359 The Makefile as distributed builds a minimal interpreter sufficient to
9360 run Configure.py. See also misc/BUILD
9362 The Makefile now includes more "utility" targets, e.g. install and
9365 Using the provided strtod.c and strtol.c are now separate options, as
9366 on the Sun the provided strtod.c dumps core :-(
9368 The regex module is now an option chosen by the Makefile, since some
9369 (old) C compilers choke on regexpr.c
9372 Changes affecting portability
9373 -----------------------------
9375 You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
9378 Dynamic loading is now supported for Sun (and other non-COFF systems)
9379 throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
9382 The system-dependent code for the use of the select() system call is
9383 moved to one file: myselect.h
9385 Thanks to Jaap Vermeulen, the code should now port cleanly to the
9389 Changes to the interpreter interface
9390 ------------------------------------
9392 The interpretation of $PYTHONPATH in the environment is different: it
9393 is inserted in front of the default path instead of overriding it
9396 Changes to existing built-in functions and methods
9397 --------------------------------------------------
9399 List objects now support an optional argument to their sort() method,
9400 which is a comparison function similar to qsort(3) in C
9402 File objects now have a method fileno(), used by the new select module
9406 New built-in function
9407 ---------------------
9409 coerce(x, y): take two numbers and return a tuple containing them
9410 both converted to a common type
9413 Changes to built-in modules
9414 ---------------------------
9416 sys: fixed core dumps in settrace() and setprofile()
9418 socket: added socket methods setsockopt() and getsockopt(); and
9419 fileno(), used by the new select module (see below)
9421 stdwin: added fileno() == connectionnumber(), in support of new module
9424 posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
9428 fl: added several new functions, fixed several obscure bugs, adapted
9432 Changes to standard modules
9433 ---------------------------
9435 posixpath: changed implementation of ismount()
9437 string: atoi() no longer mistakes leading zero for octal number
9442 New built-in modules
9443 --------------------
9445 Modules marked "dynamic only" are not configured at compile time but
9446 can be loaded dynamically. You need to turn on the DL or DLD option in
9447 the Makefile for support dynamic loading of modules (this requires
9450 select: interfaces to the BSD select() system call
9452 dbm: interfaces to the (new) dbm library (dynamic only)
9454 nis: interfaces to some NIS functions (aka yellow pages)
9456 thread: limited form of multiple threads (sgi only)
9458 audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
9459 coding (dynamic only)
9461 cd: interface to Indigo SCSI CDROM player audio library (sgi only)
9463 jpeg: read files in JPEG format (dynamic only, sgi only; needs
9466 imgfile: read SGI image files (dynamic only, sgi only)
9468 sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
9470 sv: interface to Indigo video library (sgi only)
9472 pc: a minimal set of MS-DOS interfaces (MS-DOS only)
9474 rotor: encryption, by Lance Ellinghouse (dynamic only)
9477 New standard modules
9478 --------------------
9480 Not all these modules are documented. Read the source:
9481 lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains
9482 additional documentation.
9484 imghdr: recognizes image file headers
9486 sndhdr: recognizes sound file headers
9488 profile: print run-time statistics of Python code
9490 readcd, cdplayer: companion modules for built-in module cd (sgi only)
9492 emacs: interface to Emacs using py-connect.el (see below).
9494 SOCKET: symbolic constant definitions for socket options
9496 SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
9498 SV: symbolic constat definitions for sv (sgi only)
9500 CD: symbolic constat definitions for cd (sgi only)
9506 scripts/pp.py: execute Python as a filter with a Perl-like command
9509 classes/: examples using the new class features
9511 threads/: examples using the new thread module
9513 sgi/cd/: examples using the new cd module
9516 Changes to the documentation
9517 ----------------------------
9519 The last-minute syntax changes of release 0.9.6 are now reflected
9520 everywhere in the manuals
9522 The reference manual has a new section (3.2) on implementing new kinds
9523 of numbers, sequences or mappings with user classes
9525 Classes are now treated extensively in the tutorial (chapter 9)
9527 Slightly restructured the system-dependent chapters of the library
9530 The file misc/EXTENDING incorporates documentation for mkvalue() and
9531 a new section on error handling
9533 The files misc/CLASSES and misc/ERRORS are no longer necessary
9535 The doc/Makefile now creates PostScript files automatically
9538 Miscellaneous changes
9539 ---------------------
9541 Incorporated Tim Peters' changes to python-mode.el, it's now version
9544 A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
9545 program running in an Emacs buffer execute Emacs lisp code. The
9546 necessary Python code is in lib/emacs.py. The Emacs code is
9547 misc/py-connect.el (it needs some external Emacs lisp code)
9550 Changes to the source code that affect C extension writers
9551 ----------------------------------------------------------
9553 New service function mkvalue() to construct a Python object from C
9554 values according to a "format" string a la getargs()
9556 Most functions from pythonmain.c moved to new pythonrun.c which is
9557 in libpython.a. This should make embedded versions of Python easier
9559 ceval.h is split in eval.h (which needs compile.h and only declares
9560 eval_code) and ceval.h (which doesn't need compile.hand declares the
9563 ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
9564 improve the parallellism of multi-threaded programs by letting other
9565 Python code run when a blocking system call or something similar is
9568 In structmember.[ch], new member types BYTE, CHAR and unsigned
9569 variants have been added
9571 New file xxmodule.c is a template for new extension modules.
9574 ==================================
9575 ==> Release 0.9.6 (6 Apr 1992) <==
9576 ==================================
9579 - Restructured the misc subdirectory
9580 - Reference manual completed, library manual much extended (with indexes!)
9581 - the GNU Readline library is now distributed standard with Python
9582 - the script "../demo/scripts/classfix.py" fixes Python modules using old
9584 - Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
9585 - Because of the GNU copyleft business I am not using the GNU regular
9586 expression implementation but a free re-implementation by Tatu Ylonen
9587 that recently appeared in comp.sources.misc (Bravo, Tatu!)
9589 New features in 0.9.6:
9590 - stricter try stmt syntax: cannot mix except and finally clauses on 1 try
9591 - New module 'os' supplants modules 'mac' and 'posix' for most cases;
9592 module 'path' is replaced by 'os.path'
9593 - os.path.split() return value differs from that of old path.split()
9594 - sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
9595 currently being handled
9596 - sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
9598 - New function string.expandtabs() expands tabs in a string
9599 - Added times() interface to posix (user & sys time of process & children)
9600 - Added uname() interface to posix (returns OS type, hostname, etc.)
9601 - New built-in function execfile() is like exec() but from a file
9602 - Functions exec() and eval() are less picky about whitespace/newlines
9603 - New built-in functions getattr() and setattr() access arbitrary attributes
9604 - More generic argument handling in built-in functions (see "./EXTENDING")
9605 - Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
9606 - Division and modulo for long and plain integers with negative operands
9607 have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
9608 as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as
9609 (a/b, a%b) for integers. For floats, % is also changed, but of course
9610 / is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
9611 - A function with explicit variable-length argument list can be declared
9612 like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
9613 - Code tracing and profiling features have been added, and two source
9614 code debuggers are provided in the library (pdb.py, tty-oriented,
9615 and wdb, window-oriented); you can now step through Python programs!
9616 See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
9617 - '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
9618 a script that fixes old Python modules
9619 - Plain integer right shift now uses sign extension
9620 - Long integer shift/mask operations now simulate 2's complement
9621 to give more useful results for negative operands
9622 - Changed/added range checks for long/plain integer shifts
9623 - Options found after "-c command" are now passed to the command in sys.argv
9624 (note subtle incompatiblity with "python -c command -- -options"!)
9625 - Module stdwin is better protected against touching objects after they've
9626 been closed; menus can now also be closed explicitly
9627 - Stdwin now uses its own exception (stdwin.error)
9629 New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
9630 - dictionary objects can now be compared properly; e.g., {}=={} is true
9631 - new exception SystemExit causes termination if not caught;
9632 it is raised by sys.exit() so that 'finally' clauses can clean up,
9633 and it may even be caught. It does work interactively!
9634 - new module "regex" implements GNU Emacs style regular expressions;
9635 module "regexp" is rewritten in Python for backward compatibility
9636 - formal parameter lists may contain trailing commas
9638 Bugs fixed in 0.9.6:
9639 - assigning to or deleting a list item with a negative index dumped core
9640 - divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
9642 Bugs fixed in 0.9.5:
9643 - masking operations involving negative long integers gave wrong results
9646 ===================================
9647 ==> Release 0.9.4 (24 Dec 1991) <==
9648 ===================================
9650 - new function argument handling (see below)
9651 - built-in apply(func, args) means func(args[0], args[1], ...)
9652 - new, more refined exceptions
9653 - new exception string values (NameError = 'NameError' etc.)
9654 - better checking for math exceptions
9655 - for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
9656 - fixed list assignment bug: "a[1:1] = a" now works correctly
9657 - new class syntax, without extraneous parentheses
9658 - new 'global' statement to assign global variables from within a function
9664 You can now declare a base class as follows:
9666 class B: # Was: class B():
9667 def some_method(self): ...
9670 and a derived class thusly:
9672 class D(B): # Was: class D() = B():
9673 def another_method(self, arg): ...
9675 Multiple inheritance looks like this:
9677 class M(B, D): # Was: class M() = B(), D():
9678 def this_or_that_method(self, arg): ...
9680 The old syntax is still accepted by Python 0.9.4, but will disappear
9681 in Python 1.0 (to be posted to comp.sources).
9684 New 'global' statement
9685 ----------------------
9687 Every now and then you have a global variable in a module that you
9688 want to change from within a function in that module -- say, a count
9689 of calls to a function, or an option flag, etc. Until now this was
9690 not directly possible. While several kludges are known that
9691 circumvent the problem, and often the need for a global variable can
9692 be avoided by rewriting the module as a class, this does not always
9693 lead to clearer code.
9695 The 'global' statement solves this dilemma. Its occurrence in a
9696 function body means that, for the duration of that function, the
9697 names listed there refer to global variables. For instance:
9702 def add_to_total(amount):
9704 total = total + amount
9707 'global' must be repeated in each function where it is needed. The
9708 names listed in a 'global' statement must not be used in the function
9709 before the statement is reached.
9711 Remember that you don't need to use 'global' if you only want to *use*
9712 a global variable in a function; nor do you need ot for assignments to
9713 parts of global variables (e.g., list or dictionary items or
9714 attributes of class instances). This has not changed; in fact
9715 assignment to part of a global variable was the standard workaround.
9721 Several new exceptions have been defined, to distinguish more clearly
9722 between different types of errors.
9726 AttributeError reference to non-existing attribute NameError
9727 IOError unexpected I/O error RuntimeError
9728 ImportError import of non-existing module or name NameError
9729 IndexError invalid string, tuple or list index RuntimeError
9730 KeyError key not in dictionary RuntimeError
9731 OverflowError numeric overflow RuntimeError
9732 SyntaxError invalid syntax RuntimeError
9733 ValueError invalid argument value RuntimeError
9734 ZeroDivisionError division by zero RuntimeError
9736 The string value of each exception is now its name -- this makes it
9737 easier to experimentally find out which operations raise which
9740 >>> KeyboardInterrupt
9745 New argument passing semantics
9746 ------------------------------
9748 Off-line discussions with Steve Majewski and Daniel LaLiberte have
9749 convinced me that Python's parameter mechanism could be changed in a
9750 way that made both of them happy (I hope), kept me happy, fixed a
9751 number of outstanding problems, and, given some backward compatibility
9752 provisions, would only break a very small amount of existing code --
9753 probably all mine anyway. In fact I suspect that most Python users
9754 will hardly notice the difference. And yet it has cost me at least
9755 one sleepless night to decide to make the change...
9757 Philosophically, the change is quite radical (to me, anyway): a
9758 function is no longer called with either zero or one argument, which
9759 is a tuple if there appear to be more arguments. Every function now
9760 has an argument list containing 0, 1 or more arguments. This list is
9761 always implemented as a tuple, and it is a (run-time) error if a
9762 function is called with a different number of arguments than expected.
9764 What's the difference? you may ask. The answer is, very little unless
9765 you want to write variadic functions -- functions that may be called
9766 with a variable number of arguments. Formerly, you could write a
9767 function that accepted one or more arguments with little trouble, but
9768 writing a function that could be called with either 0 or 1 argument
9769 (or more) was next to impossible. This is now a piece of cake: you
9770 can simply declare an argument that receives the entire argument
9771 tuple, and check its length -- it will be of size 0 if there are no
9774 Another anomaly of the old system was the way multi-argument methods
9775 (in classes) had to be declared, e.g.:
9778 def init(self, (x, y, color)): ...
9779 def setcolor(self, color): ...
9780 dev moveto(self, (x, y)): ...
9783 Using the new scheme there is no need to enclose the method arguments
9784 in an extra set of parentheses, so the above class could become:
9787 def init(self, x, y, color): ...
9788 def setcolor(self, color): ...
9789 dev moveto(self, x, y): ...
9792 That is, the equivalence rule between methods and functions has
9793 changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
9794 while formerly it was equivalent to Point.moveto(p,(x,y)).
9796 A special backward compatibility rule makes that the old version also
9797 still works: whenever a function with exactly two arguments (at the top
9798 level) is called with more than two arguments, the second and further
9799 arguments are packed into a tuple and passed as the second argument.
9800 This rule is invoked independently of whether the function is actually a
9801 method, so there is a slight chance that some erroneous calls of
9802 functions expecting two arguments with more than that number of
9803 arguments go undetected at first -- when the function tries to use the
9804 second argument it may find it is a tuple instead of what was expected.
9805 Note that this rule will be removed from future versions of the
9806 language; it is a backward compatibility provision *only*.
9808 Two other rules and a new built-in function handle conversion between
9809 tuples and argument lists:
9811 Rule (a): when a function with more than one argument is called with a
9812 single argument that is a tuple of the right size, the tuple's items
9813 are used as arguments.
9815 Rule (b): when a function with exactly one argument receives no
9816 arguments or more than one, that one argument will receive a tuple
9817 containing the arguments (the tuple will be empty if there were no
9821 A new built-in function, apply(), was added to support functions that
9822 need to call other functions with a constructed argument list. The call
9824 apply(function, tuple)
9828 function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
9831 While no new argument syntax was added in this phase, it would now be
9832 quite sensible to add explicit syntax to Python for default argument
9833 values (as in C++ or Modula-3), or a "rest" argument to receive the
9834 remaining arguments of a variable-length argument list.
9837 ========================================================
9838 ==> Release 0.9.3 (never made available outside CWI) <==
9839 ========================================================
9841 - string sys.version shows current version (also printed on interactive entry)
9842 - more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
9843 - 'global' statement to declare module-global variables assigned in functions.
9844 - new class declaration syntax: class C(Base1, Base2, ...): suite
9845 (the old syntax is still accepted -- be sure to convert your classes now!)
9846 - C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
9847 - C comparison operators: == != (the old = and <> remain valid).
9848 - floating point numbers may now start with a period (e.g., .14).
9849 - definition of integer division tightened (always truncates towards zero).
9850 - new builtins hex(x), oct(x) return hex/octal string from (long) integer.
9851 - new list method l.count(x) returns the number of occurrences of x in l.
9852 - new SGI module: al (Indigo and 4D/35 audio library).
9853 - the FORMS interface (modules fl and FL) now uses FORMS 2.0
9854 - module gl: added lrect{read,write}, rectzoom and pixmode;
9855 added (non-GL) functions (un)packrect.
9856 - new socket method: s.allowbroadcast(flag).
9857 - many objects support __dict__, __methods__ or __members__.
9858 - dir() lists anything that has __dict__.
9859 - class attributes are no longer read-only.
9860 - classes support __bases__, instances support __class__ (and __dict__).
9861 - divmod() now also works for floats.
9862 - fixed obscure bug in eval('1 ').
9865 ===================================
9866 ==> Release 0.9.2 (Autumn 1991) <==
9867 ===================================
9872 - tutorial now (almost) complete; library reference reorganized
9873 - new syntax: continue statement; semicolons; dictionary constructors;
9874 restrictions on blank lines in source files removed
9875 - dramatically improved module load time through precompiled modules
9876 - arbitrary precision integers: compute 2 to the power 1000 and more...
9877 - arithmetic operators now accept mixed type operands, e.g., 3.14/4
9878 - more operations on list: remove, index, reverse; repetition
9879 - improved/new file operations: readlines, seek, tell, flush, ...
9880 - process management added to the posix module: fork/exec/wait/kill etc.
9881 - BSD socket operations (with example servers and clients!)
9882 - many new STDWIN features (color, fonts, polygons, ...)
9883 - new SGI modules: font manager and FORMS library interface
9886 Extended list of changes in 0.9.2
9887 ---------------------------------
9889 Here is a summary of the most important user-visible changes in 0.9.2,
9890 in somewhat arbitrary order. Changes in later versions are listed in
9891 the "highlights" section above.
9894 1. Changes to the interpreter proper
9896 - Simple statements can now be separated by semicolons.
9897 If you write "if t: s1; s2", both s1 and s2 are executed
9899 - The 'continue' statement was added, with semantics as in C.
9900 - Dictionary displays are now allowed on input: {key: value, ...}.
9901 - Blank lines and lines bearing only a comment no longer need to
9902 be indented properly. (A completely empty line still ends a multi-
9903 line statement interactively.)
9904 - Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
9905 - Option "-c command" to execute statements from the command line
9906 - Compiled versions of modules are cached in ".pyc" files, giving a
9907 dramatic improvement of start-up time
9908 - Other, smaller speed improvements, e.g., extracting characters from
9909 strings, looking up single-character keys, and looking up global
9911 - Interrupting a print operation raises KeyboardInterrupt instead of
9912 only cancelling the print operation
9913 - Fixed various portability problems (it now passes gcc with only
9914 warnings -- more Standard C compatibility will be provided in later
9916 - Source is prepared for porting to MS-DOS
9917 - Numeric constants are now checked for overflow (this requires
9918 standard-conforming strtol() and strtod() functions; a correct
9919 strtol() implementation is provided, but the strtod() provided
9920 relies on atof() for everything, including error checking
9923 2. Changes to the built-in types, functions and modules
9925 - New module socket: interface to BSD socket primitives
9926 - New modules pwd and grp: access the UNIX password and group databases
9927 - (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
9928 - (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
9929 - New numeric type: long integer, for unlimited precision
9930 - integer constants suffixed with 'L' or 'l' are long integers
9931 - new built-in function long(x) converts int or float to long
9932 - int() and float() now also convert from long integers
9933 - New built-in function:
9934 - pow(x, y) returns x to the power y
9935 - New operation and methods for lists:
9936 - l*n returns a new list consisting of n concatenated copies of l
9937 - l.remove(x) removes the first occurrence of the value x from l
9938 - l.index(x) returns the index of the first occurrence of x in l
9939 - l.reverse() reverses l in place
9940 - New operation for tuples:
9941 - t*n returns a tuple consisting of n concatenated copies of t
9942 - Improved file handling:
9943 - f.readline() no longer restricts the line length, is faster,
9944 and isn't confused by null bytes; same for raw_input()
9945 - f.read() without arguments reads the entire (rest of the) file
9946 - mixing of print and sys.stdout.write() has different effect
9947 - New methods for files:
9948 - f.readlines() returns a list containing the lines of the file,
9949 as read with f.readline()
9950 - f.flush(), f.tell(), f.seek() call their stdio counterparts
9951 - f.isatty() tests for "tty-ness"
9952 - New posix functions:
9953 - _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
9954 - popen() returns a file object connected to a pipe
9955 - utime() replaces utimes() (the latter is not a POSIX name)
9956 - New stdwin features, including:
9959 - scroll bars made optional
9961 - filled and xor shapes
9962 - text editing objects now have a 'settext' method
9965 3. Changes to the standard library
9967 - Name change: the functions path.cat and macpath.cat are now called
9968 path.join and macpath.join
9969 - Added new modules: formatter, mutex, persist, sched, mainloop
9970 - Added some modules and functionality to the "widget set" (which is
9971 still under development, so please bear with me):
9972 DirList, FormSplit, TextEdit, WindowSched
9973 - Fixed module testall to work non-interactively
9975 - added functions join() and joinfields()
9976 - fixed center() to work correct and make it "transitive"
9977 - Obsolete modules were removed: util, minmax
9978 - Some modules were moved to the demo directory
9981 4. Changes to the demonstration programs
9983 - Added new useful scipts: byteyears, eptags, fact, from, lfact,
9984 objgraph, pdeps, pi, primes, ptags, which
9985 - Added a bunch of socket demos
9986 - Doubled the speed of ptags
9987 - Added new stdwin demos: microedit, miniedit
9988 - Added a windowing interface to the Python interpreter: python (most
9990 - Added a browser for Emacs info files: demo/stdwin/ibrowse
9991 (yes, I plan to put all STDWIN and Python documentation in texinfo
9995 5. Other changes to the distribution
9997 - An Emacs Lisp file "python.el" is provided to facilitate editing
9998 Python programs in GNU Emacs (slightly improved since posted to
10000 - Some info on writing an extension in C is provided
10001 - Some info on building Python on non-UNIX platforms is provided
10004 =====================================
10005 ==> Release 0.9.1 (February 1991) <==
10006 =====================================
10008 - Micro changes only
10009 - Added file "patchlevel.h"
10012 =====================================
10013 ==> Release 0.9.0 (February 1991) <==
10014 =====================================
10016 Original posting to alt.sources.