Re: what's in 1.2

Guido.van.Rossum@cwi.nl
Fri, 17 Mar 1995 18:07:26 +0100

> I wonder if someone would care to help us beginners out and sumarize
> the major new features of 1.2, i.e why would a newbie want to upgrade
> from 1.1.1 after 1.2 becomes stable. Is there anything significant
> there or is this cleanup.

It's rather more than cleanup, although there's lots of that too --
many bugs have been fixed and leaks plugged (e.g. the dreaded Linux
ternary pow() crash is fixed, and I think it now compiles without
trouble using GCC on the DEC Alpha). It's also more portable.

Highlights of the user-visible changes:

Documentation strings -- a string literal at the beginning of a
function, class, module etc. turns into the object's __doc__
attribute (default None).

User-defined classes can be used as exceptions.

New modules:

pickle, shelve, copy (persistency, shallow/deep copying)

cgi, urllib, htmllib and lots more (WWW/Internet)

There is now real documentation for the debugger and profiler (and in
fact for several modules that were undocumented in 1.1, such as types,
traceback).

The special methods __coerce__ and __cmp__ for user-defined classes now
work properly.

Hooks are in place so you can program restricted execution of
untrusted code (a.k.a. "safe-python"). By redefining the built-in
function __import__ you can write your own implementation of import
(using the new imp module which provides the tools for importing
modules).

And if you're extending or embedding Python, the following might be
important:

The run-time API has changed to exclusive use of the new naming scheme
(e.g. PyObject *, Py_None, PyList_GetItem() instead of object *, None,
getlistitem()). Full backward compatibility is provided. There are
lots of smaller (compatible) changes to the API as well. The
extensions manual has been updated to document the new naming scheme
and the new options to (new)getargs (renamed to PyArg_ParseTuple()).

I hope this helps and keeps you on the lookout for the new release
(very soon now!),

--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>

PS Follow the links from this URL to the Python on-line documentation,
and you'll see the docs for 1.2!