Fix argument order in pure python version of nsmallest() and nlargest().
[python/dscho.git] / Misc / NEWS
blob99616395dbdba366061986d79363f399279516e2
1 +++++++++++
2 Python News
3 +++++++++++
5 (editors: check NEWS.help for information about editing NEWS using ReST.)
7 What's New in Python 2.4 release candidate 2
8 =====================================================
10 *Release date: XX-NOV-2004*
12 Core and builtins
13 -----------------
15 - Bug 875692: Improve signal handling, especially when using threads, by
16   forcing an early re-execution of PyEval_EvalFrame() "periodic" code when
17   things_to_do is not cleared by Py_MakePendingCalls().
20 What's New in Python 2.4 (release candidate 1|beta 3)
21 =====================================================
23 *Release date: 18-NOV-2004*
25 Core and builtins
26 -----------------
28 - Bug 1061968:  Fixes in 2.4a3 to address thread bug 1010677 reintroduced
29   the years-old thread shutdown race bug 225673.  Numeric history lesson
30   aside, all bugs in all three reports are fixed now.
33 Extension Modules
34 -----------------
36 ...
38 Library
39 -------
41 - Bug 1052242: If exceptions are raised by an atexit handler function an
42   attempt is made to execute the remaining handlers.  The last exception
43   raised is re-raised.
45 - ``doctest``'s new support for adding ``pdb.set_trace()`` calls to
46   doctests was broken in a dramatic but shallow way.  Fixed.
48 - Bug 1065388:  ``calendar``'s ``day_name``, ``day_abbr``, ``month_name``,
49   and ``month_abbr`` attributes emulate sequences of locale-correct
50   spellings of month and day names.  Because the locale can change at
51   any time, the correct spelling is recomputed whenever one of these is
52   indexed.  In the worst case, the index may be a slice object, so these
53   recomputed every day or month name each time they were indexed.  This is
54   much slower than necessary in the usual case, when the index is just an
55   integer.  In that case, only the single spelling needed is recomputed
56   now; and, when the index is a slice object, only the spellings needed
57   by the slice are recomputed now.
59 - Patch 1061679: Added ``__all__`` to pickletools.py.
61 Build
62 -----
64 - Bug 1034277 / Patch 1035255: Remove compilation of core against CoreServices
65   and CoreFoundation on OS X.  Involved removing PyMac_GetAppletScriptFile()
66   which has no known users.  Thanks Bob Ippolito.
68 C API
69 -----
71 - The PyRange_New() function is deprecated.
74 Documentation
75 -------------
77 ...
79 Tests
80 -----
82 ...
84 Windows
85 -------
87 ...
89 Mac
90 ---
92 ...
94 New platforms
95 -------------
97 ...
99 Tools/Demos
100 -----------
105 What's New in Python 2.4 beta 2?
106 ================================
108 *Release date: 03-NOV-2004*
110 License
111 -------
113 The Python Software Foundation changed the license under which Python
114 is released, to remove Python version numbers.  There were no other
115 changes to the license.  So, for example, wherever the license for
116 Python 2.3 said "Python 2.3", the new license says "Python".  The
117 intent is to make it possible to refer to the PSF license in a more
118 durable way.  For example, some people say they're confused by that
119 the Open Source Initiative's entry for the Python Software Foundation
120 License::
122       http://www.opensource.org/licenses/PythonSoftFoundation.php
124 says "Python 2.1.1" all over it, wondering whether it applies only
125 to Python 2.1.1.
127 The official name of the new license is the Python Software Foundation
128 License Version 2.
130 Core and builtins
131 -----------------
133 - Bug #1055820 Cyclic garbage collection was not protecting against that
134   calling a live weakref to a piece of cyclic trash could resurrect an
135   insane mutation of the trash if any Python code ran during gc (via
136   running a dead object's __del__ method, running another callback on a
137   weakref to a dead object, or via any Python code run in any other thread
138   that managed to obtain the GIL while a __del__ or callback was running
139   in the thread doing gc).  The most likely symptom was "impossible"
140   ``AttributeEror`` exceptions, appearing seemingly at random, on weakly
141   referenced objects.  The cure was to clear all weakrefs to unreachable
142   objects before allowing any callbacks to run.
144 - Bug #1054139 _PyString_Resize() now invalidates its cached hash value.
146 Extension Modules
147 -----------------
149 - Bug #1048870:  the compiler now generates distinct code objects for
150   functions with identical bodies.  This was producing confusing
151   traceback messages which pointed to the function where the code
152   object was first defined rather than the function being executed.
154 Library
155 -------
157 - Patch #1056967 changes the semantics of Template.safe_substitute() so that
158   no ValueError is raised on an 'invalid' match group.  Now the delimiter is
159   returned.
161 - Bug #1052503 pdb.runcall() was not passing along keyword arguments.
163 - Bug #902037: XML.sax.saxutils.prepare_input_source() now combines relative
164   paths with a base path before checking os.path.isfile().
166 - The whichdb module can now be run from the command line.
168 - Bug #1045381: time.strptime() can now infer the date using %U or %W (week of
169   the year) when the day of the week and year are also specified.
171 - Bug #1048816: fix bug in Ctrl-K at start of line in curses.textpad.Textbox
173 - Bug #1017553: fix bug in tarfile.filemode()
175 - Patch #737473: fix bug that old source code is shown in tracebacks even if
176   the source code is updated and reloaded.
178 Build
179 -----
181 - Patch #1044395: --enable-shared is allowed in FreeBSD also.
183 What's New in Python 2.4 beta 1?
184 ================================
186 *Release date: 15-OCT-2004*
188 Core and builtins
189 -----------------
191 - Patch #975056: Restartable signals were not correctly disabled on
192   BSD systems. Consistently use PyOS_setsig() instead of signal().
194 - The internal portable implementation of thread-local storage (TLS), used
195   by the ``PyGILState_Ensure()``/``PyGILState_Release()`` API, was not
196   thread-correct.  This could lead to a variety of problems, up to and
197   including segfaults.  See bug 1041645 for an example.
199 - Added a command line option, -m module, which searches sys.path for the
200   module and then runs it.  (Contributed by Nick Coghlan.)
202 - The bytecode optimizer now folds tuples of constants into a single
203   constant.
205 - SF bug #513866:  Float/long comparison anomaly.  Prior to 2.4b1, when
206   an integer was compared to a float, the integer was coerced to a float.
207   That could yield spurious overflow errors (if the integer was very
208   large), and to anomalies such as
209   ``long(1e200)+1 == 1e200 == long(1e200)-1``.  Coercion to float is no
210   longer performed, and cases like ``long(1e200)-1 < 1e200``,
211   ``long(1e200)+1 > 1e200`` and ``(1 << 20000) > 1e200`` are computed
212   correctly now.
214 Extension modules
215 -----------------
217 - ``collections.deque`` objects didn't play quite right with garbage
218   collection, which could lead to a segfault in a release build, or
219   an assert failure in a debug build.  Also, added overflow checks,
220   better detection of mutation during iteration, and shielded deque
221   comparisons from unusual subclass overrides of the __iter__() method.
223 Library
224 -------
226 - Patch 1046644: distutils build_ext grew two new options - --swig for
227   specifying the swig executable to use, and --swig-opts to specify
228   options to pass to swig. --swig-opts="-c++" is the new way to spell
229   --swig-cpp.
231 - Patch 983206: distutils now obeys environment variable LDSHARED, if
232   it is set.
234 - Added Peter Astrand's subprocess.py module.  See PEP 324 for details.
236 - time.strptime() now properly escapes timezones and all other locale-specific
237   strings for regex-specific symbols.  Was breaking under Japanese Windows when
238   the timezone was specified as "Tokyo (standard time)".
239   Closes bug #1039270.
241 - Updates for the email package:
243   + email.Utils.formatdate() grew a 'usegmt' argument for HTTP support.
244   + All deprecated APIs that in email 2.x issued warnings have been removed:
245     _encoder argument to the MIMEText constructor, Message.add_payload(),
246     Utils.dump_address_pair(), Utils.decode(), Utils.encode()
247   + New deprecations: Generator.__call__(), Message.get_type(),
248     Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
249     the Parser constructor.  These will be removed in email 3.1.
250   + Support for Python earlier than 2.3 has been removed (see PEP 291).
251   + All defect classes have been renamed to end in 'Defect'.
252   + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
253     added to messages that claim to be multipart but really aren't.
254   + Updates to documentation.
256 - re's findall() and finditer() functions now take an optional flags argument
257   just like the compile(), search(), and match() functions.  Also, documented
258   the previously existing start and stop parameters for the findall() and
259   finditer() methods of regular expression objects.
261 - rfc822 Messages now support iterating over the headers.
263 - The (undocumented) tarfile.Tarfile.membernames has been removed;
264   applications should use the getmember function.
266 - httplib now offers symbolic constants for the HTTP status codes.
268 - SF bug #1028306:  Trying to compare a ``datetime.date`` to a
269   ``datetime.datetime`` mistakenly compared only the year, month and day.
270   Now it acts like a mixed-type comparison:  ``False`` for ``==``,
271   ``True`` for ``!=``, and raises ``TypeError`` for other comparison
272   operators.  Because datetime is a subclass of date, comparing only the
273   base class (date) members can still be done, if that's desired, by
274   forcing using of the approprate date method; e.g.,
275   ``a_date.__eq__(a_datetime)`` is true if and only if the year, month
276   and day members of ``a_date`` and ``a_datetime`` are equal.
278 - bdist_rpm now supports command line options --force-arch,
279   {pre,post}-install,  {pre,post}-uninstall, and
280   {prep,build,install,clean,verify}-script.
282 - SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
283   decoding incomplete input (when the input stream is temporarily exhausted).
284   ``codecs.StreamReader`` now implements buffering, which enables proper
285   readline support for the UTF-16 decoders. ``codecs.StreamReader.read()``
286   has a new argument ``chars`` which specifies the number of characters to
287   return. ``codecs.StreamReader.readline()`` and
288   ``codecs.StreamReader.readlines()`` have a new argument ``keepends``.
289   Trailing "\n"s will be stripped from the lines if ``keepends`` is false.
291 - The documentation for doctest is greatly expanded, and now covers all
292   the new public features (of which there are many).
294 - ``doctest.master`` was put back in, and ``doctest.testmod()`` once again
295   updates it.  This isn't good, because every ``testmod()`` call
296   contributes to bloating the "hidden" state of ``doctest.master``, but
297   some old code apparently relies on it.  For now, all we can do is
298   encourage people to stitch doctests together via doctest's unittest
299   integration features instead.
301 - httplib now handles ipv6 address/port pairs.
303 - SF bug #1017864: ConfigParser now correctly handles default keys,
304   processing them with ``ConfigParser.optionxform`` when supplied,
305   consistent with the handling of config file entries and runtime-set
306   options.
308 - SF bug #997050: Document, test, & check for non-string values in
309   ConfigParser.  Moved the new string-only restriction added in
310   rev. 1.65 to the SafeConfigParser class, leaving existing
311   ConfigParser & RawConfigParser behavior alone, and documented the
312   conditions under which non-string values work.
314 Build
315 -----
317 - Building on darwin now includes /opt/local/include and /opt/local/lib for
318   building extension modules.  This is so as to include software installed as
319   a DarwinPorts port <http://darwinports.opendarwin.org/>
321 - pyport.h now defines a Py_IS_NAN macro.  It works as-is when the
322   platform C computes true for ``x != x`` if and only if X is a NaN.
323   Other platforms can override the default definition with a platform-
324   specific spelling in that platform's pyconfig.h.  You can also override
325   pyport.h's default Py_IS_INFINITY definition now.
327 C API
328 -----
330 - SF patch 1044089:  New function ``PyEval_ThreadsInitialized()`` returns
331   non-zero if PyEval_InitThreads() has been called.
333 - The undocumented and unused extern int ``_PyThread_Started`` was removed.
335 - The C API calls ``PyInterpreterState_New()`` and ``PyThreadState_New()``
336   are two of the very few advertised as being safe to call without holding
337   the GIL.  However, this wasn't true in a debug build, as bug 1041645
338   demonstrated.  In a debug build, Python redirects the ``PyMem`` family
339   of calls to Python's small-object allocator, to get the benefit of
340   its extra debugging capabilities.  But Python's small-object allocator
341   isn't threadsafe, relying on the GIL to avoid the expense of doing its
342   own locking.  ``PyInterpreterState_New()`` and ``PyThreadState_New()``
343   call the platform ``malloc()`` directly now, regardless of build type.
345 - PyLong_AsUnsignedLong[Mask] now support int objects as well.
347 - SF patch #998993: ``PyUnicode_DecodeUTF8Stateful`` and
348   ``PyUnicode_DecodeUTF16Stateful`` have been added, which implement stateful
349   decoding.
351 Tests
352 -----
354 - test__locale ported to unittest
359 - ``plistlib`` now supports non-dict root objects.  There is also a new
360   interface for reading and writing plist files: ``readPlist(pathOrFile)``
361   and ``writePlist(rootObject, pathOrFile)``
363 Tools/Demos
364 -----------
366 - The text file comparison scripts ``ndiff.py`` and ``diff.py`` now
367   read the input files in universal-newline mode.  This spares them
368   from consuming a great deal of time to deduce the useless result that,
369   e.g., a file with Windows line ends and a file with Linux line ends
370   have no lines in common.
373 What's New in Python 2.4 alpha 3?
374 =================================
376 *Release date: 02-SEP-2004*
378 Core and builtins
379 -----------------
381 - SF patch #1007189: ``from ... import ...`` statements now allow the name
382   list to be surrounded by parentheses.
384 - Some speedups for long arithmetic, thanks to Trevor Perrin.  Gradeschool
385   multiplication was sped a little by optimizing the C code.  Gradeschool
386   squaring was sped by about a factor of 2, by exploiting that about half
387   the digit products are duplicates in a square.  Because exponentiation
388   uses squaring often, this also speeds long power.  For example, the time
389   to compute 17**1000000 dropped from about 14 seconds to 9 on my box due
390   to this much.  The cutoff for Karatsuba multiplication was raised,
391   since gradeschool multiplication got quicker, and the cutoff was
392   aggressively small regardless.  The exponentiation algorithm was switched
393   from right-to-left to left-to-right, which is more efficient for small
394   bases.  In addition, if the exponent is large, the algorithm now does
395   5 bits (instead of 1 bit) at a time.  That cut the time to compute
396   17**1000000 on my box in half again, down to about 4.5 seconds.
398 - OverflowWarning is no longer generated.  PEP 237 scheduled this to
399   occur in Python 2.3, but since OverflowWarning was disabled by default,
400   nobody realized it was still being generated.  On the chance that user
401   code is still using them, the Python builtin OverflowWarning, and
402   corresponding C API PyExc_OverflowWarning, will exist until Python 2.5.
404 - Py_InitializeEx has been added.
406 - Fix the order of application of decorators.  The proper order is bottom-up;
407   the first decorator listed is the last one called.
409 - SF patch #1005778.  Fix a seg fault if the list size changed while
410   calling list.index().  This could happen if a rich comparison function
411   modified the list.
413 - The ``func_name`` (a.k.a. ``__name__``) attribute of user-defined
414   functions is now writable.
416 - code_new (a.k.a new.code()) now checks its arguments sufficiently
417   carefully that passing them on to PyCode_New() won't trigger calls
418   to Py_FatalError() or PyErr_BadInternalCall().  It is still the case
419   that the returned code object might be entirely insane.
421 - Subclasses of string can no longer be interned.  The semantics of
422   interning were not clear here -- a subclass could be mutable, for
423   example -- and had bugs.  Explicitly interning a subclass of string
424   via intern() will raise a TypeError.  Internal operations that attempt
425   to intern a string subclass will have no effect.
427 - Bug 1003935:  xrange() could report bogus OverflowErrors.  Documented
428   what xrange() intends, and repaired tests accordingly.
430 Extension modules
431 -----------------
433 - difflib now supports HTML side-by-side diff.
435 - os.urandom has been added for systems that support sources of random
436   data.
438 - Patch 1012740:  truncate() on a writeable cStringIO now resets the
439   position to the end of the stream.  This is consistent with the original
440   StringIO module and avoids inadvertently resurrecting data that was
441   supposed to have been truncated away.
443 - Added socket.socketpair().
445 - Added CurrentByteIndex, CurrentColumnNumber, CurrentLineNumber
446   members to xml.parsers.expat.XMLParser object.
448 - The mpz, rotor, and xreadlines modules, all deprecated in earlier
449   versions of Python, have now been removed.
451 Library
452 -------
454 - Patch #934356: if a module defines __all__, believe that rather than using
455   heuristics for filtering out imported names.
457 - Patch #941486: added os.path.lexists(), which returns True for broken
458   symlinks, unlike os.path.exists().
460 - the random module now uses os.urandom() for seeding if it is available.
461   Added a new generator based on os.urandom().
463 - difflib and diff.py can now generate HTML.
465 - bdist_rpm now includes version and release in the BuildRoot, and
466   replaces - by ``_`` in version and release.
468 - distutils build/build_scripts now has an -e option to specify the
469   path to the Python interpreter for installed scripts.
471 - PEP 292 classes Template and SafeTemplate are added to the string module.
473 - tarfile now generates GNU tar files by default.
475 - HTTPResponse has now a getheaders method.
477 - Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
478   Percivall.
480 - logging.handlers.SMTPHandler.date_time has been removed;
481   the class now uses email.Utils.formatdate to generate the time stamp.
483 - A new function tkFont.nametofont was added to return an existing
484   font. The Font class constructor now has an additional exists argument
485   which, if True, requests to return/configure an existing font, rather
486   than creating a new one.
488 - Updated the decimal package's min() and max() methods to match the
489   latest revision of the General Decimal Arithmetic Specification.
490   Quiet NaNs are ignored and equal values are sorted based on sign
491   and exponent.
493 - The decimal package's Context.copy() method now returns deep copies.
495 - Deprecated sys.exitfunc in favor of the atexit module.  The sys.exitfunc
496   attribute will be kept around for backwards compatability and atexit
497   will just become the one preferred way to do it.
499 - patch #675551: Add get_history_item and replace_history_item functions
500   to the readline module.
502 - bug #989672: pdb.doc and the help messages for the help_d and help_u methods
503   of the pdb.Pdb class gives have been corrected. d(own) goes to a newer
504   frame, u(p) to an older frame, not the other way around.
506 - bug #990669: os.path.realpath() will resolve symlinks before normalizing the
507   path, as normalizing the path may alter the meaning of the path if it
508   contains symlinks.
510 - bug #851123: shutil.copyfile will raise an exception when trying to copy a
511   file onto a link to itself. Thanks Gregory Ball.
513 - bug #570300: Fix inspect to resolve file locations using os.path.realpath()
514   so as to properly list all functions in a module when the module itself is
515   reached through a symlink.  Thanks Johannes Gijsbers.
517 - doctest refactoring continued.  See the docs for details.  As part of
518   this effort, some old and little- (never?) used features are now
519   deprecated:  the Tester class, the module is_private() function, and the
520   isprivate argument to testmod().  The Tester class supplied a feeble
521   "by hand" way to combine multiple doctests, if you knew exactly what
522   you were doing.  The newer doctest features for unittest integration
523   already did a better job of that, are stronger now than ever, and the
524   new DocTestRunner class is a saner foundation if you want to do it by
525   hand.  The "private name" filtering gimmick was a mistake from the
526   start, and testmod() changed long ago to ignore it by default.  If
527   you want to filter out tests, the new DocTestFinder class can be used
528   to return a list of all doctests, and you can filter that list by
529   any computable criteria before passing it to a DocTestRunner instance.
531 - Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)).
533 Tools/Demos
534 -----------
536 - IDLE's shortcut keys for windows are now case insensitive so that
537   Control-V works the same as Control-v.
539 - pygettext.py: Generate POT-Creation-Date header in ISO format.
541 Build
542 -----
544 - Backward incompatibility:  longintrepr.h now triggers a compile-time
545   error if SHIFT (the number of bits in a Python long "digit") isn't
546   divisible by 5.  This new requirement allows simple code for the new
547   5-bits-at-a-time long_pow() implementation.  If necessary, the
548   restriction could be removed (by complicating long_pow(), or by
549   falling back to the 1-bit-at-a-time algorithm), but there are no
550   plans to do so.
552 - bug #991962: When building with --disable-toolbox-glue on Darwin no
553   attempt to build Mac-specific modules occurs.
555 - The --with-tsc flag to configure to enable VM profiling with the
556   processor's timestamp counter now works on PPC platforms.
558 - patch #1006629: Define _XOPEN_SOURCE to 500 on Solaris 8/9 to match
559   GCC's definition and avoid redefinition warnings.
561 - Detect pthreads support (provided by gnu pth pthread emulation) on
562   GNU/k*BSD systems.
564 - bug #1005737, #1007249: Fixed several build problems and warnings
565   found on old/legacy C compilers of HP-UX, IRIX and Tru64.
567 C API
568 -----
572 Documentation
573 -------------
575 - patch #1005936, bug #1009373: fix index entries which contain
576   an underscore when viewed with Acrobat.
578 - bug #990669: os.path.normpath may alter the meaning of a path if
579   it contains symbolic links. This has been documented in a comment
580   since 1992, but is now in the library reference as well.
582 New platforms
583 -------------
585 - FreeBSD 6 is now supported.
587 Tests
588 -----
592 Windows
593 -------
595 - Boosted the stack reservation for python.exe and pythonw.exe from
596   the default 1MB to 2MB.  Stack frames under VC 7.1 for 2.4 are enough
597   bigger than under VC 6.0 for 2.3.4 that deeply recursive progams
598   within the default sys.getrecursionlimit() default value of 1000 were
599   able to suffer undetected C stack overflows.  The standard test program
600   test_compiler was one such program.  If a Python process on Windows
601   "just vanishes" without a trace, and without an error message of any
602   kind, but with an exit code of 128, undetected stack overflow may be
603   the problem.
611 What's New in Python 2.4 alpha 2?
612 =================================
614 *Release date: 05-AUG-2004*
616 Core and builtins
617 -----------------
619 - Patch #980695:  Implements efficient string concatenation for statements
620   of the form s=s+t and s+=t.  This will vary across implementations.
621   Accordingly, the str.join() method is strongly preferred for performance
622   sensitive code.
624 - PEP-0318, Function Decorators have been added to the language. These are
625   implemented using the Java-style @decorator syntax, like so::
627      @staticmethod
628      def foo(bar):
630   (The PEP needs to be updated to reflect the current state)
632 - When importing a module M raises an exception, Python no longer leaves M
633   in sys.modules.  Before 2.4a2 it did, and a subsequent import of M would
634   succeed, picking up a module object from sys.modules reflecting as much
635   of the initialization of M as completed before the exception was raised.
636   Subsequent imports got no indication that M was in a partially-
637   initialized state, and the importers could get into arbitrarily bad
638   trouble as a result (the M they got was in an unintended state,
639   arbitrarily far removed from M's author's intent).  Now subsequent
640   imports of M will continue raising exceptions (but if, for example, the
641   source code for M is edited between import attempts, then perhaps later
642   attempts will succeed, or raise a different exception).
644   This can break existing code, but in such cases the code was probably
645   working before by accident.  In the Python source, the only case of
646   breakage discovered was in a test accidentally relying on a damaged
647   module remaining in sys.modules.  Cases are also known where tests
648   deliberately provoking import errors remove damaged modules from
649   sys.modules themselves, and such tests will break now if they do an
650   unconditional del sys.modules[M].
652 - u'%s' % obj will now try obj.__unicode__() first and fallback to
653   obj.__str__() if no __unicode__ method can be found.
655 - Patch #550732: Add PyArg_VaParseTupleAndKeywords().  Analogous to
656   PyArg_VaParse().  Both are now documented.  Thanks Greg Chapman.
658 - Allow string and unicode return types from .encode()/.decode()
659   methods on string and unicode objects.  Added unicode.decode()
660   which was missing for no apparent reason.
662 - An attempt to fix the mess that is Python's behaviour with
663   signal handlers and threads, complicated by readline's behaviour.
664   It's quite possible that there are still bugs here.
666 - Added C macros Py_CLEAR and Py_VISIT to ease the implementation of
667   types that support garbage collection.
669 - Compiler now treats None as a constant.
671 - The type of values returned by __int__, __float__, __long__,
672   __oct__, and __hex__ are now checked.  Returning an invalid type
673   will cause a TypeError to be raised.  This matches the behavior of
674   Jython.
676 - Implemented bind_textdomain_codeset() in locale module.
678 - Added a workaround for proper string operations in BSDs.  str.split
679   and str.is* methods can now work correctly with UTF-8 locales.
681 - Bug #989185: unicode.iswide() and unicode.width() is dropped and
682   the East Asian Width support is moved to unicodedata extension
683   module.
685 - Patch #941229: The source code encoding in interactive mode
686   now refers sys.stdin.encoding not just ISO-8859-1 anymore.  This
687   allows for non-latin-1 users to write unicode strings directly.
689 Extension modules
690 -----------------
692 - cpickle now supports the same keyword arguments as pickle.
694 Library
695 -------
697 - Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and
698   TIS-620
700 - Thanks to Edward Loper, doctest has been massively refactored, and
701   many new features were added.  Full docs will appear later.  For now
702   the doctest module comments and new test cases give good coverage.
703   The refactoring provides many hook points for customizing behavior
704   (such as how to report errors, and how to compare expected to actual
705   output).  New features include a <BLANKLINE> marker for expected
706   output containing blank lines, options to produce unified or context
707   diffs when actual output doesn't match expectations, an option to
708   normalize whitespace before comparing, and an option to use an
709   ellipsis to signify "don't care" regions of output.
711 - Tkinter now supports the wish -sync and -use options.
713 - The following methods in time support passing of None: ctime(), gmtime(),
714   and localtime().  If None is provided, the current time is used (the
715   same as when the argument is omitted).
716   [SF bug 658254, patch 663482]
718 - nntplib does now allow to ignore a .netrc file.
720 - urllib2 now recognizes Basic authentication even if other authentication
721   schemes are offered.
723 - Bug #1001053.  wave.open() now accepts unicode filenames.
725 - gzip.GzipFile has a new fileno() method, to retrieve the handle of the
726   underlying file object (provided it has a fileno() method).  This is
727   needed if you want to use os.fsync() on a GzipFile.
729 - imaplib has two new methods: deleteacl and myrights.
731 - nntplib has two new methods: description and descriptions. They
732   use a more RFC-compliant way of getting a newsgroup description.
734 - Bug #993394.  Fix a possible red herring of KeyError in 'threading' being
735   raised during interpreter shutdown from a registered function with atexit
736   when dummy_threading is being used.
738 - Bug #857297/Patch #916874.  Fix an error when extracting a hard link
739   from a tarfile.
741 - Patch #846659.  Fix an error in tarfile.py when using
742   GNU longname/longlink creation.
744 - The obsolete FCNTL.py has been deleted.  The builtin fcntl module
745   has been available (on platforms that support fcntl) since Python
746   1.5a3, and all FCNTL.py did is export fcntl's names, after generating
747   a deprecation warning telling you to use fcntl directly.
749 - Several new unicode codecs are added: big5hkscs, euc_jis_2004,
750   iso2022_jp_2004, shift_jis_2004.
752 - Bug #788520.  Queue.{get, get_nowait, put, put_nowait} have new
753   implementations, exploiting Conditions (which didn't exist at the time
754   Queue was introduced).  A minor semantic change is that the Full and
755   Empty exceptions raised by non-blocking calls now occur only if the
756   queue truly was full or empty at the instant the queue was checked (of
757   course the Queue may no longer be full or empty by the time a calling
758   thread sees those exceptions, though).  Before, the exceptions could
759   also be raised if it was "merely inconvenient" for the implementation
760   to determine the true state of the Queue (because the Queue was locked
761   by some other method in progress).
763 - Bugs #979794 and #980117: difflib.get_grouped_opcodes() now handles the
764   case of comparing two empty lists.  This affected both context_diff() and
765   unified_diff(),
767 - Bug #980938: smtplib now prints debug output to sys.stderr.
769 - Bug #930024: posixpath.realpath() now handles infinite loops in symlinks by
770   returning the last point in the path that was not part of any loop.  Thanks
771   AM Kuchling.
773 - Bug #980327: ntpath not handles compressing erroneous slashes between the
774   drive letter and the rest of the path.  Also clearly handles UNC addresses now
775   as well.  Thanks Paul Moore.
777 - bug #679953: zipfile.py should now work for files over 2 GB.  The packed data
778   for file sizes (compressed and uncompressed) was being stored as signed
779   instead of unsigned.
781 - decimal.py now only uses signals in the IBM spec.  The other conditions are
782   no longer part of the public API.
784 - codecs module now has two new generic APIs: encode() and decode()
785   which don't restrict the return types (unlike the unicode and
786   string methods of the same name).
788 - Non-blocking SSL sockets work again; they were broken in Python 2.3.
789   SF patch 945642.
791 - doctest unittest integration improvements:
793   o Improved the unitest test output for doctest-based unit tests
795   o Can now pass setUp and tearDown functions when creating
796     DocTestSuites.
798 - The threading module has a new class, local, for creating objects
799   that provide thread-local data.
801 - Bug #990307: when keep_empty_values is True, cgi.parse_qsl()
802   no longer returns spurious empty fields.
804 - Implemented bind_textdomain_codeset() in gettext module.
806 - Introduced in gettext module the l*gettext() family of functions,
807   which return translation strings encoded in the preferred encoding,
808   as informed by locale module's getpreferredencoding().
810 - optparse module (and tests) upgraded to Optik 1.5a1.  Changes:
812   - Add expansion of default values in help text: the string
813     "%default" in an option's help string is expanded to str() of
814     that option's default value, or "none" if no default value.
816   - Bug #955889: option default values that happen to be strings are
817     now processed in the same way as values from the command line; this
818     allows generation of nicer help when using custom types.  Can
819     be disabled with parser.set_process_default_values(False).
821   - Bug #960515: don't crash when generating help for callback
822     options that specify 'type', but not 'dest' or 'metavar'.
824   - Feature #815264: change the default help format for short options
825     that take an argument from e.g. "-oARG" to "-o ARG"; add
826     set_short_opt_delimiter() and set_long_opt_delimiter() methods to
827     HelpFormatter to allow (slight) customization of the formatting.
829   - Patch #736940: internationalize Optik: all built-in user-
830     targeted literal strings are passed through gettext.gettext().  (If
831     you want translations (.po files), they're not included with Python
832     -- you'll find them in the Optik source distribution from
833     http://optik.sourceforge.net/ .)
835   - Bug #878453: respect $COLUMNS environment variable for
836     wrapping help output.
838   - Feature #988122: expand "%prog" in the 'description' passed
839     to OptionParser, just like in the 'usage' and 'version' strings.
840     (This is *not* done in the 'description' passed to OptionGroup.)
842 C API
843 -----
845 - PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx():  if an
846   error occurs while loading the module, these now delete the module's
847   entry from sys.modules.  All ways of loading modules eventually call
848   one of these, so this is an error-case change in semantics for all
849   ways of loading modules.  In rare cases, a module loader may wish
850   to keep a module object in sys.modules despite that the module's
851   code cannot be executed.  In such cases, the module loader must
852   arrange to reinsert the name and module object in sys.modules.
853   PyImport_ReloadModule() has been changed to reinsert the original
854   module object into sys.modules if the module reload fails, so that
855   its visible semantics have not changed.
857 - A large pile of datetime field-extraction macros is now documented,
858   thanks to Anthony Tuininga (patch #986010).
860 Documentation
861 -------------
863 - Improved the tutorial on creating types in C.
865   - point out the importance of reassigning data members before
866     assigning their values
868   - correct my misconception about return values from visitprocs. Sigh.
870   - mention the labor saving Py_VISIT and Py_CLEAR macros.
872 - Major rewrite of the math module docs, to address common confusions.
874 Tests
875 -----
877 - The test data files for the decimal test suite are now installed on
878   platforms that use the Makefile.
880 - SF patch 995225:  The test file testtar.tar accidentally contained
881   CVS keywords (like $Id$), which could cause spurious failures in
882   test_tarfile.py depending on how the test file was checked out.
885 What's New in Python 2.4 alpha 1?
886 =================================
888 *Release date: 08-JUL-2004*
890 Core and builtins
891 -----------------
893 - weakref.ref is now the type object also known as
894   weakref.ReferenceType; it can be subclassed like any other new-style
895   class.  There's less per-entry overhead in WeakValueDictionary
896   objects now (one object instead of three).
898 - Bug #951851: Python crashed when reading import table of certain
899   Windows DLLs.
901 - Bug #215126.  The locals argument to eval(), execfile(), and exec now
902   accept any mapping type.
904 - marshal now shares interned strings. This change introduces
905   a new .pyc magic.
907 - Bug #966623. classes created with type() in an exec(, {}) don't
908   have a __module__, but code in typeobject assumed it would always
909   be there.
911 - Python no longer relies on the LC_NUMERIC locale setting to be
912   the "C" locale; as a result, it no longer tries to prevent changing
913   the LC_NUMERIC category.
915 - Bug #952807:  Unpickling pickled instances of subclasses of
916   datetime.date, datetime.datetime and datetime.time could yield insane
917   objects.  Thanks to Jiwon Seo for a fix.
919 - Bug #845802: Python crashes when __init__.py is a directory.
921 - Unicode objects received two new methods: iswide() and width().
922   These query East Asian width information, as specified in Unicode
923   TR11.
925 - Improved the tuple hashing algorithm to give fewer collisions in
926   common cases.  Fixes bug  #942952.
928 - Implemented generator expressions (PEP 289).  Coded by Jiwon Seo.
930 - Enabled the profiling of C extension functions (and builtins) - check
931   new documentation and modified profile and bdb modules for more details
933 - Set file.name to the object passed to open (instead of a new string)
935 - Moved tracebackobject into traceback.h and renamed to PyTracebackObject
937 - Optimized the byte coding for multiple assignments like "a,b=b,a" and
938   "a,b,c=1,2,3".  Improves their speed by 25% to 30%.
940 - Limit the nested depth of a tuple for the second argument to isinstance()
941   and issubclass() to the recursion limit of the interpreter.
942   Fixes bug  #858016 .
944 - Optimized dict iterators, creating separate types for each
945   and having them reveal their length.  Also optimized the
946   methods:  keys(), values(), and items().
948 - Implemented a newcode opcode, LIST_APPEND, that simplifies
949   the generated bytecode for list comprehensions and further
950   improves their performance (about 35%).
952 - Implemented rich comparisons for floats, which seems to make
953   comparisons involving NaNs somewhat less surprising when the
954   underlying C compiler actually implements C99 semantics.
956 - Optimized list.extend() to save memory and no longer create
957   intermediate sequences.  Also, extend() now pre-allocates the
958   needed memory whenever the length of the iterable is known in
959   advance -- this halves the time to extend the list.
961 - Optimized list resize operations to make fewer calls to the system
962   realloc().  Significantly speeds up list appends, list pops,
963   list comprehensions, and the list contructor (when the input iterable
964   length is not known).
966 - Changed the internal list over-allocation scheme.  For larger lists,
967   overallocation ranged between 3% and 25%.  Now, it is a constant 12%.
968   For smaller lists (n<8), overallocation was upto eight elements.  Now,
969   the overallocation is no more than three elements -- this improves space
970   utilization for applications that have large numbers of small lists.
972 - Most list bodies now get re-used rather than freed.  Speeds up list
973   instantiation and deletion by saving calls to malloc() and free().
975 - The dict.update() method now accepts all the same argument forms
976   as the dict() constructor.  This now includes item lists and/or
977   keyword arguments.
979 - Support for arbitrary objects supporting the read-only buffer
980   interface as the co_code field of code objects (something that was
981   only possible to create from C code) has been removed.
983 - Made omitted callback and None equivalent for weakref.ref() and
984   weakref.proxy(); the None case wasn't handled correctly in all
985   cases.
987 - Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy()
988   assumed that initial existing entries in an object's weakref list
989   would not be removed while allocating a new weakref object.  Since
990   GC could be invoked at that time, however, that assumption was
991   invalid.  In a truly obscure case of GC being triggered during
992   creation for a new weakref object for an referent which already
993   has a weakref without a callback which is only referenced from
994   cyclic trash, a memory error can occur.  This consistently created a
995   segfault in a debug build, but provided less predictable behavior in
996   a release build.
998 - input() builtin function now respects compiler flags such as
999   __future__ statements.  SF patch 876178.
1001 - Removed PendingDeprecationWarning from apply().  apply() remains
1002   deprecated, but the nuisance warning will not be issued.
1004 - At Python shutdown time (Py_Finalize()), 2.3 called cyclic garbage
1005   collection twice, both before and after tearing down modules.  The
1006   call after tearing down modules has been disabled, because too much
1007   of Python has been torn down then for __del__ methods and weakref
1008   callbacks to execute sanely.  The most common symptom was a sequence
1009   of uninformative messages on stderr when Python shut down, produced
1010   by threads trying to raise exceptions, but unable to report the nature
1011   of their problems because too much of the sys module had already been
1012   destroyed.
1014 - Removed FutureWarnings related to hex/oct literals and conversions
1015   and left shifts.  (Thanks to Kalle Svensson for SF patch 849227.)
1016   This addresses most of the remaining semantic changes promised by
1017   PEP 237, except for repr() of a long, which still shows the trailing
1018   'L'.  The PEP appears to promise warnings for operations that
1019   changed semantics compared to Python 2.3, but this is not
1020   implemented; we've suffered through enough warnings related to
1021   hex/oct literals and I think it's best to be silent now.
1023 - For str and unicode objects, the ljust(), center(), and rjust()
1024   methods now accept an optional argument specifying a fill
1025   character other than a space.
1027 - When method objects have an attribute that can be satisfied either
1028   by the function object or by the method object, the function
1029   object's attribute usually wins.  Christian Tismer pointed out that
1030   that this is really a mistake, because this only happens for special
1031   methods (like __reduce__) where the method object's version is
1032   really more appropriate than the function's attribute.  So from now
1033   on, all method attributes will have precedence over function
1034   attributes with the same name.
1036 - Critical bugfix, for SF bug 839548:  if a weakref with a callback,
1037   its callback, and its weakly referenced object, all became part of
1038   cyclic garbage during a single run of garbage collection, the order
1039   in which they were torn down was unpredictable.  It was possible for
1040   the callback to see partially-torn-down objects, leading to immediate
1041   segfaults, or, if the callback resurrected garbage objects, to
1042   resurrect insane objects that caused segfaults (or other surprises)
1043   later.  In one sense this wasn't surprising, because Python's cyclic gc
1044   had no knowledge of Python's weakref objects.  It does now.  When
1045   weakrefs with callbacks become part of cyclic garbage now, those
1046   weakrefs are cleared first.  The callbacks don't trigger then,
1047   preventing the problems.  If you need callbacks to trigger, then just
1048   as when cyclic gc is not involved, you need to write your code so
1049   that weakref objects outlive the objects they weakly reference.
1051 - Critical bugfix, for SF bug 840829:  if cyclic garbage collection
1052   happened to occur during a weakref callback for a new-style class
1053   instance, subtle memory corruption was the result (in a release build;
1054   in a debug build, a segfault occurred reliably very soon after).
1055   This has been repaired.
1057 - Compiler flags set in PYTHONSTARTUP are now active in __main__.
1059 - Added two builtin types, set() and frozenset().
1061 - Added a reversed() builtin function that returns a reverse iterator
1062   over a sequence.
1064 - Added a sorted() builtin function that returns a new sorted list
1065   from any iterable.
1067 - CObjects are now mutable (on the C level) through PyCObject_SetVoidPtr.
1069 - list.sort() now supports three keyword arguments:  cmp, key, and reverse.
1070   The key argument can be a function of one argument that extracts a
1071   comparison key from the original record:  mylist.sort(key=str.lower).
1072   The reverse argument is a boolean value and if True will change the
1073   sort order as if the comparison arguments were reversed.  In addition,
1074   the documentation has been amended to provide a guarantee that all sorts
1075   starting with Py2.3 are guaranteed to be stable (the relative order of
1076   records with equal keys is unchanged).
1078 - Added test whether wchar_t is signed or not. A signed wchar_t is not
1079   usable as internal unicode type base for Py_UNICODE since the
1080   unicode implementation assumes an unsigned type.
1082 - Fixed a bug in the cache of length-one Unicode strings that could
1083   lead to a seg fault.  The specific problem occurred when an earlier,
1084   non-fatal error left an uninitialized Unicode object in the
1085   freelist.
1087 - The % formatting operator now supports '%F' which is equivalent to
1088   '%f'.  This has always been documented but never implemented.
1090 - complex(obj) could leak a little memory if obj wasn't a string or
1091   number.
1093 - zip() with no arguments now returns an empty list instead of raising
1094   a TypeError exception.
1096 - obj.__contains__() now returns True/False instead of 1/0.  SF patch
1097   820195.
1099 - Python no longer tries to be smart about recursive comparisons.
1100   When comparing containers with cyclic references to themselves it
1101   will now just hit the recursion limit.  See SF patch 825639.
1103 - str and unicode builtin types now have an rsplit() method that is
1104   same as split() except that it scans the string from the end
1105   working towards the beginning.  See SF feature request 801847.
1107 - Fixed a bug in object.__reduce_ex__ when using protocol 2.  Failure
1108   to clear the error when attempts to get the __getstate__ attribute
1109   fail caused intermittent errors and odd behavior.
1111 - buffer objects based on other objects no longer cache a pointer to
1112   the data and the data length.  Instead, the appropriate tp_as_buffer
1113   method is called as necessary.
1115 - fixed: if a file is opened with an explicit buffer size >= 1, repeated
1116   close() calls would attempt to free() the buffer already free()ed on
1117   the first call.
1120 Extension modules
1121 -----------------
1123 - Added socket.getservbyport(), and make the second argument in
1124   getservbyname() and getservbyport() optional.
1126 - time module code that deals with input POSIX timestamps will now raise
1127   ValueError if more than a second is lost in precision when the
1128   timestamp is cast to the platform C time_t type.  There's no chance
1129   that the platform will do anything sensible with the result in such
1130   cases.  This includes ctime(), localtime() and gmtime().  Assorted
1131   fromtimestamp() and utcfromtimestamp() methods in the datetime module
1132   were also protected.  Closes bugs #919012 and 975996.
1134 - fcntl.ioctl now warns if the mutate flag is not specified.
1136 - nt now properly allows to refer to UNC roots, e.g. in nt.stat().
1138 - the weakref module now supports additional objects:  array.array,
1139   sre.pattern_objects, file objects, and sockets.
1141 - operator.isMappingType() and operator.isSequenceType() now give
1142   fewer false positives.
1144 - socket.sslerror is now a subclass of socket.error .  Also added
1145   socket.error to the socket module's C API.
1147 - Bug #920575: A problem where the _locale module segfaults on
1148   nl_langinfo(ERA) caused by GNU libc's illegal NULL return is fixed.
1150 - array objects now support the copy module.  Also, their resizing
1151   scheme has been updated to match that used for list objects.  This improves
1152   the performance (speed and memory usage) of append() operations.
1153   Also, array.array() and array.extend() now accept any iterable argument
1154   for repeated appends without needing to create another temporary array.
1156 - cStringIO.writelines() now accepts any iterable argument and writes
1157   the lines one at a time rather than joining them and writing once.
1158   Made a parallel change to StringIO.writelines().  Saves memory and
1159   makes suitable for use with generator expressions.
1161 - time.strftime() now checks that the values in its time tuple argument
1162   are within the proper boundaries to prevent possible crashes from the
1163   platform's C library implementation of strftime().  Can possibly
1164   break code that uses values outside the range that didn't cause
1165   problems previously (such as sitting day of year to 0).  Fixes bug
1166   #897625.
1168 - The socket module now supports Bluetooth sockets, if the
1169   system has <bluetooth/bluetooth.h>
1171 - Added a collections module containing a new datatype, deque(),
1172   offering high-performance, thread-safe, memory friendly appends
1173   and pops on either side of the deque.
1175 - Several modules now take advantage of collections.deque() for
1176   improved performance:  Queue, mutex, shlex, threading, and pydoc.
1178 - The operator module has two new functions, attrgetter() and
1179   itemgetter() which are useful for creating fast data extractor
1180   functions for map(), list.sort(), itertools.groupby(), and
1181   other functions that expect a function argument.
1183 - socket.SHUT_{RD,WR,RDWR} was added.
1185 - os.getsid was added.
1187 - The pwd module incorrectly advertised its struct type as
1188   struct_pwent; this has been renamed to struct_passwd.  (The old name
1189   is still supported for backwards compatibility.)
1191 - The xml.parsers.expat module now provides Expat 1.95.7.
1193 - socket.IPPROTO_IPV6 was added.
1195 - readline.clear_history was added.
1197 - select.select() now accepts sequences for its first three arguments.
1199 - cStringIO now supports the f.closed attribute.
1201 - The signal module now exposes SIGRTMIN and SIGRTMAX (if available).
1203 - curses module now supports use_default_colors().  [patch #739124]
1205 - Bug #811028: ncurses.h breakage on FreeBSD/MacOS X
1207 - Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI
1209 - Implemented non-recursive SRE matching scheme (#757624).
1211 - Implemented (?(id/name)yes|no) support in SRE (#572936).
1213 - random.seed() with no arguments or None uses time.time() as a default
1214   seed.  Modified to match Py2.2 behavior and use fractional seconds so
1215   that successive runs are more likely to produce different sequences.
1217 - random.Random has a new method, getrandbits(k), which returns an int
1218   with k random bits.  This method is now an optional part of the API
1219   for user defined generators.  Any generator that defines genrandbits()
1220   can now use randrange() for ranges with a length >= 2**53.  Formerly,
1221   randrange would return only even numbers for ranges that large (see
1222   SF bug #812202).  Generators that do not define genrandbits() now
1223   issue a warning when randrange() is called with a range that large.
1225 - itertools has a new function, groupby() for aggregating iterables
1226   into groups sharing the same key (as determined by a key function).
1227   It offers some of functionality of SQL's groupby keyword and of
1228   the Unix uniq filter.
1230 - itertools now has a new tee() function which produces two independent
1231   iterators from a single iterable.
1233 - itertools.izip() with no arguments now returns an empty iterator instead
1234   of raising a TypeError exception.
1236 - Fixed #853061: allow BZ2Compressor.compress() to receive an empty string
1237   as parameter.
1239 Library
1240 -------
1242 - Bug #981530: Fix UnboundLocalError in shutil.rmtree().  This affects
1243   the documented behavior: the function passed to the onerror()
1244   handler can now also be os.listdir.
1246 - Bug #754449: threading.Thread objects no longer mask exceptions raised during
1247   interpreter shutdown with another exception from attempting to handle the
1248   original exception.
1250 - Added decimal.py per PEP 327.
1252 - Bug #981299: rsync is now a recognized protocol in urlparse that uses a
1253   "netloc" portion of a URL.
1255 - Bug #919012: shutil.move() will not try to move a directory into itself.
1256   Thanks Johannes Gijsbers.
1258 - Bug #934282: pydoc.stripid() is now case-insensitive.  Thanks Robin Becker.
1260 - Bug #823209:  cmath.log() now takes an optional base argument so that its
1261   API matches math.log().
1263 - Bug #957381: distutils bdist_rpm no longer fails on recent RPM versions
1264   that generate a -debuginfo.rpm
1266 - os.path.devnull has been added for all supported platforms.
1268 - Fixed #877165: distutils now picks the right C++ compiler command
1269   on cygwin and mingw32.
1271 - urllib.urlopen().readline() now handles HTTP/0.9 correctly.
1273 - refactored site.py into functions.  Also wrote regression tests for the
1274   module.
1276 - The distutils install command now supports the --home option and
1277   installation scheme for all platforms.
1279 - asyncore.loop now has a repeat count parameter that defaults to
1280   looping forever.
1282 - The distutils sdist command now ignores all .svn directories, in
1283   addition to CVS and RCS directories.  .svn directories hold
1284   administrative files for the Subversion source control system.
1286 - Added a new module: cookielib.  Automatic cookie handling for HTTP
1287   clients.  Also, support for cookielib has been added to urllib2, so
1288   urllib2.urlopen() can transparently handle cookies.
1290 - stringprep.py now uses built-in set() instead of sets.Set().
1292 - Bug #876278: Unbounded recursion in modulefinder
1294 - Bug #780300: Swap public and system ID in LexicalHandler.startDTD.
1295   Applications relying on the wrong order need to be corrected.
1297 - Bug #926075: Fixed a bug that returns a wrong pattern object
1298   for a string or unicode object in sre.compile() when a different
1299   type pattern with the same value exists.
1301 - Added countcallers arg to trace.Trace class (--trackcalls command line arg
1302   when run from the command prompt).
1304 - Fixed a caching bug in platform.platform() where the argument of 'terse' was
1305   not taken into consideration when caching value.
1307 - Added two new command-line arguments for profile (output file and
1308   default sort).
1310 - Added global runctx function to profile module
1312 - Add hlist missing entryconfigure and entrycget methods.
1314 - The ptcp154 codec was added for Kazakh character set support.
1316 - Support non-anonymous ftp URLs in urllib2.
1318 - The encodings package will now apply codec name aliases
1319   first before starting to try the import of the codec module.
1320   This simplifies overriding built-in codecs with external
1321   packages, e.g. the included CJK codecs with the JapaneseCodecs
1322   package, by adjusting the aliases dictionary in encodings.aliases
1323   accordingly.
1325 - base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and
1326   decoding standards.
1328 - urllib2 now supports processors.  A processor is a handler that
1329   implements an xxx_request or xxx_response method.  These methods are
1330   called for all requests.
1332 - distutils compilers now compile source files in the same order as
1333   they are passed to the compiler.
1335 - pprint.pprint() and pprint.pformat() now have additional parameters
1336   indent, width and depth.
1338 - Patch #750542: pprint now will pretty print subclasses of list, tuple
1339   and dict too, as long as they don't overwrite __repr__().
1341 - Bug #848614: distutils' msvccompiler fails to find the MSVC6
1342   compiler because of incomplete registry entries.
1344 - httplib.HTTP.putrequest now offers to omit the implicit Accept-Encoding.
1346 - Patch #841977: modulefinder didn't find extension modules in packages
1348 - imaplib.IMAP4.thread was added.
1350 - Plugged a minor hole in tempfile.mktemp() due to the use of
1351   os.path.exists(), switched to using os.lstat() directly if possible.
1353 - bisect.py and heapq.py now have underlying C implementations
1354   for better performance.
1356 - heapq.py has two new functions, nsmallest() and nlargest().
1358 - traceback.format_exc has been added (similar to print_exc but it returns
1359   a string).
1361 - xmlrpclib.MultiCall has been added.
1363 - poplib.POP3_SSL has been added.
1365 - tmpfile.mkstemp now returns an absolute path even if dir is relative.
1367 - urlparse is RFC 2396 compliant.
1369 - The fieldnames argument to the csv module's DictReader constructor is now
1370   optional.  If omitted, the first row of the file will be used as the
1371   list of fieldnames.
1373 - encodings.bz2_codec was added for access to bz2 compression
1374   using "a long string".encode('bz2')
1376 - Various improvements to unittest.py, realigned with PyUnit CVS.
1378 - dircache now passes exceptions to the caller, instead of returning
1379   empty lists.
1381 - The bsddb module and dbhash module now support the iterator and
1382   mapping protocols which make them more substitutable for dictionaries
1383   and shelves.
1385 - The csv module's DictReader and DictWriter classes now accept keyword
1386   arguments.  This was an omission in the initial implementation.
1388 - The email package handles some RFC 2231 parameters with missing
1389   CHARSET fields better.  It also includes a patch to parameter
1390   parsing when semicolons appear inside quotes.
1392 - sets.py now runs under Py2.2.  In addition, the argument restrictions
1393   for most set methods (but not the operators) have been relaxed to
1394   allow any iterable.
1396 - _strptime.py now has a behind-the-scenes caching mechanism for the most
1397   recent TimeRE instance used along with the last five unique directive
1398   patterns.  The overall module was also made more thread-safe.
1400 - random.cunifvariate() and random.stdgamma() were deprecated in Py2.3
1401   and removed in Py2.4.
1403 - Bug #823328: urllib2.py's HTTP Digest Auth support works again.
1405 - Patch #873597: CJK codecs are imported into rank of default codecs.
1407 Tools/Demos
1408 -----------
1410 - A hotshotmain script was added to the Tools/scripts directory that
1411   makes it easy to run a script under control of the hotshot profiler.
1413 - The db2pickle and pickle2db scripts can now dump/load gdbm files.
1415 - The file order on the command line of the pickle2db script was reversed.
1416   It is now [ picklefile ] dbfile.  This provides better symmetry with
1417   db2pickle.  The file arguments to both scripts are now source followed by
1418   destination in situations where both files are given.
1420 - The pydoc script will display a link to the module documentation for
1421   modules determined to be part of the core distribution.  The documentation
1422   base directory defaults to http://www.python.org/doc/current/lib/ but can
1423   be changed by setting the PYTHONDOCS environment variable.
1425 - texcheck.py now detects double word errors.
1427 - md5sum.py mistakenly opened input files in text mode by default, a
1428   silent and dangerous change from previous releases.  It once again
1429   opens input files in binary mode by default.  The -t and -b flags
1430   remain for compatibility with the 2.3 release, but -b is the default
1431   now.
1433 - py-electric-colon now works when pending-delete/delete-selection mode is
1434   in effect
1436 - py-help-at-point is no longer bound to the F1 key - it's still bound to
1437   C-c C-h
1439 - Pynche was fixed to not crash when there is no ~/.pynche file and no
1440   -d option was given.
1442 Build
1443 -----
1445 - Bug #978645: Modules/getpath.c now builds properly in --disable-framework
1446   build under OS X.
1448 - Profiling using gprof is now available if Python is configured with
1449   --enable-profiling.
1451 - Profiling the VM using the Pentium TSC is now possible if Python
1452   is configured --with-tsc.
1454 - In order to find libraries, setup.py now also looks in /lib64, for use
1455   on AMD64.
1457 - Bug #934635: Fixed a bug where the configure script couldn't detect
1458   getaddrinfo() properly if the KAME stack had SCTP support.
1460 - Support for missing ANSI C header files (limits.h, stddef.h, etc) was
1461   removed.
1463 - Systems requiring the D4, D6 or D7 variants of pthreads are no longer
1464   supported (see PEP 11).
1466 - Universal newline support can no longer be disabled (see PEP 11).
1468 - Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11).
1470 - Support for systems requiring --with-dl-dld or --with-sgi-dl was removed
1471   (see PEP 11).
1473 - Tests for sizeof(char) were removed since ANSI C mandates that
1474   sizeof(char) must be 1.
1476 C API
1477 -----
1479 - Thanks to Anthony Tuininga, the datetime module now supplies a C API
1480   containing type-check macros and constructors.  See new docs in the
1481   Python/C API Reference Manual for details.
1483 - Private function _PyTime_DoubleToTimet added, to convert a Python
1484   timestamp (C double) to platform time_t with some out-of-bounds
1485   checking.  Declared in new header file timefuncs.h.  It would be
1486   good to expose some other internal timemodule.c functions there.
1488 - New public functions PyEval_EvaluateFrame and PyGen_New to expose
1489   generator objects.
1491 - New public functions Py_IncRef() and Py_DecRef(), exposing the
1492   functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for
1493   runtime dynamic embedding of Python.  See patch #938302, by Bob
1494   Ippolito.
1496 - Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's
1497   underlying array of PyObject pointers.  Useful for high speed looping.
1499 - Created a new method flag, METH_COEXIST, which causes a method to be loaded
1500   even if already defined by a slot wrapper.  This allows a __contains__
1501   method, for example, to co-exist with a defined sq_contains slot.  This
1502   is helpful because the PyCFunction can take advantage of optimized calls
1503   whenever METH_O or METH_NOARGS flags are defined.
1505 - Added a new function, PyDict_Contains(d, k) which is like
1506   PySequence_Contains() but is specific to dictionaries and executes
1507   about 10% faster.
1509 - Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE.
1510   Each return the singleton they mention after Py_INCREF()ing them.
1512 - Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a
1513   variable length argument list of Python objects without having to invoke
1514   the more complex machinery of Py_BuildValue().  PyTuple_Pack(3, a, b, c)
1515   is equivalent to Py_BuildValue("(OOO)", a, b, c).
1517 Windows
1518 -------
1520 - The _winreg module could segfault when reading very large registry
1521   values, due to unchecked alloca() calls (SF bug 851056).  The fix is
1522   uses either PyMem_Malloc(n) or PyString_FromStringAndSize(NULL, n),
1523   as appropriate, followed by a size check.
1525 - file.truncate() could misbehave if the file was open for update
1526   (modes r+, rb+, w+, wb+), and the most recent file operation before
1527   the truncate() call was an input operation.  SF bug 801631.
1530 What's New in Python 2.3 final?
1531 ===============================
1533 *Release date: 29-Jul-2003*
1535 IDLE
1536 ----
1538 - Bug 778400:  IDLE hangs when selecting "Edit with IDLE" from explorer.
1539   This was unique to Windows, and was fixed by adding an -n switch to
1540   the command the Windows installer creates to execute "Edit with IDLE"
1541   context-menu actions.
1543 - IDLE displays a new message upon startup:  some "personal firewall"
1544   kinds of programs (for example, ZoneAlarm) open a dialog of their
1545   own when any program opens a socket.  IDLE does use sockets, talking
1546   on the computer's internal loopback interface.  This connection is not
1547   visible on any external interface and no data is sent to or received
1548   from the Internet.  So, if you get such a dialog when opening IDLE,
1549   asking whether to let pythonw.exe talk to address 127.0.0.1, say yes,
1550   and rest assured no communication external to your machine is taking
1551   place.  If you don't allow it, IDLE won't be able to start.
1554 What's New in Python 2.3 release candidate 2?
1555 =============================================
1557 *Release date: 24-Jul-2003*
1559 Core and builtins
1560 -----------------
1562 - It is now possible to import from zipfiles containing additional
1563   data bytes before the zip compatible archive.  Zipfiles containing a
1564   comment at the end are still unsupported.
1566 Extension modules
1567 -----------------
1569 - A longstanding bug in the parser module's initialization could cause
1570   fatal internal refcount confusion when the module got initialized more
1571   than once.  This has been fixed.
1573 - Fixed memory leak in pyexpat; using the parser's ParseFile() method
1574   with open files that aren't instances of the standard file type
1575   caused an instance of the bound .read() method to be leaked on every
1576   call.
1578 - Fixed some leaks in the locale module.
1580 Library
1581 -------
1583 - Lib/encodings/rot_13.py when used as a script, now more properly
1584   uses the first Python interpreter on your path.
1586 - Removed caching of TimeRE (and thus LocaleTime) in _strptime.py to
1587   fix a locale related bug in the test suite.  Although another patch
1588   was needed to actually fix the problem, the cache code was not
1589   restored.
1591 IDLE
1592 ----
1594 - Calltips patches.
1596 Build
1597 -----
1599 - For MacOSX, added -mno-fused-madd to BASECFLAGS to fix test_coercion
1600   on Panther (OSX 10.3).
1602 C API
1603 -----
1605 Windows
1606 -------
1608 - The tempfile module could do insane imports on Windows if PYTHONCASEOK
1609   was set, making temp file creation impossible.  Repaired.
1611 - Add a patch to workaround pthread_sigmask() bugs in Cygwin.
1616 - Various fixes to pimp.
1618 - Scripts runs with pythonw no longer had full window manager access.
1620 - Don't force boot-disk-only install, for reasons unknown it causes
1621   more problems than it solves.
1624 What's New in Python 2.3 release candidate 1?
1625 =============================================
1627 *Release date: 18-Jul-2003*
1629 Core and builtins
1630 -----------------
1632 - The new function sys.getcheckinterval() returns the last value set
1633   by sys.setcheckinterval().
1635 - Several bugs in the symbol table phase of the compiler have been
1636   fixed.  Errors could be lost and compilation could fail without
1637   reporting an error.  SF patch 763201.
1639 - The interpreter is now more robust about importing the warnings
1640   module.  In an executable generated by freeze or similar programs,
1641   earlier versions of 2.3 would fail if the warnings module could
1642   not be found on the file system.  Fixes SF bug 771097.
1644 - A warning about assignments to module attributes that shadow
1645   builtins, present in earlier releases of 2.3, has been removed.
1647 - It is not possible to create subclasses of builtin types like str
1648   and tuple that define an itemsize.  Earlier releases of Python 2.3
1649   allowed this by mistake, leading to crashes and other problems.
1651 - The thread_id is now initialized to 0 in a non-thread build.  SF bug
1652   770247.
1654 - SF bug 762891: "del p[key]" on proxy object no longer raises SystemError.
1656 Extension modules
1657 -----------------
1659 - weakref.proxy() can now handle "del obj[i]" for proxy objects
1660   defining __delitem__.  Formerly, it generated a SystemError.
1662 - SSL no longer crashes the interpreter when the remote side disconnects.
1664 - On Unix the mmap module can again be used to map device files.
1666 - time.strptime now exclusively uses the Python implementation
1667   contained within the _strptime module.
1669 - The print slot of weakref proxy objects was removed, because it was
1670   not consistent with the object's repr slot.
1672 - The mmap module only checks file size for regular files, not
1673   character or block devices.  SF patch 708374.
1675 - The cPickle Pickler garbage collection support was fixed to traverse
1676   the find_class attribute, if present.
1678 - There are several fixes for the bsddb3 wrapper module.
1680   bsddb3 no longer crashes if an environment is closed before a cursor
1681   (SF bug 763298).
1683   The DB and DBEnv set_get_returns_none function was extended to take
1684   a level instead of a boolean flag.  The new level 2 means that in
1685   addition, cursor.set()/.get() methods return None instead of raising
1686   an exception.
1688   A typo was fixed in DBCursor.join_item(), preventing a crash.
1690 Library
1691 -------
1693 - distutils now supports MSVC 7.1
1695 - doctest now examines all docstrings by default.  Previously, it would
1696   skip over functions with private names (as indicated by the underscore
1697   naming convention).  The old default created too much of a risk that
1698   user tests were being skipped inadvertently.  Note, this change could
1699   break code in the unlikely case that someone had intentionally put
1700   failing tests in the docstrings of private functions.  The breakage
1701   is easily fixable by specifying the old behavior when calling testmod()
1702   or Tester().
1704 - There were several fixes to the way dumbdbms are closed.  It's vital
1705   that a dumbdbm database be closed properly, else the on-disk data
1706   and directory files can be left in mutually inconsistent states.
1707   dumbdbm.py's _Database.__del__() method attempted to close the
1708   database properly, but a shutdown race in _Database._commit() could
1709   prevent this from working, so that a program trusting __del__() to
1710   get the on-disk files in synch could be badly surprised.  The race
1711   has been repaired.  A sync() method was also added so that shelve
1712   can guarantee data is written to disk.
1714   The close() method can now be called more than once without complaint.
1716 - The classes in threading.py are now new-style classes.  That they
1717   weren't before was an oversight.
1719 - The urllib2 digest authentication handlers now define the correct
1720   auth_header.  The earlier versions would fail at runtime.
1722 - SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
1723   when there are no lines.
1725 - SF bug 763637: fix exception in Tkinter with after_cancel
1726   which could occur with Tk 8.4
1728 - SF bug 770601: CGIHTTPServer.py now passes the entire environment
1729   to child processes.
1731 - SF bug 765238: add filter to fnmatch's __all__.
1733 - SF bug 748201: make time.strptime() error messages more helpful.
1735 - SF patch 764470: Do not dump the args attribute of a Fault object in
1736   xmlrpclib.
1738 - SF patch 549151: urllib and urllib2 now redirect POSTs on 301
1739   responses.
1741 - SF patch 766650: The whichdb module was fixed to recognize dbm files
1742   generated by gdbm on OS/2 EMX.
1744 - SF bugs 763047 and 763052: fixes bug of timezone value being left as
1745   -1 when ``time.tzname[0] == time.tzname[1] and not time.daylight``
1746   is true when it should only when time.daylight is true.
1748 - SF bug 764548: re now allows subclasses of str and unicode to be
1749   used as patterns.
1751 - SF bug 763637: In Tkinter, change after_cancel() to handle tuples
1752   of varying sizes.  Tk 8.4 returns a different number of values
1753   than Tk 8.3.
1755 - SF bug 763023: difflib.ratio() did not catch zero division.
1757 - The Queue module now has an __all__ attribute.
1759 Tools/Demos
1760 -----------
1762 - See Lib/idlelib/NEWS.txt for IDLE news.
1764 - SF bug 753592: webchecker/wsgui now handles user supplied directories.
1766 - The trace.py script has been removed.  It is now in the standard library.
1768 Build
1769 -----
1771 - Python now compiles with -fno-strict-aliasing if possible (SF bug 766696).
1773 - The socket module compiles on IRIX 6.5.10.
1775 - An irix64 system is treated the same way as an irix6 system (SF
1776   patch 764560).
1778 - Several definitions were missing on FreeBSD 5.x unless the
1779   __BSD_VISIBLE symbol was defined.  configure now defines it as
1780   needed.
1782 C API
1783 -----
1785 - Unicode objects now support mbcs as a built-in encoding, so the C
1786   API can use it without deferring to the encodings package.
1788 Windows
1789 -------
1791 - The Windows implementation of PyThread_start_new_thread() never
1792   checked error returns from Windows functions correctly.  As a result,
1793   it could claim to start a new thread even when the Microsoft
1794   _beginthread() function failed (due to "too many threads" -- this is
1795   on the order of thousands when it happens).  In these cases, the
1796   Python exception ::
1798       thread.error: can't start new thread
1800   is raised now.
1802 - SF bug 766669: Prevent a GPF on interpreter exit when sockets are in
1803   use.  The interpreter now calls WSACleanup() from Py_Finalize()
1804   instead of from DLL teardown.
1809 - Bundlebuilder now inherits default values in the right way.  It was
1810   previously possible for app bundles to get a type of "BNDL" instead
1811   of "APPL."  Other improvements include, a --build-id option to
1812   specify the CFBundleIdentifier and using the --python option to set
1813   the executable in the bundle.
1815 - Fixed two bugs in MacOSX framework handling.
1817 - pythonw did not allow user interaction in 2.3rc1, this has been fixed.
1819 - Python is now compiled with -mno-fused-madd, making all tests pass
1820   on Panther.
1822 What's New in Python 2.3 beta 2?
1823 ================================
1825 *Release date: 29-Jun-2003*
1827 Core and builtins
1828 -----------------
1830 - A program can now set the environment variable PYTHONINSPECT to some
1831   string value in Python, and cause the interpreter to enter the
1832   interactive prompt at program exit, as if Python had been invoked
1833   with the -i option.
1835 - list.index() now accepts optional start and stop arguments.  Similar
1836   changes were made to UserList.index(). SF feature request 754014.
1838 - SF patch 751998 fixes an unwanted side effect of the previous fix
1839   for SF bug 742860 (the next item).
1841 - SF bug 742860: "WeakKeyDictionary __delitem__ uses iterkeys".  This
1842   wasn't threadsafe, was very inefficient (expected time O(len(dict))
1843   instead of O(1)), and could raise a spurious RuntimeError if another
1844   thread mutated the dict during __delitem__, or if a comparison function
1845   mutated it.  It also neglected to raise KeyError when the key wasn't
1846   present; didn't raise TypeError when the key wasn't of a weakly
1847   referencable type; and broke various more-or-less obscure dict
1848   invariants by using a sequence of equality comparisons over the whole
1849   set of dict keys instead of computing the key's hash code to narrow
1850   the search to those keys with the same hash code.  All of these are
1851   considered to be bugs.  A new implementation of __delitem__ repairs all
1852   that, but note that fixing these bugs may change visible behavior in
1853   code relying (whether intentionally or accidentally) on old behavior.
1855 - SF bug 734869: Fixed a compiler bug that caused a fatal error when
1856   compiling a list comprehension that contained another list comprehension
1857   embedded in a lambda expression.
1859 - SF bug 705231:  builtin pow() no longer lets the platform C pow()
1860   raise -1.0 to integer powers, because (at least) glibc gets it wrong
1861   in some cases.  The result should be -1.0 if the power is odd and 1.0
1862   if the power is even, and any float with a sufficiently large exponent
1863   is (mathematically) an exact even integer.
1865 - SF bug 759227: A new-style class that implements __nonzero__() must
1866   return a bool or int (but not an int subclass) from that method.  This
1867   matches the restriction on classic classes.
1869 - The encoding attribute has been added for file objects, and set to
1870   the terminal encoding on Unix and Windows.
1872 - The softspace attribute of file objects became read-only by oversight.
1873   It's writable again.
1875 - Reverted a 2.3 beta 1 change to iterators for subclasses of list and
1876   tuple.  By default, the iterators now access data elements directly
1877   instead of going through __getitem__.  If __getitem__ access is
1878   preferred, then __iter__ can be overridden.
1880 - SF bug 735247: The staticmethod and super types participate in
1881   garbage collection. Before this change, it was possible for leaks to
1882   occur in functions with non-global free variables that used these types.
1884 Extension modules
1885 -----------------
1887 - the socket module has a new exception, socket.timeout, to allow
1888   timeouts to be handled separately from other socket errors.
1890 - SF bug 751276: cPickle has fixed to propagate exceptions raised in
1891   user code.  In earlier versions, cPickle caught and ignored any
1892   exception when it performed operations that it expected to raise
1893   specific exceptions like AttributeError.
1895 - cPickle Pickler and Unpickler objects now participate in garbage
1896   collection.
1898 - mimetools.choose_boundary() could return duplicate strings at times,
1899   especially likely on Windows.  The strings returned are now guaranteed
1900   unique within a single program run.
1902 - thread.interrupt_main() raises KeyboardInterrupt in the main thread.
1903   dummy_thread has also been modified to try to simulate the behavior.
1905 - array.array.insert() now treats negative indices as being relative
1906   to the end of the array, just like list.insert() does. (SF bug #739313)
1908 - The datetime module classes datetime, time, and timedelta are now
1909   properly subclassable.
1911 - _tkinter.{get|set}busywaitinterval was added.
1913 - itertools.islice() now accepts stop=None as documented.
1914   Fixes SF bug #730685.
1916 - the bsddb185 module is built in one restricted instance -
1917   /usr/include/db.h exists and defines HASHVERSION to be 2.  This is true
1918   for many BSD-derived systems.
1921 Library
1922 -------
1924 - Some happy doctest extensions from Jim Fulton have been added to
1925   doctest.py.  These are already being used in Zope3.  The two
1926   primary ones:
1928   doctest.debug(module, name) extracts the doctests from the named object
1929   in the given module, puts them in a temp file, and starts pdb running
1930   on that file.  This is great when a doctest fails.
1932   doctest.DocTestSuite(module=None) returns a synthesized unittest
1933   TestSuite instance, to be run by the unittest framework, which
1934   runs all the doctests in the module.  This allows writing tests in
1935   doctest style (which can be clearer and shorter than writing tests
1936   in unittest style), without losing unittest's powerful testing
1937   framework features (which doctest lacks).
1939 - For compatibility with doctests created before 2.3, if an expected
1940   output block consists solely of "1" and the actual output block
1941   consists solely of "True", it's accepted as a match; similarly
1942   for "0" and "False".  This is quite un-doctest-like, but is practical.
1943   The behavior can be disabled by passing the new doctest module
1944   constant DONT_ACCEPT_TRUE_FOR_1 to the new optionflags optional
1945   argument.
1947 - ZipFile.testzip() now only traps BadZipfile exceptions.  Previously,
1948   a bare except caught to much and reported all errors as a problem
1949   in the archive.
1951 - The logging module now has a new function, makeLogRecord() making
1952   LogHandler easier to interact with DatagramHandler and SocketHandler.
1954 - The cgitb module has been extended to support plain text display (SF patch
1955   569574).
1957 - A brand new version of IDLE (from the IDLEfork project at
1958   SourceForge) is now included as Lib/idlelib.  The old Tools/idle is
1959   no more.
1961 - Added a new module: trace (documentation missing).  This module used
1962   to be distributed in Tools/scripts.  It uses sys.settrace() to trace
1963   code execution -- either function calls or individual lines.  It can
1964   generate tracing output during execution or a post-mortem report of
1965   code coverage.
1967 - The threading module has new functions settrace() and setprofile()
1968   that cooperate with the functions of the same name in the sys
1969   module.  A function registered with the threading module will
1970   be used for all threads it creates.  The new trace module uses this
1971   to provide tracing for code running in threads.
1973 - copy.py: applied SF patch 707900, fixing bug 702858, by Steven
1974   Taschuk.  Copying a new-style class that had a reference to itself
1975   didn't work.  (The same thing worked fine for old-style classes.)
1976   Builtin functions are now treated as atomic, fixing bug #746304.
1978 - difflib.py has two new functions:  context_diff() and unified_diff().
1980 - More fixes to urllib (SF 549151): (a) When redirecting, always use
1981   GET.  This is common practice and more-or-less sanctioned by the
1982   HTTP standard. (b) Add a handler for 307 redirection, which becomes
1983   an error for POST, but a regular redirect for GET and HEAD
1985 - Added optional 'onerror' argument to os.walk(), to control error
1986   handling.
1988 - inspect.is{method|data}descriptor was added, to allow pydoc display
1989   __doc__ of data descriptors.
1991 - Fixed socket speed loss caused by use of the _socketobject wrapper class
1992   in socket.py.
1994 - timeit.py now checks the current directory for imports.
1996 - urllib2.py now knows how to order proxy classes, so the user doesn't
1997   have to insert it in front of other classes, nor do dirty tricks like
1998   inserting a "dummy" HTTPHandler after a ProxyHandler when building an
1999   opener with proxy support.
2001 - Iterators have been added for dbm keys.
2003 - random.Random objects can now be pickled.
2005 Tools/Demos
2006 -----------
2008 - pydoc now offers help on keywords and topics.
2010 - Tools/idle is gone; long live Lib/idlelib.
2012 - diff.py prints file diffs in context, unified, or ndiff formats,
2013   providing a command line interface to difflib.py.
2015 - texcheck.py is a new script for making a rough validation of Python LaTeX
2016   files.
2018 Build
2019 -----
2021 - Setting DESTDIR during 'make install' now allows specifying a
2022   different root directory.
2024 C API
2025 -----
2027 - PyType_Ready():  If a type declares that it participates in gc
2028   (Py_TPFLAGS_HAVE_GC), and its base class does not, and its base class's
2029   tp_free slot is the default _PyObject_Del, and type does not define
2030   a tp_free slot itself, _PyObject_GC_Del is assigned to type->tp_free.
2031   Previously _PyObject_Del was inherited, which could at best lead to a
2032   segfault.  In addition, if even after this magic the type's tp_free
2033   slot is _PyObject_Del or NULL, and the type is a base type
2034   (Py_TPFLAGS_BASETYPE), TypeError is raised:  since the type is a base
2035   type, its dealloc function must call type->tp_free, and since the type
2036   is gc'able, tp_free must not be NULL or _PyObject_Del.
2038 - PyThreadState_SetAsyncExc(): A new API (deliberately accessible only
2039   from C) to interrupt a thread by sending it an exception.  It is
2040   intentional that you have to write your own C extension to call it
2041   from Python.
2044 New platforms
2045 -------------
2047 None this time.
2049 Tests
2050 -----
2052 - test_imp rewritten so that it doesn't raise RuntimeError if run as a
2053   side effect of being imported ("import test.autotest").
2055 Windows
2056 -------
2058 - The Windows installer ships with Tcl/Tk 8.4.3 (upgraded from 8.4.1).
2060 - The installer always suggested that Python be installed on the C:
2061   drive, due to a hardcoded "C:" generated by the Wise installation
2062   wizard.  People with machines where C: is not the system drive
2063   usually want Python installed on whichever drive is their system drive
2064   instead.  We removed the hardcoded "C:", and two testers on machines
2065   where C: is not the system drive report that the installer now
2066   suggests their system drive.  Note that you can always select the
2067   directory you want in the "Select Destination Directory" dialog --
2068   that's what it's for.
2073 - There's a new module called "autoGIL", which offers a mechanism to
2074   automatically release the Global Interpreter Lock when an event loop
2075   goes to sleep, allowing other threads to run. It's currently only
2076   supported on OSX, in the Mach-O version.
2077 - The OSA modules now allow direct access to properties of the
2078   toplevel application class (in AppleScript terminology).
2079 - The Package Manager can now update itself.
2081 SourceForge Bugs and Patches Applied
2082 ------------------------------------
2084 430160, 471893, 501716, 542562, 549151, 569574, 595837, 596434,
2085 598163, 604210, 604716, 610332, 612627, 614770, 620190, 621891,
2086 622042, 639139, 640236, 644345, 649742, 649742, 658233, 660022,
2087 661318, 661676, 662807, 662923, 666219, 672855, 678325, 682347,
2088 683486, 684981, 685773, 686254, 692776, 692959, 693094, 696777,
2089 697989, 700827, 703666, 708495, 708604, 708901, 710733, 711902,
2090 713722, 715782, 718286, 719359, 719367, 723136, 723831, 723962,
2091 724588, 724767, 724767, 725942, 726150, 726446, 726869, 727051,
2092 727719, 727719, 727805, 728277, 728563, 728656, 729096, 729103,
2093 729293, 729297, 729300, 729317, 729395, 729622, 729817, 730170,
2094 730296, 730594, 730685, 730826, 730963, 731209, 731403, 731504,
2095 731514, 731626, 731635, 731643, 731644, 731644, 731689, 732124,
2096 732143, 732234, 732284, 732284, 732479, 732761, 732783, 732951,
2097 733667, 733781, 734118, 734231, 734869, 735051, 735293, 735527,
2098 735613, 735694, 736962, 736962, 737970, 738066, 739313, 740055,
2099 740234, 740301, 741806, 742126, 742741, 742860, 742860, 742911,
2100 744041, 744104, 744238, 744687, 744877, 745055, 745478, 745525,
2101 745620, 746012, 746304, 746366, 746801, 746953, 747348, 747667,
2102 747954, 748846, 748849, 748973, 748975, 749191, 749210, 749759,
2103 749831, 749911, 750008, 750092, 750542, 750595, 751038, 751107,
2104 751276, 751451, 751916, 751941, 751956, 751998, 752671, 753451,
2105 753602, 753617, 753845, 753925, 754014, 754340, 754447, 755031,
2106 755087, 755147, 755245, 755683, 755987, 756032, 756996, 757058,
2107 757229, 757818, 757821, 757822, 758112, 758910, 759227, 759889,
2108 760257, 760703, 760792, 761104, 761337, 761519, 761830, 762455
2111 What's New in Python 2.3 beta 1?
2112 ================================
2114 *Release date: 25-Apr-2003*
2116 Core and builtins
2117 -----------------
2119 - New format codes B, H, I, k and K have been implemented for
2120   PyArg_ParseTuple and PyBuild_Value.
2122 - New builtin function sum(seq, start=0) returns the sum of all the
2123   items in iterable object seq, plus start (items are normally numbers,
2124   and cannot be strings).
2126 - bool() called without arguments now returns False rather than
2127   raising an exception.  This is consistent with calling the
2128   constructors for the other builtin types -- called without argument
2129   they all return the false value of that type.  (SF patch #724135)
2131 - In support of PEP 269 (making the pgen parser generator accessible
2132   from Python), some changes to the pgen code structure were made; a
2133   few files that used to be linked only with pgen are now linked with
2134   Python itself.
2136 - The repr() of a weakref object now shows the __name__ attribute of
2137   the referenced object, if it has one.
2139 - super() no longer ignores data descriptors, except __class__.  See
2140   the thread started at
2141   http://mail.python.org/pipermail/python-dev/2003-April/034338.html
2143 - list.insert(i, x) now interprets negative i as it would be
2144   interpreted by slicing, so negative values count from the end of the
2145   list.  This was the only place where such an interpretation was not
2146   placed on a list index.
2148 - range() now works even if the arguments are longs with magnitude
2149   larger than sys.maxint, as long as the total length of the sequence
2150   fits.  E.g., range(2**100, 2**101, 2**100) is the following list:
2151   [1267650600228229401496703205376L].  (SF patch #707427.)
2153 - Some horridly obscure problems were fixed involving interaction
2154   between garbage collection and old-style classes with "ambitious"
2155   getattr hooks.  If an old-style instance didn't have a __del__ method,
2156   but did have a __getattr__ hook, and the instance became reachable
2157   only from an unreachable cycle, and the hook resurrected or deleted
2158   unreachable objects when asked to resolve "__del__", anything up to
2159   a segfault could happen.  That's been repaired.
2161 - dict.pop now takes an optional argument specifying a default
2162   value to return if the key is not in the dict.  If a default is not
2163   given and the key is not found, a KeyError will still be raised.
2164   Parallel changes were made to UserDict.UserDict and UserDict.DictMixin.
2165   [SF patch #693753] (contributed by Michael Stone.)
2167 - sys.getfilesystemencoding() was added to expose
2168   Py_FileSystemDefaultEncoding.
2170 - New function sys.exc_clear() clears the current exception.  This is
2171   rarely needed, but can sometimes be useful to release objects
2172   referenced by the traceback held in sys.exc_info()[2].  (SF patch
2173   #693195.)
2175 - On 64-bit systems, a dictionary could contain duplicate long/int keys
2176   if the key value was larger than 2**32.  See SF bug #689659.
2178 - Fixed SF bug #663074. The codec system was using global static
2179   variables to store internal data. As a result, any attempts to use the
2180   unicode system with multiple active interpreters, or successive
2181   interpreter executions, would fail.
2183 - "%c" % u"a" now returns a unicode string instead of raising a
2184   TypeError. u"%c" % 0xffffffff now raises a OverflowError instead
2185   of a ValueError to be consistent with "%c" % 256. See SF patch #710127.
2187 Extension modules
2188 -----------------
2190 - The socket module now provides the functions inet_pton and inet_ntop
2191   for converting between string and packed representation of IP
2192   addresses.  There is also a new module variable, has_ipv6, which is
2193   True iff the current Python has IPv6 support.  See SF patch #658327.
2195 - Tkinter wrappers around Tcl variables now pass objects directly
2196   to Tcl, instead of first converting them to strings.
2198 - The .*? pattern in the re module is now special-cased to avoid the
2199   recursion limit.  (SF patch #720991 -- many thanks to Gary Herron
2200   and Greg Chapman.)
2202 - New function sys.call_tracing() allows pdb to debug code
2203   recursively.
2205 - New function gc.get_referents(obj) returns a list of objects
2206   directly referenced by obj.  In effect, it exposes what the object's
2207   tp_traverse slot does, and can be helpful when debugging memory
2208   leaks.
2210 - The iconv module has been removed from this release.
2212 - The platform-independent routines for packing floats in IEEE formats
2213   (struct.pack's <f, >f, <d, and >d codes; pickle and cPickle's protocol 1
2214   pickling of floats) ignored that rounding can cause a carry to
2215   propagate.  The worst consequence was that, in rare cases, <f and >f
2216   could produce strings that, when unpacked again, were a factor of 2
2217   away from the original float.  This has been fixed.  See SF bug
2218   #705836.
2220 - New function time.tzset() provides access to the C library tzset()
2221   function, if supported.  (SF patch #675422.)
2223 - Using createfilehandler, deletefilehandler, createtimerhandler functions
2224   on Tkinter.tkinter (_tkinter module) no longer crashes the interpreter.
2225   See SF bug #692416.
2227 - Modified the fcntl.ioctl() function to allow modification of a passed
2228   mutable buffer (for details see the reference documentation).
2230 - Made user requested changes to the itertools module.
2231   Subsumed the times() function into repeat().
2232   Added chain() and cycle().
2234 - The rotor module is now deprecated; the encryption algorithm it uses
2235   is not believed to be secure, and including crypto code with Python
2236   has implications for exporting and importing it in various countries.
2238 - The socket module now always uses the _socketobject wrapper class, even on
2239   platforms which have dup(2).  The makefile() method is built directly
2240   on top of the socket without duplicating the file descriptor, allowing
2241   timeouts to work properly.
2243 Library
2244 -------
2246 - New generator function os.walk() is an easy-to-use alternative to
2247   os.path.walk().  See os module docs for details.  os.path.walk()
2248   isn't deprecated at this time, but may become deprecated in a
2249   future release.
2251 - Added new module "platform" which provides a wide range of tools
2252   for querying platform dependent features.
2254 - netrc now allows ASCII punctuation characters in passwords.
2256 - shelve now supports the optional writeback argument, and exposes
2257   pickle protocol versions.
2259 - Several methods of nntplib.NNTP have grown an optional file argument
2260   which specifies a file where to divert the command's output
2261   (already supported by the body() method).  (SF patch #720468)
2263 - The self-documenting XML server library DocXMLRPCServer was added.
2265 - Support for internationalized domain names has been added through
2266   the 'idna' and 'punycode' encodings, the 'stringprep' module, the
2267   'mkstringprep' tool, and enhancements to the socket and httplib
2268   modules.
2270 - htmlentitydefs has two new dictionaries: name2codepoint maps
2271   HTML entity names to Unicode codepoints (as integers).
2272   codepoint2name is the reverse mapping. See SF patch #722017.
2274 - pdb has a new command, "debug", which lets you step through
2275   arbitrary code from the debugger's (pdb) prompt.
2277 - unittest.failUnlessEqual and its equivalent unittest.assertEqual now
2278   return 'not a == b' rather than 'a != b'.  This gives the desired
2279   result for classes that define __eq__ without defining __ne__.
2281 - sgmllib now supports SGML marked sections, in particular the
2282   MS Office extensions.
2284 - The urllib module now offers support for the iterator protocol.
2285   SF patch 698520 contributed by Brett Cannon.
2287 - New module timeit provides a simple framework for timing the
2288   execution speed of expressions and statements.
2290 - sets.Set objects now support mixed-type __eq__ and __ne__, instead
2291   of raising TypeError.  If x is a Set object and y is a non-Set object,
2292   x == y is False, and x != y is True.  This is akin to the change made
2293   for mixed-type comparisons of datetime objects in 2.3a2; more info
2294   about the rationale is in the NEWS entry for that.  See also SF bug
2295   report <http://www.python.org/sf/693121>.
2297 - On Unix platforms, if os.listdir() is called with a Unicode argument,
2298   it now returns Unicode strings.  (This behavior was added earlier
2299   to the Windows NT/2k/XP version of os.listdir().)
2301 - Distutils: both 'py_modules' and 'packages' keywords can now be specified
2302   in core.setup().  Previously you could supply one or the other, but
2303   not both of them.  (SF patch #695090 from Bernhard Herzog)
2305 - New csv package makes it easy to read/write CSV files.
2307 - Module shlex has been extended to allow posix-like shell parsings,
2308   including a split() function for easy spliting of quoted strings and
2309   commands. An iterator interface was also implemented.
2311 Tools/Demos
2312 -----------
2314 - New script combinerefs.py helps analyze new PYTHONDUMPREFS output.
2315   See the module docstring for details.
2317 Build
2318 -----
2320 - Fix problem building on OSF1 because the compiler only accepted
2321   preprocessor directives that start in column 1.  (SF bug #691793.)
2323 C API
2324 -----
2326 - Added PyGC_Collect(), equivalent to calling gc.collect().
2328 - PyThreadState_GetDict() was changed not to raise an exception or
2329   issue a fatal error when no current thread state is available.  This
2330   makes it possible to print dictionaries when no thread is active.
2332 - LONG_LONG was renamed to PY_LONG_LONG.  Extensions that use this and
2333   need compatibility with previous versions can use this:
2335     #ifndef  PY_LONG_LONG
2336     #define  PY_LONG_LONG  LONG_LONG
2337     #endif
2339 - Added PyObject_SelfIter() to fill the tp_iter slot for the
2340   typical case where the method returns its self argument.
2342 - The extended type structure used for heap types (new-style
2343   classes defined by Python code using a class statement) is now
2344   exported from object.h as PyHeapTypeObject.  (SF patch #696193.)
2346 New platforms
2347 -------------
2349 None this time.
2351 Tests
2352 -----
2354 - test_timeout now requires -u network to be passed to regrtest to run.
2355   See SF bug #692988.
2357 Windows
2358 -------
2360 - os.fsync() now exists on Windows, and calls the Microsoft _commit()
2361   function.
2363 - New function winsound.MessageBeep() wraps the Win32 API
2364   MessageBeep().
2369 - os.listdir() now returns Unicode strings on MacOS X when called with
2370   a Unicode argument. See the general news item under "Library".
2372 - A new method MacOS.WMAvailable() returns true if it is safe to access
2373   the window manager, false otherwise.
2375 - EasyDialogs dialogs are now movable-modal, and if the application is
2376   currently in the background they will ask to be moved to the foreground
2377   before displaying.
2379 - OSA Scripting support has improved a lot, and gensuitemodule.py can now
2380   be used by mere mortals. The documentation is now also more or less
2381   complete.
2383 - The IDE (in a framework build) now includes introductory documentation
2384   in Apple Help Viewer format.
2387 What's New in Python 2.3 alpha 2?
2388 =================================
2390 *Release date: 19-Feb-2003*
2392 Core and builtins
2393 -----------------
2395 - Negative positions returned from PEP 293 error callbacks are now
2396   treated as being relative to the end of the input string. Positions
2397   that are out of bounds raise an IndexError.
2399 - sys.path[0] (the directory from which the script is loaded) is now
2400   turned into an absolute pathname, unless it is the empty string.
2401   (SF patch #664376.)
2403 - Finally fixed the bug in compile() and exec where a string ending
2404   with an indented code block but no newline would raise SyntaxError.
2405   This would have been a four-line change in parsetok.c...  Except
2406   codeop.py depends on this behavior, so a compilation flag had to be
2407   invented that causes the tokenizer to revert to the old behavior;
2408   this required extra changes to 2 .h files, 2 .c files, and 2 .py
2409   files.  (Fixes SF bug #501622.)
2411 - If a new-style class defines neither __new__ nor __init__, its
2412   constructor would ignore all arguments.  This is changed now: the
2413   constructor refuses arguments in this case.  This might break code
2414   that worked under Python 2.2.  The simplest fix is to add a no-op
2415   __init__: ``def __init__(self, *args, **kw): pass``.
2417 - Through a bytecode optimizer bug (and I bet you didn't even know
2418   Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants
2419   with a leading minus sign would come out with the wrong sign.
2420   ("Unsigned" hex/oct constants are those with a face value in the
2421   range sys.maxint+1 through sys.maxint*2+1, inclusive; these have
2422   always been interpreted as negative numbers through sign folding.)
2423   E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would
2424   come out as -4294967295.  This was the case in Python 2.2 through
2425   2.2.2 and 2.3a1, and in Python 2.4 it will once again have that
2426   value, but according to PEP 237 it really needs to be 1 now.  This
2427   will be backported to Python 2.2.3 a well.  (SF #660455)
2429 - int(s, base) sometimes sign-folds hex and oct constants; it only
2430   does this when base is 0 and s.strip() starts with a '0'.  When the
2431   sign is actually folded, as in int("0xffffffff", 0) on a 32-bit
2432   machine, which returns -1, a FutureWarning is now issued; in Python
2433   2.4, this will return 4294967295L, as do int("+0xffffffff", 0) and
2434   int("0xffffffff", 16) right now.  (PEP 347)
2436 - super(X, x): x may now be a proxy for an X instance, i.e.
2437   issubclass(x.__class__, X) but not issubclass(type(x), X).
2439 - isinstance(x, X): if X is a new-style class, this is now equivalent
2440   to issubclass(type(x), X) or issubclass(x.__class__, X).  Previously
2441   only type(x) was tested.  (For classic classes this was already the
2442   case.)
2444 - compile(), eval() and the exec statement now fully support source code
2445   passed as unicode strings.
2447 - int subclasses can be initialized with longs if the value fits in an int.
2448   See SF bug #683467.
2450 - long(string, base) takes time linear in len(string) when base is a power
2451   of 2 now.  It used to take time quadratic in len(string).
2453 - filter returns now Unicode results for Unicode arguments.
2455 - raw_input can now return Unicode objects.
2457 - List objects' sort() method now accepts None as the comparison function.
2458   Passing None is semantically identical to calling sort() with no
2459   arguments.
2461 - Fixed crash when printing a subclass of str and __str__ returned self.
2462   See SF bug #667147.
2464 - Fixed an invalid RuntimeWarning and an undetected error when trying
2465   to convert a long integer into a float which couldn't fit.
2466   See SF bug #676155.
2468 - Function objects now have a __module__ attribute that is bound to
2469   the name of the module in which the function was defined.  This
2470   applies for C functions and methods as well as functions and methods
2471   defined in Python.  This attribute is used by pickle.whichmodule(),
2472   which changes the behavior of whichmodule slightly.  In Python 2.2
2473   whichmodule() returns "__main__" for functions that are not defined
2474   at the top-level of a module (examples: methods, nested functions).
2475   Now whichmodule() will return the proper module name.
2477 Extension modules
2478 -----------------
2480 - operator.isNumberType() now checks that the object has a nb_int or
2481   nb_float slot, rather than simply checking whether it has a non-NULL
2482   tp_as_number pointer.
2484 - The imp module now has ways to acquire and release the "import
2485   lock": imp.acquire_lock() and imp.release_lock().  Note: this is a
2486   reentrant lock, so releasing the lock only truly releases it when
2487   this is the last release_lock() call.  You can check with
2488   imp.lock_held().  (SF bug #580952 and patch #683257.)
2490 - Change to cPickle to match pickle.py (see below and PEP 307).
2492 - Fix some bugs in the parser module.  SF bug #678518.
2494 - Thanks to Scott David Daniels, a subtle bug in how the zlib
2495   extension implemented flush() was fixed.  Scott also rewrote the
2496   zlib test suite using the unittest module.  (SF bug #640230 and
2497   patch #678531.)
2499 - Added an itertools module containing high speed, memory efficient
2500   looping constructs inspired by tools from Haskell and SML.
2502 - The SSL module now handles sockets with a timeout set correctly (SF
2503   patch #675750, fixing SF bug #675552).
2505 - os/posixmodule has grown the sysexits.h constants (EX_OK and friends).
2507 - Fixed broken threadstate swap in readline that could cause fatal
2508   errors when a readline hook was being invoked while a background
2509   thread was active.  (SF bugs #660476 and #513033.)
2511 - fcntl now exposes the strops.h I_* constants.
2513 - Fix a crash on Solaris that occurred when calling close() on
2514   an mmap'ed file which was already closed.  (SF patch #665913)
2516 - Fixed several serious bugs in the zipimport implementation.
2518 - datetime changes:
2520   The date class is now properly subclassable.  (SF bug #720908)
2522   The datetime and datetimetz classes have been collapsed into a single
2523   datetime class, and likewise the time and timetz classes into a single
2524   time class.  Previously, a datetimetz object with tzinfo=None acted
2525   exactly like a datetime object, and similarly for timetz.  This wasn't
2526   enough of a difference to justify distinct classes, and life is simpler
2527   now.
2529   today() and now() now round system timestamps to the closest
2530   microsecond <http://www.python.org/sf/661086>.  This repairs an
2531   irritation most likely seen on Windows systems.
2533   In dt.astimezone(tz), if tz.utcoffset(dt) returns a duration,
2534   ValueError is raised if tz.dst(dt) returns None (2.3a1 treated it
2535   as 0 instead, but a tzinfo subclass wishing to participate in
2536   time zone conversion has to take a stand on whether it supports
2537   DST; if you don't care about DST, then code dst() to return 0 minutes,
2538   meaning that DST is never in effect).
2540   The tzinfo methods utcoffset() and dst() must return a timedelta object
2541   (or None) now.  In 2.3a1 they could also return an int or long, but that
2542   was an unhelpfully redundant leftover from an earlier version wherein
2543   they couldn't return a timedelta.  TOOWTDI.
2545   The example tzinfo class for local time had a bug.  It was replaced
2546   by a later example coded by Guido.
2548   datetime.astimezone(tz) no longer raises an exception when the
2549   input datetime has no UTC equivalent in tz.  For typical "hybrid" time
2550   zones (a single tzinfo subclass modeling both standard and daylight
2551   time), this case can arise one hour per year, at the hour daylight time
2552   ends.  See new docs for details.  In short, the new behavior mimics
2553   the local wall clock's behavior of repeating an hour in local time.
2555   dt.astimezone() can no longer be used to convert between naive and aware
2556   datetime objects.  If you merely want to attach, or remove, a tzinfo
2557   object, without any conversion of date and time members, use
2558   dt.replace(tzinfo=whatever) instead, where "whatever" is None or a
2559   tzinfo subclass instance.
2561   A new method tzinfo.fromutc(dt) can be overridden in tzinfo subclasses
2562   to give complete control over how a UTC time is to be converted to
2563   a local time.  The default astimezone() implementation calls fromutc()
2564   as its last step, so a tzinfo subclass can affect that too by overriding
2565   fromutc().  It's expected that the default fromutc() implementation will
2566   be suitable as-is for "almost all" time zone subclasses, but the
2567   creativity of political time zone fiddling appears unbounded -- fromutc()
2568   allows the highly motivated to emulate any scheme expressible in Python.
2570   datetime.now():  The optional tzinfo argument was undocumented (that's
2571   repaired), and its name was changed to tz ("tzinfo" is overloaded enough
2572   already).  With a tz argument, now(tz) used to return the local date
2573   and time, and attach tz to it, without any conversion of date and time
2574   members.  This was less than useful.  Now now(tz) returns the current
2575   date and time as local time in tz's time zone, akin to ::
2577       tz.fromutc(datetime.utcnow().replace(tzinfo=utc))
2579   where "utc" is an instance of a tzinfo subclass modeling UTC.  Without
2580   a tz argument, now() continues to return the current local date and time,
2581   as a naive datetime object.
2583   datetime.fromtimestamp():  Like datetime.now() above, this had less than
2584   useful behavior when the optional tinzo argument was specified.  See
2585   also SF bug report <http://www.python.org/sf/660872>.
2587   date and datetime comparison:  In order to prevent comparison from
2588   falling back to the default compare-object-addresses strategy, these
2589   raised TypeError whenever they didn't understand the other object type.
2590   They still do, except when the other object has a "timetuple" attribute,
2591   in which case they return NotImplemented now.  This gives other
2592   datetime objects (e.g., mxDateTime) a chance to intercept the
2593   comparison.
2595   date, time, datetime and timedelta comparison:  When the exception
2596   for mixed-type comparisons in the last paragraph doesn't apply, if
2597   the comparison is == then False is returned, and if the comparison is
2598   != then True is returned.  Because dict lookup and the "in" operator
2599   only invoke __eq__, this allows, for example, ::
2601       if some_datetime in some_sequence:
2603   and ::
2605       some_dict[some_timedelta] = whatever
2607   to work as expected, without raising TypeError just because the
2608   sequence is heterogeneous, or the dict has mixed-type keys.  [This
2609   seems like a good idea to implement for all mixed-type comparisons
2610   that don't want to allow falling back to address comparison.]
2612   The constructors building a datetime from a timestamp could raise
2613   ValueError if the platform C localtime()/gmtime() inserted "leap
2614   seconds".  Leap seconds are ignored now.  On such platforms, it's
2615   possible to have timestamps that differ by a second, yet where
2616   datetimes constructed from them are equal.
2618   The pickle format of date, time and datetime objects has changed
2619   completely.  The undocumented pickler and unpickler functions no
2620   longer exist.  The undocumented __setstate__() and __getstate__()
2621   methods no longer exist either.
2623 Library
2624 -------
2626 - The logging module was updated slightly; the WARN level was renamed
2627   to WARNING, and the matching function/method warn() to warning().
2629 - The pickle and cPickle modules were updated with a new pickling
2630   protocol (documented by pickletools.py, see below) and several
2631   extensions to the pickle customization API (__reduce__, __setstate__
2632   etc.).  The copy module now uses more of the pickle customization
2633   API to copy objects that don't implement __copy__ or __deepcopy__.
2634   See PEP 307 for details.
2636 - The distutils "register" command now uses http://www.python.org/pypi
2637   as the default repository.  (See PEP 301.)
2639 - the platform dependent path related variables sep, altsep, extsep,
2640   pathsep, curdir, pardir and defpath are now defined in the platform
2641   dependent path modules (e.g. ntpath.py) rather than os.py, so these
2642   variables are now available via os.path.  They continue to be
2643   available from the os module.
2644   (see <http://www.python.org/sf/680789>).
2646 - array.array was added to the types repr.py knows about (see
2647   <http://www.python.org/sf/680789>).
2649 - The new pickletools.py contains lots of documentation about pickle
2650   internals, and supplies some helpers for working with pickles, such as
2651   a symbolic pickle disassembler.
2653 - Xmlrpclib.py now supports the builtin boolean type.
2655 - py_compile has a new 'doraise' flag and a new PyCompileError
2656   exception.
2658 - SimpleXMLRPCServer now supports CGI through the CGIXMLRPCRequestHandler
2659   class.
2661 - The sets module now raises TypeError in __cmp__, to clarify that
2662   sets are not intended to be three-way-compared; the comparison
2663   operators are overloaded as subset/superset tests.
2665 - Bastion.py and rexec.py are disabled.  These modules are not safe in
2666   Python 2.2. or 2.3.
2668 - realpath is now exported when doing ``from poxixpath import *``.
2669   It is also exported for ntpath, macpath, and os2emxpath.
2670   See SF bug #659228.
2672 - New module tarfile from Lars Gustäbel provides a comprehensive interface
2673   to tar archive files with transparent gzip and bzip2 compression.
2674   See SF patch #651082.
2676 - urlparse can now parse imap:// URLs.  See SF feature request #618024.
2678 - Tkinter.Canvas.scan_dragto() provides an optional parameter to support
2679   the gain value which is passed to Tk.  SF bug# 602259.
2681 - Fix logging.handlers.SysLogHandler protocol when using UNIX domain sockets.
2682   See SF patch #642974.
2684 - The dospath module was deleted.  Use the ntpath module when manipulating
2685   DOS paths from other platforms.
2687 Tools/Demos
2688 -----------
2690 - Two new scripts (db2pickle.py and pickle2db.py) were added to the
2691   Tools/scripts directory to facilitate conversion from the old bsddb module
2692   to the new one.  While the user-visible API of the new module is
2693   compatible with the old one, it's likely that the version of the
2694   underlying database library has changed.  To convert from the old library,
2695   run the db2pickle.py script using the old version of Python to convert it
2696   to a pickle file.  After upgrading Python, run the pickle2db.py script
2697   using the new version of Python to reconstitute your database.  For
2698   example:
2700     % python2.2 db2pickle.py -h some.db > some.pickle
2701     % python2.3 pickle2db.py -h some.db.new < some.pickle
2703   Run the scripts without any args to get a usage message.
2706 Build
2707 -----
2709 - The audio driver tests (test_ossaudiodev.py and
2710   test_linuxaudiodev.py) are no longer run by default.  This is
2711   because they don't always work, depending on your hardware and
2712   software.  To run these tests, you must use an invocation like ::
2714     ./python Lib/test/regrtest.py -u audio test_ossaudiodev
2716 - On systems which build using the configure script, compiler flags which
2717   used to be lumped together using the OPT flag have been split into two
2718   groups, OPT and BASECFLAGS.  OPT is meant to carry just optimization- and
2719   debug-related flags like "-g" and "-O3".  BASECFLAGS is meant to carry
2720   compiler flags that are required to get a clean compile.  On some
2721   platforms (many Linux flavors in particular) BASECFLAGS will be empty by
2722   default.  On others, such as Mac OS X and SCO, it will contain required
2723   flags.  This change allows people building Python to override OPT without
2724   fear of clobbering compiler flags which are required to get a clean build.
2726 - On Darwin/Mac OS X platforms, /sw/lib and /sw/include are added to the
2727   relevant search lists in setup.py.  This allows users building Python to
2728   take advantage of the many packages available from the fink project
2729   <http://fink.sf.net/>.
2731 - A new Makefile target, scriptsinstall, installs a number of useful scripts
2732   from the Tools/scripts directory.
2734 C API
2735 -----
2737 - PyEval_GetFrame() is now declared to return a ``PyFrameObject *``
2738   instead of a plain ``PyObject *``.  (SF patch #686601.)
2740 - PyNumber_Check() now checks that the object has a nb_int or nb_float
2741   slot, rather than simply checking whether it has a non-NULL
2742   tp_as_number pointer.
2744 - A C type that inherits from a base type that defines tp_as_buffer
2745   will now inherit the tp_as_buffer pointer if it doesn't define one.
2746   (SF #681367)
2748 - The PyArg_Parse functions now issue a DeprecationWarning if a float
2749   argument is provided when an integer is specified (this affects the 'b',
2750   'B', 'h', 'H', 'i', and 'l' codes).  Future versions of Python will
2751   raise a TypeError.
2753 Tests
2754 -----
2756 - Several tests weren't being run from regrtest.py (test_timeout.py,
2757   test_tarfile.py, test_netrc.py, test_multifile.py,
2758   test_importhooks.py and test_imp.py).  Now they are.  (Note to
2759   developers: please read Lib/test/README when creating a new test, to
2760   make sure to do it right!  All tests need to use either unittest or
2761   pydoc.)
2763 - Added test_posix.py, a test suite for the posix module.
2765 - Added test_hexoct.py, a test suite for hex/oct constant folding.
2767 Windows
2768 -------
2770 - The timeout code for socket connect() didn't work right; this has
2771   now been fixed.  test_timeout.py should pass (at least most of the
2772   time).
2774 - distutils' msvccompiler class now passes the preprocessor options to
2775   the resource compiler.  See SF patch #669198.
2777 - The bsddb module now ships with Sleepycat's 4.1.25.NC, the latest
2778   release without strong cryptography.
2780 - sys.path[0], if it contains a directory name, is now always an
2781   absolute pathname. (SF patch #664376.)
2783 - The new logging package is now installed by the Windows installer.  It
2784   wasn't in 2.3a1 due to oversight.
2789 - There are new dialogs EasyDialogs.AskFileForOpen, AskFileForSave
2790   and AskFolder. The old macfs.StandardGetFile and friends are deprecated.
2792 - Most of the standard library now uses pathnames or FSRefs in preference
2793   of FSSpecs, and use the underlying Carbon.File and Carbon.Folder modules
2794   in stead of macfs. macfs will probably be deprecated in the future.
2796 - Type Carbon.File.FSCatalogInfo and supporting methods have been implemented.
2797   This also makes macfs.FSSpec.SetDates() work again.
2799 - There is a new module pimp, the package install manager for Python, and
2800   accompanying applet PackageManager. These allow you to easily download
2801   and install pretested extension packages either in source or binary
2802   form. Only in MacPython-OSX.
2804 - Applets are now built with bundlebuilder in MacPython-OSX, which should make
2805   them more robust and also provides a path towards BuildApplication. The
2806   downside of this change is that applets can no longer be run from the
2807   Terminal window, this will hopefully be fixed in the 2.3b1.
2810 What's New in Python 2.3 alpha 1?
2811 =================================
2813 *Release date: 31-Dec-2002*
2815 Type/class unification and new-style classes
2816 --------------------------------------------
2818 - One can now assign to __bases__ and __name__ of new-style classes.
2820 - dict() now accepts keyword arguments so that dict(one=1, two=2)
2821   is the equivalent of {"one": 1, "two": 2}.  Accordingly,
2822   the existing (but undocumented) 'items' keyword argument has
2823   been eliminated.  This means that dict(items=someMapping) now has
2824   a different meaning than before.
2826 - int() now returns a long object if the argument is outside the
2827   integer range, so int("4" * 1000), int(1e200) and int(1L<<1000) will
2828   all return long objects instead of raising an OverflowError.
2830 - Assignment to __class__ is disallowed if either the old or the new
2831   class is a statically allocated type object (such as defined by an
2832   extension module).  This prevents anomalies like 2.__class__ = bool.
2834 - New-style object creation and deallocation have been sped up
2835   significantly; they are now faster than classic instance creation
2836   and deallocation.
2838 - The __slots__ variable can now mention "private" names, and the
2839   right thing will happen (e.g. __slots__ = ["__foo"]).
2841 - The built-ins slice() and buffer() are now callable types.  The
2842   types classobj (formerly class), code, function, instance, and
2843   instancemethod (formerly instance-method), which have no built-in
2844   names but are accessible through the types module, are now also
2845   callable.  The type dict-proxy is renamed to dictproxy.
2847 - Cycles going through the __class__ link of a new-style instance are
2848   now detected by the garbage collector.
2850 - Classes using __slots__ are now properly garbage collected.
2851   [SF bug 519621]
2853 - Tightened the __slots__ rules: a slot name must be a valid Python
2854   identifier.
2856 - The constructor for the module type now requires a name argument and
2857   takes an optional docstring argument.  Previously, this constructor
2858   ignored its arguments.  As a consequence, deriving a class from a
2859   module (not from the module type) is now illegal; previously this
2860   created an unnamed module, just like invoking the module type did.
2861   [SF bug 563060]
2863 - A new type object, 'basestring', is added.  This is a common base type
2864   for 'str' and 'unicode', and can be used instead of
2865   types.StringTypes, e.g. to test whether something is "a string":
2866   isinstance(x, basestring) is True for Unicode and 8-bit strings.  This
2867   is an abstract base class and cannot be instantiated directly.
2869 - Changed new-style class instantiation so that when C's __new__
2870   method returns something that's not a C instance, its __init__ is
2871   not called.  [SF bug #537450]
2873 - Fixed super() to work correctly with class methods.  [SF bug #535444]
2875 - If you try to pickle an instance of a class that has __slots__ but
2876   doesn't define or override __getstate__, a TypeError is now raised.
2877   This is done by adding a bozo __getstate__ to the class that always
2878   raises TypeError.  (Before, this would appear to be pickled, but the
2879   state of the slots would be lost.)
2881 Core and builtins
2882 -----------------
2884 - Import from zipfiles is now supported.  The name of a zipfile placed
2885   on sys.path causes the import statement to look for importable Python
2886   modules (with .py, pyc and .pyo extensions) and packages inside the
2887   zipfile.  The zipfile import follows the specification (though not
2888   the sample implementation) of PEP 273.  The semantics of __path__ are
2889   compatible with those that have been implemented in Jython since
2890   Jython 2.1.
2892 - PEP 302 has been accepted.  Although it was initially developed to
2893   support zipimport, it offers a new, general import hook mechanism.
2894   Several new variables have been added to the sys module:
2895   sys.meta_path, sys.path_hooks, and sys.path_importer_cache; these
2896   make extending the import statement much more convenient than
2897   overriding the __import__ built-in function.  For a description of
2898   these, see PEP 302.
2900 - A frame object's f_lineno attribute can now be written to from a
2901   trace function to change which line will execute next.  A command to
2902   exploit this from pdb has been added.  [SF patch #643835]
2904 - The _codecs support module for codecs.py was turned into a builtin
2905   module to assure that at least the builtin codecs are available
2906   to the Python parser for source code decoding according to PEP 263.
2908 - issubclass now supports a tuple as the second argument, just like
2909   isinstance does. ``issubclass(X, (A, B))`` is equivalent to
2910   ``issubclass(X, A) or issubclass(X, B)``.
2912 - Thanks to Armin Rigo, the last known way to provoke a system crash
2913   by cleverly arranging for a comparison function to mutate a list
2914   during a list.sort() operation has been fixed.  The effect of
2915   attempting to mutate a list, or even to inspect its contents or
2916   length, while a sort is in progress, is not defined by the language.
2917   The C implementation of Python 2.3 attempts to detect mutations,
2918   and raise ValueError if one occurs, but there's no guarantee that
2919   all mutations will be caught, or that any will be caught across
2920   releases or implementations.
2922 - Unicode file name processing for Windows (PEP 277) is implemented.
2923   All platforms now have an os.path.supports_unicode_filenames attribute,
2924   which is set to True on Windows NT/2000/XP, and False elsewhere.
2926 - Codec error handling callbacks (PEP 293) are implemented.
2927   Error handling in unicode.encode or str.decode can now be customized.
2929 - A subtle change to the semantics of the built-in function intern():
2930   interned strings are no longer immortal.  You must keep a reference
2931   to the return value intern() around to get the benefit.
2933 - Use of 'None' as a variable, argument or attribute name now
2934   issues a SyntaxWarning.  In the future, None may become a keyword.
2936 - SET_LINENO is gone.  co_lnotab is now consulted to determine when to
2937   call the trace function.  C code that accessed f_lineno should call
2938   PyCode_Addr2Line instead (f_lineno is still there, but only kept up
2939   to date when there is a trace function set).
2941 - There's a new warning category, FutureWarning.  This is used to warn
2942   about a number of situations where the value or sign of an integer
2943   result will change in Python 2.4 as a result of PEP 237 (integer
2944   unification).  The warnings implement stage B0 mentioned in that
2945   PEP.  The warnings are about the following situations:
2947     - Octal and hex literals without 'L' prefix in the inclusive range
2948       [0x80000000..0xffffffff]; these are currently negative ints, but
2949       in Python 2.4 they will be positive longs with the same bit
2950       pattern.
2952     - Left shifts on integer values that cause the outcome to lose
2953       bits or have a different sign than the left operand.  To be
2954       precise: x<<n where this currently doesn't yield the same value
2955       as long(x)<<n; in Python 2.4, the outcome will be long(x)<<n.
2957     - Conversions from ints to string that show negative values as
2958       unsigned ints in the inclusive range [0x80000000..0xffffffff];
2959       this affects the functions hex() and oct(), and the string
2960       formatting codes %u, %o, %x, and %X.  In Python 2.4, these will
2961       show signed values (e.g. hex(-1) currently returns "0xffffffff";
2962       in Python 2.4 it will return "-0x1").
2964 - The bits manipulated under the cover by sys.setcheckinterval() have
2965   been changed.  Both the check interval and the ticker used to be
2966   per-thread values.  They are now just a pair of global variables.
2967   In addition, the default check interval was boosted from 10 to 100
2968   bytecode instructions.  This may have some effect on systems that
2969   relied on the old default value.  In particular, in multi-threaded
2970   applications which try to be highly responsive, response time will
2971   increase by some (perhaps imperceptible) amount.
2973 - When multiplying very large integers, a version of the so-called
2974   Karatsuba algorithm is now used.  This is most effective if the
2975   inputs have roughly the same size.  If they both have about N digits,
2976   Karatsuba multiplication has O(N**1.58) runtime (the exponent is
2977   log_base_2(3)) instead of the previous O(N**2).  Measured results may
2978   be better or worse than that, depending on platform quirks.  Besides
2979   the O() improvement in raw instruction count, the Karatsuba algorithm
2980   appears to have much better cache behavior on extremely large integers
2981   (starting in the ballpark of a million bits).  Note that this is a
2982   simple implementation, and there's no intent here to compete with,
2983   e.g., GMP.  It gives a very nice speedup when it applies, but a package
2984   devoted to fast large-integer arithmetic should run circles around it.
2986 - u'%c' will now raise a ValueError in case the argument is an
2987   integer outside the valid range of Unicode code point ordinals.
2989 - The tempfile module has been overhauled for enhanced security.  The
2990   mktemp() function is now deprecated; new, safe replacements are
2991   mkstemp() (for files) and mkdtemp() (for directories), and the
2992   higher-level functions NamedTemporaryFile() and TemporaryFile().
2993   Use of some global variables in this module is also deprecated; the
2994   new functions have keyword arguments to provide the same
2995   functionality.  All Lib, Tools and Demo modules that used the unsafe
2996   interfaces have been updated to use the safe replacements.  Thanks
2997   to Zack Weinberg!
2999 - When x is an object whose class implements __mul__ and __rmul__,
3000   1.0*x would correctly invoke __rmul__, but 1*x would erroneously
3001   invoke __mul__.  This was due to the sequence-repeat code in the int
3002   type.  This has been fixed now.
3004 - Previously, "str1 in str2" required str1 to be a string of length 1.
3005   This restriction has been relaxed to allow str1 to be a string of
3006   any length.  Thus "'el' in 'hello world'" returns True now.
3008 - File objects are now their own iterators.  For a file f, iter(f) now
3009   returns f (unless f is closed), and f.next() is similar to
3010   f.readline() when EOF is not reached; however, f.next() uses a
3011   readahead buffer that messes up the file position, so mixing
3012   f.next() and f.readline() (or other methods) doesn't work right.
3013   Calling f.seek() drops the readahead buffer, but other operations
3014   don't.  It so happens that this gives a nice additional speed boost
3015   to "for line in file:"; the xreadlines method and corresponding
3016   module are now obsolete.  Thanks to Oren Tirosh!
3018 - Encoding declarations (PEP 263, phase 1) have been implemented.  A
3019   comment of the form "# -*- coding: <encodingname> -*-" in the first
3020   or second line of a Python source file indicates the encoding.
3022 - list.sort() has a new implementation.  While cross-platform results
3023   may vary, and in data-dependent ways, this is much faster on many
3024   kinds of partially ordered lists than the previous implementation,
3025   and reported to be just as fast on randomly ordered lists on
3026   several major platforms.  This sort is also stable (if A==B and A
3027   precedes B in the list at the start, A precedes B after the sort too),
3028   although the language definition does not guarantee stability.  A
3029   potential drawback is that list.sort() may require temp space of
3030   len(list)*2 bytes (``*4`` on a 64-bit machine).  It's therefore possible
3031   for list.sort() to raise MemoryError now, even if a comparison function
3032   does not.  See <http://www.python.org/sf/587076> for full details.
3034 - All standard iterators now ensure that, once StopIteration has been
3035   raised, all future calls to next() on the same iterator will also
3036   raise StopIteration.  There used to be various counterexamples to
3037   this behavior, which could caused confusion or subtle program
3038   breakage, without any benefits.  (Note that this is still an
3039   iterator's responsibility; the iterator framework does not enforce
3040   this.)
3042 - Ctrl+C handling on Windows has been made more consistent with
3043   other platforms.  KeyboardInterrupt can now reliably be caught,
3044   and Ctrl+C at an interactive prompt no longer terminates the
3045   process under NT/2k/XP (it never did under Win9x).  Ctrl+C will
3046   interrupt time.sleep() in the main thread, and any child processes
3047   created via the popen family (on win2k; we can't make win9x work
3048   reliably) are also interrupted (as generally happens on for Linux/Unix.)
3049   [SF bugs 231273, 439992 and 581232]
3051 - sys.getwindowsversion() has been added on Windows.  This
3052   returns a tuple with information about the version of Windows
3053   currently running.
3055 - Slices and repetitions of buffer objects now consistently return
3056   a string.  Formerly, strings would be returned most of the time,
3057   but a buffer object would be returned when the repetition count
3058   was one or when the slice range was all inclusive.
3060 - Unicode objects in sys.path are no longer ignored but treated
3061   as directory names.
3063 - Fixed string.startswith and string.endswith builtin methods
3064   so they accept negative indices.  [SF bug 493951]
3066 - Fixed a bug with a continue inside a try block and a yield in the
3067   finally clause.  [SF bug 567538]
3069 - Most builtin sequences now support "extended slices", i.e. slices
3070   with a third "stride" parameter.  For example, "hello world"[::-1]
3071   gives "dlrow olleh".
3073 - A new warning PendingDeprecationWarning was added to provide
3074   direction on features which are in the process of being deprecated.
3075   The warning will not be printed by default.  To see the pending
3076   deprecations, use -Walways::PendingDeprecationWarning::
3077   as a command line option or warnings.filterwarnings() in code.
3079 - Deprecated features of xrange objects have been removed as
3080   promised.  The start, stop, and step attributes and the tolist()
3081   method no longer exist.  xrange repetition and slicing have been
3082   removed.
3084 - New builtin function enumerate(x), from PEP 279.  Example:
3085   enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
3086   The argument can be an arbitrary iterable object.
3088 - The assert statement no longer tests __debug__ at runtime.  This means
3089   that assert statements cannot be disabled by assigning a false value
3090   to __debug__.
3092 - A method zfill() was added to str and unicode, that fills a numeric
3093   string to the left with zeros.  For example,
3094   "+123".zfill(6) -> "+00123".
3096 - Complex numbers supported divmod() and the // and % operators, but
3097   these make no sense.  Since this was documented, they're being
3098   deprecated now.
3100 - String and unicode methods lstrip(), rstrip() and strip() now take
3101   an optional argument that specifies the characters to strip.  For
3102   example, "Foo!!!?!?!?".rstrip("?!") -> "Foo".
3104 - There's a new dictionary constructor (a class method of the dict
3105   class), dict.fromkeys(iterable, value=None).  It constructs a
3106   dictionary with keys taken from the iterable and all values set to a
3107   single value.  It can be used for building sets and for removing
3108   duplicates from sequences.
3110 - Added a new dict method pop(key).  This removes and returns the
3111   value corresponding to key.  [SF patch #539949]
3113 - A new built-in type, bool, has been added, as well as built-in
3114   names for its two values, True and False.  Comparisons and sundry
3115   other operations that return a truth value have been changed to
3116   return a bool instead.  Read PEP 285 for an explanation of why this
3117   is backward compatible.
3119 - Fixed two bugs reported as SF #535905: under certain conditions,
3120   deallocating a deeply nested structure could cause a segfault in the
3121   garbage collector, due to interaction with the "trashcan" code;
3122   access to the current frame during destruction of a local variable
3123   could access a pointer to freed memory.
3125 - The optional object allocator ("pymalloc") has been enabled by
3126   default.  The recommended practice for memory allocation and
3127   deallocation has been streamlined.  A header file is included,
3128   Misc/pymemcompat.h, which can be bundled with 3rd party extensions
3129   and lets them use the same API with Python versions from 1.5.2
3130   onwards.
3132 - PyErr_Display will provide file and line information for all exceptions
3133   that have an attribute print_file_and_line, not just SyntaxErrors.
3135 - The UTF-8 codec will now encode and decode Unicode surrogates
3136   correctly and without raising exceptions for unpaired ones.
3138 - Universal newlines (PEP 278) is implemented.  Briefly, using 'U'
3139   instead of 'r' when opening a text file for reading changes the line
3140   ending convention so that any of '\r', '\r\n', and '\n' is
3141   recognized (even mixed in one file); all three are converted to
3142   '\n', the standard Python line end character.
3144 - file.xreadlines() now raises a ValueError if the file is closed:
3145   Previously, an xreadlines object was returned which would raise
3146   a ValueError when the xreadlines.next() method was called.
3148 - sys.exit() inadvertently allowed more than one argument.
3149   An exception will now be raised if more than one argument is used.
3151 - Changed evaluation order of dictionary literals to conform to the
3152   general left to right evaluation order rule. Now {f1(): f2()} will
3153   evaluate f1 first.
3155 - Fixed bug #521782: when a file was in non-blocking mode, file.read()
3156   could silently lose data or wrongly throw an unknown error.
3158 - The sq_repeat, sq_inplace_repeat, sq_concat and sq_inplace_concat
3159   slots are now always tried after trying the corresponding nb_* slots.
3160   This fixes a number of minor bugs (see bug #624807).
3162 - Fix problem with dynamic loading on 64-bit AIX (see bug #639945).
3164 Extension modules
3165 -----------------
3167 - Added three operators to the operator module:
3168     operator.pow(a,b) which is equivalent to:  a**b.
3169     operator.is_(a,b) which is equivalent to:  a is b.
3170     operator.is_not(a,b) which is equivalent to:  a is not b.
3172 - posix.openpty now works on all systems that have /dev/ptmx.
3174 - A module zipimport exists to support importing code from zip
3175   archives.
3177 - The new datetime module supplies classes for manipulating dates and
3178   times.  The basic design came from the Zope "fishbowl process", and
3179   favors practical commercial applications over calendar esoterica.  See
3181       http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
3183 - _tkinter now returns Tcl objects, instead of strings. Objects which
3184   have Python equivalents are converted to Python objects, other objects
3185   are wrapped. This can be configured through the wantobjects method,
3186   or Tkinter.wantobjects.
3188 - The PyBSDDB wrapper around the Sleepycat Berkeley DB library has
3189   been added as the package bsddb.  The traditional bsddb module is
3190   still available in source code, but not built automatically anymore,
3191   and is now named bsddb185.  This supports Berkeley DB versions from
3192   3.0 to 4.1.  For help converting your databases from the old module (which
3193   probably used an obsolete version of Berkeley DB) to the new module, see
3194   the db2pickle.py and pickle2db.py scripts described in the Tools/Demos
3195   section above.
3197 - unicodedata was updated to Unicode 3.2. It supports normalization
3198   and names for Hangul syllables and CJK unified ideographs.
3200 - resource.getrlimit() now returns longs instead of ints.
3202 - readline now dynamically adjusts its input/output stream if
3203   sys.stdin/stdout changes.
3205 - The _tkinter module (and hence Tkinter) has dropped support for
3206   Tcl/Tk 8.0 and 8.1.  Only Tcl/Tk versions 8.2, 8.3 and 8.4 are
3207   supported.
3209 - cPickle.BadPickleGet is now a class.
3211 - The time stamps in os.stat_result are floating point numbers
3212   after stat_float_times has been called.
3214 - If the size passed to mmap.mmap() is larger than the length of the
3215   file on non-Windows platforms, a ValueError is raised. [SF bug 585792]
3217 - The xreadlines module is slated for obsolescence.
3219 - The strptime function in the time module is now always available (a
3220   Python implementation is used when the C library doesn't define it).
3222 - The 'new' module is no longer an extension, but a Python module that
3223   only exists for backwards compatibility.  Its contents are no longer
3224   functions but callable type objects.
3226 - The bsddb.*open functions can now take 'None' as a filename.
3227   This will create a temporary in-memory bsddb that won't be
3228   written to disk.
3230 - posix.getloadavg, posix.lchown, posix.killpg, posix.mknod, and
3231   posix.getpgid have been added where available.
3233 - The locale module now exposes the C library's gettext interface. It
3234   also has a new function getpreferredencoding.
3236 - A security hole ("double free") was found in zlib-1.1.3, a popular
3237   third party compression library used by some Python modules.  The
3238   hole was quickly plugged in zlib-1.1.4, and the Windows build of
3239   Python now ships with zlib-1.1.4.
3241 - pwd, grp, and resource return enhanced tuples now, with symbolic
3242   field names.
3244 - array.array is now a type object. A new format character
3245   'u' indicates Py_UNICODE arrays. For those, .tounicode and
3246   .fromunicode methods are available. Arrays now support __iadd__
3247   and __imul__.
3249 - dl now builds on every system that has dlfcn.h.  Failure in case
3250   of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open
3251   is called.
3253 - The sys module acquired a new attribute, api_version, which evaluates
3254   to the value of the PYTHON_API_VERSION macro with which the
3255   interpreter was compiled.
3257 - Fixed bug #470582: sre module would return a tuple (None, 'a', 'ab')
3258   when applying the regular expression '^((a)c)?(ab)$' on 'ab'. It now
3259   returns (None, None, 'ab'), as expected. Also fixed handling of
3260   lastindex/lastgroup match attributes in similar cases. For example,
3261   when running the expression r'(a)(b)?b' over 'ab', lastindex must be
3262   1, not 2.
3264 - Fixed bug #581080: sre scanner was not checking the buffer limit
3265   before increasing the current pointer. This was creating an infinite
3266   loop in the search function, once the pointer exceeded the buffer
3267   limit.
3269 - The os.fdopen function now enforces a file mode starting with the
3270   letter 'r', 'w' or 'a', otherwise a ValueError is raised. This fixes
3271   bug #623464.
3273 - The linuxaudiodev module is now deprecated; it is being replaced by
3274   ossaudiodev.  The interface has been extended to cover a lot more of
3275   OSS (see www.opensound.com), including most DSP ioctls and the
3276   OSS mixer API.  Documentation forthcoming in 2.3a2.
3278 Library
3279 -------
3281 - imaplib.py now supports SSL (Tino Lange and Piers Lauder).
3283 - Freeze's modulefinder.py has been moved to the standard library;
3284   slightly improved so it will issue less false missing submodule
3285   reports (see sf path #643711 for details).  Documentation will follow
3286   with Python 2.3a2.
3288 - os.path exposes getctime.
3290 - unittest.py now has two additional methods called assertAlmostEqual()
3291   and failIfAlmostEqual().  They implement an approximate comparison
3292   by rounding the difference between the two arguments and comparing
3293   the result to zero.  Approximate comparison is essential for
3294   unit tests of floating point results.
3296 - calendar.py now depends on the new datetime module rather than
3297   the time module.  As a result, the range of allowable dates
3298   has been increased.
3300 - pdb has a new 'j(ump)' command to select the next line to be
3301   executed.
3303 - The distutils created windows installers now can run a
3304   postinstallation script.
3306 - doctest.testmod can now be called without argument, which means to
3307   test the current module.
3309 - When canceling a server that implemented threading with a keyboard
3310   interrupt, the server would shut down but not terminate (waiting on
3311   client threads). A new member variable, daemon_threads, was added to
3312   the ThreadingMixIn class in SocketServer.py to make it explicit that
3313   this behavior needs to be controlled.
3315 - A new module, optparse, provides a fancy alternative to getopt for
3316   command line parsing.  It is a slightly modified version of Greg
3317   Ward's Optik package.
3319 - UserDict.py now defines a DictMixin class which defines all dictionary
3320   methods for classes that already have a minimum mapping interface.
3321   This greatly simplifies writing classes that need to be substitutable
3322   for dictionaries (such as the shelve module).
3324 - shelve.py now subclasses from UserDict.DictMixin.  Now shelve supports
3325   all dictionary methods.  This eases the transition to persistent
3326   storage for scripts originally written with dictionaries in mind.
3328 - shelve.open and the various classes in shelve.py now accept an optional
3329   binary flag, which defaults to False.  If True, the values stored in the
3330   shelf are binary pickles.
3332 - A new package, logging, implements the logging API defined by PEP
3333   282.  The code is written by Vinay Sajip.
3335 - StreamReader, StreamReaderWriter and StreamRecoder in the codecs
3336   modules are iterators now.
3338 - gzip.py now handles files exceeding 2GB.  Files over 4GB also work
3339   now (provided the OS supports it, and Python is configured with large
3340   file support), but in that case the underlying gzip file format can
3341   record only the least-significant 32 bits of the file size, so that
3342   some tools working with gzipped files may report an incorrect file
3343   size.
3345 - xml.sax.saxutils.unescape has been added, to replace entity references
3346   with their entity value.
3348 - Queue.Queue.{put,get} now support an optional timeout argument.
3350 - Various features of Tk 8.4 are exposed in Tkinter.py. The multiple
3351   option of tkFileDialog is exposed as function askopenfile{,name}s.
3353 - Various configure methods of Tkinter have been stream-lined, so that
3354   tag_configure, image_configure, window_configure now return a
3355   dictionary when invoked with no argument.
3357 - Importing the readline module now no longer has the side effect of
3358   calling setlocale(LC_CTYPE, "").  The initial "C" locale, or
3359   whatever locale is explicitly set by the user, is preserved.  If you
3360   want repr() of 8-bit strings in your preferred encoding to preserve
3361   all printable characters of that encoding, you have to add the
3362   following code to your $PYTHONSTARTUP file or to your application's
3363   main():
3365     import locale
3366     locale.setlocale(locale.LC_CTYPE, "")
3368 - shutil.move was added. shutil.copytree now reports errors as an
3369   exception at the end, instead of printing error messages.
3371 - Encoding name normalization was generalized to not only
3372   replace hyphens with underscores, but also all other non-alphanumeric
3373   characters (with the exception of the dot which is used for Python
3374   package names during lookup). The aliases.py mapping was updated
3375   to the new standard.
3377 - mimetypes has two new functions: guess_all_extensions() which
3378   returns a list of all known extensions for a mime type, and
3379   add_type() which adds one mapping between a mime type and
3380   an extension to the database.
3382 - New module: sets, defines the class Set that implements a mutable
3383   set type using the keys of a dict to represent the set.  There's
3384   also a class ImmutableSet which is useful when you need sets of sets
3385   or when you need to use sets as dict keys, and a class BaseSet which
3386   is the base class of the two.
3388 - Added random.sample(population,k) for random sampling without replacement.
3389   Returns a k length list of unique elements chosen from the population.
3391 - random.randrange(-sys.maxint-1, sys.maxint) no longer raises
3392   OverflowError.  That is, it now accepts any combination of 'start'
3393   and 'stop' arguments so long as each is in the range of Python's
3394   bounded integers.
3396 - Thanks to Raymond Hettinger, random.random() now uses a new core
3397   generator.  The Mersenne Twister algorithm is implemented in C,
3398   threadsafe, faster than the previous generator, has an astronomically
3399   large period (2**19937-1), creates random floats to full 53-bit
3400   precision, and may be the most widely tested random number generator
3401   in existence.
3403   The random.jumpahead(n) method has different semantics for the new
3404   generator.  Instead of jumping n steps ahead, it uses n and the
3405   existing state to create a new state.  This means that jumpahead()
3406   continues to support multi-threaded code needing generators of
3407   non-overlapping sequences.  However, it will break code which relies
3408   on jumpahead moving a specific number of steps forward.
3410   The attributes random.whseed and random.__whseed have no meaning for
3411   the new generator.  Code using these attributes should switch to a
3412   new class, random.WichmannHill which is provided for backward
3413   compatibility and to make an alternate generator available.
3415 - New "algorithms" module: heapq, implements a heap queue.  Thanks to
3416   Kevin O'Connor for the code and François Pinard for an entertaining
3417   write-up explaining the theory and practical uses of heaps.
3419 - New encoding for the Palm OS character set: palmos.
3421 - binascii.crc32() and the zipfile module had problems on some 64-bit
3422   platforms.  These have been fixed.  On a platform with 8-byte C longs,
3423   crc32() now returns a signed-extended 4-byte result, so that its value
3424   as a Python int is equal to the value computed a 32-bit platform.
3426 - xml.dom.minidom.toxml and toprettyxml now take an optional encoding
3427   argument.
3429 - Some fixes in the copy module: when an object is copied through its
3430   __reduce__ method, there was no check for a __setstate__ method on
3431   the result [SF patch 565085]; deepcopy should treat instances of
3432   custom metaclasses the same way it treats instances of type 'type'
3433   [SF patch 560794].
3435 - Sockets now support timeout mode.  After s.settimeout(T), where T is
3436   a float expressing seconds, subsequent operations raise an exception
3437   if they cannot be completed within T seconds.  To disable timeout
3438   mode, use s.settimeout(None).  There's also a module function,
3439   socket.setdefaulttimeout(T), which sets the default for all sockets
3440   created henceforth.
3442 - getopt.gnu_getopt was added.  This supports GNU-style option
3443   processing, where options can be mixed with non-option arguments.
3445 - Stop using strings for exceptions.  String objects used for
3446   exceptions are now classes deriving from Exception.  The objects
3447   changed were: Tkinter.TclError, bdb.BdbQuit, macpath.norm_error,
3448   tabnanny.NannyNag, and xdrlib.Error.
3450 - Constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
3451   BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
3452   Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
3453   big endian systems were added to the codecs module. The old names
3454   BOM32_* and BOM64_* were off by a factor of 2.
3456 - Added conversion functions math.degrees() and math.radians().
3458 - math.log() now takes an optional argument:  math.log(x[, base]).
3460 - ftplib.retrlines() now tests for callback is None rather than testing
3461   for False.  Was causing an error when given a callback object which
3462   was callable but also returned len() as zero.  The change may
3463   create new breakage if the caller relied on the undocumented behavior
3464   and called with callback set to [] or some other False value not
3465   identical to None.
3467 - random.gauss() uses a piece of hidden state used by nothing else,
3468   and the .seed() and .whseed() methods failed to reset it.  In other
3469   words, setting the seed didn't completely determine the sequence of
3470   results produced by random.gauss().  It does now.  Programs repeatedly
3471   mixing calls to a seed method with calls to gauss() may see different
3472   results now.
3474 - The pickle.Pickler class grew a clear_memo() method to mimic that
3475   provided by cPickle.Pickler.
3477 - difflib's SequenceMatcher class now does a dynamic analysis of
3478   which elements are so frequent as to constitute noise.  For
3479   comparing files as sequences of lines, this generally works better
3480   than the IS_LINE_JUNK function, and function ndiff's linejunk
3481   argument defaults to None now as a result.  A happy benefit is
3482   that SequenceMatcher may run much faster now when applied
3483   to large files with many duplicate lines (for example, C program
3484   text with lots of repeated "}" and "return NULL;" lines).
3486 - New Text.dump() method in Tkinter module.
3488 - New distutils commands for building packagers were added to
3489   support pkgtool on Solaris and swinstall on HP-UX.
3491 - distutils now has a new abstract binary packager base class
3492   command/bdist_packager, which simplifies writing packagers.
3493   This will hopefully provide the missing bits to encourage
3494   people to submit more packagers, e.g. for Debian, FreeBSD
3495   and other systems.
3497 - The UTF-16, -LE and -BE stream readers now raise a
3498   NotImplementedError for all calls to .readline(). Previously, they
3499   used to just produce garbage or fail with an encoding error --
3500   UTF-16 is a 2-byte encoding and the C lib's line reading APIs don't
3501   work well with these.
3503 - compileall now supports quiet operation.
3505 - The BaseHTTPServer now implements optional HTTP/1.1 persistent
3506   connections.
3508 - socket module: the SSL support was broken out of the main
3509   _socket module C helper and placed into a new _ssl helper
3510   which now gets imported by socket.py if available and working.
3512 - encodings package: added aliases for all supported IANA character
3513   sets
3515 - ftplib: to safeguard the user's privacy, anonymous login will use
3516   "anonymous@" as default password, rather than the real user and host
3517   name.
3519 - webbrowser: tightened up the command passed to os.system() so that
3520   arbitrary shell code can't be executed because a bogus URL was
3521   passed in.
3523 - gettext.translation has an optional fallback argument, and
3524   gettext.find an optional all argument. Translations will now fallback
3525   on a per-message basis. The module supports plural forms, by means
3526   of gettext.[d]ngettext and Translation.[u]ngettext.
3528 - distutils bdist commands now offer a --skip-build option.
3530 - warnings.warn now accepts a Warning instance as first argument.
3532 - The xml.sax.expatreader.ExpatParser class will no longer create
3533   circular references by using itself as the locator that gets passed
3534   to the content handler implementation.  [SF bug #535474]
3536 - The email.Parser.Parser class now properly parses strings regardless
3537   of their line endings, which can be any of \r, \n, or \r\n (CR, LF,
3538   or CRLF).  Also, the Header class's constructor default arguments
3539   has changed slightly so that an explicit maxlinelen value is always
3540   honored, and so unicode conversion error handling can be specified.
3542 - distutils' build_ext command now links C++ extensions with the C++
3543   compiler available in the Makefile or CXX environment variable, if
3544   running under \*nix.
3546 - New module bz2: provides a comprehensive interface for the bz2 compression
3547   library.  It implements a complete file interface, one-shot (de)compression
3548   functions, and types for sequential (de)compression.
3550 - New pdb command 'pp' which is like 'p' except that it pretty-prints
3551   the value of its expression argument.
3553 - Now bdist_rpm distutils command understands a verify_script option in
3554   the config file, including the contents of the referred filename in
3555   the "%verifyscript" section of the rpm spec file.
3557 - Fixed bug #495695: webbrowser module would run graphic browsers in a
3558   unix environment even if DISPLAY was not set. Also, support for
3559   skipstone browser was included.
3561 - Fixed bug #636769: rexec would run unallowed code if subclasses of
3562   strings were used as parameters for certain functions.
3564 Tools/Demos
3565 -----------
3567 - pygettext.py now supports globbing on Windows, and accepts module
3568   names in addition to accepting file names.
3570 - The SGI demos (Demo/sgi) have been removed.  Nobody thought they
3571   were interesting any more.  (The SGI library modules and extensions
3572   are still there; it is believed that at least some of these are
3573   still used and useful.)
3575 - IDLE supports the new encoding declarations (PEP 263); it can also
3576   deal with legacy 8-bit files if they use the locale's encoding. It
3577   allows non-ASCII strings in the interactive shell and executes them
3578   in the locale's encoding.
3580 - freeze.py now produces binaries which can import shared modules,
3581   unlike before when this failed due to missing symbol exports in
3582   the generated binary.
3584 Build
3585 -----
3587 - On Unix, IDLE is now installed automatically.
3589 - The fpectl module is not built by default; it's dangerous or useless
3590   except in the hands of experts.
3592 - The public Python C API will generally be declared using PyAPI_FUNC
3593   and PyAPI_DATA macros, while Python extension module init functions
3594   will be declared with PyMODINIT_FUNC.  DL_EXPORT/DL_IMPORT macros
3595   are deprecated.
3597 - A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or
3598   get into infinite loops, when a new-style class got garbage-collected.
3599   Unfortunately, to avoid this, the way COUNT_ALLOCS works requires
3600   that new-style classes be immortal in COUNT_ALLOCS builds.  Note that
3601   COUNT_ALLOCS is not enabled by default, in either release or debug
3602   builds, and that new-style classes are immortal only in COUNT_ALLOCS
3603   builds.
3605 - Compiling out the cyclic garbage collector is no longer an option.
3606   The old symbol WITH_CYCLE_GC is now ignored, and Python.h arranges
3607   that it's always defined (for the benefit of any extension modules
3608   that may be conditionalizing on it).  A bonus is that any extension
3609   type participating in cyclic gc can choose to participate in the
3610   Py_TRASHCAN mechanism now too; in the absence of cyclic gc, this used
3611   to require editing the core to teach the trashcan mechanism about the
3612   new type.
3614 - According to Annex F of the current C standard,
3616     The Standard C macro HUGE_VAL and its float and long double analogs,
3617     HUGE_VALF and HUGE_VALL, expand to expressions whose values are
3618     positive infinities.
3620   Python only uses the double HUGE_VAL, and only to #define its own symbol
3621   Py_HUGE_VAL.  Some platforms have incorrect definitions for HUGE_VAL.
3622   pyport.h used to try to worm around that, but the workarounds triggered
3623   other bugs on other platforms, so we gave up.  If your platform defines
3624   HUGE_VAL incorrectly, you'll need to #define Py_HUGE_VAL to something
3625   that works on your platform.  The only instance of this I'm sure about
3626   is on an unknown subset of Cray systems, described here:
3628   http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm
3630   Presumably 2.3a1 breaks such systems.  If anyone uses such a system, help!
3632 - The configure option --without-doc-strings can be used to remove the
3633   doc strings from the builtin functions and modules; this reduces the
3634   size of the executable.
3636 - The universal newlines option (PEP 278) is on by default.  On Unix
3637   it can be disabled by passing --without-universal-newlines to the
3638   configure script.  On other platforms, remove
3639   WITH_UNIVERSAL_NEWLINES from pyconfig.h.
3641 - On Unix, a shared libpython2.3.so can be created with --enable-shared.
3643 - All uses of the CACHE_HASH, INTERN_STRINGS, and DONT_SHARE_SHORT_STRINGS
3644   preprocessor symbols were eliminated.  The internal decisions they
3645   controlled stopped being experimental long ago.
3647 - The tools used to build the documentation now work under Cygwin as
3648   well as Unix.
3650 - The bsddb and dbm module builds have been changed to try and avoid version
3651   skew problems and disable linkage with Berkeley DB 1.85 unless the
3652   installer knows what s/he's doing.  See the section on building these
3653   modules in the README file for details.
3655 C API
3656 -----
3658 - PyNumber_Check() now returns true for string and unicode objects.
3659   This is a result of these types having a partially defined
3660   tp_as_number slot.  (This is not a feature, but an indication that
3661   PyNumber_Check() is not very useful to determine numeric behavior.
3662   It may be deprecated.)
3664 - The string object's layout has changed: the pointer member
3665   ob_sinterned has been replaced by an int member ob_sstate.  On some
3666   platforms (e.g. most 64-bit systems) this may change the offset of
3667   the ob_sval member, so as a precaution the API_VERSION has been
3668   incremented.  The apparently unused feature of "indirect interned
3669   strings", supported by the ob_sinterned member, is gone.  Interned
3670   strings are now usually mortal; there is a new API,
3671   PyString_InternImmortal() that creates immortal interned strings.
3672   (The ob_sstate member can only take three values; however, while
3673   making it a char saves a few bytes per string object on average, in
3674   it also slowed things down a bit because ob_sval was no longer
3675   aligned.)
3677 - The Py_InitModule*() functions now accept NULL for the 'methods'
3678   argument.  Modules without global functions are becoming more common
3679   now that factories can be types rather than functions.
3681 - New C API PyUnicode_FromOrdinal() which exposes unichr() at C
3682   level.
3684 - New functions PyErr_SetExcFromWindowsErr() and
3685   PyErr_SetExcFromWindowsErrWithFilename(). Similar to
3686   PyErr_SetFromWindowsErrWithFilename() and
3687   PyErr_SetFromWindowsErr(), but they allow to specify
3688   the exception type to raise. Available on Windows.
3690 - Py_FatalError() is now declared as taking a const char* argument.  It
3691   was previously declared without const.  This should not affect working
3692   code.
3694 - Added new macro PySequence_ITEM(o, i) that directly calls
3695   sq_item without rechecking that o is a sequence and without
3696   adjusting for negative indices.
3698 - PyRange_New() now raises ValueError if the fourth argument is not 1.
3699   This is part of the removal of deprecated features of the xrange
3700   object.
3702 - PyNumber_Coerce() and PyNumber_CoerceEx() now also invoke the type's
3703   coercion if both arguments have the same type but this type has the
3704   CHECKTYPES flag set.  This is to better support proxies.
3706 - The type of tp_free has been changed from "``void (*)(PyObject *)``" to
3707   "``void (*)(void *)``".
3709 - PyObject_Del, PyObject_GC_Del are now functions instead of macros.
3711 - A type can now inherit its metatype from its base type.  Previously,
3712   when PyType_Ready() was called, if ob_type was found to be NULL, it
3713   was always set to &PyType_Type; now it is set to base->ob_type,
3714   where base is tp_base, defaulting to &PyObject_Type.
3716 - PyType_Ready() accidentally did not inherit tp_is_gc; now it does.
3718 - The PyCore_* family of APIs have been removed.
3720 - The "u#" parser marker will now pass through Unicode objects as-is
3721   without going through the buffer API.
3723 - The enumerators of cmp_op have been renamed to use the prefix ``PyCmp_``.
3725 - An old #define of ANY as void has been removed from pyport.h.  This
3726   hasn't been used since Python's pre-ANSI days, and the #define has
3727   been marked as obsolete since then.  SF bug 495548 says it created
3728   conflicts with other packages, so keeping it around wasn't harmless.
3730 - Because Python's magic number scheme broke on January 1st, we decided
3731   to stop Python development.  Thanks for all the fish!
3733 - Some of us don't like fish, so we changed Python's magic number
3734   scheme to a new one. See Python/import.c for details.
3736 New platforms
3737 -------------
3739 - OpenVMS is now supported.
3741 - AtheOS is now supported.
3743 - the EMX runtime environment on OS/2 is now supported.
3745 - GNU/Hurd is now supported.
3747 Tests
3748 -----
3750 - The regrtest.py script's -u option now provides a way to say "allow
3751   all resources except this one."  For example, to allow everything
3752   except bsddb, give the option '-uall,-bsddb'.
3754 Windows
3755 -------
3757 - The Windows distribution now ships with version 4.0.14 of the
3758   Sleepycat Berkeley database library.  This should be a huge
3759   improvement over the previous Berkeley DB 1.85, which had many
3760   bugs.
3761   XXX What are the licensing issues here?
3762   XXX If a user has a database created with a previous version of
3763   XXX     Python, what must they do to convert it?
3764   XXX I'm still not sure how to link this thing (see PCbuild/readme.txt).
3765   XXX The version # is likely to change before 2.3a1.
3767 - The Windows distribution now ships with a Secure Sockets Library (SLL)
3768    module (_ssl.pyd)
3770 - The Windows distribution now ships with Tcl/Tk version 8.4.1 (it
3771   previously shipped with Tcl/Tk 8.3.2).
3773 - When Python is built under a Microsoft compiler, sys.version now
3774   includes the compiler version number (_MSC_VER).  For example, under
3775   MSVC 6, sys.version contains the substring "MSC v.1200 ".  1200 is
3776   the value of _MSC_VER under MSVC 6.
3778 - Sometimes the uninstall executable (UNWISE.EXE) vanishes.  One cause
3779   of that has been fixed in the installer (disabled Wise's "delete in-
3780   use files" uninstall option).
3782 - Fixed a bug in urllib's proxy handling in Windows.  [SF bug #503031]
3784 - The installer now installs Start menu shortcuts under (the local
3785   equivalent of) "All Users" when doing an Admin install.
3787 - file.truncate([newsize]) now works on Windows for all newsize values.
3788   It used to fail if newsize didn't fit in 32 bits, reflecting a
3789   limitation of MS _chsize (which is no longer used).
3791 - os.waitpid() is now implemented for Windows, and can be used to block
3792   until a specified process exits.  This is similar to, but not exactly
3793   the same as, os.waitpid() on POSIX systems.  If you're waiting for
3794   a specific process whose pid was obtained from one of the spawn()
3795   functions, the same Python os.waitpid() code works across platforms.
3796   See the docs for details.  The docs were changed to clarify that
3797   spawn functions return, and waitpid requires, a process handle on
3798   Windows (not the same thing as a Windows process id).
3800 - New tempfile.TemporaryFile implementation for Windows:  this doesn't
3801   need a TemporaryFileWrapper wrapper anymore, and should be immune
3802   to a nasty problem:  before 2.3, if you got a temp file on Windows, it
3803   got wrapped in an object whose close() method first closed the
3804   underlying file, then deleted the file.  This usually worked fine.
3805   However, the spawn family of functions on Windows create (at a low C
3806   level) the same set of open files in the spawned process Q as were
3807   open in the spawning process P.  If a temp file f was among them, then
3808   doing f.close() in P first closed P's C-level file handle on f, but Q's
3809   C-level file handle on f remained open, so the attempt in P to delete f
3810   blew up with a "Permission denied" error (Windows doesn't allow
3811   deleting open files).  This was surprising, subtle, and difficult to
3812   work around.
3814 - The os module now exports all the symbolic constants usable with the
3815   low-level os.open() on Windows:  the new constants in 2.3 are
3816   O_NOINHERIT, O_SHORT_LIVED, O_TEMPORARY, O_RANDOM and O_SEQUENTIAL.
3817   The others were also available in 2.2:  O_APPEND, O_BINARY, O_CREAT,
3818   O_EXCL, O_RDONLY, O_RDWR, O_TEXT, O_TRUNC and O_WRONLY.  Contrary
3819   to Microsoft docs, O_SHORT_LIVED does not seem to imply O_TEMPORARY
3820   (so specify both if you want both; note that neither is useful unless
3821   specified with O_CREAT too).
3824 ----
3826 - Mac/Relnotes is gone, the release notes are now here.
3828 - Python (the OSX-only, unix-based version, not the OS9-compatible CFM
3829   version) now fully supports unicode strings as arguments to various file
3830   system calls, eg. open(), file(), os.stat() and os.listdir().
3832 - The current naming convention for Python on the Macintosh is that MacPython
3833   refers to the unix-based OSX-only version, and MacPython-OS9 refers to the
3834   CFM-based version that runs on both OS9 and OSX.
3836 - All MacPython-OS9 functionality is now available in an OSX unix build,
3837   including the Carbon modules, the IDE, OSA support, etc. A lot of this
3838   will only work correctly in a framework build, though, because you cannot
3839   talk to the window manager unless your application is run from a .app
3840   bundle. There is a command line tool "pythonw" that runs your script
3841   with an interpreter living in such a .app bundle, this interpreter should
3842   be used to run any Python script using the window manager (including
3843   Tkinter or wxPython scripts).
3845 - Most of Mac/Lib has moved to Lib/plat-mac, which is again used both in
3846   MacPython-OSX and MacPython-OS9. The only modules remaining in Mac/Lib
3847   are specifically for MacPython-OS9 (CFM support, preference resources, etc).
3849 - A new utility PythonLauncher will start a Python interpreter when a .py or
3850   .pyw script is double-clicked in the Finder. By default .py scripts are
3851   run with a normal Python interpreter in a Terminal window and .pyw
3852   files are run with a window-aware pythonw interpreter without a Terminal
3853   window, but all this can be customized.
3855 - MacPython-OS9 is now Carbon-only, so it runs on Mac OS 9 or Mac OS X and
3856   possibly on Mac OS 8.6 with the right CarbonLib installed, but not on earlier
3857   releases.
3859 - Many tools such as BuildApplet.py and gensuitemodule.py now support a command
3860   line interface too.
3862 - All the Carbon classes are now PEP253 compliant, meaning that you can
3863   subclass them from Python. Most of the attributes have gone, you should
3864   now use the accessor function call API, which is also what Apple's
3865   documentation uses. Some attributes such as grafport.visRgn are still
3866   available for convenience.
3868 - New Carbon modules File (implementing the APIs in Files.h and Aliases.h)
3869   and Folder (APIs from Folders.h). The old macfs builtin module is
3870   gone, and replaced by a Python wrapper around the new modules.
3872 - Pathname handling should now be fully consistent: MacPython-OSX always uses
3873   unix pathnames and MacPython-OS9 always uses colon-separated Mac pathnames
3874   (also when running on Mac OS X).
3876 - New Carbon modules Help and AH give access to the Carbon Help Manager.
3877   There are hooks in the IDE to allow accessing the Python documentation
3878   (and Apple's Carbon and Cocoa documentation) through the Help Viewer.
3879   See Mac/OSX/README for converting the Python documentation to a
3880   Help Viewer compatible form and installing it.
3882 - OSA support has been redesigned and the generated Python classes now
3883   mirror the inheritance defined by the underlying OSA classes.
3885 - MacPython no longer maps both \r and \n to \n on input for any text file.
3886   This feature has been replaced by universal newline support (PEP278).
3888 - The default encoding for Python sourcefiles in MacPython-OS9 is no longer
3889   mac-roman (or whatever your local Mac encoding was) but "ascii", like on
3890   other platforms. If you really need sourcefiles with Mac characters in them
3891   you can change this in site.py.
3894 What's New in Python 2.2 final?
3895 ===============================
3897 *Release date: 21-Dec-2001*
3899 Type/class unification and new-style classes
3900 --------------------------------------------
3902 - pickle.py, cPickle: allow pickling instances of new-style classes
3903   with a custom metaclass.
3905 Core and builtins
3906 -----------------
3908 - weakref proxy object: when comparing, unwrap both arguments if both
3909   are proxies.
3911 Extension modules
3912 -----------------
3914 - binascii.b2a_base64(): fix a potential buffer overrun when encoding
3915   very short strings.
3917 - cPickle: the obscure "fast" mode was suspected of causing stack
3918   overflows on the Mac.  Hopefully fixed this by setting the recursion
3919   limit much smaller.  If the limit is too low (it only affects
3920   performance), you can change it by defining PY_CPICKLE_FAST_LIMIT
3921   when compiling cPickle.c (or in pyconfig.h).
3923 Library
3924 -------
3926 - dumbdbm.py: fixed a dumb old bug (the file didn't get synched at
3927   close or delete time).
3929 - rfc822.py: fixed a bug where the address '<>' was converted to None
3930   instead of an empty string (also fixes the email.Utils module).
3932 - xmlrpclib.py: version 1.0.0; uses precision for doubles.
3934 - test suite: the pickle and cPickle tests were not executing any code
3935   when run from the standard regression test.
3937 Tools/Demos
3938 -----------
3940 Build
3941 -----
3943 C API
3944 -----
3946 New platforms
3947 -------------
3949 Tests
3950 -----
3952 Windows
3953 -------
3955 - distutils package: fixed broken Windows installers (bdist_wininst).
3957 - tempfile.py: prevent mysterious warnings when TemporaryFileWrapper
3958   instances are deleted at process exit time.
3960 - socket.py: prevent mysterious warnings when socket instances are
3961   deleted at process exit time.
3963 - posixmodule.c: fix a Windows crash with stat() of a filename ending
3964   in backslash.
3967 ----
3969 - The Carbon toolbox modules have been upgraded to Universal Headers
3970   3.4, and experimental CoreGraphics and CarbonEvents modules have
3971   been added.  All only for framework-enabled MacOSX.
3974 What's New in Python 2.2c1?
3975 ===========================
3977 *Release date: 14-Dec-2001*
3979 Type/class unification and new-style classes
3980 --------------------------------------------
3982 - Guido's tutorial introduction to the new type/class features has
3983   been extensively updated.  See
3985       http://www.python.org/2.2/descrintro.html
3987   That remains the primary documentation in this area.
3989 - Fixed a leak: instance variables declared with __slots__ were never
3990   deleted!
3992 - The "delete attribute" method of descriptor objects is called
3993   __delete__, not __del__.  In previous releases, it was mistakenly
3994   called __del__, which created an unfortunate overloading condition
3995   with finalizers.  (The "get attribute" and "set attribute" methods
3996   are still called __get__ and __set__, respectively.)
3998 - Some subtle issues with the super built-in were fixed:
4000   (a) When super itself is subclassed, its __get__ method would still
4001       return an instance of the base class (i.e., of super).
4003   (b) super(C, C()).__class__ would return C rather than super.  This
4004       is confusing.  To fix this, I decided to change the semantics of
4005       super so that it only applies to code attributes, not to data
4006       attributes.  After all, overriding data attributes is not
4007       supported anyway.
4009   (c) The __get__ method didn't check whether the argument was an
4010       instance of the type used in creation of the super instance.
4012 - Previously, hash() of an instance of a subclass of a mutable type
4013   (list or dictionary) would return some value, rather than raising
4014   TypeError.  This has been fixed.  Also, directly calling
4015   dict.__hash__ and list.__hash__ now raises the same TypeError
4016   (previously, these were the same as object.__hash__).
4018 - New-style objects now support deleting their __dict__.  This is for
4019   all intents and purposes equivalent to assigning a brand new empty
4020   dictionary, but saves space if the object is not used further.
4022 Core and builtins
4023 -----------------
4025 - -Qnew now works as documented in PEP 238:  when -Qnew is passed on
4026   the command line, all occurrences of "/" use true division instead
4027   of classic division.  See the PEP for details.  Note that "all"
4028   means all instances in library and 3rd-party modules, as well as in
4029   your own code.  As the PEP says, -Qnew is intended for use only in
4030   educational environments with control over the libraries in use.
4031   Note that test_coercion.py in the standard Python test suite fails
4032   under -Qnew; this is expected, and won't be repaired until true
4033   division becomes the default (in the meantime, test_coercion is
4034   testing the current rules).
4036 - complex() now only allows the first argument to be a string
4037   argument, and raises TypeError if either the second arg is a string
4038   or if the second arg is specified when the first is a string.
4040 Extension modules
4041 -----------------
4043 - gc.get_referents was renamed to gc.get_referrers.
4045 Library
4046 -------
4048 - Functions in the os.spawn() family now release the global interpreter
4049   lock around calling the platform spawn.  They should always have done
4050   this, but did not before 2.2c1.  Multithreaded programs calling
4051   an os.spawn function with P_WAIT will no longer block all Python threads
4052   until the spawned program completes.  It's possible that some programs
4053   relies on blocking, although more likely by accident than by design.
4055 - webbrowser defaults to netscape.exe on OS/2 now.
4057 - Tix.ResizeHandle exposes detach_widget, hide, and show.
4059 - The charset alias windows_1252 has been added.
4061 - types.StringTypes is a tuple containing the defined string types;
4062   usually this will be (str, unicode), but if Python was compiled
4063   without Unicode support it will be just (str,).
4065 - The pulldom and minidom modules were synchronized to PyXML.
4067 Tools/Demos
4068 -----------
4070 - A new script called Tools/scripts/google.py was added, which fires
4071   off a search on Google.
4073 Build
4074 -----
4076 - Note that release builds of Python should arrange to define the
4077   preprocessor symbol NDEBUG on the command line (or equivalent).
4078   In the 2.2 pre-release series we tried to define this by magic in
4079   Python.h instead, but it proved to cause problems for extension
4080   authors.  The Unix, Windows and Mac builds now all define NDEBUG in
4081   release builds via cmdline (or equivalent) instead.  Ports to
4082   other platforms should do likewise.
4084 - It is no longer necessary to use --with-suffix when building on a
4085   case-insensitive file system (such as Mac OS X HFS+). In the build
4086   directory an extension is used, but not in the installed python.
4088 C API
4089 -----
4091 - New function PyDict_MergeFromSeq2() exposes the builtin dict
4092   constructor's logic for updating a dictionary from an iterable object
4093   producing key-value pairs.
4095 - PyArg_ParseTupleAndKeywords() requires that the number of entries in
4096   the keyword list equal the number of argument specifiers.  This
4097   wasn't checked correctly, and PyArg_ParseTupleAndKeywords could even
4098   dump core in some bad cases.  This has been repaired.  As a result,
4099   PyArg_ParseTupleAndKeywords may raise RuntimeError in bad cases that
4100   previously went unchallenged.
4102 New platforms
4103 -------------
4105 Tests
4106 -----
4108 Windows
4109 -------
4112 ----
4114 - In unix-Python on Mac OS X (and darwin) sys.platform is now "darwin",
4115   without any trailing digits.
4117 - Changed logic for finding python home in Mac OS X framework Pythons.
4118   Now sys.executable points to the executable again, in stead of to
4119   the shared library. The latter is used only for locating the python
4120   home.
4123 What's New in Python 2.2b2?
4124 ===========================
4126 *Release date: 16-Nov-2001*
4128 Type/class unification and new-style classes
4129 --------------------------------------------
4131 - Multiple inheritance mixing new-style and classic classes in the
4132   list of base classes is now allowed, so this works now:
4134       class Classic: pass
4135       class Mixed(Classic, object): pass
4137   The MRO (method resolution order) for each base class is respected
4138   according to its kind, but the MRO for the derived class is computed
4139   using new-style MRO rules if any base class is a new-style class.
4140   This needs to be documented.
4142 - The new builtin dictionary() constructor, and dictionary type, have
4143   been renamed to dict.  This reflects a decade of common usage.
4145 - dict() now accepts an iterable object producing 2-sequences.  For
4146   example, dict(d.items()) == d for any dictionary d.  The argument,
4147   and the elements of the argument, can be any iterable objects.
4149 - New-style classes can now have a __del__ method, which is called
4150   when the instance is deleted (just like for classic classes).
4152 - Assignment to object.__dict__ is now possible, for objects that are
4153   instances of new-style classes that have a __dict__ (unless the base
4154   class forbids it).
4156 - Methods of built-in types now properly check for keyword arguments
4157   (formerly these were silently ignored).  The only built-in methods
4158   that take keyword arguments are __call__, __init__ and __new__.
4160 - The socket function has been converted to a type; see below.
4162 Core and builtins
4163 -----------------
4165 - Assignment to __debug__ raises SyntaxError at compile-time.  This
4166   was promised when 2.1c1 was released as "What's New in Python 2.1c1"
4167   (see below) says.
4169 - Clarified the error messages for unsupported operands to an operator
4170   (like 1 + '').
4172 Extension modules
4173 -----------------
4175 - mmap has a new keyword argument, "access", allowing a uniform way for
4176   both Windows and Unix users to create read-only, write-through and
4177   copy-on-write memory mappings.  This was previously possible only on
4178   Unix.  A new keyword argument was required to support this in a
4179   uniform way because the mmap() signatures had diverged across
4180   platforms.  Thanks to Jay T Miller for repairing this!
4182 - By default, the gc.garbage list now contains only those instances in
4183   unreachable cycles that have __del__ methods; in 2.1 it contained all
4184   instances in unreachable cycles.  "Instances" here has been generalized
4185   to include instances of both new-style and old-style classes.
4187 - The socket module defines a new method for socket objects,
4188   sendall().  This is like send() but may make multiple calls to
4189   send() until all data has been sent.  Also, the socket function has
4190   been converted to a subclassable type, like list and tuple (etc.)
4191   before it; socket and SocketType are now the same thing.
4193 - Various bugfixes to the curses module.  There is now a test suite
4194   for the curses module (you have to run it manually).
4196 - binascii.b2a_base64 no longer places an arbitrary restriction of 57
4197   bytes on its input.
4199 Library
4200 -------
4202 - tkFileDialog exposes a Directory class and askdirectory
4203   convenience function.
4205 - Symbolic group names in regular expressions must be unique.  For
4206   example, the regexp r'(?P<abc>)(?P<abc>)' is not allowed, because a
4207   single name can't mean both "group 1" and "group 2" simultaneously.
4208   Python 2.2 detects this error at regexp compilation time;
4209   previously, the error went undetected, and results were
4210   unpredictable.  Also in sre, the pattern.split(), pattern.sub(), and
4211   pattern.subn() methods have been rewritten in C.  Also, an
4212   experimental function/method finditer() has been added, which works
4213   like findall() but returns an iterator.
4215 - Tix exposes more commands through the classes DirSelectBox,
4216   DirSelectDialog, ListNoteBook, Meter, CheckList, and the
4217   methods tix_addbitmapdir, tix_cget, tix_configure, tix_filedialog,
4218   tix_getbitmap, tix_getimage, tix_option_get, and tix_resetoptions.
4220 - Traceback objects are now scanned by cyclic garbage collection, so
4221   cycles created by casual use of sys.exc_info() no longer cause
4222   permanent memory leaks (provided garbage collection is enabled).
4224 - os.extsep -- a new variable needed by the RISCOS support.  It is the
4225   separator used by extensions, and is '.' on all platforms except
4226   RISCOS, where it is '/'.  There is no need to use this variable
4227   unless you have a masochistic desire to port your code to RISCOS.
4229 - mimetypes.py has optional support for non-standard, but commonly
4230   found types.  guess_type() and guess_extension() now accept an
4231   optional 'strict' flag, defaulting to true, which controls whether
4232   recognize non-standard types or not.  A few non-standard types we
4233   know about have been added.  Also, when run as a script, there are
4234   new -l and -e options.
4236 - statcache is now deprecated.
4238 - email.Utils.formatdate() now produces the preferred RFC 2822 style
4239   dates with numeric timezones (it used to produce obsolete dates
4240   hard coded to "GMT" timezone).  An optional 'localtime' flag is
4241   added to produce dates in the local timezone, with daylight savings
4242   time properly taken into account.
4244 - In pickle and cPickle, instead of masking errors in load() by
4245   transforming them into SystemError, we let the original exception
4246   propagate out.  Also, implement support for __safe_for_unpickling__
4247   in pickle, as it already was supported in cPickle.
4249 Tools/Demos
4250 -----------
4252 Build
4253 -----
4255 - The dbm module is built using libdb1 if available.  The bsddb module
4256   is built with libdb3 if available.
4258 - Misc/Makefile.pre.in has been removed by BDFL pronouncement.
4260 C API
4261 -----
4263 - New function PySequence_Fast_GET_SIZE() returns the size of a non-
4264   NULL result from PySequence_Fast(), more quickly than calling
4265   PySequence_Size().
4267 - New argument unpacking function PyArg_UnpackTuple() added.
4269 - New functions PyObject_CallFunctionObjArgs() and
4270   PyObject_CallMethodObjArgs() have been added to make it more
4271   convenient and efficient to call functions and methods from C.
4273 - PyArg_ParseTupleAndKeywords() no longer masks errors, so it's
4274   possible that this will propagate errors it didn't before.
4276 - New function PyObject_CheckReadBuffer(), which returns true if its
4277   argument supports the single-segment readable buffer interface.
4279 New platforms
4280 -------------
4282 - We've finally confirmed that this release builds on HP-UX 11.00,
4283   *with* threads, and passes the test suite.
4285 - Thanks to a series of patches from Michael Muller, Python may build
4286   again under OS/2 Visual Age C++.
4288 - Updated RISCOS port by Dietmar Schwertberger.
4290 Tests
4291 -----
4293 - Added a test script for the curses module.  It isn't run automatically;
4294   regrtest.py must be run with '-u curses' to enable it.
4296 Windows
4297 -------
4300 ----
4302 - PythonScript has been moved to unsupported and is slated to be
4303   removed completely in the next release.
4305 - It should now be possible to build applets that work on both OS9 and
4306   OSX.
4308 - The core is now linked with CoreServices not Carbon; as a side
4309   result, default 8bit encoding on OSX is now ASCII.
4311 - Python should now build on OSX 10.1.1
4314 What's New in Python 2.2b1?
4315 ===========================
4317 *Release date: 19-Oct-2001*
4319 Type/class unification and new-style classes
4320 --------------------------------------------
4322 - New-style classes are now always dynamic (except for built-in and
4323   extension types).  There is no longer a performance penalty, and I
4324   no longer see another reason to keep this baggage around.  One relic
4325   remains: the __dict__ of a new-style class is a read-only proxy; you
4326   must set the class's attribute to modify it.  As a consequence, the
4327   __defined__ attribute of new-style types no longer exists, for lack
4328   of need: there is once again only one __dict__ (although in the
4329   future a __cache__ may be resurrected with a similar function, if I
4330   can prove that it actually speeds things up).
4332 - C.__doc__ now works as expected for new-style classes (in 2.2a4 it
4333   always returned None, even when there was a class docstring).
4335 - doctest now finds and runs docstrings attached to new-style classes,
4336   class methods, static methods, and properties.
4338 Core and builtins
4339 -----------------
4341 - A very subtle syntactical pitfall in list comprehensions was fixed.
4342   For example: [a+b for a in 'abc', for b in 'def'].  The comma in
4343   this example is a mistake.  Previously, this would silently let 'a'
4344   iterate over the singleton tuple ('abc',), yielding ['abcd', 'abce',
4345   'abcf'] rather than the intended ['ad', 'ae', 'af', 'bd', 'be',
4346   'bf', 'cd', 'ce', 'cf'].  Now, this is flagged as a syntax error.
4347   Note that [a for a in <singleton>] is a convoluted way to say
4348   [<singleton>] anyway, so it's not like any expressiveness is lost.
4350 - getattr(obj, name, default) now only catches AttributeError, as
4351   documented, rather than returning the default value for all
4352   exceptions (which could mask bugs in a __getattr__ hook, for
4353   example).
4355 - Weak reference objects are now part of the core and offer a C API.
4356   A bug which could allow a core dump when binary operations involved
4357   proxy reference has been fixed.  weakref.ReferenceError is now a
4358   built-in exception.
4360 - unicode(obj) now behaves more like str(obj), accepting arbitrary
4361   objects, and calling a __unicode__ method if it exists.
4362   unicode(obj, encoding) and unicode(obj, encoding, errors) still
4363   require an 8-bit string or character buffer argument.
4365 - isinstance() now allows any object as the first argument and a
4366   class, a type or something with a __bases__ tuple attribute for the
4367   second argument.  The second argument may also be a tuple of a
4368   class, type, or something with __bases__, in which case isinstance()
4369   will return true if the first argument is an instance of any of the
4370   things contained in the second argument tuple.  E.g.
4372   isinstance(x, (A, B))
4374   returns true if x is an instance of A or B.
4376 Extension modules
4377 -----------------
4379 - thread.start_new_thread() now returns the thread ID (previously None).
4381 - binascii has now two quopri support functions, a2b_qp and b2a_qp.
4383 - readline now supports setting the startup_hook and the
4384   pre_event_hook, and adds the add_history() function.
4386 - os and posix supports chroot(), setgroups() and unsetenv() where
4387   available.  The stat(), fstat(), statvfs() and fstatvfs() functions
4388   now return "pseudo-sequences" -- the various fields can now be
4389   accessed as attributes (e.g. os.stat("/").st_mtime) but for
4390   backwards compatibility they also behave as a fixed-length sequence.
4391   Some platform-specific fields (e.g. st_rdev) are only accessible as
4392   attributes.
4394 - time: localtime(), gmtime() and strptime() now return a
4395   pseudo-sequence similar to the os.stat() return value, with
4396   attributes like tm_year etc.
4398 - Decompression objects in the zlib module now accept an optional
4399   second parameter to decompress() that specifies the maximum amount
4400   of memory to use for the uncompressed data.
4402 - optional SSL support in the socket module now exports OpenSSL
4403   functions RAND_add(), RAND_egd(), and RAND_status().  These calls
4404   are useful on platforms like Solaris where OpenSSL does not
4405   automatically seed its PRNG.  Also, the keyfile and certfile
4406   arguments to socket.ssl() are now optional.
4408 - posixmodule (and by extension, the os module on POSIX platforms) now
4409   exports O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.
4411 Library
4412 -------
4414 - doctest now excludes functions and classes not defined by the module
4415   being tested, thanks to Tim Hochberg.
4417 - HotShot, a new profiler implemented using a C-based callback, has
4418   been added.  This substantially reduces the overhead of profiling,
4419   but it is still quite preliminary.  Support modules and
4420   documentation will be added in upcoming releases (before 2.2 final).
4422 - profile now produces correct output in situations where an exception
4423   raised in Python is cleared by C code (e.g. hasattr()).  This used
4424   to cause wrong output, including spurious claims of recursive
4425   functions and attribution of time spent to the wrong function.
4427   The code and documentation for the derived OldProfile and HotProfile
4428   profiling classes was removed.  The code hasn't worked for years (if
4429   you tried to use them, they raised exceptions).  OldProfile
4430   intended to reproduce the behavior of the profiler Python used more
4431   than 7 years ago, and isn't interesting anymore.  HotProfile intended
4432   to provide a faster profiler (but producing less information), and
4433   that's a worthy goal we intend to meet via a different approach (but
4434   without losing information).
4436 - Profile.calibrate() has a new implementation that should deliver
4437   a much better system-specific calibration constant.  The constant can
4438   now be specified in an instance constructor, or as a Profile class or
4439   instance variable, instead of by editing profile.py's source code.
4440   Calibration must still be done manually (see the docs for the profile
4441   module).
4443   Note that Profile.calibrate() must be overridden by subclasses.
4444   Improving the accuracy required exploiting detailed knowledge of
4445   profiler internals; the earlier method abstracted away the details
4446   and measured a simplified model instead, but consequently computed
4447   a constant too small by a factor of 2 on some modern machines.
4449 - quopri's encode and decode methods take an optional header parameter,
4450   which indicates whether output is intended for the header 'Q'
4451   encoding.
4453 - The SocketServer.ThreadingMixIn class now closes the request after
4454   finish_request() returns.  (Not when it errors out though.)
4456 - The nntplib module's NNTP.body() method has grown a 'file' argument
4457   to allow saving the message body to a file.
4459 - The email package has added a class email.Parser.HeaderParser which
4460   only parses headers and does not recurse into the message's body.
4461   Also, the module/class MIMEAudio has been added for representing
4462   audio data (contributed by Anthony Baxter).
4464 - ftplib should be able to handle files > 2GB.
4466 - ConfigParser.getboolean() now also interprets TRUE, FALSE, YES, NO,
4467   ON, and OFF.
4469 - xml.dom.minidom NodeList objects now support the length attribute
4470   and item() method as required by the DOM specifications.
4472 Tools/Demos
4473 -----------
4475 - Demo/dns was removed.  It no longer serves any purpose; a package
4476   derived from it is now maintained by Anthony Baxter, see
4477   http://PyDNS.SourceForge.net.
4479 - The freeze tool has been made more robust, and two new options have
4480   been added: -X and -E.
4482 Build
4483 -----
4485 - configure will use CXX in LINKCC if CXX is used to build main() and
4486   the system requires to link a C++ main using the C++ compiler.
4488 C API
4489 -----
4491 - The documentation for the tp_compare slot is updated to require that
4492   the return value must be -1, 0, 1; an arbitrary number <0 or >0 is
4493   not correct.  This is not yet enforced but will be enforced in
4494   Python 2.3; even later, we may use -2 to indicate errors and +2 for
4495   "NotImplemented".  Right now, -1 should be used for an error return.
4497 - PyLong_AsLongLong() now accepts int (as well as long) arguments.
4498   Consequently, PyArg_ParseTuple's 'L' code also accepts int (as well
4499   as long) arguments.
4501 - PyThread_start_new_thread() now returns a long int giving the thread
4502   ID, if one can be calculated; it returns -1 for error, 0 if no
4503   thread ID is calculated (this is an incompatible change, but only
4504   the thread module used this API).  This code has only really been
4505   tested on Linux and Windows; other platforms please beware (and
4506   report any bugs or strange behavior).
4508 - PyUnicode_FromEncodedObject() no longer accepts Unicode objects as
4509   input.
4511 New platforms
4512 -------------
4514 Tests
4515 -----
4517 Windows
4518 -------
4520 - Installer:  If you install IDLE, and don't disable file-extension
4521   registration, a new "Edit with IDLE" context (right-click) menu entry
4522   is created for .py and .pyw files.
4524 - The signal module now supports SIGBREAK on Windows, thanks to Steven
4525   Scott.  Note that SIGBREAK is unique to Windows.  The default SIGBREAK
4526   action remains to call Win32 ExitProcess().  This can be changed via
4527   signal.signal().  For example::
4529       # Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
4530       # (SIGINT) behavior.
4531       import signal
4532       signal.signal(signal.SIGBREAK, signal.default_int_handler)
4534       try:
4535           while 1:
4536               pass
4537       except KeyboardInterrupt:
4538           # We get here on Ctrl+C or Ctrl+Break now; if we had not changed
4539           # SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the
4540           # program without the possibility for any Python-level cleanup).
4541           print "Clean exit"
4544 What's New in Python 2.2a4?
4545 ===========================
4547 *Release date: 28-Sep-2001*
4549 Type/class unification and new-style classes
4550 --------------------------------------------
4552 - pydoc and inspect are now aware of new-style classes;
4553   e.g. help(list) at the interactive prompt now shows proper
4554   documentation for all operations on list objects.
4556 - Applications using Jim Fulton's ExtensionClass module can now safely
4557   be used with Python 2.2.  In particular, Zope 2.4.1 now works with
4558   Python 2.2 (as well as with Python 2.1.1).  The Demo/metaclass
4559   examples also work again.  It is hoped that Gtk and Boost also work
4560   with 2.2a4 and beyond.  (If you can confirm this, please write
4561   webmaster@python.org; if there are still problems, please open a bug
4562   report on SourceForge.)
4564 - property() now takes 4 keyword arguments:  fget, fset, fdel and doc.
4565   These map to read-only attributes 'fget', 'fset', 'fdel', and '__doc__'
4566   in the constructed property object.  fget, fset and fdel weren't
4567   discoverable from Python in 2.2a3.  __doc__ is new, and allows to
4568   associate a docstring with a property.
4570 - Comparison overloading is now more completely implemented.  For
4571   example, a str subclass instance can properly be compared to a str
4572   instance, and it can properly overload comparison.  Ditto for most
4573   other built-in object types.
4575 - The repr() of new-style classes has changed; instead of <type
4576   'M.Foo'> a new-style class is now rendered as <class 'M.Foo'>,
4577   *except* for built-in types, which are still rendered as <type
4578   'Foo'> (to avoid upsetting existing code that might parse or
4579   otherwise rely on repr() of certain type objects).
4581 - The repr() of new-style objects is now always <Foo object at XXX>;
4582   previously, it was sometimes <Foo instance at XXX>.
4584 - For new-style classes, what was previously called __getattr__ is now
4585   called __getattribute__.  This method, if defined, is called for
4586   *every* attribute access.  A new __getattr__ hook more similar to the
4587   one in classic classes is defined which is called only if regular
4588   attribute access raises AttributeError; to catch *all* attribute
4589   access, you can use __getattribute__ (for new-style classes).  If
4590   both are defined, __getattribute__ is called first, and if it raises
4591   AttributeError, __getattr__ is called.
4593 - The __class__ attribute of new-style objects can be assigned to.
4594   The new class must have the same C-level object layout as the old
4595   class.
4597 - The builtin file type can be subclassed now.  In the usual pattern,
4598   "file" is the name of the builtin type, and file() is a new builtin
4599   constructor, with the same signature as the builtin open() function.
4600   file() is now the preferred way to open a file.
4602 - Previously, __new__ would only see sequential arguments passed to
4603   the type in a constructor call; __init__ would see both sequential
4604   and keyword arguments.  This made no sense whatsoever any more, so
4605   now both __new__ and __init__ see all arguments.
4607 - Previously, hash() applied to an instance of a subclass of str or
4608   unicode always returned 0.  This has been repaired.
4610 - Previously, an operation on an instance of a subclass of an
4611   immutable type (int, long, float, complex, tuple, str, unicode),
4612   where the subtype didn't override the operation (and so the
4613   operation was handled by the builtin type), could return that
4614   instance instead a value of the base type.  For example, if s was of
4615   a str subclass type, s[:] returned s as-is.  Now it returns a str
4616   with the same value as s.
4618 - Provisional support for pickling new-style objects has been added.
4620 Core
4621 ----
4623 - file.writelines() now accepts any iterable object producing strings.
4625 - PyUnicode_FromEncodedObject() now works very much like
4626   PyObject_Str(obj) in that it tries to use __str__/tp_str
4627   on the object if the object is not a string or buffer. This
4628   makes unicode() behave like str() when applied to non-string/buffer
4629   objects.
4631 - PyFile_WriteObject now passes Unicode objects to the file's write
4632   method. As a result, all file-like objects which may be the target
4633   of a print statement must support Unicode objects, i.e. they must
4634   at least convert them into ASCII strings.
4636 - Thread scheduling on Solaris should be improved; it is no longer
4637   necessary to insert a small sleep at the start of a thread in order
4638   to let other runnable threads be scheduled.
4640 Library
4641 -------
4643 - StringIO.StringIO instances and cStringIO.StringIO instances support
4644   read character buffer compatible objects for their .write() methods.
4645   These objects are converted to strings and then handled as such
4646   by the instances.
4648 - The "email" package has been added.  This is basically a port of the
4649   mimelib package <http://sf.net/projects/mimelib> with API changes
4650   and some implementations updated to use iterators and generators.
4652 - difflib.ndiff() and difflib.Differ.compare() are generators now.  This
4653   restores the ability of Tools/scripts/ndiff.py to start producing output
4654   before the entire comparison is complete.
4656 - StringIO.StringIO instances and cStringIO.StringIO instances support
4657   iteration just like file objects (i.e. their .readline() method is
4658   called for each iteration until it returns an empty string).
4660 - The codecs module has grown four new helper APIs to access
4661   builtin codecs: getencoder(), getdecoder(), getreader(),
4662   getwriter().
4664 - SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer)
4665   simplifies writing XML RPC servers.
4667 - os.path.realpath(): a new function that returns the absolute pathname
4668   after interpretation of symbolic links.  On non-Unix systems, this
4669   is an alias for os.path.abspath().
4671 - operator.indexOf() (PySequence_Index() in the C API) now works with any
4672   iterable object.
4674 - smtplib now supports various authentication and security features of
4675   the SMTP protocol through the new login() and starttls() methods.
4677 - hmac: a new module implementing keyed hashing for message
4678   authentication.
4680 - mimetypes now recognizes more extensions and file types.  At the
4681   same time, some mappings not sanctioned by IANA were removed.
4683 - The "compiler" package has been brought up to date to the state of
4684   Python 2.2 bytecode generation.  It has also been promoted from a
4685   Tool to a standard library package.  (Tools/compiler still exists as
4686   a sample driver.)
4688 Build
4689 -----
4691 - Large file support (LFS) is now automatic when the platform supports
4692   it; no more manual configuration tweaks are needed.  On Linux, at
4693   least, it's possible to have a system whose C library supports large
4694   files but whose kernel doesn't; in this case, large file support is
4695   still enabled but doesn't do you any good unless you upgrade your
4696   kernel or share your Python executable with another system whose
4697   kernel has large file support.
4699 - The configure script now supplies plausible defaults in a
4700   cross-compilation environment.  This doesn't mean that the supplied
4701   values are always correct, or that cross-compilation now works
4702   flawlessly -- but it's a first step (and it shuts up most of
4703   autoconf's warnings about AC_TRY_RUN).
4705 - The Unix build is now a bit less chatty, courtesy of the parser
4706   generator.  The build is completely silent (except for errors) when
4707   using "make -s", thanks to a -q option to setup.py.
4709 C API
4710 -----
4712 - The "structmember" API now supports some new flag bits to deny read
4713   and/or write access to attributes in restricted execution mode.
4715 New platforms
4716 -------------
4718 - Compaq's iPAQ handheld, running the "familiar" Linux distribution
4719   (http://familiar.handhelds.org).
4721 Tests
4722 -----
4724 - The "classic" standard tests, which work by comparing stdout to
4725   an expected-output file under Lib/test/output/, no longer stop at
4726   the first mismatch.  Instead the test is run to completion, and a
4727   variant of ndiff-style comparison is used to report all differences.
4728   This is much easier to understand than the previous style of reporting.
4730 - The unittest-based standard tests now use regrtest's test_main()
4731   convention, instead of running as a side-effect of merely being
4732   imported.  This allows these tests to be run in more natural and
4733   flexible ways as unittests, outside the regrtest framework.
4735 - regrtest.py is much better integrated with unittest and doctest now,
4736   especially in regard to reporting errors.
4738 Windows
4739 -------
4741 - Large file support now also works for files > 4GB, on filesystems
4742   that support it (NTFS under Windows 2000).  See "What's New in
4743   Python 2.2a3" for more detail.
4746 What's New in Python 2.2a3?
4747 ===========================
4749 *Release Date: 07-Sep-2001*
4751 Core
4752 ----
4754 - Conversion of long to float now raises OverflowError if the long is too
4755   big to represent as a C double.
4757 - The 3-argument builtin pow() no longer allows a third non-None argument
4758   if either of the first two arguments is a float, or if both are of
4759   integer types and the second argument is negative (in which latter case
4760   the arguments are converted to float, so this is really the same
4761   restriction).
4763 - The builtin dir() now returns more information, and sometimes much
4764   more, generally naming all attributes of an object, and all attributes
4765   reachable from the object via its class, and from its class's base
4766   classes, and so on from them too.  Example:  in 2.2a2, dir([]) returned
4767   an empty list.  In 2.2a3,
4769   >>> dir([])
4770   ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
4771    '__eq__', '__ge__', '__getattr__', '__getitem__', '__getslice__',
4772    '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__le__',
4773    '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__repr__',
4774    '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__',
4775    'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
4776    'reverse', 'sort']
4778   dir(module) continues to return only the module's attributes, though.
4780 - Overflowing operations on plain ints now return a long int rather
4781   than raising OverflowError.  This is a partial implementation of PEP
4782   237.  You can use -Wdefault::OverflowWarning to enable a warning for
4783   this situation, and -Werror::OverflowWarning to revert to the old
4784   OverflowError exception.
4786 - A new command line option, -Q<arg>, is added to control run-time
4787   warnings for the use of classic division.  (See PEP 238.)  Possible
4788   values are -Qold, -Qwarn, -Qwarnall, and -Qnew.  The default is
4789   -Qold, meaning the / operator has its classic meaning and no
4790   warnings are issued.  Using -Qwarn issues a run-time warning about
4791   all uses of classic division for int and long arguments; -Qwarnall
4792   also warns about classic division for float and complex arguments
4793   (for use with fixdiv.py).
4794   [Note:  the remainder of this item (preserved below) became
4795   obsolete in 2.2c1 -- -Qnew has global effect in 2.2] ::
4797     Using -Qnew is questionable; it turns on new division by default, but
4798     only in the __main__ module.  You can usefully combine -Qwarn or
4799     -Qwarnall and -Qnew: this gives the __main__ module new division, and
4800     warns about classic division everywhere else.
4802 - Many built-in types can now be subclassed.  This applies to int,
4803   long, float, str, unicode, and tuple.  (The types complex, list and
4804   dictionary can also be subclassed; this was introduced earlier.)
4805   Note that restrictions apply when subclassing immutable built-in
4806   types: you can only affect the value of the instance by overloading
4807   __new__.  You can add mutable attributes, and the subclass instances
4808   will have a __dict__ attribute, but you cannot change the "value"
4809   (as implemented by the base class) of an immutable subclass instance
4810   once it is created.
4812 - The dictionary constructor now takes an optional argument, a
4813   mapping-like object, and initializes the dictionary from its
4814   (key, value) pairs.
4816 - A new built-in type, super, has been added.  This facilitates making
4817   "cooperative super calls" in a multiple inheritance setting.  For an
4818   explanation, see http://www.python.org/2.2/descrintro.html#cooperation
4820 - A new built-in type, property, has been added.  This enables the
4821   creation of "properties".  These are attributes implemented by
4822   getter and setter functions (or only one of these for read-only or
4823   write-only attributes), without the need to override __getattr__.
4824   See http://www.python.org/2.2/descrintro.html#property
4826 - The syntax of floating-point and imaginary literals has been
4827   liberalized, to allow leading zeroes.  Examples of literals now
4828   legal that were SyntaxErrors before:
4830       00.0    0e3   0100j   07.5   00000000000000000008.
4832 - An old tokenizer bug allowed floating point literals with an incomplete
4833   exponent, such as 1e and 3.1e-.  Such literals now raise SyntaxError.
4835 Library
4836 -------
4838 - telnetlib includes symbolic names for the options, and support for
4839   setting an option negotiation callback. It also supports processing
4840   of suboptions.
4842 - The new C standard no longer requires that math libraries set errno to
4843   ERANGE on overflow.  For platform libraries that exploit this new
4844   freedom, Python's overflow-checking was wholly broken.  A new overflow-
4845   checking scheme attempts to repair that, but may not be reliable on all
4846   platforms (C doesn't seem to provide anything both useful and portable
4847   in this area anymore).
4849 - Asynchronous timeout actions are available through the new class
4850   threading.Timer.
4852 - math.log and math.log10 now return sensible results for even huge
4853   long arguments.  For example, math.log10(10 ** 10000) ~= 10000.0.
4855 - A new function, imp.lock_held(), returns 1 when the import lock is
4856   currently held.  See the docs for the imp module.
4858 - pickle, cPickle and marshal on 32-bit platforms can now correctly read
4859   dumps containing ints written on platforms where Python ints are 8 bytes.
4860   When read on a box where Python ints are 4 bytes, such values are
4861   converted to Python longs.
4863 - In restricted execution mode (using the rexec module), unmarshalling
4864   code objects is no longer allowed.  This plugs a security hole.
4866 - unittest.TestResult instances no longer store references to tracebacks
4867   generated by test failures. This prevents unexpected dangling references
4868   to objects that should be garbage collected between tests.
4870 Tools
4871 -----
4873 - Tools/scripts/fixdiv.py has been added which can be used to fix
4874   division operators as per PEP 238.
4876 Build
4877 -----
4879 - If you are an adventurous person using Mac OS X you may want to look at
4880   Mac/OSX. There is a Makefile there that will build Python as a real Mac
4881   application, which can be used for experimenting with Carbon or Cocoa.
4882   Discussion of this on pythonmac-sig, please.
4884 C API
4885 -----
4887 - New function PyObject_Dir(obj), like Python __builtin__.dir(obj).
4889 - Note that PyLong_AsDouble can fail!  This has always been true, but no
4890   callers checked for it.  It's more likely to fail now, because overflow
4891   errors are properly detected now.  The proper way to check::
4893       double x = PyLong_AsDouble(some_long_object);
4894       if (x == -1.0 && PyErr_Occurred()) {
4895               /* The conversion failed. */
4896       }
4898 - The GC API has been changed.  Extensions that use the old API will still
4899   compile but will not participate in GC.  To upgrade an extension
4900   module:
4902     - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC
4904     - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and
4905       PyObject_GC_Del to deallocate them
4907     - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini
4908       to PyObject_GC_UnTrack
4910     - remove PyGC_HEAD_SIZE from object size calculations
4912     - remove calls to PyObject_AS_GC and PyObject_FROM_GC
4914 - Two new functions: PyString_FromFormat() and PyString_FromFormatV().
4915   These can be used safely to construct string objects from a
4916   sprintf-style format string (similar to the format string supported
4917   by PyErr_Format()).
4919 New platforms
4920 -------------
4922 - Stephen Hansen contributed patches sufficient to get a clean compile
4923   under Borland C (Windows), but he reports problems running it and ran
4924   out of time to complete the port.  Volunteers?  Expect a MemoryError
4925   when importing the types module; this is probably shallow, and
4926   causing later failures too.
4928 Tests
4929 -----
4931 Windows
4932 -------
4934 - Large file support is now enabled on Win32 platforms as well as on
4935   Win64.  This means that, for example, you can use f.tell() and f.seek()
4936   to manipulate files larger than 2 gigabytes (provided you have enough
4937   disk space, and are using a Windows filesystem that supports large
4938   partitions).  Windows filesystem limits:  FAT has a 2GB (gigabyte)
4939   filesize limit, and large file support makes no difference there.
4940   FAT32's limit is 4GB, and files >= 2GB are easier to use from Python now.
4941   NTFS has no practical limit on file size, and files of any size can be
4942   used from Python now.
4944 - The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC
4945   points to command.com (patch from Brian Quinlan).
4948 What's New in Python 2.2a2?
4949 ===========================
4951 *Release Date: 22-Aug-2001*
4953 Build
4954 -----
4956 - Tim Peters developed a brand new Windows installer using Wise 8.1,
4957   generously donated to us by Wise Solutions.
4959 - configure supports a new option --enable-unicode, with the values
4960   ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode
4961   type and supporting code is completely removed from the interpreter.
4963 - A new configure option --enable-framework builds a Mac OS X framework,
4964   which "make frameworkinstall" will install. This provides a starting
4965   point for more mac-like functionality, join pythonmac-sig@python.org
4966   if you are interested in helping.
4968 - The NeXT platform is no longer supported.
4970 - The 'new' module is now statically linked.
4972 Tools
4973 -----
4975 - The new Tools/scripts/cleanfuture.py can be used to automatically
4976   edit out obsolete future statements from Python source code.  See
4977   the module docstring for details.
4979 Tests
4980 -----
4982 - regrtest.py now knows which tests are expected to be skipped on some
4983   platforms, allowing to give clearer test result output.  regrtest
4984   also has optional --use/-u switch to run normally disabled tests
4985   which require network access or consume significant disk resources.
4987 - Several new tests in the standard test suite, with special thanks to
4988   Nick Mathewson.
4990 Core
4991 ----
4993 - The floor division operator // has been added as outlined in PEP
4994   238.  The / operator still provides classic division (and will until
4995   Python 3.0) unless "from __future__ import division" is included, in
4996   which case the / operator will provide true division.  The operator
4997   module provides truediv() and floordiv() functions.  Augmented
4998   assignment variants are included, as are the equivalent overloadable
4999   methods and C API methods.  See the PEP for a full discussion:
5000   <http://python.sf.net/peps/pep-0238.html>
5002 - Future statements are now effective in simulated interactive shells
5003   (like IDLE).  This should "just work" by magic, but read Michael
5004   Hudson's "Future statements in simulated shells" PEP 264 for full
5005   details:  <http://python.sf.net/peps/pep-0264.html>.
5007 - The type/class unification (PEP 252-253) was integrated into the
5008   trunk and is not so tentative any more (the exact specification of
5009   some features is still tentative).  A lot of work has done on fixing
5010   bugs and adding robustness and features (performance still has to
5011   come a long way).
5013 - Warnings about a mismatch in the Python API during extension import
5014   now use the Python warning framework (which makes it possible to
5015   write filters for these warnings).
5017 - A function's __dict__ (aka func_dict) will now always be a
5018   dictionary.  It used to be possible to delete it or set it to None,
5019   but now both actions raise TypeErrors.  It is still legal to set it
5020   to a dictionary object.  Getting func.__dict__ before any attributes
5021   have been assigned now returns an empty dictionary instead of None.
5023 - A new command line option, -E, was added which disables the use of
5024   all environment variables, or at least those that are specifically
5025   significant to Python.  Usually those have a name starting with
5026   "PYTHON".  This was used to fix a problem where the tests fail if
5027   the user happens to have PYTHONHOME or PYTHONPATH pointing to an
5028   older distribution.
5030 Library
5031 -------
5033 - New class Differ and new functions ndiff() and restore() in difflib.py.
5034   These package the algorithms used by the popular Tools/scripts/ndiff.py,
5035   for programmatic reuse.
5037 - New function xml.sax.saxutils.quoteattr():  Quote an XML attribute
5038   value using the minimal quoting required for the value; more
5039   reliable than using xml.sax.saxutils.escape() for attribute values.
5041 - Readline completion support for cmd.Cmd was added.
5043 - Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings.
5045 - Added function threading.BoundedSemaphore()
5047 - Added Ka-Ping Yee's cgitb.py module.
5049 - The 'new' module now exposes the CO_xxx flags.
5051 - The gc module offers the get_referents function.
5053 New platforms
5054 -------------
5056 C API
5057 -----
5059 - Two new APIs PyOS_snprintf() and PyOS_vsnprintf() were added
5060   which provide a cross-platform implementations for the
5061   relatively new snprintf()/vsnprintf() C lib APIs. In contrast to
5062   the standard sprintf() and vsprintf() C lib APIs, these versions
5063   apply bounds checking on the used buffer which enhances protection
5064   against buffer overruns.
5066 - Unicode APIs now use name mangling to assure that mixing interpreters
5067   and extensions using different Unicode widths is rendered next to
5068   impossible. Trying to import an incompatible Unicode-aware extension
5069   will result in an ImportError.  Unicode extensions writers must make
5070   sure to check the Unicode width compatibility in their extensions by
5071   using at least one of the mangled Unicode APIs in the extension.
5073 - Two new flags METH_NOARGS and METH_O are available in method definition
5074   tables to simplify implementation of methods with no arguments and a
5075   single untyped argument. Calling such methods is more efficient than
5076   calling corresponding METH_VARARGS methods. METH_OLDARGS is now
5077   deprecated.
5079 Windows
5080 -------
5082 - "import module" now compiles module.pyw if it exists and nothing else
5083   relevant is found.
5086 What's New in Python 2.2a1?
5087 ===========================
5089 *Release date: 18-Jul-2001*
5091 Core
5092 ----
5094 - TENTATIVELY, a large amount of code implementing much of what's
5095   described in PEP 252 (Making Types Look More Like Classes) and PEP
5096   253 (Subtyping Built-in Types) was added.  This will be released
5097   with Python 2.2a1.  Documentation will be provided separately
5098   through http://www.python.org/2.2/.  The purpose of releasing this
5099   with Python 2.2a1 is to test backwards compatibility.  It is
5100   possible, though not likely, that a decision is made not to release
5101   this code as part of 2.2 final, if any serious backwards
5102   incompatibilities are found during alpha testing that cannot be
5103   repaired.
5105 - Generators were added; this is a new way to create an iterator (see
5106   below) using what looks like a simple function containing one or
5107   more 'yield' statements.  See PEP 255.  Since this adds a new
5108   keyword to the language, this feature must be enabled by including a
5109   future statement: "from __future__ import generators" (see PEP 236).
5110   Generators will become a standard feature in a future release
5111   (probably 2.3).  Without this future statement, 'yield' remains an
5112   ordinary identifier, but a warning is issued each time it is used.
5113   (These warnings currently don't conform to the warnings framework of
5114   PEP 230; we intend to fix this in 2.2a2.)
5116 - The UTF-16 codec was modified to be more RFC compliant. It will now
5117   only remove BOM characters at the start of the string and then
5118   only if running in native mode (UTF-16-LE and -BE won't remove a
5119   leading BMO character).
5121 - Strings now have a new method .decode() to complement the already
5122   existing .encode() method. These two methods provide direct access
5123   to the corresponding decoders and encoders of the registered codecs.
5125   To enhance the usability of the .encode() method, the special
5126   casing of Unicode object return values was dropped (Unicode objects
5127   were auto-magically converted to string using the default encoding).
5129   Both methods will now return whatever the codec in charge of the
5130   requested encoding returns as object, e.g. Unicode codecs will
5131   return Unicode objects when decoding is requested ("äöü".decode("latin-1")
5132   will return u"äöü"). This enables codec writer to create codecs
5133   for various simple to use conversions.
5135   New codecs were added to demonstrate these new features (the .encode()
5136   and .decode() columns indicate the type of the returned objects):
5138   +---------+-----------+-----------+-----------------------------+
5139   |Name     | .encode() | .decode() | Description                 |
5140   +=========+===========+===========+=============================+
5141   |uu       | string    | string    | UU codec (e.g. for email)   |
5142   +---------+-----------+-----------+-----------------------------+
5143   |base64   | string    | string    | base64 codec                |
5144   +---------+-----------+-----------+-----------------------------+
5145   |quopri   | string    | string    | quoted-printable codec      |
5146   +---------+-----------+-----------+-----------------------------+
5147   |zlib     | string    | string    | zlib compression            |
5148   +---------+-----------+-----------+-----------------------------+
5149   |hex      | string    | string    | 2-byte hex codec            |
5150   +---------+-----------+-----------+-----------------------------+
5151   |rot-13   | string    | Unicode   | ROT-13 Unicode charmap codec|
5152   +---------+-----------+-----------+-----------------------------+
5154 - Some operating systems now support the concept of a default Unicode
5155   encoding for file system operations.  Notably, Windows supports 'mbcs'
5156   as the default.  The Macintosh will also adopt this concept in the medium
5157   term, although the default encoding for that platform will be other than
5158   'mbcs'.
5160   On operating system that support non-ASCII filenames, it is common for
5161   functions that return filenames (such as os.listdir()) to return Python
5162   string objects pre-encoded using the default file system encoding for
5163   the platform.  As this encoding is likely to be different from Python's
5164   default encoding, converting this name to a Unicode object before passing
5165   it back to the Operating System would result in a Unicode error, as Python
5166   would attempt to use its default encoding (generally ASCII) rather than
5167   the default encoding for the file system.
5169   In general, this change simply removes surprises when working with
5170   Unicode and the file system, making these operations work as you expect,
5171   increasing the transparency of Unicode objects in this context.
5172   See [????] for more details, including examples.
5174 - Float (and complex) literals in source code were evaluated to full
5175   precision only when running from a .py file; the same code loaded from a
5176   .pyc (or .pyo) file could suffer numeric differences starting at about the
5177   12th significant decimal digit.  For example, on a machine with IEEE-754
5178   floating arithmetic,
5180       x = 9007199254740992.0
5181       print long(x)
5183   printed 9007199254740992 if run directly from .py, but 9007199254740000
5184   if from a compiled (.pyc or .pyo) file.  This was due to marshal using
5185   str(float) instead of repr(float) when building code objects.  marshal
5186   now uses repr(float) instead, which should reproduce floats to full
5187   machine precision (assuming the platform C float<->string I/O conversion
5188   functions are of good quality).
5190   This may cause floating-point results to change in some cases, and
5191   usually for the better, but may also cause numerically unstable
5192   algorithms to break.
5194 - The implementation of dicts suffers fewer collisions, which has speed
5195   benefits.  However, the order in which dict entries appear in dict.keys(),
5196   dict.values() and dict.items() may differ from previous releases for a
5197   given dict.  Nothing is defined about this order, so no program should
5198   rely on it.  Nevertheless, it's easy to write test cases that rely on the
5199   order by accident, typically because of printing the str() or repr() of a
5200   dict to an "expected results" file.  See Lib/test/test_support.py's new
5201   sortdict(dict) function for a simple way to display a dict in sorted
5202   order.
5204 - Many other small changes to dicts were made, resulting in faster
5205   operation along the most common code paths.
5207 - Dictionary objects now support the "in" operator: "x in dict" means
5208   the same as dict.has_key(x).
5210 - The update() method of dictionaries now accepts generic mapping
5211   objects.  Specifically the argument object must support the .keys()
5212   and __getitem__() methods.  This allows you to say, for example,
5213   {}.update(UserDict())
5215 - Iterators were added; this is a generalized way of providing values
5216   to a for loop.  See PEP 234.  There's a new built-in function iter()
5217   to return an iterator.  There's a new protocol to get the next value
5218   from an iterator using the next() method (in Python) or the
5219   tp_iternext slot (in C).  There's a new protocol to get iterators
5220   using the __iter__() method (in Python) or the tp_iter slot (in C).
5221   Iterating (i.e. a for loop) over a dictionary generates its keys.
5222   Iterating over a file generates its lines.
5224 - The following functions were generalized to work nicely with iterator
5225   arguments::
5227     map(), filter(), reduce(), zip()
5228     list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API)
5229     max(), min()
5230     join() method of strings
5231     extend() method of lists
5232     'x in y' and 'x not in y' (PySequence_Contains() in C API)
5233     operator.countOf() (PySequence_Count() in C API)
5234     right-hand side of assignment statements with multiple targets, such as ::
5235         x, y, z = some_iterable_object_returning_exactly_3_values
5237 - Accessing module attributes is significantly faster (for example,
5238   random.random or os.path or yourPythonModule.yourAttribute).
5240 - Comparing dictionary objects via == and != is faster, and now works even
5241   if the keys and values don't support comparisons other than ==.
5243 - Comparing dictionaries in ways other than == and != is slower:  there were
5244   insecurities in the dict comparison implementation that could cause Python
5245   to crash if the element comparison routines for the dict keys and/or
5246   values mutated the dicts.  Making the code bulletproof slowed it down.
5248 - Collisions in dicts are resolved via a new approach, which can help
5249   dramatically in bad cases.  For example, looking up every key in a dict
5250   d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x
5251   faster now.  Thanks to Christian Tismer for pointing out the cause and
5252   the nature of an effective cure (last December! better late than never).
5254 - repr() is much faster for large containers (dict, list, tuple).
5257 Library
5258 -------
5260 - The constants ascii_letters, ascii_lowercase. and ascii_uppercase
5261   were added to the string module.  These a locale-independent
5262   constants, unlike letters, lowercase, and uppercase.  These are now
5263   use in appropriate locations in the standard library.
5265 - The flags used in dlopen calls can now be configured using
5266   sys.setdlopenflags and queried using sys.getdlopenflags.
5268 - Fredrik Lundh's xmlrpclib is now a standard library module.  This
5269   provides full client-side XML-RPC support.  In addition,
5270   Demo/xmlrpc/ contains two server frameworks (one SocketServer-based,
5271   one asyncore-based).  Thanks to Eric Raymond for the documentation.
5273 - The xrange() object is simplified: it no longer supports slicing,
5274   repetition, comparisons, efficient 'in' checking, the tolist()
5275   method, or the start, stop and step attributes.  See PEP 260.
5277 - A new function fnmatch.filter to filter lists of file names was added.
5279 - calendar.py uses month and day names based on the current locale.
5281 - strop is now *really* obsolete (this was announced before with 1.6),
5282   and issues DeprecationWarning when used (except for the four items
5283   that are still imported into string.py).
5285 - Cookie.py now sorts key+value pairs by key in output strings.
5287 - pprint.isrecursive(object) didn't correctly identify recursive objects.
5288   Now it does.
5290 - pprint functions now much faster for large containers (tuple, list, dict).
5292 - New 'q' and 'Q' format codes in the struct module, corresponding to C
5293   types "long long" and "unsigned long long" (on Windows, __int64).  In
5294   native mode, these can be used only when the platform C compiler supports
5295   these types (when HAVE_LONG_LONG is #define'd by the Python config
5296   process), and then they inherit the sizes and alignments of the C types.
5297   In standard mode, 'q' and 'Q' are supported on all platforms, and are
5298   8-byte integral types.
5300 - The site module installs a new built-in function 'help' that invokes
5301   pydoc.help.  It must be invoked as 'help()'; when invoked as 'help',
5302   it displays a message reminding the user to use 'help()' or
5303   'help(object)'.
5305 Tests
5306 -----
5308 - New test_mutants.py runs dict comparisons where the key and value
5309   comparison operators mutate the dicts randomly during comparison.  This
5310   rapidly causes Python to crash under earlier releases (not for the faint
5311   of heart:  it can also cause Win9x to freeze or reboot!).
5313 - New test_pprint.py verifies that pprint.isrecursive() and
5314   pprint.isreadable() return sensible results.  Also verifies that simple
5315   cases produce correct output.
5317 C API
5318 -----
5320 - Removed the unused last_is_sticky argument from the internal
5321   _PyTuple_Resize().  If this affects you, you were cheating.
5323 ----
5325 **(For information about older versions, consult the HISTORY file.)**