This file lists people who have contributed in some way to the Python
documentation. It is probably not complete -- if you feel that you or
anyone else should be on this list, please let us know (send email to
-python-docs@python.org), and we'll be glad to correct the problem.
+docs@python.org), and we'll be glad to correct the problem.
It is only with the input and contributions of the Python community
that Python has such wonderful documentation -- Thank You!
# The formatted output is located in subdirectories. For PDF and
# PostScript, look in the paper-$(PAPER)/ directory. For HTML, look in
# the html/ directory. If you want to fix the GNU info process, look
-# in the info/ directory; please send patches to python-docs@python.org.
+# in the info/ directory; please send patches to docs@python.org.
# This Makefile only includes information on how to perform builds; for
# dependency information, see Makefile.deps.
# This is the *documentation* release, and is used to construct the file
# names of the downloadable tarballs.
-RELEASE=2.3
+RELEASE=2.3+
PYTHON= python
DVIPS= dvips -N0 -t $(PAPER)
Other suggestions or questions should be sent to the Python
Documentation Team:
- python-docs@python.org
+ docs@python.org
Thanks!
-What happened to the Macintosh chapter of the Python Library Reference?
------------------------------------------------------------------------
-
-The directory mac/ contains the LaTeX sources for the "Macintosh
-Library Modules" manual; this is built using the standard build
-targets, so check the proper output directory for your chosen format
-and paper size.
-
-
What tools do I need?
---------------------
interested parties.
Comments and bug reports on the standard documents should be sent
- to \email{python-docs@python.org}. This may include comments
+ to \email{docs@python.org}. This may include comments
about formatting, content, grammatical and spelling errors, or
this document. You can also send comments on this document
directly to the author at \email{fdrake@acm.org}.
<h2>Comments and Questions</h2>
<p> General comments and questions regarding this document should
- be sent by email to <a href="mailto:python-docs@python.org"
- >python-docs@python.org</a>. If you find specific errors in
+ be sent by email to <a href="mailto:docs@python.org"
+ >docs@python.org</a>. If you find specific errors in
this document, please report the bug at the <a
href="http://sourceforge.net/bugs/?group_id=5470">Python Bug
Tracker</a> at <a href="http://sourceforge.net/">SourceForge</a>.
<h2>Comments and Questions</h2>
<p> General comments and questions regarding this document should
- be sent by email to <a href="mailto:python-docs@python.org"
- >python-docs@python.org</a>. If you find specific errors in
+ be sent by email to <a href="mailto:docs@python.org"
+ >docs@python.org</a>. If you find specific errors in
this document, either in the content or the presentation, please
report the bug at the <a
href="http://sourceforge.net/bugs/?group_id=5470">Python Bug
conversion to the info format.
Questions and comments on these documents should be directed to
-python-docs@python.org.
+docs@python.org.
Here's a quick listing of modules that are currently undocumented, but
that should be documented. Feel free to contribute documentation for
-them! (Send via email to \email{python-docs@python.org}.)
+them! (Send via email to \email{docs@python.org}.)
The idea and original contents for this chapter were taken
from a posting by Fredrik Lundh; the specific contents of this chapter
\strong{Warning!} These modules are not yet documented. If you
wish to contribute documentation of any of these modules, please get
-in touch with \email{python-docs@python.org}.
+in touch with \email{docs@python.org}.
\localmoduletable
The modules in this chapter are poorly documented (if at all). If you
wish to contribute documentation of any of these modules, please get in
touch with
-\ulink{\email{python-docs@python.org}}{mailto:python-docs@python.org}.
+\ulink{\email{docs@python.org}}{mailto:docs@python.org}.
\localmoduletable
This message is being sent in response to your message to the Python
-documentation maintainers (python-docs@python.org). Your message will
+documentation maintainers (docs@python.org). Your message will
be handled by a human, but this message serves to answer the most
common questions sent to this address.
Start by reading the documentation for XXX. If the
documentation doesn't make sense or seems incomplete, please
- file a specific bug report to python-docs@python.org (the
+ file a specific bug report to docs@python.org (the
address you sent your question to). Otherwise, you probably
sent your question to the wrong place (which does not preclude
an answer, if I know it).
http://www.jython.org/
Chances are very good that the person who answers questions
- posted to python-docs@python.org doesn't use Jython very often,
+ posted to docs@python.org doesn't use Jython very often,
and won't be able to give you a meaningful answer beyond "Look
at the Jython website." Sorry, I don't have *all* the answers!
8. I found a bug in the documentation, who should I tell?
If you're reading this, you've found the right address! Send
- all documentation bug reports to python-docs@python.org. If
+ all documentation bug reports to docs@python.org. If
you prefer to use a Web-based reporting mechanism, you can use
the bug database at http://www.python.org/python-bugs/.
Fred L. Drake, Jr., editor}
\authoraddress{
\strong{PythonLabs}\\
- Email: \email{python-docs@python.org}
+ Email: \email{docs@python.org}
}
-\date{July 29, 2003} % XXX update before final release!
+\date{\today} % XXX update before final release!
\release{2.3} % software release, not documentation
\setreleaseinfo{} % empty for final release
\setshortversion{2.3} % major.minor only for software
If you have any questions, comments, or suggestions regarding these
-documents, please send them via email to python-docs@python.org.
+documents, please send them via email to docs@python.org.
"""
def count_pages(filename):
# Index:
# Perhaps double-check that every tag mentioned in the index is found
# in the text.
-# Python: email to python-docs@python.org, to get their feedback.
+# Python: email to docs@python.org, to get their feedback.
# Compare to existing lib/ Info manual
# Write the hooks into info-look; replace pyliblookup1-1.tar.gz.
# Postpass to remove extra quotation marks around typography already in
documentation. This list is probably not complete -- if you feel that
you or anyone else should be on this list, please let us know (send
email to <a
-href="mailto:python-docs@python.org">python-docs@python.org</a>), and
+href="mailto:docs@python.org">docs@python.org</a>), and
we will be glad to correct the problem.</p>
<p>It is only with the input and contributions of the Python community
cd Doc/<document-dir>
make -f ../tools/sgmlconv/make.rules TOOLSDIR=../tools
-Please send comments and bug reports to python-docs@python.org.
+Please send comments and bug reports to docs@python.org.
What do the tools do?
def __getitem__(self, item):
if isinstance(item, slice):
indices = item.indices(len(self))
- return FakeSeq([self.calc_item(i) in range(*indices)])
+ return FakeSeq([self.calc_item(i) for i in range(*indices)])
else:
return self.calc_item(i)
\end{verbatim}
The author would like to thank the following people for offering
suggestions, corrections and assistance with various drafts of this
article: Jeff Bauer, Simon Brunning, Brett Cannon, Michael Chermside,
-Andrew Dalke, Scott David Daniels, Fred~L. Drake, Jr., Kelly Gerber,
+Andrew Dalke, Scott David Daniels, Fred~L. Drake, Jr., David Fraser,
+Kelly Gerber,
Raymond Hettinger, Michael Hudson, Chris Lambert, Detlef Lannert,
Martin von~L\"owis, Andrew MacIntyre, Lalo Martins, Chad Netzer,
Gustavo Niemeyer, Neal Norwitz, Hans Nowak, Chris Reedy, Francesco
class TestVersion(BaseTest):
def test_version(self):
oldargv = sys.argv[0]
- sys.argv[0] = "./foo/bar"
+ sys.argv[0] = os.path.join(os.curdir, "foo", "bar")
self.parser = OptionParser(usage=SUPPRESS_USAGE, version="%prog 0.1")
self.assertStdoutEquals(["--version"], "bar 0.1\n")
sys.argv[0] = oldargv
def assertHelpEquals(self, expected_output):
# This trick is used to make optparse believe bar.py is being executed.
oldargv = sys.argv[0]
- sys.argv[0] = "./foo/bar.py"
+ sys.argv[0] = os.path.join(os.curdir, "foo", "bar.py")
self.assertStdoutEquals(["-h"], expected_output)
self.assertRaises(TypeError, posixpath.samestat)
def test_ismount(self):
+ if os.name in ('mac',):
+ return
self.assertIs(posixpath.ismount("/"), True)
self.assertRaises(TypeError, posixpath.ismount)
import time
import locale
import re
+import sys
from test import test_support
import _strptime
strf_output = time.strftime("%Z") #UTC does not have a timezone
strp_output = _strptime.strptime(strf_output, "%Z")
locale_time = _strptime.LocaleTime()
+ if sys.platform == 'mac':
+ # Timezones don't really work on MacOS9
+ return
if time.tzname[0] != time.tzname[1] or not time.daylight:
self.failUnless(strp_output[8] == time_tuple[8],
"timezone check failed; '%s' -> %s != %s" %
# Make sure that a local file just gets its own location returned and
# a headers value is returned.
result = urllib.urlretrieve("file:%s" % test_support.TESTFN)
- self.assertEqual(result[0], test_support.TESTFN)
+ self.assertEqual(os.path.normpath(result[0]),
+ os.path.normpath(test_support.TESTFN))
self.assert_(isinstance(result[1], mimetools.Message),
"did not get a mimetools.Message instance as second "
"returned value")
uu.decode(f)
f.close()
- f = open(self.tmpout, 'r')
+ f = open(self.tmpout, 'rU')
s = f.read()
f.close()
self.assertEqual(s, plaintext)
(':Tools:framer', '')
(':Tools:freeze', '')
(':Tools:i18n', '')
-(':Tools:idle', '')
(':Tools:modulator', None)
(':Tools:pynche', '')
(':Tools:scripts', '')
(':pystone.py', None)
(':setup.py', None)
(':site-packages', None)
+(':Tools:unicode:mkstringprep.py', '')
+(':Objects:dictnotes.txt', None)
(':Mac:mwerks:malloc', None)
(':Mac:mwerks:mwerks_carbonNOGUSI_config.h', None)
(':Mac:mwerks:mwerks_nscarbon_config.h', '')
+(':Mac:mwerks:mwerks_pyexpat_config.h', None)
(':Mac:mwerks:mwerks_shcarbon_config.h', '')
(':Mac:mwerks:mwerks_smcarbon_config.h', '')
(':Mac:mwerks:mwerks_thrcarbonsm_config.h', None)
(':Modules:_curses_panel.c', None)
(':Modules:_cursesmodule.c', None)
(':Modules:_hotshot.c', None)
+(':Modules:_iconv_codec.c', None)
(':Modules:_localemodule.c', None)
(':Modules:_randommodule.c', None)
(':Modules:_sre.c', None)
(':Modules:grpmodule.c', None)
(':Modules:imageop.c', None)
(':Modules:imgfile.c', None)
+(':Modules:itertoolsmodule.c', None)
(':Modules:ld_so_aix', None)
(':Modules:ld_so_beos', None)
(':Modules:license.terms', None)
(':readmefiles', None)
(':setup.py', None)
(':site-packages', None)
-(':Modules:itertoolsmodule.c', None)
-(':Modules:_iconv_codec.c', None)
-(':Mac:mwerks:mwerks_pyexpat_config.h', None)
+(':Tools:unicode:mkstringprep.py', '')
+(':Modules:_csv.c', None)
+(':Mac:Build:_csv.carbon.mcp.xml', None)
+(':Mac:Build:_csv.carbon.mcp.exp', None)
+(':Mac:Build:_csv.carbon.mcp', None)
(':Tools:bgen', '')
(':Tools:compiler', '')
(':Tools:faqwiz', '')
+(':Tools:framer', '')
(':Tools:freeze', '')
(':Tools:i18n', '')
-(':Tools:idle', '')
(':Tools:modulator', '')
(':Tools:pynche', '')
(':Tools:scripts', '')
(':pystone.py', None)
(':setup.py', None)
(':site-packages', None)
-(':Tools:framer', '')
+(':Mac:Distributions:.DS_Store', None)
+(':Mac:Unsupported:unshar.py', '')
+(':Tools:unicode:mkstringprep.py', '')
-#define BUILD 154
+#define BUILD 155
# TODO: Parameterize the versions, builddirs, etc...
# Script configs
-PYVERSION=2.3rc1plus
+PYVERSION=2.3
PYVER=2.3
-BUILDNUM=8
+BUILDNUM=1
DOCLEANUP=no
PROGDIR="`dirname \"$0\"`"
# ...and then make a disk image containing the package.
mv MacPython-OSX.pkg $DMGDIR/root
-cp $RESOURCEDIR/Welcome.txt $DMGDIR/root/README.txt
+cp $RESOURCEDIR/ReadMe.txt $DMGDIR/root/ReadMe.txt
$PROGDIR/makedmg $DMGDIR/root $DMGDIR MacPython-OSX-$PYVERSION-$BUILDNUM
echo Moving $DMGDIR/MacPython-OSX-$PYVERSION-$BUILDNUM to $DESTDIR
--- /dev/null
+This package will install MacPython 2.3 for Mac OS X
+10.2. Installation on the Panther preview may work, on
+10.1 or earlier will not work.
+
+Installation requires approximately 20 MB of disk
+space, ignore the message that it will take zero bytes.
+
+You must install onto your current boot disk, even
+though the installer does not enforce this, otherwise
+things will not work.
+
+MacPython consists of the Python programming language
+interpreter, plus a set of programs to allow easy
+access to it for Mac users (an integrated development
+environment, a Python extension package manager), plus
+a set of pre-built extension modules that open up
+specific Macintosh technologies to Python programs
+(Carbon, AppleScript, Quicktime, more).
+
+The installer puts the applications in MacPython-2.3 in
+your Applications folder, command-line tools in
+/usr/local/bin and the underlying machinery in
+/Library/Frameworks/Python.framework.
+
+The PythonIDE application has a Help command that gets
+you started quickly with MacPython and contains
+references to other documentation.
+
+More information on MacPython can be found at
+http://www.cwi.nl/~jack/macpython.html, more
+information on Python in general at
+http://www.python.org.
--- /dev/null
+{\rtf1\mac\ansicpg10000\cocoartf102
+{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;}
+{\colortbl;\red255\green255\blue255;}
+\paperw11900\paperh16840\margl1440\margr1440\vieww9920\viewh10660\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
+
+\f0\fs24 \cf0 This package will install
+\f1\b MacPython 2.3
+\f0\b0 for
+\f1\b Mac OS X 10.2
+\f0\b0 . Installation on the Panther preview may work, on 10.1 or earlier will not work.\
+\
+MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users (an integrated development environment, a Python extension package manager), plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs (Carbon, AppleScript, Quicktime, more).\
+\
+See the ReadMe file for more information.}
\ No newline at end of file
+++ /dev/null
-This package will install MacPython 2.3rc1+ for Mac OS X 10.2. Installation
-on the Panther preview may work, on 10.1 or earlier will not work.
-
-Installation requires approximately 20 MB of disk space, ignore the
-message that it will take zero bytes. You must install onto your current
-boot disk, even though the installer does not enforce this, otherwise
-things will not work.
-
-MacPython consists of the Python programming language interpreter,
-plus a set of programs to allow easy access to it for Mac users (an
-integrated development environment, a Python extension package manager),
-plus a set of pre-built extension modules that open up specific
-Macintosh technologies to Python programs (Carbon, AppleScript,
-Quicktime, more).
-
-The installer puts the applications in MacPython-2.3 in your
-Applications folder, command-line tools in /usr/local/bin and the
-underlying machinery in /Library/Frameworks/Python.framework.
-
-The PythonIDE application has a Help command that gets you started
-quickly with MacPython and contains references to other documentation.
-
-More information on MacPython can be found at
-http://www.cwi.nl/~jack/macpython.html, more information on Python in
-general at http://www.python.org.
-How to install MacPython-OS9 2.3a2 on your Macintosh
-----------------------------------------------------
+How to install MacPython-OS9 2.3 on your Macintosh
+--------------------------------------------------
This is a MacPython that can run on Mac OS 8.6 with CarbonLib
installed, Mac OS 9 and Mac OS X. It is the direct successor of MacPython 2.2.
if curcrtp <> (cr, tp):
if change:
MacOS.SetCreatorAndType(name, cr, tp)
- macostools.touched(fs)
+ #macostools.touched(fs)
print 'Fixed ', name
else:
print 'Wrong', curcrtp, name
walktree(pathname, change)
if __name__ == '__main__':
- run(0)
+ run(1)
======================================================================
+What's New in Python 2.2 final?
+===============================
+
+*Release date: 21-Dec-2001*
+
+Type/class unification and new-style classes
+--------------------------------------------
+
+- pickle.py, cPickle: allow pickling instances of new-style classes
+ with a custom metaclass.
+
+Core and builtins
+-----------------
+
+- weakref proxy object: when comparing, unwrap both arguments if both
+ are proxies.
+
+Extension modules
+-----------------
+
+- binascii.b2a_base64(): fix a potential buffer overrun when encoding
+ very short strings.
+
+- cPickle: the obscure "fast" mode was suspected of causing stack
+ overflows on the Mac. Hopefully fixed this by setting the recursion
+ limit much smaller. If the limit is too low (it only affects
+ performance), you can change it by defining PY_CPICKLE_FAST_LIMIT
+ when compiling cPickle.c (or in pyconfig.h).
+
+Library
+-------
+
+- dumbdbm.py: fixed a dumb old bug (the file didn't get synched at
+ close or delete time).
+
+- rfc822.py: fixed a bug where the address '<>' was converted to None
+ instead of an empty string (also fixes the email.Utils module).
+
+- xmlrpclib.py: version 1.0.0; uses precision for doubles.
+
+- test suite: the pickle and cPickle tests were not executing any code
+ when run from the standard regression test.
+
+Tools/Demos
+-----------
+
+Build
+-----
+
+C API
+-----
+
+New platforms
+-------------
+
+Tests
+-----
+
+Windows
+-------
+
+- distutils package: fixed broken Windows installers (bdist_wininst).
+
+- tempfile.py: prevent mysterious warnings when TemporaryFileWrapper
+ instances are deleted at process exit time.
+
+- socket.py: prevent mysterious warnings when socket instances are
+ deleted at process exit time.
+
+- posixmodule.c: fix a Windows crash with stat() of a filename ending
+ in backslash.
+
+Mac
+----
+
+- The Carbon toolbox modules have been upgraded to Universal Headers
+ 3.4, and experimental CoreGraphics and CarbonEvents modules have
+ been added. All only for framework-enabled MacOSX.
+
+
+What's New in Python 2.2c1?
+===========================
+
+*Release date: 14-Dec-2001*
+
+Type/class unification and new-style classes
+--------------------------------------------
+
+- Guido's tutorial introduction to the new type/class features has
+ been extensively updated. See
+
+ http://www.python.org/2.2/descrintro.html
+
+ That remains the primary documentation in this area.
+
+- Fixed a leak: instance variables declared with __slots__ were never
+ deleted!
+
+- The "delete attribute" method of descriptor objects is called
+ __delete__, not __del__. In previous releases, it was mistakenly
+ called __del__, which created an unfortunate overloading condition
+ with finalizers. (The "get attribute" and "set attribute" methods
+ are still called __get__ and __set__, respectively.)
+
+- Some subtle issues with the super built-in were fixed:
+
+ (a) When super itself is subclassed, its __get__ method would still
+ return an instance of the base class (i.e., of super).
+
+ (b) super(C, C()).__class__ would return C rather than super. This
+ is confusing. To fix this, I decided to change the semantics of
+ super so that it only applies to code attributes, not to data
+ attributes. After all, overriding data attributes is not
+ supported anyway.
+
+ (c) The __get__ method didn't check whether the argument was an
+ instance of the type used in creation of the super instance.
+
+- Previously, hash() of an instance of a subclass of a mutable type
+ (list or dictionary) would return some value, rather than raising
+ TypeError. This has been fixed. Also, directly calling
+ dict.__hash__ and list.__hash__ now raises the same TypeError
+ (previously, these were the same as object.__hash__).
+
+- New-style objects now support deleting their __dict__. This is for
+ all intents and purposes equivalent to assigning a brand new empty
+ dictionary, but saves space if the object is not used further.
+
+Core and builtins
+-----------------
+
+- -Qnew now works as documented in PEP 238: when -Qnew is passed on
+ the command line, all occurrences of "/" use true division instead
+ of classic division. See the PEP for details. Note that "all"
+ means all instances in library and 3rd-party modules, as well as in
+ your own code. As the PEP says, -Qnew is intended for use only in
+ educational environments with control over the libraries in use.
+ Note that test_coercion.py in the standard Python test suite fails
+ under -Qnew; this is expected, and won't be repaired until true
+ division becomes the default (in the meantime, test_coercion is
+ testing the current rules).
+
+- complex() now only allows the first argument to be a string
+ argument, and raises TypeError if either the second arg is a string
+ or if the second arg is specified when the first is a string.
+
+Extension modules
+-----------------
+
+- gc.get_referents was renamed to gc.get_referrers.
+
+Library
+-------
+
+- Functions in the os.spawn() family now release the global interpreter
+ lock around calling the platform spawn. They should always have done
+ this, but did not before 2.2c1. Multithreaded programs calling
+ an os.spawn function with P_WAIT will no longer block all Python threads
+ until the spawned program completes. It's possible that some programs
+ relies on blocking, although more likely by accident than by design.
+
+- webbrowser defaults to netscape.exe on OS/2 now.
+
+- Tix.ResizeHandle exposes detach_widget, hide, and show.
+
+- The charset alias windows_1252 has been added.
+
+- types.StringTypes is a tuple containing the defined string types;
+ usually this will be (str, unicode), but if Python was compiled
+ without Unicode support it will be just (str,).
+
+- The pulldom and minidom modules were synchronized to PyXML.
+
+Tools/Demos
+-----------
+
+- A new script called Tools/scripts/google.py was added, which fires
+ off a search on Google.
+
+Build
+-----
+
+- Note that release builds of Python should arrange to define the
+ preprocessor symbol NDEBUG on the command line (or equivalent).
+ In the 2.2 pre-release series we tried to define this by magic in
+ Python.h instead, but it proved to cause problems for extension
+ authors. The Unix, Windows and Mac builds now all define NDEBUG in
+ release builds via cmdline (or equivalent) instead. Ports to
+ other platforms should do likewise.
+
+- It is no longer necessary to use --with-suffix when building on a
+ case-insensitive file system (such as Mac OS X HFS+). In the build
+ directory an extension is used, but not in the installed python.
+
+C API
+-----
+
+- New function PyDict_MergeFromSeq2() exposes the builtin dict
+ constructor's logic for updating a dictionary from an iterable object
+ producing key-value pairs.
+
+- PyArg_ParseTupleAndKeywords() requires that the number of entries in
+ the keyword list equal the number of argument specifiers. This
+ wasn't checked correctly, and PyArg_ParseTupleAndKeywords could even
+ dump core in some bad cases. This has been repaired. As a result,
+ PyArg_ParseTupleAndKeywords may raise RuntimeError in bad cases that
+ previously went unchallenged.
+
+New platforms
+-------------
+
+Tests
+-----
+
+Windows
+-------
+
+Mac
+----
+
+- In unix-Python on Mac OS X (and darwin) sys.platform is now "darwin",
+ without any trailing digits.
+
+- Changed logic for finding python home in Mac OS X framework Pythons.
+ Now sys.executable points to the executable again, in stead of to
+ the shared library. The latter is used only for locating the python
+ home.
+
+
+What's New in Python 2.2b2?
+===========================
+
+*Release date: 16-Nov-2001*
+
+Type/class unification and new-style classes
+--------------------------------------------
+
+- Multiple inheritance mixing new-style and classic classes in the
+ list of base classes is now allowed, so this works now:
+
+ class Classic: pass
+ class Mixed(Classic, object): pass
+
+ The MRO (method resolution order) for each base class is respected
+ according to its kind, but the MRO for the derived class is computed
+ using new-style MRO rules if any base class is a new-style class.
+ This needs to be documented.
+
+- The new builtin dictionary() constructor, and dictionary type, have
+ been renamed to dict. This reflects a decade of common usage.
+
+- dict() now accepts an iterable object producing 2-sequences. For
+ example, dict(d.items()) == d for any dictionary d. The argument,
+ and the elements of the argument, can be any iterable objects.
+
+- New-style classes can now have a __del__ method, which is called
+ when the instance is deleted (just like for classic classes).
+
+- Assignment to object.__dict__ is now possible, for objects that are
+ instances of new-style classes that have a __dict__ (unless the base
+ class forbids it).
+
+- Methods of built-in types now properly check for keyword arguments
+ (formerly these were silently ignored). The only built-in methods
+ that take keyword arguments are __call__, __init__ and __new__.
+
+- The socket function has been converted to a type; see below.
+
+Core and builtins
+-----------------
+
+- Assignment to __debug__ raises SyntaxError at compile-time. This
+ was promised when 2.1c1 was released as "What's New in Python 2.1c1"
+ (see below) says.
+
+- Clarified the error messages for unsupported operands to an operator
+ (like 1 + '').
+
+Extension modules
+-----------------
+
+- mmap has a new keyword argument, "access", allowing a uniform way for
+ both Windows and Unix users to create read-only, write-through and
+ copy-on-write memory mappings. This was previously possible only on
+ Unix. A new keyword argument was required to support this in a
+ uniform way because the mmap() signatures had diverged across
+ platforms. Thanks to Jay T Miller for repairing this!
+
+- By default, the gc.garbage list now contains only those instances in
+ unreachable cycles that have __del__ methods; in 2.1 it contained all
+ instances in unreachable cycles. "Instances" here has been generalized
+ to include instances of both new-style and old-style classes.
+
+- The socket module defines a new method for socket objects,
+ sendall(). This is like send() but may make multiple calls to
+ send() until all data has been sent. Also, the socket function has
+ been converted to a subclassable type, like list and tuple (etc.)
+ before it; socket and SocketType are now the same thing.
+
+- Various bugfixes to the curses module. There is now a test suite
+ for the curses module (you have to run it manually).
+
+- binascii.b2a_base64 no longer places an arbitrary restriction of 57
+ bytes on its input.
+
+Library
+-------
+
+- tkFileDialog exposes a Directory class and askdirectory
+ convenience function.
+
+- Symbolic group names in regular expressions must be unique. For
+ example, the regexp r'(?P<abc>)(?P<abc>)' is not allowed, because a
+ single name can't mean both "group 1" and "group 2" simultaneously.
+ Python 2.2 detects this error at regexp compilation time;
+ previously, the error went undetected, and results were
+ unpredictable. Also in sre, the pattern.split(), pattern.sub(), and
+ pattern.subn() methods have been rewritten in C. Also, an
+ experimental function/method finditer() has been added, which works
+ like findall() but returns an iterator.
+
+- Tix exposes more commands through the classes DirSelectBox,
+ DirSelectDialog, ListNoteBook, Meter, CheckList, and the
+ methods tix_addbitmapdir, tix_cget, tix_configure, tix_filedialog,
+ tix_getbitmap, tix_getimage, tix_option_get, and tix_resetoptions.
+
+- Traceback objects are now scanned by cyclic garbage collection, so
+ cycles created by casual use of sys.exc_info() no longer cause
+ permanent memory leaks (provided garbage collection is enabled).
+
+- os.extsep -- a new variable needed by the RISCOS support. It is the
+ separator used by extensions, and is '.' on all platforms except
+ RISCOS, where it is '/'. There is no need to use this variable
+ unless you have a masochistic desire to port your code to RISCOS.
+
+- mimetypes.py has optional support for non-standard, but commonly
+ found types. guess_type() and guess_extension() now accept an
+ optional 'strict' flag, defaulting to true, which controls whether
+ recognize non-standard types or not. A few non-standard types we
+ know about have been added. Also, when run as a script, there are
+ new -l and -e options.
+
+- statcache is now deprecated.
+
+- email.Utils.formatdate() now produces the preferred RFC 2822 style
+ dates with numeric timezones (it used to produce obsolete dates
+ hard coded to "GMT" timezone). An optional 'localtime' flag is
+ added to produce dates in the local timezone, with daylight savings
+ time properly taken into account.
+
+- In pickle and cPickle, instead of masking errors in load() by
+ transforming them into SystemError, we let the original exception
+ propagate out. Also, implement support for __safe_for_unpickling__
+ in pickle, as it already was supported in cPickle.
+
+Tools/Demos
+-----------
+
+Build
+-----
+
+- The dbm module is built using libdb1 if available. The bsddb module
+ is built with libdb3 if available.
+
+- Misc/Makefile.pre.in has been removed by BDFL pronouncement.
+
+C API
+-----
+
+- New function PySequence_Fast_GET_SIZE() returns the size of a non-
+ NULL result from PySequence_Fast(), more quickly than calling
+ PySequence_Size().
+
+- New argument unpacking function PyArg_UnpackTuple() added.
+
+- New functions PyObject_CallFunctionObjArgs() and
+ PyObject_CallMethodObjArgs() have been added to make it more
+ convenient and efficient to call functions and methods from C.
+
+- PyArg_ParseTupleAndKeywords() no longer masks errors, so it's
+ possible that this will propagate errors it didn't before.
+
+- New function PyObject_CheckReadBuffer(), which returns true if its
+ argument supports the single-segment readable buffer interface.
+
+New platforms
+-------------
+
+- We've finally confirmed that this release builds on HP-UX 11.00,
+ *with* threads, and passes the test suite.
+
+- Thanks to a series of patches from Michael Muller, Python may build
+ again under OS/2 Visual Age C++.
+
+- Updated RISCOS port by Dietmar Schwertberger.
+
+Tests
+-----
+
+- Added a test script for the curses module. It isn't run automatically;
+ regrtest.py must be run with '-u curses' to enable it.
+
+Windows
+-------
+
+Mac
+----
+
+- PythonScript has been moved to unsupported and is slated to be
+ removed completely in the next release.
+
+- It should now be possible to build applets that work on both OS9 and
+ OSX.
+
+- The core is now linked with CoreServices not Carbon; as a side
+ result, default 8bit encoding on OSX is now ASCII.
+
+- Python should now build on OSX 10.1.1
+
+
+What's New in Python 2.2b1?
+===========================
+
+*Release date: 19-Oct-2001*
+
+Type/class unification and new-style classes
+--------------------------------------------
+
+- New-style classes are now always dynamic (except for built-in and
+ extension types). There is no longer a performance penalty, and I
+ no longer see another reason to keep this baggage around. One relic
+ remains: the __dict__ of a new-style class is a read-only proxy; you
+ must set the class's attribute to modify it. As a consequence, the
+ __defined__ attribute of new-style types no longer exists, for lack
+ of need: there is once again only one __dict__ (although in the
+ future a __cache__ may be resurrected with a similar function, if I
+ can prove that it actually speeds things up).
+
+- C.__doc__ now works as expected for new-style classes (in 2.2a4 it
+ always returned None, even when there was a class docstring).
+
+- doctest now finds and runs docstrings attached to new-style classes,
+ class methods, static methods, and properties.
+
+Core and builtins
+-----------------
+
+- A very subtle syntactical pitfall in list comprehensions was fixed.
+ For example: [a+b for a in 'abc', for b in 'def']. The comma in
+ this example is a mistake. Previously, this would silently let 'a'
+ iterate over the singleton tuple ('abc',), yielding ['abcd', 'abce',
+ 'abcf'] rather than the intended ['ad', 'ae', 'af', 'bd', 'be',
+ 'bf', 'cd', 'ce', 'cf']. Now, this is flagged as a syntax error.
+ Note that [a for a in <singleton>] is a convoluted way to say
+ [<singleton>] anyway, so it's not like any expressiveness is lost.
+
+- getattr(obj, name, default) now only catches AttributeError, as
+ documented, rather than returning the default value for all
+ exceptions (which could mask bugs in a __getattr__ hook, for
+ example).
+
+- Weak reference objects are now part of the core and offer a C API.
+ A bug which could allow a core dump when binary operations involved
+ proxy reference has been fixed. weakref.ReferenceError is now a
+ built-in exception.
+
+- unicode(obj) now behaves more like str(obj), accepting arbitrary
+ objects, and calling a __unicode__ method if it exists.
+ unicode(obj, encoding) and unicode(obj, encoding, errors) still
+ require an 8-bit string or character buffer argument.
+
+- isinstance() now allows any object as the first argument and a
+ class, a type or something with a __bases__ tuple attribute for the
+ second argument. The second argument may also be a tuple of a
+ class, type, or something with __bases__, in which case isinstance()
+ will return true if the first argument is an instance of any of the
+ things contained in the second argument tuple. E.g.
+
+ isinstance(x, (A, B))
+
+ returns true if x is an instance of A or B.
+
+Extension modules
+-----------------
+
+- thread.start_new_thread() now returns the thread ID (previously None).
+
+- binascii has now two quopri support functions, a2b_qp and b2a_qp.
+
+- readline now supports setting the startup_hook and the
+ pre_event_hook, and adds the add_history() function.
+
+- os and posix supports chroot(), setgroups() and unsetenv() where
+ available. The stat(), fstat(), statvfs() and fstatvfs() functions
+ now return "pseudo-sequences" -- the various fields can now be
+ accessed as attributes (e.g. os.stat("/").st_mtime) but for
+ backwards compatibility they also behave as a fixed-length sequence.
+ Some platform-specific fields (e.g. st_rdev) are only accessible as
+ attributes.
+
+- time: localtime(), gmtime() and strptime() now return a
+ pseudo-sequence similar to the os.stat() return value, with
+ attributes like tm_year etc.
+
+- Decompression objects in the zlib module now accept an optional
+ second parameter to decompress() that specifies the maximum amount
+ of memory to use for the uncompressed data.
+
+- optional SSL support in the socket module now exports OpenSSL
+ functions RAND_add(), RAND_egd(), and RAND_status(). These calls
+ are useful on platforms like Solaris where OpenSSL does not
+ automatically seed its PRNG. Also, the keyfile and certfile
+ arguments to socket.ssl() are now optional.
+
+- posixmodule (and by extension, the os module on POSIX platforms) now
+ exports O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.
+
+Library
+-------
+
+- doctest now excludes functions and classes not defined by the module
+ being tested, thanks to Tim Hochberg.
+
+- HotShot, a new profiler implemented using a C-based callback, has
+ been added. This substantially reduces the overhead of profiling,
+ but it is still quite preliminary. Support modules and
+ documentation will be added in upcoming releases (before 2.2 final).
+
+- profile now produces correct output in situations where an exception
+ raised in Python is cleared by C code (e.g. hasattr()). This used
+ to cause wrong output, including spurious claims of recursive
+ functions and attribution of time spent to the wrong function.
+
+ The code and documentation for the derived OldProfile and HotProfile
+ profiling classes was removed. The code hasn't worked for years (if
+ you tried to use them, they raised exceptions). OldProfile
+ intended to reproduce the behavior of the profiler Python used more
+ than 7 years ago, and isn't interesting anymore. HotProfile intended
+ to provide a faster profiler (but producing less information), and
+ that's a worthy goal we intend to meet via a different approach (but
+ without losing information).
+
+- Profile.calibrate() has a new implementation that should deliver
+ a much better system-specific calibration constant. The constant can
+ now be specified in an instance constructor, or as a Profile class or
+ instance variable, instead of by editing profile.py's source code.
+ Calibration must still be done manually (see the docs for the profile
+ module).
+
+ Note that Profile.calibrate() must be overridden by subclasses.
+ Improving the accuracy required exploiting detailed knowledge of
+ profiler internals; the earlier method abstracted away the details
+ and measured a simplified model instead, but consequently computed
+ a constant too small by a factor of 2 on some modern machines.
+
+- quopri's encode and decode methods take an optional header parameter,
+ which indicates whether output is intended for the header 'Q'
+ encoding.
+
+- The SocketServer.ThreadingMixIn class now closes the request after
+ finish_request() returns. (Not when it errors out though.)
+
+- The nntplib module's NNTP.body() method has grown a 'file' argument
+ to allow saving the message body to a file.
+
+- The email package has added a class email.Parser.HeaderParser which
+ only parses headers and does not recurse into the message's body.
+ Also, the module/class MIMEAudio has been added for representing
+ audio data (contributed by Anthony Baxter).
+
+- ftplib should be able to handle files > 2GB.
+
+- ConfigParser.getboolean() now also interprets TRUE, FALSE, YES, NO,
+ ON, and OFF.
+
+- xml.dom.minidom NodeList objects now support the length attribute
+ and item() method as required by the DOM specifications.
+
+Tools/Demos
+-----------
+
+- Demo/dns was removed. It no longer serves any purpose; a package
+ derived from it is now maintained by Anthony Baxter, see
+ http://PyDNS.SourceForge.net.
+
+- The freeze tool has been made more robust, and two new options have
+ been added: -X and -E.
+
+Build
+-----
+
+- configure will use CXX in LINKCC if CXX is used to build main() and
+ the system requires to link a C++ main using the C++ compiler.
+
+C API
+-----
+
+- The documentation for the tp_compare slot is updated to require that
+ the return value must be -1, 0, 1; an arbitrary number <0 or >0 is
+ not correct. This is not yet enforced but will be enforced in
+ Python 2.3; even later, we may use -2 to indicate errors and +2 for
+ "NotImplemented". Right now, -1 should be used for an error return.
+
+- PyLong_AsLongLong() now accepts int (as well as long) arguments.
+ Consequently, PyArg_ParseTuple's 'L' code also accepts int (as well
+ as long) arguments.
+
+- PyThread_start_new_thread() now returns a long int giving the thread
+ ID, if one can be calculated; it returns -1 for error, 0 if no
+ thread ID is calculated (this is an incompatible change, but only
+ the thread module used this API). This code has only really been
+ tested on Linux and Windows; other platforms please beware (and
+ report any bugs or strange behavior).
+
+- PyUnicode_FromEncodedObject() no longer accepts Unicode objects as
+ input.
+
+New platforms
+-------------
+
+Tests
+-----
+
+Windows
+-------
+
+- Installer: If you install IDLE, and don't disable file-extension
+ registration, a new "Edit with IDLE" context (right-click) menu entry
+ is created for .py and .pyw files.
+
+- The signal module now supports SIGBREAK on Windows, thanks to Steven
+ Scott. Note that SIGBREAK is unique to Windows. The default SIGBREAK
+ action remains to call Win32 ExitProcess(). This can be changed via
+ signal.signal(). For example::
+
+ # Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
+ # (SIGINT) behavior.
+ import signal
+ signal.signal(signal.SIGBREAK, signal.default_int_handler)
+
+ try:
+ while 1:
+ pass
+ except KeyboardInterrupt:
+ # We get here on Ctrl+C or Ctrl+Break now; if we had not changed
+ # SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the
+ # program without the possibility for any Python-level cleanup).
+ print "Clean exit"
+
+
+What's New in Python 2.2a4?
+===========================
+
+*Release date: 28-Sep-2001*
+
+Type/class unification and new-style classes
+--------------------------------------------
+
+- pydoc and inspect are now aware of new-style classes;
+ e.g. help(list) at the interactive prompt now shows proper
+ documentation for all operations on list objects.
+
+- Applications using Jim Fulton's ExtensionClass module can now safely
+ be used with Python 2.2. In particular, Zope 2.4.1 now works with
+ Python 2.2 (as well as with Python 2.1.1). The Demo/metaclass
+ examples also work again. It is hoped that Gtk and Boost also work
+ with 2.2a4 and beyond. (If you can confirm this, please write
+ webmaster@python.org; if there are still problems, please open a bug
+ report on SourceForge.)
+
+- property() now takes 4 keyword arguments: fget, fset, fdel and doc.
+ These map to read-only attributes 'fget', 'fset', 'fdel', and '__doc__'
+ in the constructed property object. fget, fset and fdel weren't
+ discoverable from Python in 2.2a3. __doc__ is new, and allows to
+ associate a docstring with a property.
+
+- Comparison overloading is now more completely implemented. For
+ example, a str subclass instance can properly be compared to a str
+ instance, and it can properly overload comparison. Ditto for most
+ other built-in object types.
+
+- The repr() of new-style classes has changed; instead of <type
+ 'M.Foo'> a new-style class is now rendered as <class 'M.Foo'>,
+ *except* for built-in types, which are still rendered as <type
+ 'Foo'> (to avoid upsetting existing code that might parse or
+ otherwise rely on repr() of certain type objects).
+
+- The repr() of new-style objects is now always <Foo object at XXX>;
+ previously, it was sometimes <Foo instance at XXX>.
+
+- For new-style classes, what was previously called __getattr__ is now
+ called __getattribute__. This method, if defined, is called for
+ *every* attribute access. A new __getattr__ hook more similar to the
+ one in classic classes is defined which is called only if regular
+ attribute access raises AttributeError; to catch *all* attribute
+ access, you can use __getattribute__ (for new-style classes). If
+ both are defined, __getattribute__ is called first, and if it raises
+ AttributeError, __getattr__ is called.
+
+- The __class__ attribute of new-style objects can be assigned to.
+ The new class must have the same C-level object layout as the old
+ class.
+
+- The builtin file type can be subclassed now. In the usual pattern,
+ "file" is the name of the builtin type, and file() is a new builtin
+ constructor, with the same signature as the builtin open() function.
+ file() is now the preferred way to open a file.
+
+- Previously, __new__ would only see sequential arguments passed to
+ the type in a constructor call; __init__ would see both sequential
+ and keyword arguments. This made no sense whatsoever any more, so
+ now both __new__ and __init__ see all arguments.
+
+- Previously, hash() applied to an instance of a subclass of str or
+ unicode always returned 0. This has been repaired.
+
+- Previously, an operation on an instance of a subclass of an
+ immutable type (int, long, float, complex, tuple, str, unicode),
+ where the subtype didn't override the operation (and so the
+ operation was handled by the builtin type), could return that
+ instance instead a value of the base type. For example, if s was of
+ a str subclass type, s[:] returned s as-is. Now it returns a str
+ with the same value as s.
+
+- Provisional support for pickling new-style objects has been added.
+
+Core
+----
+
+- file.writelines() now accepts any iterable object producing strings.
+
+- PyUnicode_FromEncodedObject() now works very much like
+ PyObject_Str(obj) in that it tries to use __str__/tp_str
+ on the object if the object is not a string or buffer. This
+ makes unicode() behave like str() when applied to non-string/buffer
+ objects.
+
+- PyFile_WriteObject now passes Unicode objects to the file's write
+ method. As a result, all file-like objects which may be the target
+ of a print statement must support Unicode objects, i.e. they must
+ at least convert them into ASCII strings.
+
+- Thread scheduling on Solaris should be improved; it is no longer
+ necessary to insert a small sleep at the start of a thread in order
+ to let other runnable threads be scheduled.
+
+Library
+-------
+
+- StringIO.StringIO instances and cStringIO.StringIO instances support
+ read character buffer compatible objects for their .write() methods.
+ These objects are converted to strings and then handled as such
+ by the instances.
+
+- The "email" package has been added. This is basically a port of the
+ mimelib package <http://sf.net/projects/mimelib> with API changes
+ and some implementations updated to use iterators and generators.
+
+- difflib.ndiff() and difflib.Differ.compare() are generators now. This
+ restores the ability of Tools/scripts/ndiff.py to start producing output
+ before the entire comparison is complete.
+
+- StringIO.StringIO instances and cStringIO.StringIO instances support
+ iteration just like file objects (i.e. their .readline() method is
+ called for each iteration until it returns an empty string).
+
+- The codecs module has grown four new helper APIs to access
+ builtin codecs: getencoder(), getdecoder(), getreader(),
+ getwriter().
+
+- SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer)
+ simplifies writing XML RPC servers.
+
+- os.path.realpath(): a new function that returns the absolute pathname
+ after interpretation of symbolic links. On non-Unix systems, this
+ is an alias for os.path.abspath().
+
+- operator.indexOf() (PySequence_Index() in the C API) now works with any
+ iterable object.
+
+- smtplib now supports various authentication and security features of
+ the SMTP protocol through the new login() and starttls() methods.
+
+- hmac: a new module implementing keyed hashing for message
+ authentication.
+
+- mimetypes now recognizes more extensions and file types. At the
+ same time, some mappings not sanctioned by IANA were removed.
+
+- The "compiler" package has been brought up to date to the state of
+ Python 2.2 bytecode generation. It has also been promoted from a
+ Tool to a standard library package. (Tools/compiler still exists as
+ a sample driver.)
+
+Build
+-----
+
+- Large file support (LFS) is now automatic when the platform supports
+ it; no more manual configuration tweaks are needed. On Linux, at
+ least, it's possible to have a system whose C library supports large
+ files but whose kernel doesn't; in this case, large file support is
+ still enabled but doesn't do you any good unless you upgrade your
+ kernel or share your Python executable with another system whose
+ kernel has large file support.
+
+- The configure script now supplies plausible defaults in a
+ cross-compilation environment. This doesn't mean that the supplied
+ values are always correct, or that cross-compilation now works
+ flawlessly -- but it's a first step (and it shuts up most of
+ autoconf's warnings about AC_TRY_RUN).
+
+- The Unix build is now a bit less chatty, courtesy of the parser
+ generator. The build is completely silent (except for errors) when
+ using "make -s", thanks to a -q option to setup.py.
+
+C API
+-----
+
+- The "structmember" API now supports some new flag bits to deny read
+ and/or write access to attributes in restricted execution mode.
+
+New platforms
+-------------
+
+- Compaq's iPAQ handheld, running the "familiar" Linux distribution
+ (http://familiar.handhelds.org).
+
+Tests
+-----
+
+- The "classic" standard tests, which work by comparing stdout to
+ an expected-output file under Lib/test/output/, no longer stop at
+ the first mismatch. Instead the test is run to completion, and a
+ variant of ndiff-style comparison is used to report all differences.
+ This is much easier to understand than the previous style of reporting.
+
+- The unittest-based standard tests now use regrtest's test_main()
+ convention, instead of running as a side-effect of merely being
+ imported. This allows these tests to be run in more natural and
+ flexible ways as unittests, outside the regrtest framework.
+
+- regrtest.py is much better integrated with unittest and doctest now,
+ especially in regard to reporting errors.
+
+Windows
+-------
+
+- Large file support now also works for files > 4GB, on filesystems
+ that support it (NTFS under Windows 2000). See "What's New in
+ Python 2.2a3" for more detail.
+
+
+What's New in Python 2.2a3?
+===========================
+
+*Release Date: 07-Sep-2001*
+
+Core
+----
+
+- Conversion of long to float now raises OverflowError if the long is too
+ big to represent as a C double.
+
+- The 3-argument builtin pow() no longer allows a third non-None argument
+ if either of the first two arguments is a float, or if both are of
+ integer types and the second argument is negative (in which latter case
+ the arguments are converted to float, so this is really the same
+ restriction).
+
+- The builtin dir() now returns more information, and sometimes much
+ more, generally naming all attributes of an object, and all attributes
+ reachable from the object via its class, and from its class's base
+ classes, and so on from them too. Example: in 2.2a2, dir([]) returned
+ an empty list. In 2.2a3,
+
+ >>> dir([])
+ ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
+ '__eq__', '__ge__', '__getattr__', '__getitem__', '__getslice__',
+ '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__le__',
+ '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__repr__',
+ '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__',
+ 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
+ 'reverse', 'sort']
+
+ dir(module) continues to return only the module's attributes, though.
+
+- Overflowing operations on plain ints now return a long int rather
+ than raising OverflowError. This is a partial implementation of PEP
+ 237. You can use -Wdefault::OverflowWarning to enable a warning for
+ this situation, and -Werror::OverflowWarning to revert to the old
+ OverflowError exception.
+
+- A new command line option, -Q<arg>, is added to control run-time
+ warnings for the use of classic division. (See PEP 238.) Possible
+ values are -Qold, -Qwarn, -Qwarnall, and -Qnew. The default is
+ -Qold, meaning the / operator has its classic meaning and no
+ warnings are issued. Using -Qwarn issues a run-time warning about
+ all uses of classic division for int and long arguments; -Qwarnall
+ also warns about classic division for float and complex arguments
+ (for use with fixdiv.py).
+ [Note: the remainder of this item (preserved below) became
+ obsolete in 2.2c1 -- -Qnew has global effect in 2.2] ::
+
+ Using -Qnew is questionable; it turns on new division by default, but
+ only in the __main__ module. You can usefully combine -Qwarn or
+ -Qwarnall and -Qnew: this gives the __main__ module new division, and
+ warns about classic division everywhere else.
+
+- Many built-in types can now be subclassed. This applies to int,
+ long, float, str, unicode, and tuple. (The types complex, list and
+ dictionary can also be subclassed; this was introduced earlier.)
+ Note that restrictions apply when subclassing immutable built-in
+ types: you can only affect the value of the instance by overloading
+ __new__. You can add mutable attributes, and the subclass instances
+ will have a __dict__ attribute, but you cannot change the "value"
+ (as implemented by the base class) of an immutable subclass instance
+ once it is created.
+
+- The dictionary constructor now takes an optional argument, a
+ mapping-like object, and initializes the dictionary from its
+ (key, value) pairs.
+
+- A new built-in type, super, has been added. This facilitates making
+ "cooperative super calls" in a multiple inheritance setting. For an
+ explanation, see http://www.python.org/2.2/descrintro.html#cooperation
+
+- A new built-in type, property, has been added. This enables the
+ creation of "properties". These are attributes implemented by
+ getter and setter functions (or only one of these for read-only or
+ write-only attributes), without the need to override __getattr__.
+ See http://www.python.org/2.2/descrintro.html#property
+
+- The syntax of floating-point and imaginary literals has been
+ liberalized, to allow leading zeroes. Examples of literals now
+ legal that were SyntaxErrors before:
+
+ 00.0 0e3 0100j 07.5 00000000000000000008.
+
+- An old tokenizer bug allowed floating point literals with an incomplete
+ exponent, such as 1e and 3.1e-. Such literals now raise SyntaxError.
+
+Library
+-------
+
+- telnetlib includes symbolic names for the options, and support for
+ setting an option negotiation callback. It also supports processing
+ of suboptions.
+
+- The new C standard no longer requires that math libraries set errno to
+ ERANGE on overflow. For platform libraries that exploit this new
+ freedom, Python's overflow-checking was wholly broken. A new overflow-
+ checking scheme attempts to repair that, but may not be reliable on all
+ platforms (C doesn't seem to provide anything both useful and portable
+ in this area anymore).
+
+- Asynchronous timeout actions are available through the new class
+ threading.Timer.
+
+- math.log and math.log10 now return sensible results for even huge
+ long arguments. For example, math.log10(10 ** 10000) ~= 10000.0.
+
+- A new function, imp.lock_held(), returns 1 when the import lock is
+ currently held. See the docs for the imp module.
+
+- pickle, cPickle and marshal on 32-bit platforms can now correctly read
+ dumps containing ints written on platforms where Python ints are 8 bytes.
+ When read on a box where Python ints are 4 bytes, such values are
+ converted to Python longs.
+
+- In restricted execution mode (using the rexec module), unmarshalling
+ code objects is no longer allowed. This plugs a security hole.
+
+- unittest.TestResult instances no longer store references to tracebacks
+ generated by test failures. This prevents unexpected dangling references
+ to objects that should be garbage collected between tests.
+
+Tools
+-----
+
+- Tools/scripts/fixdiv.py has been added which can be used to fix
+ division operators as per PEP 238.
+
+Build
+-----
+
+- If you are an adventurous person using Mac OS X you may want to look at
+ Mac/OSX. There is a Makefile there that will build Python as a real Mac
+ application, which can be used for experimenting with Carbon or Cocoa.
+ Discussion of this on pythonmac-sig, please.
+
+C API
+-----
+
+- New function PyObject_Dir(obj), like Python __builtin__.dir(obj).
+
+- Note that PyLong_AsDouble can fail! This has always been true, but no
+ callers checked for it. It's more likely to fail now, because overflow
+ errors are properly detected now. The proper way to check::
+
+ double x = PyLong_AsDouble(some_long_object);
+ if (x == -1.0 && PyErr_Occurred()) {
+ /* The conversion failed. */
+ }
+
+- The GC API has been changed. Extensions that use the old API will still
+ compile but will not participate in GC. To upgrade an extension
+ module:
+
+ - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC
+
+ - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and
+ PyObject_GC_Del to deallocate them
+
+ - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini
+ to PyObject_GC_UnTrack
+
+ - remove PyGC_HEAD_SIZE from object size calculations
+
+ - remove calls to PyObject_AS_GC and PyObject_FROM_GC
+
+- Two new functions: PyString_FromFormat() and PyString_FromFormatV().
+ These can be used safely to construct string objects from a
+ sprintf-style format string (similar to the format string supported
+ by PyErr_Format()).
+
+New platforms
+-------------
+
+- Stephen Hansen contributed patches sufficient to get a clean compile
+ under Borland C (Windows), but he reports problems running it and ran
+ out of time to complete the port. Volunteers? Expect a MemoryError
+ when importing the types module; this is probably shallow, and
+ causing later failures too.
+
+Tests
+-----
+
+Windows
+-------
+
+- Large file support is now enabled on Win32 platforms as well as on
+ Win64. This means that, for example, you can use f.tell() and f.seek()
+ to manipulate files larger than 2 gigabytes (provided you have enough
+ disk space, and are using a Windows filesystem that supports large
+ partitions). Windows filesystem limits: FAT has a 2GB (gigabyte)
+ filesize limit, and large file support makes no difference there.
+ FAT32's limit is 4GB, and files >= 2GB are easier to use from Python now.
+ NTFS has no practical limit on file size, and files of any size can be
+ used from Python now.
+
+- The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC
+ points to command.com (patch from Brian Quinlan).
+
+
+What's New in Python 2.2a2?
+===========================
+
+*Release Date: 22-Aug-2001*
+
+Build
+-----
+
+- Tim Peters developed a brand new Windows installer using Wise 8.1,
+ generously donated to us by Wise Solutions.
+
+- configure supports a new option --enable-unicode, with the values
+ ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode
+ type and supporting code is completely removed from the interpreter.
+
+- A new configure option --enable-framework builds a Mac OS X framework,
+ which "make frameworkinstall" will install. This provides a starting
+ point for more mac-like functionality, join pythonmac-sig@python.org
+ if you are interested in helping.
+
+- The NeXT platform is no longer supported.
+
+- The 'new' module is now statically linked.
+
+Tools
+-----
+
+- The new Tools/scripts/cleanfuture.py can be used to automatically
+ edit out obsolete future statements from Python source code. See
+ the module docstring for details.
+
+Tests
+-----
+
+- regrtest.py now knows which tests are expected to be skipped on some
+ platforms, allowing to give clearer test result output. regrtest
+ also has optional --use/-u switch to run normally disabled tests
+ which require network access or consume significant disk resources.
+
+- Several new tests in the standard test suite, with special thanks to
+ Nick Mathewson.
+
+Core
+----
+
+- The floor division operator // has been added as outlined in PEP
+ 238. The / operator still provides classic division (and will until
+ Python 3.0) unless "from __future__ import division" is included, in
+ which case the / operator will provide true division. The operator
+ module provides truediv() and floordiv() functions. Augmented
+ assignment variants are included, as are the equivalent overloadable
+ methods and C API methods. See the PEP for a full discussion:
+ <http://python.sf.net/peps/pep-0238.html>
+
+- Future statements are now effective in simulated interactive shells
+ (like IDLE). This should "just work" by magic, but read Michael
+ Hudson's "Future statements in simulated shells" PEP 264 for full
+ details: <http://python.sf.net/peps/pep-0264.html>.
+
+- The type/class unification (PEP 252-253) was integrated into the
+ trunk and is not so tentative any more (the exact specification of
+ some features is still tentative). A lot of work has done on fixing
+ bugs and adding robustness and features (performance still has to
+ come a long way).
+
+- Warnings about a mismatch in the Python API during extension import
+ now use the Python warning framework (which makes it possible to
+ write filters for these warnings).
+
+- A function's __dict__ (aka func_dict) will now always be a
+ dictionary. It used to be possible to delete it or set it to None,
+ but now both actions raise TypeErrors. It is still legal to set it
+ to a dictionary object. Getting func.__dict__ before any attributes
+ have been assigned now returns an empty dictionary instead of None.
+
+- A new command line option, -E, was added which disables the use of
+ all environment variables, or at least those that are specifically
+ significant to Python. Usually those have a name starting with
+ "PYTHON". This was used to fix a problem where the tests fail if
+ the user happens to have PYTHONHOME or PYTHONPATH pointing to an
+ older distribution.
+
+Library
+-------
+
+- New class Differ and new functions ndiff() and restore() in difflib.py.
+ These package the algorithms used by the popular Tools/scripts/ndiff.py,
+ for programmatic reuse.
+
+- New function xml.sax.saxutils.quoteattr(): Quote an XML attribute
+ value using the minimal quoting required for the value; more
+ reliable than using xml.sax.saxutils.escape() for attribute values.
+
+- Readline completion support for cmd.Cmd was added.
+
+- Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings.
+
+- Added function threading.BoundedSemaphore()
+
+- Added Ka-Ping Yee's cgitb.py module.
+
+- The 'new' module now exposes the CO_xxx flags.
+
+- The gc module offers the get_referents function.
+
+New platforms
+-------------
+
+C API
+-----
+
+- Two new APIs PyOS_snprintf() and PyOS_vsnprintf() were added
+ which provide a cross-platform implementations for the
+ relatively new snprintf()/vsnprintf() C lib APIs. In contrast to
+ the standard sprintf() and vsprintf() C lib APIs, these versions
+ apply bounds checking on the used buffer which enhances protection
+ against buffer overruns.
+
+- Unicode APIs now use name mangling to assure that mixing interpreters
+ and extensions using different Unicode widths is rendered next to
+ impossible. Trying to import an incompatible Unicode-aware extension
+ will result in an ImportError. Unicode extensions writers must make
+ sure to check the Unicode width compatibility in their extensions by
+ using at least one of the mangled Unicode APIs in the extension.
+
+- Two new flags METH_NOARGS and METH_O are available in method definition
+ tables to simplify implementation of methods with no arguments and a
+ single untyped argument. Calling such methods is more efficient than
+ calling corresponding METH_VARARGS methods. METH_OLDARGS is now
+ deprecated.
+
+Windows
+-------
+
+- "import module" now compiles module.pyw if it exists and nothing else
+ relevant is found.
+
+
+What's New in Python 2.2a1?
+===========================
+
+*Release date: 18-Jul-2001*
+
+Core
+----
+
+- TENTATIVELY, a large amount of code implementing much of what's
+ described in PEP 252 (Making Types Look More Like Classes) and PEP
+ 253 (Subtyping Built-in Types) was added. This will be released
+ with Python 2.2a1. Documentation will be provided separately
+ through http://www.python.org/2.2/. The purpose of releasing this
+ with Python 2.2a1 is to test backwards compatibility. It is
+ possible, though not likely, that a decision is made not to release
+ this code as part of 2.2 final, if any serious backwards
+ incompatibilities are found during alpha testing that cannot be
+ repaired.
+
+- Generators were added; this is a new way to create an iterator (see
+ below) using what looks like a simple function containing one or
+ more 'yield' statements. See PEP 255. Since this adds a new
+ keyword to the language, this feature must be enabled by including a
+ future statement: "from __future__ import generators" (see PEP 236).
+ Generators will become a standard feature in a future release
+ (probably 2.3). Without this future statement, 'yield' remains an
+ ordinary identifier, but a warning is issued each time it is used.
+ (These warnings currently don't conform to the warnings framework of
+ PEP 230; we intend to fix this in 2.2a2.)
+
+- The UTF-16 codec was modified to be more RFC compliant. It will now
+ only remove BOM characters at the start of the string and then
+ only if running in native mode (UTF-16-LE and -BE won't remove a
+ leading BMO character).
+
+- Strings now have a new method .decode() to complement the already
+ existing .encode() method. These two methods provide direct access
+ to the corresponding decoders and encoders of the registered codecs.
+
+ To enhance the usability of the .encode() method, the special
+ casing of Unicode object return values was dropped (Unicode objects
+ were auto-magically converted to string using the default encoding).
+
+ Both methods will now return whatever the codec in charge of the
+ requested encoding returns as object, e.g. Unicode codecs will
+ return Unicode objects when decoding is requested ("äöü".decode("latin-1")
+ will return u"äöü"). This enables codec writer to create codecs
+ for various simple to use conversions.
+
+ New codecs were added to demonstrate these new features (the .encode()
+ and .decode() columns indicate the type of the returned objects):
+
+ +---------+-----------+-----------+-----------------------------+
+ |Name | .encode() | .decode() | Description |
+ +=========+===========+===========+=============================+
+ |uu | string | string | UU codec (e.g. for email) |
+ +---------+-----------+-----------+-----------------------------+
+ |base64 | string | string | base64 codec |
+ +---------+-----------+-----------+-----------------------------+
+ |quopri | string | string | quoted-printable codec |
+ +---------+-----------+-----------+-----------------------------+
+ |zlib | string | string | zlib compression |
+ +---------+-----------+-----------+-----------------------------+
+ |hex | string | string | 2-byte hex codec |
+ +---------+-----------+-----------+-----------------------------+
+ |rot-13 | string | Unicode | ROT-13 Unicode charmap codec|
+ +---------+-----------+-----------+-----------------------------+
+
+- Some operating systems now support the concept of a default Unicode
+ encoding for file system operations. Notably, Windows supports 'mbcs'
+ as the default. The Macintosh will also adopt this concept in the medium
+ term, although the default encoding for that platform will be other than
+ 'mbcs'.
+
+ On operating system that support non-ASCII filenames, it is common for
+ functions that return filenames (such as os.listdir()) to return Python
+ string objects pre-encoded using the default file system encoding for
+ the platform. As this encoding is likely to be different from Python's
+ default encoding, converting this name to a Unicode object before passing
+ it back to the Operating System would result in a Unicode error, as Python
+ would attempt to use its default encoding (generally ASCII) rather than
+ the default encoding for the file system.
+
+ In general, this change simply removes surprises when working with
+ Unicode and the file system, making these operations work as you expect,
+ increasing the transparency of Unicode objects in this context.
+ See [????] for more details, including examples.
+
+- Float (and complex) literals in source code were evaluated to full
+ precision only when running from a .py file; the same code loaded from a
+ .pyc (or .pyo) file could suffer numeric differences starting at about the
+ 12th significant decimal digit. For example, on a machine with IEEE-754
+ floating arithmetic,
+
+ x = 9007199254740992.0
+ print long(x)
+
+ printed 9007199254740992 if run directly from .py, but 9007199254740000
+ if from a compiled (.pyc or .pyo) file. This was due to marshal using
+ str(float) instead of repr(float) when building code objects. marshal
+ now uses repr(float) instead, which should reproduce floats to full
+ machine precision (assuming the platform C float<->string I/O conversion
+ functions are of good quality).
+
+ This may cause floating-point results to change in some cases, and
+ usually for the better, but may also cause numerically unstable
+ algorithms to break.
+
+- The implementation of dicts suffers fewer collisions, which has speed
+ benefits. However, the order in which dict entries appear in dict.keys(),
+ dict.values() and dict.items() may differ from previous releases for a
+ given dict. Nothing is defined about this order, so no program should
+ rely on it. Nevertheless, it's easy to write test cases that rely on the
+ order by accident, typically because of printing the str() or repr() of a
+ dict to an "expected results" file. See Lib/test/test_support.py's new
+ sortdict(dict) function for a simple way to display a dict in sorted
+ order.
+
+- Many other small changes to dicts were made, resulting in faster
+ operation along the most common code paths.
+
+- Dictionary objects now support the "in" operator: "x in dict" means
+ the same as dict.has_key(x).
+
+- The update() method of dictionaries now accepts generic mapping
+ objects. Specifically the argument object must support the .keys()
+ and __getitem__() methods. This allows you to say, for example,
+ {}.update(UserDict())
+
+- Iterators were added; this is a generalized way of providing values
+ to a for loop. See PEP 234. There's a new built-in function iter()
+ to return an iterator. There's a new protocol to get the next value
+ from an iterator using the next() method (in Python) or the
+ tp_iternext slot (in C). There's a new protocol to get iterators
+ using the __iter__() method (in Python) or the tp_iter slot (in C).
+ Iterating (i.e. a for loop) over a dictionary generates its keys.
+ Iterating over a file generates its lines.
+
+- The following functions were generalized to work nicely with iterator
+ arguments::
+
+ map(), filter(), reduce(), zip()
+ list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API)
+ max(), min()
+ join() method of strings
+ extend() method of lists
+ 'x in y' and 'x not in y' (PySequence_Contains() in C API)
+ operator.countOf() (PySequence_Count() in C API)
+ right-hand side of assignment statements with multiple targets, such as ::
+ x, y, z = some_iterable_object_returning_exactly_3_values
+
+- Accessing module attributes is significantly faster (for example,
+ random.random or os.path or yourPythonModule.yourAttribute).
+
+- Comparing dictionary objects via == and != is faster, and now works even
+ if the keys and values don't support comparisons other than ==.
+
+- Comparing dictionaries in ways other than == and != is slower: there were
+ insecurities in the dict comparison implementation that could cause Python
+ to crash if the element comparison routines for the dict keys and/or
+ values mutated the dicts. Making the code bulletproof slowed it down.
+
+- Collisions in dicts are resolved via a new approach, which can help
+ dramatically in bad cases. For example, looking up every key in a dict
+ d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x
+ faster now. Thanks to Christian Tismer for pointing out the cause and
+ the nature of an effective cure (last December! better late than never).
+
+- repr() is much faster for large containers (dict, list, tuple).
+
+
+Library
+-------
+
+- The constants ascii_letters, ascii_lowercase. and ascii_uppercase
+ were added to the string module. These a locale-independent
+ constants, unlike letters, lowercase, and uppercase. These are now
+ use in appropriate locations in the standard library.
+
+- The flags used in dlopen calls can now be configured using
+ sys.setdlopenflags and queried using sys.getdlopenflags.
+
+- Fredrik Lundh's xmlrpclib is now a standard library module. This
+ provides full client-side XML-RPC support. In addition,
+ Demo/xmlrpc/ contains two server frameworks (one SocketServer-based,
+ one asyncore-based). Thanks to Eric Raymond for the documentation.
+
+- The xrange() object is simplified: it no longer supports slicing,
+ repetition, comparisons, efficient 'in' checking, the tolist()
+ method, or the start, stop and step attributes. See PEP 260.
+
+- A new function fnmatch.filter to filter lists of file names was added.
+
+- calendar.py uses month and day names based on the current locale.
+
+- strop is now *really* obsolete (this was announced before with 1.6),
+ and issues DeprecationWarning when used (except for the four items
+ that are still imported into string.py).
+
+- Cookie.py now sorts key+value pairs by key in output strings.
+
+- pprint.isrecursive(object) didn't correctly identify recursive objects.
+ Now it does.
+
+- pprint functions now much faster for large containers (tuple, list, dict).
+
+- New 'q' and 'Q' format codes in the struct module, corresponding to C
+ types "long long" and "unsigned long long" (on Windows, __int64). In
+ native mode, these can be used only when the platform C compiler supports
+ these types (when HAVE_LONG_LONG is #define'd by the Python config
+ process), and then they inherit the sizes and alignments of the C types.
+ In standard mode, 'q' and 'Q' are supported on all platforms, and are
+ 8-byte integral types.
+
+- The site module installs a new built-in function 'help' that invokes
+ pydoc.help. It must be invoked as 'help()'; when invoked as 'help',
+ it displays a message reminding the user to use 'help()' or
+ 'help(object)'.
+
+Tests
+-----
+
+- New test_mutants.py runs dict comparisons where the key and value
+ comparison operators mutate the dicts randomly during comparison. This
+ rapidly causes Python to crash under earlier releases (not for the faint
+ of heart: it can also cause Win9x to freeze or reboot!).
+
+- New test_pprint.py verifies that pprint.isrecursive() and
+ pprint.isreadable() return sensible results. Also verifies that simple
+ cases produce correct output.
+
+C API
+-----
+
+- Removed the unused last_is_sticky argument from the internal
+ _PyTuple_Resize(). If this affects you, you were cheating.
+
What's New in Python 2.1 (final)?
=================================
---
- Bundlebuilder now inherits default values in the right way. It was
- previously possible for app bundles to et a type of "BNDL" instead
+ previously possible for app bundles to get a type of "BNDL" instead
of "APPL." Other improvements include, a --build-id option to
specify the CFBundleIdentifier and using the --python option to set
the executable in the bundle.
other platforms. If you really need sourcefiles with Mac characters in them
you can change this in site.py.
-
-What's New in Python 2.2 final?
-===============================
-
-*Release date: 21-Dec-2001*
-
-Type/class unification and new-style classes
---------------------------------------------
-
-- pickle.py, cPickle: allow pickling instances of new-style classes
- with a custom metaclass.
-
-Core and builtins
------------------
-
-- weakref proxy object: when comparing, unwrap both arguments if both
- are proxies.
-
-Extension modules
------------------
-
-- binascii.b2a_base64(): fix a potential buffer overrun when encoding
- very short strings.
-
-- cPickle: the obscure "fast" mode was suspected of causing stack
- overflows on the Mac. Hopefully fixed this by setting the recursion
- limit much smaller. If the limit is too low (it only affects
- performance), you can change it by defining PY_CPICKLE_FAST_LIMIT
- when compiling cPickle.c (or in pyconfig.h).
-
-Library
--------
-
-- dumbdbm.py: fixed a dumb old bug (the file didn't get synched at
- close or delete time).
-
-- rfc822.py: fixed a bug where the address '<>' was converted to None
- instead of an empty string (also fixes the email.Utils module).
-
-- xmlrpclib.py: version 1.0.0; uses precision for doubles.
-
-- test suite: the pickle and cPickle tests were not executing any code
- when run from the standard regression test.
-
-Tools/Demos
------------
-
-Build
------
-
-C API
------
-
-New platforms
--------------
-
-Tests
------
-
-Windows
--------
-
-- distutils package: fixed broken Windows installers (bdist_wininst).
-
-- tempfile.py: prevent mysterious warnings when TemporaryFileWrapper
- instances are deleted at process exit time.
-
-- socket.py: prevent mysterious warnings when socket instances are
- deleted at process exit time.
-
-- posixmodule.c: fix a Windows crash with stat() of a filename ending
- in backslash.
-
-Mac
-----
-
-- The Carbon toolbox modules have been upgraded to Universal Headers
- 3.4, and experimental CoreGraphics and CarbonEvents modules have
- been added. All only for framework-enabled MacOSX.
-
-
-What's New in Python 2.2c1?
-===========================
-
-*Release date: 14-Dec-2001*
-
-Type/class unification and new-style classes
---------------------------------------------
-
-- Guido's tutorial introduction to the new type/class features has
- been extensively updated. See
-
- http://www.python.org/2.2/descrintro.html
-
- That remains the primary documentation in this area.
-
-- Fixed a leak: instance variables declared with __slots__ were never
- deleted!
-
-- The "delete attribute" method of descriptor objects is called
- __delete__, not __del__. In previous releases, it was mistakenly
- called __del__, which created an unfortunate overloading condition
- with finalizers. (The "get attribute" and "set attribute" methods
- are still called __get__ and __set__, respectively.)
-
-- Some subtle issues with the super built-in were fixed:
-
- (a) When super itself is subclassed, its __get__ method would still
- return an instance of the base class (i.e., of super).
-
- (b) super(C, C()).__class__ would return C rather than super. This
- is confusing. To fix this, I decided to change the semantics of
- super so that it only applies to code attributes, not to data
- attributes. After all, overriding data attributes is not
- supported anyway.
-
- (c) The __get__ method didn't check whether the argument was an
- instance of the type used in creation of the super instance.
-
-- Previously, hash() of an instance of a subclass of a mutable type
- (list or dictionary) would return some value, rather than raising
- TypeError. This has been fixed. Also, directly calling
- dict.__hash__ and list.__hash__ now raises the same TypeError
- (previously, these were the same as object.__hash__).
-
-- New-style objects now support deleting their __dict__. This is for
- all intents and purposes equivalent to assigning a brand new empty
- dictionary, but saves space if the object is not used further.
-
-Core and builtins
------------------
-
-- -Qnew now works as documented in PEP 238: when -Qnew is passed on
- the command line, all occurrences of "/" use true division instead
- of classic division. See the PEP for details. Note that "all"
- means all instances in library and 3rd-party modules, as well as in
- your own code. As the PEP says, -Qnew is intended for use only in
- educational environments with control over the libraries in use.
- Note that test_coercion.py in the standard Python test suite fails
- under -Qnew; this is expected, and won't be repaired until true
- division becomes the default (in the meantime, test_coercion is
- testing the current rules).
-
-- complex() now only allows the first argument to be a string
- argument, and raises TypeError if either the second arg is a string
- or if the second arg is specified when the first is a string.
-
-Extension modules
------------------
-
-- gc.get_referents was renamed to gc.get_referrers.
-
-Library
--------
-
-- Functions in the os.spawn() family now release the global interpreter
- lock around calling the platform spawn. They should always have done
- this, but did not before 2.2c1. Multithreaded programs calling
- an os.spawn function with P_WAIT will no longer block all Python threads
- until the spawned program completes. It's possible that some programs
- relies on blocking, although more likely by accident than by design.
-
-- webbrowser defaults to netscape.exe on OS/2 now.
-
-- Tix.ResizeHandle exposes detach_widget, hide, and show.
-
-- The charset alias windows_1252 has been added.
-
-- types.StringTypes is a tuple containing the defined string types;
- usually this will be (str, unicode), but if Python was compiled
- without Unicode support it will be just (str,).
-
-- The pulldom and minidom modules were synchronized to PyXML.
-
-Tools/Demos
------------
-
-- A new script called Tools/scripts/google.py was added, which fires
- off a search on Google.
-
-Build
------
-
-- Note that release builds of Python should arrange to define the
- preprocessor symbol NDEBUG on the command line (or equivalent).
- In the 2.2 pre-release series we tried to define this by magic in
- Python.h instead, but it proved to cause problems for extension
- authors. The Unix, Windows and Mac builds now all define NDEBUG in
- release builds via cmdline (or equivalent) instead. Ports to
- other platforms should do likewise.
-
-- It is no longer necessary to use --with-suffix when building on a
- case-insensitive file system (such as Mac OS X HFS+). In the build
- directory an extension is used, but not in the installed python.
-
-C API
------
-
-- New function PyDict_MergeFromSeq2() exposes the builtin dict
- constructor's logic for updating a dictionary from an iterable object
- producing key-value pairs.
-
-- PyArg_ParseTupleAndKeywords() requires that the number of entries in
- the keyword list equal the number of argument specifiers. This
- wasn't checked correctly, and PyArg_ParseTupleAndKeywords could even
- dump core in some bad cases. This has been repaired. As a result,
- PyArg_ParseTupleAndKeywords may raise RuntimeError in bad cases that
- previously went unchallenged.
-
-New platforms
--------------
-
-Tests
------
-
-Windows
--------
-
-Mac
-----
-
-- In unix-Python on Mac OS X (and darwin) sys.platform is now "darwin",
- without any trailing digits.
-
-- Changed logic for finding python home in Mac OS X framework Pythons.
- Now sys.executable points to the executable again, in stead of to
- the shared library. The latter is used only for locating the python
- home.
-
-
-What's New in Python 2.2b2?
-===========================
-
-*Release date: 16-Nov-2001*
-
-Type/class unification and new-style classes
---------------------------------------------
-
-- Multiple inheritance mixing new-style and classic classes in the
- list of base classes is now allowed, so this works now:
-
- class Classic: pass
- class Mixed(Classic, object): pass
-
- The MRO (method resolution order) for each base class is respected
- according to its kind, but the MRO for the derived class is computed
- using new-style MRO rules if any base class is a new-style class.
- This needs to be documented.
-
-- The new builtin dictionary() constructor, and dictionary type, have
- been renamed to dict. This reflects a decade of common usage.
-
-- dict() now accepts an iterable object producing 2-sequences. For
- example, dict(d.items()) == d for any dictionary d. The argument,
- and the elements of the argument, can be any iterable objects.
-
-- New-style classes can now have a __del__ method, which is called
- when the instance is deleted (just like for classic classes).
-
-- Assignment to object.__dict__ is now possible, for objects that are
- instances of new-style classes that have a __dict__ (unless the base
- class forbids it).
-
-- Methods of built-in types now properly check for keyword arguments
- (formerly these were silently ignored). The only built-in methods
- that take keyword arguments are __call__, __init__ and __new__.
-
-- The socket function has been converted to a type; see below.
-
-Core and builtins
------------------
-
-- Assignment to __debug__ raises SyntaxError at compile-time. This
- was promised when 2.1c1 was released as "What's New in Python 2.1c1"
- (see below) says.
-
-- Clarified the error messages for unsupported operands to an operator
- (like 1 + '').
-
-Extension modules
------------------
-
-- mmap has a new keyword argument, "access", allowing a uniform way for
- both Windows and Unix users to create read-only, write-through and
- copy-on-write memory mappings. This was previously possible only on
- Unix. A new keyword argument was required to support this in a
- uniform way because the mmap() signatures had diverged across
- platforms. Thanks to Jay T Miller for repairing this!
-
-- By default, the gc.garbage list now contains only those instances in
- unreachable cycles that have __del__ methods; in 2.1 it contained all
- instances in unreachable cycles. "Instances" here has been generalized
- to include instances of both new-style and old-style classes.
-
-- The socket module defines a new method for socket objects,
- sendall(). This is like send() but may make multiple calls to
- send() until all data has been sent. Also, the socket function has
- been converted to a subclassable type, like list and tuple (etc.)
- before it; socket and SocketType are now the same thing.
-
-- Various bugfixes to the curses module. There is now a test suite
- for the curses module (you have to run it manually).
-
-- binascii.b2a_base64 no longer places an arbitrary restriction of 57
- bytes on its input.
-
-Library
--------
-
-- tkFileDialog exposes a Directory class and askdirectory
- convenience function.
-
-- Symbolic group names in regular expressions must be unique. For
- example, the regexp r'(?P<abc>)(?P<abc>)' is not allowed, because a
- single name can't mean both "group 1" and "group 2" simultaneously.
- Python 2.2 detects this error at regexp compilation time;
- previously, the error went undetected, and results were
- unpredictable. Also in sre, the pattern.split(), pattern.sub(), and
- pattern.subn() methods have been rewritten in C. Also, an
- experimental function/method finditer() has been added, which works
- like findall() but returns an iterator.
-
-- Tix exposes more commands through the classes DirSelectBox,
- DirSelectDialog, ListNoteBook, Meter, CheckList, and the
- methods tix_addbitmapdir, tix_cget, tix_configure, tix_filedialog,
- tix_getbitmap, tix_getimage, tix_option_get, and tix_resetoptions.
-
-- Traceback objects are now scanned by cyclic garbage collection, so
- cycles created by casual use of sys.exc_info() no longer cause
- permanent memory leaks (provided garbage collection is enabled).
-
-- os.extsep -- a new variable needed by the RISCOS support. It is the
- separator used by extensions, and is '.' on all platforms except
- RISCOS, where it is '/'. There is no need to use this variable
- unless you have a masochistic desire to port your code to RISCOS.
-
-- mimetypes.py has optional support for non-standard, but commonly
- found types. guess_type() and guess_extension() now accept an
- optional 'strict' flag, defaulting to true, which controls whether
- recognize non-standard types or not. A few non-standard types we
- know about have been added. Also, when run as a script, there are
- new -l and -e options.
-
-- statcache is now deprecated.
-
-- email.Utils.formatdate() now produces the preferred RFC 2822 style
- dates with numeric timezones (it used to produce obsolete dates
- hard coded to "GMT" timezone). An optional 'localtime' flag is
- added to produce dates in the local timezone, with daylight savings
- time properly taken into account.
-
-- In pickle and cPickle, instead of masking errors in load() by
- transforming them into SystemError, we let the original exception
- propagate out. Also, implement support for __safe_for_unpickling__
- in pickle, as it already was supported in cPickle.
-
-Tools/Demos
------------
-
-Build
------
-
-- The dbm module is built using libdb1 if available. The bsddb module
- is built with libdb3 if available.
-
-- Misc/Makefile.pre.in has been removed by BDFL pronouncement.
-
-C API
------
-
-- New function PySequence_Fast_GET_SIZE() returns the size of a non-
- NULL result from PySequence_Fast(), more quickly than calling
- PySequence_Size().
-
-- New argument unpacking function PyArg_UnpackTuple() added.
-
-- New functions PyObject_CallFunctionObjArgs() and
- PyObject_CallMethodObjArgs() have been added to make it more
- convenient and efficient to call functions and methods from C.
-
-- PyArg_ParseTupleAndKeywords() no longer masks errors, so it's
- possible that this will propagate errors it didn't before.
-
-- New function PyObject_CheckReadBuffer(), which returns true if its
- argument supports the single-segment readable buffer interface.
-
-New platforms
--------------
-
-- We've finally confirmed that this release builds on HP-UX 11.00,
- *with* threads, and passes the test suite.
-
-- Thanks to a series of patches from Michael Muller, Python may build
- again under OS/2 Visual Age C++.
-
-- Updated RISCOS port by Dietmar Schwertberger.
-
-Tests
------
-
-- Added a test script for the curses module. It isn't run automatically;
- regrtest.py must be run with '-u curses' to enable it.
-
-Windows
--------
-
-Mac
-----
-
-- PythonScript has been moved to unsupported and is slated to be
- removed completely in the next release.
-
-- It should now be possible to build applets that work on both OS9 and
- OSX.
-
-- The core is now linked with CoreServices not Carbon; as a side
- result, default 8bit encoding on OSX is now ASCII.
-
-- Python should now build on OSX 10.1.1
-
-
-What's New in Python 2.2b1?
-===========================
-
-*Release date: 19-Oct-2001*
-
-Type/class unification and new-style classes
---------------------------------------------
-
-- New-style classes are now always dynamic (except for built-in and
- extension types). There is no longer a performance penalty, and I
- no longer see another reason to keep this baggage around. One relic
- remains: the __dict__ of a new-style class is a read-only proxy; you
- must set the class's attribute to modify it. As a consequence, the
- __defined__ attribute of new-style types no longer exists, for lack
- of need: there is once again only one __dict__ (although in the
- future a __cache__ may be resurrected with a similar function, if I
- can prove that it actually speeds things up).
-
-- C.__doc__ now works as expected for new-style classes (in 2.2a4 it
- always returned None, even when there was a class docstring).
-
-- doctest now finds and runs docstrings attached to new-style classes,
- class methods, static methods, and properties.
-
-Core and builtins
------------------
-
-- A very subtle syntactical pitfall in list comprehensions was fixed.
- For example: [a+b for a in 'abc', for b in 'def']. The comma in
- this example is a mistake. Previously, this would silently let 'a'
- iterate over the singleton tuple ('abc',), yielding ['abcd', 'abce',
- 'abcf'] rather than the intended ['ad', 'ae', 'af', 'bd', 'be',
- 'bf', 'cd', 'ce', 'cf']. Now, this is flagged as a syntax error.
- Note that [a for a in <singleton>] is a convoluted way to say
- [<singleton>] anyway, so it's not like any expressiveness is lost.
-
-- getattr(obj, name, default) now only catches AttributeError, as
- documented, rather than returning the default value for all
- exceptions (which could mask bugs in a __getattr__ hook, for
- example).
-
-- Weak reference objects are now part of the core and offer a C API.
- A bug which could allow a core dump when binary operations involved
- proxy reference has been fixed. weakref.ReferenceError is now a
- built-in exception.
-
-- unicode(obj) now behaves more like str(obj), accepting arbitrary
- objects, and calling a __unicode__ method if it exists.
- unicode(obj, encoding) and unicode(obj, encoding, errors) still
- require an 8-bit string or character buffer argument.
-
-- isinstance() now allows any object as the first argument and a
- class, a type or something with a __bases__ tuple attribute for the
- second argument. The second argument may also be a tuple of a
- class, type, or something with __bases__, in which case isinstance()
- will return true if the first argument is an instance of any of the
- things contained in the second argument tuple. E.g.
-
- isinstance(x, (A, B))
-
- returns true if x is an instance of A or B.
-
-Extension modules
------------------
-
-- thread.start_new_thread() now returns the thread ID (previously None).
-
-- binascii has now two quopri support functions, a2b_qp and b2a_qp.
-
-- readline now supports setting the startup_hook and the
- pre_event_hook, and adds the add_history() function.
-
-- os and posix supports chroot(), setgroups() and unsetenv() where
- available. The stat(), fstat(), statvfs() and fstatvfs() functions
- now return "pseudo-sequences" -- the various fields can now be
- accessed as attributes (e.g. os.stat("/").st_mtime) but for
- backwards compatibility they also behave as a fixed-length sequence.
- Some platform-specific fields (e.g. st_rdev) are only accessible as
- attributes.
-
-- time: localtime(), gmtime() and strptime() now return a
- pseudo-sequence similar to the os.stat() return value, with
- attributes like tm_year etc.
-
-- Decompression objects in the zlib module now accept an optional
- second parameter to decompress() that specifies the maximum amount
- of memory to use for the uncompressed data.
-
-- optional SSL support in the socket module now exports OpenSSL
- functions RAND_add(), RAND_egd(), and RAND_status(). These calls
- are useful on platforms like Solaris where OpenSSL does not
- automatically seed its PRNG. Also, the keyfile and certfile
- arguments to socket.ssl() are now optional.
-
-- posixmodule (and by extension, the os module on POSIX platforms) now
- exports O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.
-
-Library
--------
-
-- doctest now excludes functions and classes not defined by the module
- being tested, thanks to Tim Hochberg.
-
-- HotShot, a new profiler implemented using a C-based callback, has
- been added. This substantially reduces the overhead of profiling,
- but it is still quite preliminary. Support modules and
- documentation will be added in upcoming releases (before 2.2 final).
-
-- profile now produces correct output in situations where an exception
- raised in Python is cleared by C code (e.g. hasattr()). This used
- to cause wrong output, including spurious claims of recursive
- functions and attribution of time spent to the wrong function.
-
- The code and documentation for the derived OldProfile and HotProfile
- profiling classes was removed. The code hasn't worked for years (if
- you tried to use them, they raised exceptions). OldProfile
- intended to reproduce the behavior of the profiler Python used more
- than 7 years ago, and isn't interesting anymore. HotProfile intended
- to provide a faster profiler (but producing less information), and
- that's a worthy goal we intend to meet via a different approach (but
- without losing information).
-
-- Profile.calibrate() has a new implementation that should deliver
- a much better system-specific calibration constant. The constant can
- now be specified in an instance constructor, or as a Profile class or
- instance variable, instead of by editing profile.py's source code.
- Calibration must still be done manually (see the docs for the profile
- module).
-
- Note that Profile.calibrate() must be overridden by subclasses.
- Improving the accuracy required exploiting detailed knowledge of
- profiler internals; the earlier method abstracted away the details
- and measured a simplified model instead, but consequently computed
- a constant too small by a factor of 2 on some modern machines.
-
-- quopri's encode and decode methods take an optional header parameter,
- which indicates whether output is intended for the header 'Q'
- encoding.
-
-- The SocketServer.ThreadingMixIn class now closes the request after
- finish_request() returns. (Not when it errors out though.)
-
-- The nntplib module's NNTP.body() method has grown a 'file' argument
- to allow saving the message body to a file.
-
-- The email package has added a class email.Parser.HeaderParser which
- only parses headers and does not recurse into the message's body.
- Also, the module/class MIMEAudio has been added for representing
- audio data (contributed by Anthony Baxter).
-
-- ftplib should be able to handle files > 2GB.
-
-- ConfigParser.getboolean() now also interprets TRUE, FALSE, YES, NO,
- ON, and OFF.
-
-- xml.dom.minidom NodeList objects now support the length attribute
- and item() method as required by the DOM specifications.
-
-Tools/Demos
------------
-
-- Demo/dns was removed. It no longer serves any purpose; a package
- derived from it is now maintained by Anthony Baxter, see
- http://PyDNS.SourceForge.net.
-
-- The freeze tool has been made more robust, and two new options have
- been added: -X and -E.
-
-Build
------
-
-- configure will use CXX in LINKCC if CXX is used to build main() and
- the system requires to link a C++ main using the C++ compiler.
-
-C API
------
-
-- The documentation for the tp_compare slot is updated to require that
- the return value must be -1, 0, 1; an arbitrary number <0 or >0 is
- not correct. This is not yet enforced but will be enforced in
- Python 2.3; even later, we may use -2 to indicate errors and +2 for
- "NotImplemented". Right now, -1 should be used for an error return.
-
-- PyLong_AsLongLong() now accepts int (as well as long) arguments.
- Consequently, PyArg_ParseTuple's 'L' code also accepts int (as well
- as long) arguments.
-
-- PyThread_start_new_thread() now returns a long int giving the thread
- ID, if one can be calculated; it returns -1 for error, 0 if no
- thread ID is calculated (this is an incompatible change, but only
- the thread module used this API). This code has only really been
- tested on Linux and Windows; other platforms please beware (and
- report any bugs or strange behavior).
-
-- PyUnicode_FromEncodedObject() no longer accepts Unicode objects as
- input.
-
-New platforms
--------------
-
-Tests
------
-
-Windows
--------
-
-- Installer: If you install IDLE, and don't disable file-extension
- registration, a new "Edit with IDLE" context (right-click) menu entry
- is created for .py and .pyw files.
-
-- The signal module now supports SIGBREAK on Windows, thanks to Steven
- Scott. Note that SIGBREAK is unique to Windows. The default SIGBREAK
- action remains to call Win32 ExitProcess(). This can be changed via
- signal.signal(). For example::
-
- # Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
- # (SIGINT) behavior.
- import signal
- signal.signal(signal.SIGBREAK, signal.default_int_handler)
-
- try:
- while 1:
- pass
- except KeyboardInterrupt:
- # We get here on Ctrl+C or Ctrl+Break now; if we had not changed
- # SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the
- # program without the possibility for any Python-level cleanup).
- print "Clean exit"
-
-
-What's New in Python 2.2a4?
-===========================
-
-*Release date: 28-Sep-2001*
-
-Type/class unification and new-style classes
---------------------------------------------
-
-- pydoc and inspect are now aware of new-style classes;
- e.g. help(list) at the interactive prompt now shows proper
- documentation for all operations on list objects.
-
-- Applications using Jim Fulton's ExtensionClass module can now safely
- be used with Python 2.2. In particular, Zope 2.4.1 now works with
- Python 2.2 (as well as with Python 2.1.1). The Demo/metaclass
- examples also work again. It is hoped that Gtk and Boost also work
- with 2.2a4 and beyond. (If you can confirm this, please write
- webmaster@python.org; if there are still problems, please open a bug
- report on SourceForge.)
-
-- property() now takes 4 keyword arguments: fget, fset, fdel and doc.
- These map to read-only attributes 'fget', 'fset', 'fdel', and '__doc__'
- in the constructed property object. fget, fset and fdel weren't
- discoverable from Python in 2.2a3. __doc__ is new, and allows to
- associate a docstring with a property.
-
-- Comparison overloading is now more completely implemented. For
- example, a str subclass instance can properly be compared to a str
- instance, and it can properly overload comparison. Ditto for most
- other built-in object types.
-
-- The repr() of new-style classes has changed; instead of <type
- 'M.Foo'> a new-style class is now rendered as <class 'M.Foo'>,
- *except* for built-in types, which are still rendered as <type
- 'Foo'> (to avoid upsetting existing code that might parse or
- otherwise rely on repr() of certain type objects).
-
-- The repr() of new-style objects is now always <Foo object at XXX>;
- previously, it was sometimes <Foo instance at XXX>.
-
-- For new-style classes, what was previously called __getattr__ is now
- called __getattribute__. This method, if defined, is called for
- *every* attribute access. A new __getattr__ hook more similar to the
- one in classic classes is defined which is called only if regular
- attribute access raises AttributeError; to catch *all* attribute
- access, you can use __getattribute__ (for new-style classes). If
- both are defined, __getattribute__ is called first, and if it raises
- AttributeError, __getattr__ is called.
-
-- The __class__ attribute of new-style objects can be assigned to.
- The new class must have the same C-level object layout as the old
- class.
-
-- The builtin file type can be subclassed now. In the usual pattern,
- "file" is the name of the builtin type, and file() is a new builtin
- constructor, with the same signature as the builtin open() function.
- file() is now the preferred way to open a file.
-
-- Previously, __new__ would only see sequential arguments passed to
- the type in a constructor call; __init__ would see both sequential
- and keyword arguments. This made no sense whatsoever any more, so
- now both __new__ and __init__ see all arguments.
-
-- Previously, hash() applied to an instance of a subclass of str or
- unicode always returned 0. This has been repaired.
-
-- Previously, an operation on an instance of a subclass of an
- immutable type (int, long, float, complex, tuple, str, unicode),
- where the subtype didn't override the operation (and so the
- operation was handled by the builtin type), could return that
- instance instead a value of the base type. For example, if s was of
- a str subclass type, s[:] returned s as-is. Now it returns a str
- with the same value as s.
-
-- Provisional support for pickling new-style objects has been added.
-
-Core
-----
-
-- file.writelines() now accepts any iterable object producing strings.
-
-- PyUnicode_FromEncodedObject() now works very much like
- PyObject_Str(obj) in that it tries to use __str__/tp_str
- on the object if the object is not a string or buffer. This
- makes unicode() behave like str() when applied to non-string/buffer
- objects.
-
-- PyFile_WriteObject now passes Unicode objects to the file's write
- method. As a result, all file-like objects which may be the target
- of a print statement must support Unicode objects, i.e. they must
- at least convert them into ASCII strings.
-
-- Thread scheduling on Solaris should be improved; it is no longer
- necessary to insert a small sleep at the start of a thread in order
- to let other runnable threads be scheduled.
-
-Library
--------
-
-- StringIO.StringIO instances and cStringIO.StringIO instances support
- read character buffer compatible objects for their .write() methods.
- These objects are converted to strings and then handled as such
- by the instances.
-
-- The "email" package has been added. This is basically a port of the
- mimelib package <http://sf.net/projects/mimelib> with API changes
- and some implementations updated to use iterators and generators.
-
-- difflib.ndiff() and difflib.Differ.compare() are generators now. This
- restores the ability of Tools/scripts/ndiff.py to start producing output
- before the entire comparison is complete.
-
-- StringIO.StringIO instances and cStringIO.StringIO instances support
- iteration just like file objects (i.e. their .readline() method is
- called for each iteration until it returns an empty string).
-
-- The codecs module has grown four new helper APIs to access
- builtin codecs: getencoder(), getdecoder(), getreader(),
- getwriter().
-
-- SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer)
- simplifies writing XML RPC servers.
-
-- os.path.realpath(): a new function that returns the absolute pathname
- after interpretation of symbolic links. On non-Unix systems, this
- is an alias for os.path.abspath().
-
-- operator.indexOf() (PySequence_Index() in the C API) now works with any
- iterable object.
-
-- smtplib now supports various authentication and security features of
- the SMTP protocol through the new login() and starttls() methods.
-
-- hmac: a new module implementing keyed hashing for message
- authentication.
-
-- mimetypes now recognizes more extensions and file types. At the
- same time, some mappings not sanctioned by IANA were removed.
-
-- The "compiler" package has been brought up to date to the state of
- Python 2.2 bytecode generation. It has also been promoted from a
- Tool to a standard library package. (Tools/compiler still exists as
- a sample driver.)
-
-Build
------
-
-- Large file support (LFS) is now automatic when the platform supports
- it; no more manual configuration tweaks are needed. On Linux, at
- least, it's possible to have a system whose C library supports large
- files but whose kernel doesn't; in this case, large file support is
- still enabled but doesn't do you any good unless you upgrade your
- kernel or share your Python executable with another system whose
- kernel has large file support.
-
-- The configure script now supplies plausible defaults in a
- cross-compilation environment. This doesn't mean that the supplied
- values are always correct, or that cross-compilation now works
- flawlessly -- but it's a first step (and it shuts up most of
- autoconf's warnings about AC_TRY_RUN).
-
-- The Unix build is now a bit less chatty, courtesy of the parser
- generator. The build is completely silent (except for errors) when
- using "make -s", thanks to a -q option to setup.py.
-
-C API
------
-
-- The "structmember" API now supports some new flag bits to deny read
- and/or write access to attributes in restricted execution mode.
-
-New platforms
--------------
-
-- Compaq's iPAQ handheld, running the "familiar" Linux distribution
- (http://familiar.handhelds.org).
-
-Tests
------
-
-- The "classic" standard tests, which work by comparing stdout to
- an expected-output file under Lib/test/output/, no longer stop at
- the first mismatch. Instead the test is run to completion, and a
- variant of ndiff-style comparison is used to report all differences.
- This is much easier to understand than the previous style of reporting.
-
-- The unittest-based standard tests now use regrtest's test_main()
- convention, instead of running as a side-effect of merely being
- imported. This allows these tests to be run in more natural and
- flexible ways as unittests, outside the regrtest framework.
-
-- regrtest.py is much better integrated with unittest and doctest now,
- especially in regard to reporting errors.
-
-Windows
--------
-
-- Large file support now also works for files > 4GB, on filesystems
- that support it (NTFS under Windows 2000). See "What's New in
- Python 2.2a3" for more detail.
-
-
-What's New in Python 2.2a3?
-===========================
-
-*Release Date: 07-Sep-2001*
-
-Core
-----
-
-- Conversion of long to float now raises OverflowError if the long is too
- big to represent as a C double.
-
-- The 3-argument builtin pow() no longer allows a third non-None argument
- if either of the first two arguments is a float, or if both are of
- integer types and the second argument is negative (in which latter case
- the arguments are converted to float, so this is really the same
- restriction).
-
-- The builtin dir() now returns more information, and sometimes much
- more, generally naming all attributes of an object, and all attributes
- reachable from the object via its class, and from its class's base
- classes, and so on from them too. Example: in 2.2a2, dir([]) returned
- an empty list. In 2.2a3,
-
- >>> dir([])
- ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
- '__eq__', '__ge__', '__getattr__', '__getitem__', '__getslice__',
- '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__le__',
- '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__repr__',
- '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__',
- 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
- 'reverse', 'sort']
-
- dir(module) continues to return only the module's attributes, though.
-
-- Overflowing operations on plain ints now return a long int rather
- than raising OverflowError. This is a partial implementation of PEP
- 237. You can use -Wdefault::OverflowWarning to enable a warning for
- this situation, and -Werror::OverflowWarning to revert to the old
- OverflowError exception.
-
-- A new command line option, -Q<arg>, is added to control run-time
- warnings for the use of classic division. (See PEP 238.) Possible
- values are -Qold, -Qwarn, -Qwarnall, and -Qnew. The default is
- -Qold, meaning the / operator has its classic meaning and no
- warnings are issued. Using -Qwarn issues a run-time warning about
- all uses of classic division for int and long arguments; -Qwarnall
- also warns about classic division for float and complex arguments
- (for use with fixdiv.py).
- [Note: the remainder of this item (preserved below) became
- obsolete in 2.2c1 -- -Qnew has global effect in 2.2] ::
-
- Using -Qnew is questionable; it turns on new division by default, but
- only in the __main__ module. You can usefully combine -Qwarn or
- -Qwarnall and -Qnew: this gives the __main__ module new division, and
- warns about classic division everywhere else.
-
-- Many built-in types can now be subclassed. This applies to int,
- long, float, str, unicode, and tuple. (The types complex, list and
- dictionary can also be subclassed; this was introduced earlier.)
- Note that restrictions apply when subclassing immutable built-in
- types: you can only affect the value of the instance by overloading
- __new__. You can add mutable attributes, and the subclass instances
- will have a __dict__ attribute, but you cannot change the "value"
- (as implemented by the base class) of an immutable subclass instance
- once it is created.
-
-- The dictionary constructor now takes an optional argument, a
- mapping-like object, and initializes the dictionary from its
- (key, value) pairs.
-
-- A new built-in type, super, has been added. This facilitates making
- "cooperative super calls" in a multiple inheritance setting. For an
- explanation, see http://www.python.org/2.2/descrintro.html#cooperation
-
-- A new built-in type, property, has been added. This enables the
- creation of "properties". These are attributes implemented by
- getter and setter functions (or only one of these for read-only or
- write-only attributes), without the need to override __getattr__.
- See http://www.python.org/2.2/descrintro.html#property
-
-- The syntax of floating-point and imaginary literals has been
- liberalized, to allow leading zeroes. Examples of literals now
- legal that were SyntaxErrors before:
-
- 00.0 0e3 0100j 07.5 00000000000000000008.
-
-- An old tokenizer bug allowed floating point literals with an incomplete
- exponent, such as 1e and 3.1e-. Such literals now raise SyntaxError.
-
-Library
--------
-
-- telnetlib includes symbolic names for the options, and support for
- setting an option negotiation callback. It also supports processing
- of suboptions.
-
-- The new C standard no longer requires that math libraries set errno to
- ERANGE on overflow. For platform libraries that exploit this new
- freedom, Python's overflow-checking was wholly broken. A new overflow-
- checking scheme attempts to repair that, but may not be reliable on all
- platforms (C doesn't seem to provide anything both useful and portable
- in this area anymore).
-
-- Asynchronous timeout actions are available through the new class
- threading.Timer.
-
-- math.log and math.log10 now return sensible results for even huge
- long arguments. For example, math.log10(10 ** 10000) ~= 10000.0.
-
-- A new function, imp.lock_held(), returns 1 when the import lock is
- currently held. See the docs for the imp module.
-
-- pickle, cPickle and marshal on 32-bit platforms can now correctly read
- dumps containing ints written on platforms where Python ints are 8 bytes.
- When read on a box where Python ints are 4 bytes, such values are
- converted to Python longs.
-
-- In restricted execution mode (using the rexec module), unmarshalling
- code objects is no longer allowed. This plugs a security hole.
-
-- unittest.TestResult instances no longer store references to tracebacks
- generated by test failures. This prevents unexpected dangling references
- to objects that should be garbage collected between tests.
-
-Tools
------
-
-- Tools/scripts/fixdiv.py has been added which can be used to fix
- division operators as per PEP 238.
-
-Build
------
-
-- If you are an adventurous person using Mac OS X you may want to look at
- Mac/OSX. There is a Makefile there that will build Python as a real Mac
- application, which can be used for experimenting with Carbon or Cocoa.
- Discussion of this on pythonmac-sig, please.
-
-C API
------
-
-- New function PyObject_Dir(obj), like Python __builtin__.dir(obj).
-
-- Note that PyLong_AsDouble can fail! This has always been true, but no
- callers checked for it. It's more likely to fail now, because overflow
- errors are properly detected now. The proper way to check::
-
- double x = PyLong_AsDouble(some_long_object);
- if (x == -1.0 && PyErr_Occurred()) {
- /* The conversion failed. */
- }
-
-- The GC API has been changed. Extensions that use the old API will still
- compile but will not participate in GC. To upgrade an extension
- module:
-
- - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC
-
- - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and
- PyObject_GC_Del to deallocate them
-
- - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini
- to PyObject_GC_UnTrack
-
- - remove PyGC_HEAD_SIZE from object size calculations
-
- - remove calls to PyObject_AS_GC and PyObject_FROM_GC
-
-- Two new functions: PyString_FromFormat() and PyString_FromFormatV().
- These can be used safely to construct string objects from a
- sprintf-style format string (similar to the format string supported
- by PyErr_Format()).
-
-New platforms
--------------
-
-- Stephen Hansen contributed patches sufficient to get a clean compile
- under Borland C (Windows), but he reports problems running it and ran
- out of time to complete the port. Volunteers? Expect a MemoryError
- when importing the types module; this is probably shallow, and
- causing later failures too.
-
-Tests
------
-
-Windows
--------
-
-- Large file support is now enabled on Win32 platforms as well as on
- Win64. This means that, for example, you can use f.tell() and f.seek()
- to manipulate files larger than 2 gigabytes (provided you have enough
- disk space, and are using a Windows filesystem that supports large
- partitions). Windows filesystem limits: FAT has a 2GB (gigabyte)
- filesize limit, and large file support makes no difference there.
- FAT32's limit is 4GB, and files >= 2GB are easier to use from Python now.
- NTFS has no practical limit on file size, and files of any size can be
- used from Python now.
-
-- The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC
- points to command.com (patch from Brian Quinlan).
-
-
-What's New in Python 2.2a2?
-===========================
-
-*Release Date: 22-Aug-2001*
-
-Build
------
-
-- Tim Peters developed a brand new Windows installer using Wise 8.1,
- generously donated to us by Wise Solutions.
-
-- configure supports a new option --enable-unicode, with the values
- ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode
- type and supporting code is completely removed from the interpreter.
-
-- A new configure option --enable-framework builds a Mac OS X framework,
- which "make frameworkinstall" will install. This provides a starting
- point for more mac-like functionality, join pythonmac-sig@python.org
- if you are interested in helping.
-
-- The NeXT platform is no longer supported.
-
-- The 'new' module is now statically linked.
-
-Tools
------
-
-- The new Tools/scripts/cleanfuture.py can be used to automatically
- edit out obsolete future statements from Python source code. See
- the module docstring for details.
-
-Tests
------
-
-- regrtest.py now knows which tests are expected to be skipped on some
- platforms, allowing to give clearer test result output. regrtest
- also has optional --use/-u switch to run normally disabled tests
- which require network access or consume significant disk resources.
-
-- Several new tests in the standard test suite, with special thanks to
- Nick Mathewson.
-
-Core
-----
-
-- The floor division operator // has been added as outlined in PEP
- 238. The / operator still provides classic division (and will until
- Python 3.0) unless "from __future__ import division" is included, in
- which case the / operator will provide true division. The operator
- module provides truediv() and floordiv() functions. Augmented
- assignment variants are included, as are the equivalent overloadable
- methods and C API methods. See the PEP for a full discussion:
- <http://python.sf.net/peps/pep-0238.html>
-
-- Future statements are now effective in simulated interactive shells
- (like IDLE). This should "just work" by magic, but read Michael
- Hudson's "Future statements in simulated shells" PEP 264 for full
- details: <http://python.sf.net/peps/pep-0264.html>.
-
-- The type/class unification (PEP 252-253) was integrated into the
- trunk and is not so tentative any more (the exact specification of
- some features is still tentative). A lot of work has done on fixing
- bugs and adding robustness and features (performance still has to
- come a long way).
-
-- Warnings about a mismatch in the Python API during extension import
- now use the Python warning framework (which makes it possible to
- write filters for these warnings).
-
-- A function's __dict__ (aka func_dict) will now always be a
- dictionary. It used to be possible to delete it or set it to None,
- but now both actions raise TypeErrors. It is still legal to set it
- to a dictionary object. Getting func.__dict__ before any attributes
- have been assigned now returns an empty dictionary instead of None.
-
-- A new command line option, -E, was added which disables the use of
- all environment variables, or at least those that are specifically
- significant to Python. Usually those have a name starting with
- "PYTHON". This was used to fix a problem where the tests fail if
- the user happens to have PYTHONHOME or PYTHONPATH pointing to an
- older distribution.
-
-Library
--------
-
-- New class Differ and new functions ndiff() and restore() in difflib.py.
- These package the algorithms used by the popular Tools/scripts/ndiff.py,
- for programmatic reuse.
-
-- New function xml.sax.saxutils.quoteattr(): Quote an XML attribute
- value using the minimal quoting required for the value; more
- reliable than using xml.sax.saxutils.escape() for attribute values.
-
-- Readline completion support for cmd.Cmd was added.
-
-- Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings.
-
-- Added function threading.BoundedSemaphore()
-
-- Added Ka-Ping Yee's cgitb.py module.
-
-- The 'new' module now exposes the CO_xxx flags.
-
-- The gc module offers the get_referents function.
-
-New platforms
--------------
-
-C API
------
-
-- Two new APIs PyOS_snprintf() and PyOS_vsnprintf() were added
- which provide a cross-platform implementations for the
- relatively new snprintf()/vsnprintf() C lib APIs. In contrast to
- the standard sprintf() and vsprintf() C lib APIs, these versions
- apply bounds checking on the used buffer which enhances protection
- against buffer overruns.
-
-- Unicode APIs now use name mangling to assure that mixing interpreters
- and extensions using different Unicode widths is rendered next to
- impossible. Trying to import an incompatible Unicode-aware extension
- will result in an ImportError. Unicode extensions writers must make
- sure to check the Unicode width compatibility in their extensions by
- using at least one of the mangled Unicode APIs in the extension.
-
-- Two new flags METH_NOARGS and METH_O are available in method definition
- tables to simplify implementation of methods with no arguments and a
- single untyped argument. Calling such methods is more efficient than
- calling corresponding METH_VARARGS methods. METH_OLDARGS is now
- deprecated.
-
-Windows
--------
-
-- "import module" now compiles module.pyw if it exists and nothing else
- relevant is found.
-
-
-What's New in Python 2.2a1?
-===========================
-
-*Release date: 18-Jul-2001*
-
-Core
-----
-
-- TENTATIVELY, a large amount of code implementing much of what's
- described in PEP 252 (Making Types Look More Like Classes) and PEP
- 253 (Subtyping Built-in Types) was added. This will be released
- with Python 2.2a1. Documentation will be provided separately
- through http://www.python.org/2.2/. The purpose of releasing this
- with Python 2.2a1 is to test backwards compatibility. It is
- possible, though not likely, that a decision is made not to release
- this code as part of 2.2 final, if any serious backwards
- incompatibilities are found during alpha testing that cannot be
- repaired.
-
-- Generators were added; this is a new way to create an iterator (see
- below) using what looks like a simple function containing one or
- more 'yield' statements. See PEP 255. Since this adds a new
- keyword to the language, this feature must be enabled by including a
- future statement: "from __future__ import generators" (see PEP 236).
- Generators will become a standard feature in a future release
- (probably 2.3). Without this future statement, 'yield' remains an
- ordinary identifier, but a warning is issued each time it is used.
- (These warnings currently don't conform to the warnings framework of
- PEP 230; we intend to fix this in 2.2a2.)
-
-- The UTF-16 codec was modified to be more RFC compliant. It will now
- only remove BOM characters at the start of the string and then
- only if running in native mode (UTF-16-LE and -BE won't remove a
- leading BMO character).
-
-- Strings now have a new method .decode() to complement the already
- existing .encode() method. These two methods provide direct access
- to the corresponding decoders and encoders of the registered codecs.
-
- To enhance the usability of the .encode() method, the special
- casing of Unicode object return values was dropped (Unicode objects
- were auto-magically converted to string using the default encoding).
-
- Both methods will now return whatever the codec in charge of the
- requested encoding returns as object, e.g. Unicode codecs will
- return Unicode objects when decoding is requested ("äöü".decode("latin-1")
- will return u"äöü"). This enables codec writer to create codecs
- for various simple to use conversions.
-
- New codecs were added to demonstrate these new features (the .encode()
- and .decode() columns indicate the type of the returned objects):
-
- +---------+-----------+-----------+-----------------------------+
- |Name | .encode() | .decode() | Description |
- +=========+===========+===========+=============================+
- |uu | string | string | UU codec (e.g. for email) |
- +---------+-----------+-----------+-----------------------------+
- |base64 | string | string | base64 codec |
- +---------+-----------+-----------+-----------------------------+
- |quopri | string | string | quoted-printable codec |
- +---------+-----------+-----------+-----------------------------+
- |zlib | string | string | zlib compression |
- +---------+-----------+-----------+-----------------------------+
- |hex | string | string | 2-byte hex codec |
- +---------+-----------+-----------+-----------------------------+
- |rot-13 | string | Unicode | ROT-13 Unicode charmap codec|
- +---------+-----------+-----------+-----------------------------+
-
-- Some operating systems now support the concept of a default Unicode
- encoding for file system operations. Notably, Windows supports 'mbcs'
- as the default. The Macintosh will also adopt this concept in the medium
- term, although the default encoding for that platform will be other than
- 'mbcs'.
-
- On operating system that support non-ASCII filenames, it is common for
- functions that return filenames (such as os.listdir()) to return Python
- string objects pre-encoded using the default file system encoding for
- the platform. As this encoding is likely to be different from Python's
- default encoding, converting this name to a Unicode object before passing
- it back to the Operating System would result in a Unicode error, as Python
- would attempt to use its default encoding (generally ASCII) rather than
- the default encoding for the file system.
-
- In general, this change simply removes surprises when working with
- Unicode and the file system, making these operations work as you expect,
- increasing the transparency of Unicode objects in this context.
- See [????] for more details, including examples.
-
-- Float (and complex) literals in source code were evaluated to full
- precision only when running from a .py file; the same code loaded from a
- .pyc (or .pyo) file could suffer numeric differences starting at about the
- 12th significant decimal digit. For example, on a machine with IEEE-754
- floating arithmetic,
-
- x = 9007199254740992.0
- print long(x)
-
- printed 9007199254740992 if run directly from .py, but 9007199254740000
- if from a compiled (.pyc or .pyo) file. This was due to marshal using
- str(float) instead of repr(float) when building code objects. marshal
- now uses repr(float) instead, which should reproduce floats to full
- machine precision (assuming the platform C float<->string I/O conversion
- functions are of good quality).
-
- This may cause floating-point results to change in some cases, and
- usually for the better, but may also cause numerically unstable
- algorithms to break.
-
-- The implementation of dicts suffers fewer collisions, which has speed
- benefits. However, the order in which dict entries appear in dict.keys(),
- dict.values() and dict.items() may differ from previous releases for a
- given dict. Nothing is defined about this order, so no program should
- rely on it. Nevertheless, it's easy to write test cases that rely on the
- order by accident, typically because of printing the str() or repr() of a
- dict to an "expected results" file. See Lib/test/test_support.py's new
- sortdict(dict) function for a simple way to display a dict in sorted
- order.
-
-- Many other small changes to dicts were made, resulting in faster
- operation along the most common code paths.
-
-- Dictionary objects now support the "in" operator: "x in dict" means
- the same as dict.has_key(x).
-
-- The update() method of dictionaries now accepts generic mapping
- objects. Specifically the argument object must support the .keys()
- and __getitem__() methods. This allows you to say, for example,
- {}.update(UserDict())
-
-- Iterators were added; this is a generalized way of providing values
- to a for loop. See PEP 234. There's a new built-in function iter()
- to return an iterator. There's a new protocol to get the next value
- from an iterator using the next() method (in Python) or the
- tp_iternext slot (in C). There's a new protocol to get iterators
- using the __iter__() method (in Python) or the tp_iter slot (in C).
- Iterating (i.e. a for loop) over a dictionary generates its keys.
- Iterating over a file generates its lines.
-
-- The following functions were generalized to work nicely with iterator
- arguments::
-
- map(), filter(), reduce(), zip()
- list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API)
- max(), min()
- join() method of strings
- extend() method of lists
- 'x in y' and 'x not in y' (PySequence_Contains() in C API)
- operator.countOf() (PySequence_Count() in C API)
- right-hand side of assignment statements with multiple targets, such as ::
- x, y, z = some_iterable_object_returning_exactly_3_values
-
-- Accessing module attributes is significantly faster (for example,
- random.random or os.path or yourPythonModule.yourAttribute).
-
-- Comparing dictionary objects via == and != is faster, and now works even
- if the keys and values don't support comparisons other than ==.
-
-- Comparing dictionaries in ways other than == and != is slower: there were
- insecurities in the dict comparison implementation that could cause Python
- to crash if the element comparison routines for the dict keys and/or
- values mutated the dicts. Making the code bulletproof slowed it down.
-
-- Collisions in dicts are resolved via a new approach, which can help
- dramatically in bad cases. For example, looking up every key in a dict
- d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x
- faster now. Thanks to Christian Tismer for pointing out the cause and
- the nature of an effective cure (last December! better late than never).
-
-- repr() is much faster for large containers (dict, list, tuple).
-
-
-Library
--------
-
-- The constants ascii_letters, ascii_lowercase. and ascii_uppercase
- were added to the string module. These a locale-independent
- constants, unlike letters, lowercase, and uppercase. These are now
- use in appropriate locations in the standard library.
-
-- The flags used in dlopen calls can now be configured using
- sys.setdlopenflags and queried using sys.getdlopenflags.
-
-- Fredrik Lundh's xmlrpclib is now a standard library module. This
- provides full client-side XML-RPC support. In addition,
- Demo/xmlrpc/ contains two server frameworks (one SocketServer-based,
- one asyncore-based). Thanks to Eric Raymond for the documentation.
-
-- The xrange() object is simplified: it no longer supports slicing,
- repetition, comparisons, efficient 'in' checking, the tolist()
- method, or the start, stop and step attributes. See PEP 260.
-
-- A new function fnmatch.filter to filter lists of file names was added.
-
-- calendar.py uses month and day names based on the current locale.
-
-- strop is now *really* obsolete (this was announced before with 1.6),
- and issues DeprecationWarning when used (except for the four items
- that are still imported into string.py).
-
-- Cookie.py now sorts key+value pairs by key in output strings.
-
-- pprint.isrecursive(object) didn't correctly identify recursive objects.
- Now it does.
-
-- pprint functions now much faster for large containers (tuple, list, dict).
-
-- New 'q' and 'Q' format codes in the struct module, corresponding to C
- types "long long" and "unsigned long long" (on Windows, __int64). In
- native mode, these can be used only when the platform C compiler supports
- these types (when HAVE_LONG_LONG is #define'd by the Python config
- process), and then they inherit the sizes and alignments of the C types.
- In standard mode, 'q' and 'Q' are supported on all platforms, and are
- 8-byte integral types.
-
-- The site module installs a new built-in function 'help' that invokes
- pydoc.help. It must be invoked as 'help()'; when invoked as 'help',
- it displays a message reminding the user to use 'help()' or
- 'help(object)'.
-
-Tests
------
-
-- New test_mutants.py runs dict comparisons where the key and value
- comparison operators mutate the dicts randomly during comparison. This
- rapidly causes Python to crash under earlier releases (not for the faint
- of heart: it can also cause Win9x to freeze or reboot!).
-
-- New test_pprint.py verifies that pprint.isrecursive() and
- pprint.isreadable() return sensible results. Also verifies that simple
- cases produce correct output.
-
-C API
------
-
-- Removed the unused last_is_sticky argument from the internal
- _PyTuple_Resize(). If this affects you, you were cheating.
-
----
**(For information about older versions, consult the HISTORY file.)**
-This is Python version 2.3 release candidate 2
-==============================================
+This is Python version 2.3 (final)
+==================================
Copyright (c) 2001, 2002, 2003 Python Software Foundation.
All rights reserved.
See the file "Misc/NEWS".
+
If you don't read instructions
------------------------------
available for all modern systems, either in the form of updated
compilers from the vendor, or one of the free compilers (gcc).
+
Unsupported systems
-------------------
- Systems using --with-dl-dld
- Systems using --without-universal-newlines
+
Platform specific notes
-----------------------