2002-09-20 11:16:59 -03:00
|
|
|
|
+++++++++++
|
|
|
|
|
Python News
|
|
|
|
|
+++++++++++
|
|
|
|
|
|
2004-11-04 01:23:17 -04:00
|
|
|
|
(editors: check NEWS.help for information about editing NEWS using ReST.)
|
|
|
|
|
|
2004-12-02 04:59:14 -04:00
|
|
|
|
What's New in Python 2.5 alpha 1?
|
|
|
|
|
=================================
|
|
|
|
|
|
2005-03-29 09:36:16 -04:00
|
|
|
|
*Release date: XX-XXX-2006*
|
|
|
|
|
|
2004-12-02 04:59:14 -04:00
|
|
|
|
Core and builtins
|
|
|
|
|
-----------------
|
|
|
|
|
|
2006-03-01 00:25:17 -04:00
|
|
|
|
- PEP 352, patch #1104669: Make exceptions new-style objects. Introduced the
|
|
|
|
|
new exception base class, BaseException, which has a new message attribute.
|
|
|
|
|
KeyboardInterrupt and SystemExit to directly inherit from BaseException now.
|
|
|
|
|
Raising a string exception now raises a DeprecationWarning.
|
|
|
|
|
|
2006-02-28 12:37:25 -04:00
|
|
|
|
- Patch #1438387, PEP 328: relative and absolute imports. Imports can now be
|
|
|
|
|
explicitly relative, using 'from .module import name' to mean 'from the same
|
|
|
|
|
package as this module is in. Imports without dots still default to the
|
|
|
|
|
old relative-then-absolute, unless 'from __future__ import
|
|
|
|
|
absolute_import' is used.
|
|
|
|
|
|
2006-02-27 19:39:10 -04:00
|
|
|
|
- Properly check if 'warnings' raises an exception (usually when a filter set
|
|
|
|
|
to "error" is triggered) when raising a warning for raising string
|
|
|
|
|
exceptions.
|
|
|
|
|
|
2006-02-27 19:24:48 -04:00
|
|
|
|
- CO_GENERATOR_ALLOWED is no longer defined, this behavior is the default.
|
|
|
|
|
The name was removed from Include/code.h.
|
|
|
|
|
|
2006-02-27 12:47:12 -04:00
|
|
|
|
- PEP 308: conditional expressions were added (x if cond else y).
|
|
|
|
|
|
2006-02-25 18:38:04 -04:00
|
|
|
|
- Patch 1433928:
|
|
|
|
|
- The copy module now "copies" function objects (as atomic objects).
|
|
|
|
|
- dict.__getitem__ now looks for a __missing__ hook before raising
|
|
|
|
|
KeyError.
|
|
|
|
|
|
2006-02-28 16:39:06 -04:00
|
|
|
|
- PEP 343: with statement implemented. Needs ``from __future__ import
|
|
|
|
|
with_statement``. Use of 'with' as a variable will generate a warning.
|
|
|
|
|
Use of 'as' as a variable will also generate a warning (unless it's
|
2006-02-28 16:06:49 -04:00
|
|
|
|
part of an import statement).
|
2006-02-28 17:57:43 -04:00
|
|
|
|
The following objects have __context__ methods:
|
|
|
|
|
- The built-in file type.
|
|
|
|
|
- The thread.LockType type.
|
|
|
|
|
- The following types defined by the threading module:
|
|
|
|
|
Lock, RLock, Condition, Semaphore, BoundedSemaphore.
|
|
|
|
|
- The decimal.Context class.
|
2006-02-27 18:32:47 -04:00
|
|
|
|
|
2006-02-19 11:22:22 -04:00
|
|
|
|
- Fix the encodings package codec search function to only search
|
|
|
|
|
inside its own package. Fixes problem reported in patch #1433198.
|
|
|
|
|
|
|
|
|
|
Note: Codec packages should implement and register their own
|
|
|
|
|
codec search function. PEP 100 has the details.
|
|
|
|
|
|
2006-02-15 13:27:45 -04:00
|
|
|
|
- PEP 353: Using ssize_t as the index type.
|
|
|
|
|
|
2006-01-10 02:03:13 -04:00
|
|
|
|
- Patch #1400181, fix unicode string formatting to not use the locale.
|
|
|
|
|
This is how string objects work. u'%f' could use , instead of .
|
|
|
|
|
for the decimal point. Now both strings and unicode always use periods.
|
|
|
|
|
|
2006-01-09 03:07:12 -04:00
|
|
|
|
- Bug #1244610, #1392915, fix build problem on OpenBSD 3.7 and 3.8.
|
|
|
|
|
configure would break checking curses.h.
|
|
|
|
|
|
2005-12-27 13:37:07 -04:00
|
|
|
|
- Bug #959576: The pwd module is now builtin. This allows Python to be
|
|
|
|
|
built on UNIX platforms without $HOME set.
|
|
|
|
|
|
2005-12-19 02:07:16 -04:00
|
|
|
|
- Bug #1072182, fix some potential problems if characters are signed.
|
|
|
|
|
|
2005-12-19 00:27:42 -04:00
|
|
|
|
- Bug #889500, fix line number on SyntaxWarning for global declarations.
|
|
|
|
|
|
2005-12-18 01:29:30 -04:00
|
|
|
|
- Bug #1378022, UTF-8 files with a leading BOM crashed the interpreter.
|
|
|
|
|
|
2005-12-18 01:03:17 -04:00
|
|
|
|
- Support for converting hex strings to floats no longer works.
|
|
|
|
|
This was not portable. float('0x3') now raises a ValueError.
|
|
|
|
|
|
2005-12-17 21:27:35 -04:00
|
|
|
|
- Patch #1382163: Expose Subversion revision number to Python. New C API
|
|
|
|
|
function Py_GetBuildNumber(). New attribute sys.build_number. Build number
|
|
|
|
|
is now displayed in interactive prompt banner.
|
|
|
|
|
|
2005-12-17 17:45:17 -04:00
|
|
|
|
- Implementation of PEP 341 - Unification of try/except and try/finally.
|
|
|
|
|
"except" clauses can now be written together with a "finally" clause in
|
2005-12-17 18:24:12 -04:00
|
|
|
|
one try statement instead of two nested ones. Patch #1355913.
|
2005-12-17 17:45:17 -04:00
|
|
|
|
|
2005-12-17 00:38:31 -04:00
|
|
|
|
- Bug #1379994: Builtin unicode_escape and raw_unicode_escape codec
|
|
|
|
|
now encodes backslash correctly.
|
|
|
|
|
|
2005-11-28 13:34:23 -04:00
|
|
|
|
- Patch #1350409: Work around signal handling bug in Visual Studio 2005.
|
|
|
|
|
|
2005-11-24 11:37:42 -04:00
|
|
|
|
- Bug #1281408: Py_BuildValue now works correct even with unsigned longs
|
|
|
|
|
and long longs.
|
|
|
|
|
|
2005-11-09 02:59:35 -04:00
|
|
|
|
- SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
|
|
|
|
|
It was possible dlerror() returns a NULL pointer, use a default error
|
|
|
|
|
message in this case.
|
|
|
|
|
|
2005-10-23 10:43:40 -03:00
|
|
|
|
- Replaced most Unicode charmap codecs with new ones using the
|
|
|
|
|
new Unicode translate string feature in the builtin charmap
|
|
|
|
|
codec; the codecs were created from the mapping tables available
|
|
|
|
|
at ftp.unicode.org and contain a few updates (e.g. the Mac OS
|
|
|
|
|
encodings now include a mapping for the Apple logo)
|
|
|
|
|
|
2005-12-16 19:13:57 -04:00
|
|
|
|
- Added a few more codecs for Mac OS encodings
|
2005-10-23 10:43:40 -03:00
|
|
|
|
|
2005-10-21 03:32:02 -03:00
|
|
|
|
- Speed up some Unicode operations.
|
|
|
|
|
|
2006-02-26 15:42:26 -04:00
|
|
|
|
- A new AST parser implementation was completed. The abstract
|
|
|
|
|
syntax tree is available for read-only (non-compile) access
|
2006-02-27 11:23:19 -04:00
|
|
|
|
to Python code; an _ast module was added.
|
2005-10-21 03:32:02 -03:00
|
|
|
|
|
2005-10-21 03:26:10 -03:00
|
|
|
|
- SF bug #1167751: fix incorrect code being for generator expressions.
|
2005-10-21 03:25:33 -03:00
|
|
|
|
The following code now raises a SyntaxError: foo(a = i for i in range(10))
|
|
|
|
|
|
2005-10-03 01:48:15 -03:00
|
|
|
|
- SF Bug #976608: fix SystemError when mtime of an imported file is -1.
|
|
|
|
|
|
2005-10-02 21:54:56 -03:00
|
|
|
|
- SF Bug #887946: fix segfault when redirecting stdin from a directory.
|
|
|
|
|
Provide a warning when a directory is passed on the command line.
|
|
|
|
|
|
2005-10-01 22:48:49 -03:00
|
|
|
|
- Fix segfault with invalid coding.
|
|
|
|
|
|
|
|
|
|
- SF bug #772896: unknown encoding results in MemoryError.
|
|
|
|
|
|
2005-09-24 18:23:05 -03:00
|
|
|
|
- All iterators now have a Boolean value of true. Formerly, some iterators
|
|
|
|
|
supported a __len__() method which evaluated to False when the iterator
|
|
|
|
|
was empty.
|
|
|
|
|
|
2005-09-20 15:49:54 -03:00
|
|
|
|
- On 64-bit platforms, when __len__() returns a value that cannot be
|
|
|
|
|
represented as a C int, raise OverflowError.
|
|
|
|
|
|
2005-09-19 00:54:46 -03:00
|
|
|
|
- test__locale is skipped on OS X < 10.4 (only partial locale support is
|
2005-10-09 16:28:35 -03:00
|
|
|
|
present).
|
2005-09-19 00:54:46 -03:00
|
|
|
|
|
2005-09-14 16:38:29 -03:00
|
|
|
|
- SF bug #893549: parsing keyword arguments was broken with a few format
|
|
|
|
|
codes.
|
|
|
|
|
|
2005-09-14 15:09:42 -03:00
|
|
|
|
- Changes donated by Elemental Security to make it work on AIX 5.3
|
|
|
|
|
with IBM's 64-bit compiler (SF patch #1284289). This also closes SF
|
|
|
|
|
bug #105470: test_pwd fails on 64bit system (Opteron).
|
|
|
|
|
|
2005-09-14 14:49:54 -03:00
|
|
|
|
- Changes donated by Elemental Security to make it work on HP-UX 11 on
|
|
|
|
|
Itanium2 with HP's 64-bit compiler (SF patch #1225212).
|
|
|
|
|
|
2005-08-26 03:43:52 -03:00
|
|
|
|
- Disallow keyword arguments for type constructors that don't use them
|
2005-08-26 03:42:30 -03:00
|
|
|
|
(fixes bug #1119418).
|
|
|
|
|
|
2005-08-24 05:39:24 -03:00
|
|
|
|
- Forward UnicodeDecodeError into SyntaxError for source encoding errors.
|
|
|
|
|
|
2005-08-15 15:14:19 -03:00
|
|
|
|
- SF bug #900092: When tracing (e.g. for hotshot), restore 'return' events for
|
|
|
|
|
exceptions that cause a function to exit.
|
|
|
|
|
|
2005-07-30 22:16:36 -03:00
|
|
|
|
- The implementation of set() and frozenset() was revised to use its
|
|
|
|
|
own internal data structure. Memory consumption is reduced by 1/3
|
|
|
|
|
and there are modest speed-ups as well. The API is unchanged.
|
|
|
|
|
|
2005-07-17 20:45:23 -03:00
|
|
|
|
- SF bug #1238681: freed pointer is used in longobject.c:long_pow().
|
|
|
|
|
|
2005-07-12 07:21:19 -03:00
|
|
|
|
- SF bug #1229429: PyObject_CallMethod failed to decrement some
|
|
|
|
|
reference counts in some error exit cases.
|
|
|
|
|
|
2005-07-10 19:30:55 -03:00
|
|
|
|
- SF bug #1185883: Python's small-object memory allocator took over
|
|
|
|
|
a block managed by the platform C library whenever a realloc specified
|
|
|
|
|
a small new size. However, there's no portable way to know then how
|
|
|
|
|
much of the address space following the pointer is valid, so no
|
|
|
|
|
portable way to copy data from the C-managed block into Python's
|
|
|
|
|
small-object space without risking a memory fault. Python's small-object
|
|
|
|
|
realloc now leaves such blocks under the control of the platform C
|
|
|
|
|
realloc.
|
|
|
|
|
|
2005-07-05 12:21:58 -03:00
|
|
|
|
- SF bug #1232517: An overflow error was not detected properly when
|
|
|
|
|
attempting to convert a large float to an int in os.utime().
|
|
|
|
|
|
2005-06-29 20:29:56 -03:00
|
|
|
|
- SF bug #1224347: hex longs now print with lowercase letters just
|
|
|
|
|
like their int counterparts.
|
|
|
|
|
|
2005-06-20 13:52:57 -03:00
|
|
|
|
- SF bug #1163563: the original fix for bug #1010677 ("thread Module
|
|
|
|
|
Breaks PyGILState_Ensure()") broke badly in the case of multiple
|
|
|
|
|
interpreter states; back out that fix and do a better job (see
|
|
|
|
|
http://mail.python.org/pipermail/python-dev/2005-June/054258.html
|
|
|
|
|
for a longer write-up of the problem).
|
|
|
|
|
|
2005-06-03 11:41:55 -03:00
|
|
|
|
- SF patch #1180995: marshal now uses a binary format by default when
|
|
|
|
|
serializing floats.
|
|
|
|
|
|
2005-06-01 08:34:22 -03:00
|
|
|
|
- SF patch #1181301: on platforms that appear to use IEEE 754 floats,
|
|
|
|
|
the routines that promise to produce IEEE 754 binary representations
|
|
|
|
|
of floats now simply copy bytes around.
|
|
|
|
|
|
2005-05-20 00:07:06 -03:00
|
|
|
|
- bug #967182: disallow opening files with 'wU' or 'aU' as specified by PEP
|
|
|
|
|
278.
|
|
|
|
|
|
2005-04-26 00:45:26 -03:00
|
|
|
|
- patch #1109424: int, long, float, complex, and unicode now check for the
|
|
|
|
|
proper magic slot for type conversions when subclassed. Previously the
|
|
|
|
|
magic slot was ignored during conversion. Semantics now match the way
|
|
|
|
|
subclasses of str always behaved. int/long/float, conversion of an instance
|
2005-09-01 09:04:29 -03:00
|
|
|
|
to the base class has been moved to the proper nb_* magic slot and out of
|
2005-04-26 00:45:26 -03:00
|
|
|
|
PyNumber_*().
|
|
|
|
|
Thanks Walter D<>rwald.
|
|
|
|
|
|
2005-04-19 20:43:40 -03:00
|
|
|
|
- Descriptors defined in C with a PyGetSetDef structure, where the setter is
|
|
|
|
|
NULL, now raise an AttributeError when attempting to set or delete the
|
|
|
|
|
attribute. Previously a TypeError was raised, but this was inconsistent
|
|
|
|
|
with the equivalent pure-Python implementation.
|
|
|
|
|
|
2005-04-18 05:46:17 -03:00
|
|
|
|
- It is now safe to call PyGILState_Release() before
|
|
|
|
|
PyEval_InitThreads() (note that if there is reason to believe there
|
|
|
|
|
are multiple threads around you still must call PyEval_InitThreads()
|
|
|
|
|
before using the Python API; this fix is for extension modules that
|
|
|
|
|
have no way of knowing if Python is multi-threaded yet).
|
|
|
|
|
|
2005-04-07 07:11:19 -03:00
|
|
|
|
- Typing Ctrl-C whilst raw_input() was waiting in a build with threads
|
|
|
|
|
disabled caused a crash.
|
|
|
|
|
|
2005-03-31 05:35:44 -04:00
|
|
|
|
- Bug #1165306: instancemethod_new allowed the creation of a method
|
|
|
|
|
with im_class == im_self == NULL, which caused a crash when called.
|
|
|
|
|
|
2005-07-10 19:30:55 -03:00
|
|
|
|
- Move exception finalisation later in the shutdown process - this
|
2005-03-29 09:36:16 -04:00
|
|
|
|
fixes the crash seen in bug #1165761
|
|
|
|
|
|
2005-03-11 02:49:40 -04:00
|
|
|
|
- Added two new builtins, any() and all().
|
|
|
|
|
|
2005-03-05 02:47:57 -04:00
|
|
|
|
- Defining a class with empty parentheses is now allowed
|
2005-04-08 23:30:16 -03:00
|
|
|
|
(e.g., ``class C(): pass`` is no longer a syntax error).
|
|
|
|
|
Patch #1176012 added support to the 'parser' module and 'compiler' package
|
|
|
|
|
(thanks to logistix for that added support).
|
2005-03-05 02:47:57 -04:00
|
|
|
|
|
2005-03-03 19:00:26 -04:00
|
|
|
|
- Patch #1115086: Support PY_LONGLONG in structmember.
|
|
|
|
|
|
2005-03-03 12:45:19 -04:00
|
|
|
|
- Bug #1155938: new style classes did not check that __init__() was
|
|
|
|
|
returning None.
|
|
|
|
|
|
2005-07-10 19:30:55 -03:00
|
|
|
|
- Patch #802188: Report characters after line continuation character
|
2005-03-03 07:45:45 -04:00
|
|
|
|
('\') with a specific error message.
|
|
|
|
|
|
2005-03-03 05:24:38 -04:00
|
|
|
|
- Bug #723201: Raise a TypeError for passing bad objects to 'L' format.
|
|
|
|
|
|
2005-02-17 10:55:21 -04:00
|
|
|
|
- Bug #1124295: the __name__ attribute of file objects was
|
|
|
|
|
inadvertently made inaccessible in restricted mode.
|
|
|
|
|
|
2005-07-10 19:30:55 -03:00
|
|
|
|
- Bug #1074011: closing sys.std{out,err} now causes a flush() and
|
2005-01-23 05:41:49 -04:00
|
|
|
|
an ferror() call.
|
|
|
|
|
|
2004-12-03 04:30:39 -04:00
|
|
|
|
- min() and max() now support key= arguments with the same meaning as in
|
|
|
|
|
list.sort().
|
|
|
|
|
|
2005-01-02 02:17:33 -04:00
|
|
|
|
- The peephole optimizer now performs simple constant folding in expressions:
|
|
|
|
|
(2+3) --> (5).
|
|
|
|
|
|
2005-01-10 23:03:27 -04:00
|
|
|
|
- set and frozenset objects can now be marshalled. SF #1098985.
|
|
|
|
|
|
2005-01-31 13:09:25 -04:00
|
|
|
|
- Bug #1077106: Poor argument checking could cause memory corruption
|
|
|
|
|
in calls to os.read().
|
2004-12-02 04:59:14 -04:00
|
|
|
|
|
2005-02-04 14:44:06 -04:00
|
|
|
|
- The parser did not complain about future statements in illegal
|
|
|
|
|
positions. It once again reports a syntax error if a future
|
|
|
|
|
statement occurs after anything other than a doc string.
|
|
|
|
|
|
2005-08-12 14:34:58 -03:00
|
|
|
|
- Change the %s format specifier for str objects so that it returns a
|
|
|
|
|
unicode instance if the argument is not an instance of basestring and
|
|
|
|
|
calling __str__ on the argument returns a unicode instance.
|
|
|
|
|
|
2006-02-27 13:15:31 -04:00
|
|
|
|
- Patch #1413181: changed ``PyThreadState_Delete()`` to forget about the
|
|
|
|
|
current thread state when the auto-GIL-state machinery knows about
|
|
|
|
|
it (since the thread state is being deleted, continuing to remember it
|
|
|
|
|
can't help, but can hurt if another thread happens to get created with
|
|
|
|
|
the same thread id).
|
|
|
|
|
|
2004-12-02 04:59:14 -04:00
|
|
|
|
Extension Modules
|
|
|
|
|
-----------------
|
|
|
|
|
|
2006-02-25 18:38:04 -04:00
|
|
|
|
- Patch 1433928: Added a new type, defaultdict, to the collections module.
|
|
|
|
|
This uses the new __missing__ hook behavior added to dict (see above).
|
|
|
|
|
|
2006-02-20 05:42:33 -04:00
|
|
|
|
- Bug #854823: socketmodule now builds on Sun platforms even when
|
|
|
|
|
INET_ADDRSTRLEN is not defined.
|
|
|
|
|
|
2006-02-18 18:29:33 -04:00
|
|
|
|
- Patch #1393157: os.startfile() now has an optional argument to specify
|
|
|
|
|
a "command verb" to invoke on the file.
|
|
|
|
|
|
2006-02-07 03:04:46 -04:00
|
|
|
|
- Bug #876637, prevent stack corruption when socket descriptor
|
|
|
|
|
is larger than FD_SETSIZE.
|
|
|
|
|
|
2006-02-05 01:45:43 -04:00
|
|
|
|
- Patch #1407135, bug #1424041: harmonize mmap behavior of anonymous memory.
|
|
|
|
|
mmap.mmap(-1, size) now returns anonymous memory in both Unix and Windows.
|
|
|
|
|
mmap.mmap(0, size) should not be used on Windows for anonymous memory.
|
|
|
|
|
|
2006-02-04 15:12:37 -04:00
|
|
|
|
- Patch #1422385: The nis module now supports access to domains other
|
|
|
|
|
than the system default domain.
|
|
|
|
|
|
2006-02-03 08:54:16 -04:00
|
|
|
|
- Use Win32 API to implement os.stat/fstat. As a result, subsecond timestamps
|
|
|
|
|
are reported, the limit on path name lengths is removed, and stat reports
|
|
|
|
|
WindowsError now (instead of OSError).
|
|
|
|
|
|
2006-01-29 15:46:23 -04:00
|
|
|
|
- Add bsddb.db.DBEnv.set_tx_timestamp allowing time based database recovery.
|
|
|
|
|
|
2006-01-25 01:21:55 -04:00
|
|
|
|
- Bug #1413192, fix seg fault in bsddb if a transaction was deleted
|
|
|
|
|
before the env.
|
|
|
|
|
|
2006-01-14 14:12:57 -04:00
|
|
|
|
- Patch #1103116: Basic AF_NETLINK support.
|
|
|
|
|
|
2006-01-11 04:54:45 -04:00
|
|
|
|
- Bug #1402308, (possible) segfault when using mmap.mmap(-1, ...)
|
|
|
|
|
|
2006-01-10 03:05:44 -04:00
|
|
|
|
- Bug #1400822, _curses over{lay,write} doesn't work when passing 6 ints.
|
|
|
|
|
Also fix ungetmouse() which did not accept arguments properly.
|
|
|
|
|
The code now conforms to the documented signature.
|
|
|
|
|
|
2006-01-09 02:24:35 -04:00
|
|
|
|
- Bug #1400115, Fix segfault when calling curses.panel.userptr()
|
|
|
|
|
without prior setting of the userptr.
|
|
|
|
|
|
2006-01-05 01:43:35 -04:00
|
|
|
|
- Fix 64-bit problems in bsddb.
|
|
|
|
|
|
2005-12-17 23:34:22 -04:00
|
|
|
|
- Patch #1365916: fix some unsafe 64-bit mmap methods.
|
|
|
|
|
|
2005-12-12 07:48:32 -04:00
|
|
|
|
- Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build
|
|
|
|
|
problem on AIX.
|
|
|
|
|
|
2005-11-22 15:30:31 -04:00
|
|
|
|
- Bug #869197: os.setgroups rejects long integer arguments
|
|
|
|
|
|
2005-11-03 01:00:25 -04:00
|
|
|
|
- Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
|
|
|
|
|
|
2005-11-02 01:26:07 -04:00
|
|
|
|
- Bug #1344508, Fix UNIX mmap leaking file descriptors
|
|
|
|
|
|
2005-10-28 02:52:22 -03:00
|
|
|
|
- Patch #1338314, Bug #1336623: fix tarfile so it can extract
|
|
|
|
|
REGTYPE directories from tarfiles written by old programs.
|
|
|
|
|
|
2006-01-24 16:09:45 -04:00
|
|
|
|
- Patch #1407992, fixes broken bsddb module db associate when using
|
|
|
|
|
BerkeleyDB 3.3, 4.0 or 4.1.
|
|
|
|
|
|
|
|
|
|
- Get bsddb module to build with BerkeleyDB version 4.4
|
|
|
|
|
|
|
|
|
|
- Get bsddb module to build with BerkeleyDB version 3.2
|
2005-10-21 03:32:02 -03:00
|
|
|
|
|
2005-09-30 01:46:49 -03:00
|
|
|
|
- Patch #1309009, Fix segfault in pyexpat when the XML document is in latin_1,
|
|
|
|
|
but Python incorrectly assumes it is in UTF-8 format
|
|
|
|
|
|
2005-09-29 10:40:49 -03:00
|
|
|
|
- Fix parse errors in the readline module when compiling without threads.
|
|
|
|
|
|
2005-09-24 11:58:47 -03:00
|
|
|
|
- Patch #1288833: Removed thread lock from socket.getaddrinfo on
|
|
|
|
|
FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
|
|
|
|
|
|
2005-09-22 06:19:01 -03:00
|
|
|
|
- Patches #1298449 and #1298499: Add some missing checks for error
|
|
|
|
|
returns in cStringIO.c.
|
|
|
|
|
|
2005-09-21 03:44:25 -03:00
|
|
|
|
- Patch #1297028: fix segfault if call type on MultibyteCodec,
|
|
|
|
|
MultibyteStreamReader, or MultibyteStreamWriter
|
|
|
|
|
|
2005-09-19 03:49:27 -03:00
|
|
|
|
- Fix memory leak in posix.access().
|
|
|
|
|
|
2005-09-18 05:17:56 -03:00
|
|
|
|
- Patch #1213831: Fix typo in unicodedata._getcode.
|
|
|
|
|
|
2005-09-14 17:53:32 -03:00
|
|
|
|
- Bug #1007046: os.startfile() did not accept unicode strings encoded in
|
|
|
|
|
the file system encoding.
|
|
|
|
|
|
2005-08-26 05:34:00 -03:00
|
|
|
|
- Patch #756021: Special-case socket.inet_aton('255.255.255.255') for
|
|
|
|
|
platforms that don't have inet_aton().
|
2005-08-25 10:10:41 -03:00
|
|
|
|
|
2005-08-26 05:34:00 -03:00
|
|
|
|
- Bug #1215928: Fix bz2.BZ2File.seek() for 64-bit file offsets.
|
|
|
|
|
|
|
|
|
|
- Bug #1191043: Fix bz2.BZ2File.(x)readlines for files containing one
|
2005-08-25 10:10:41 -03:00
|
|
|
|
line without newlines.
|
|
|
|
|
|
2005-08-24 04:17:40 -03:00
|
|
|
|
- Bug #728515: mmap.resize() now resizes the file on Unix as it did
|
|
|
|
|
on Windows.
|
|
|
|
|
|
2005-10-09 16:38:21 -03:00
|
|
|
|
- Patch #1180695: Add nanosecond stat resolution, and st_gen,
|
2005-08-09 12:00:59 -03:00
|
|
|
|
st_birthtime for FreeBSD.
|
|
|
|
|
|
2005-07-27 17:24:40 -03:00
|
|
|
|
- Patch #1231069: The fcntl.ioctl function now uses the 'I' code for
|
|
|
|
|
the request code argument, which results in more C-like behaviour
|
|
|
|
|
for large or negative values.
|
|
|
|
|
|
2005-07-10 19:30:55 -03:00
|
|
|
|
- Bug #1234979: For the argument of thread.Lock.acquire, the Windows
|
2005-08-22 21:57:07 -03:00
|
|
|
|
implementation treated all integer values except 1 as false.
|
2005-07-08 19:26:13 -03:00
|
|
|
|
|
2005-06-03 16:47:00 -03:00
|
|
|
|
- Bug #1194181: bz2.BZ2File didn't handle mode 'U' correctly.
|
|
|
|
|
|
2005-06-02 10:09:30 -03:00
|
|
|
|
- Patch #1212117: os.stat().st_flags is now accessible as a attribute
|
|
|
|
|
if available on the platform.
|
|
|
|
|
|
2005-05-15 23:42:22 -03:00
|
|
|
|
- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
|
|
|
|
|
available on the platform.
|
|
|
|
|
|
2005-03-31 05:35:44 -04:00
|
|
|
|
- Bug #1166660: The readline module could segfault if hook functions
|
|
|
|
|
were set in a different thread than that which called readline.
|
|
|
|
|
|
2005-03-18 17:20:23 -04:00
|
|
|
|
- collections.deque objects now support a remove() method.
|
|
|
|
|
|
2005-03-09 12:38:48 -04:00
|
|
|
|
- operator.itemgetter() and operator.attrgetter() now support retrieving
|
|
|
|
|
multiple fields. This provides direct support for sorting on multiple
|
|
|
|
|
keys (primary, secondary, etc).
|
|
|
|
|
|
2005-03-08 05:10:29 -04:00
|
|
|
|
- os.access now supports Unicode path names on non-Win32 systems.
|
|
|
|
|
|
2005-03-04 10:37:01 -04:00
|
|
|
|
- Patches #925152, #1118602: Avoid reading after the end of the buffer
|
|
|
|
|
in pyexpat.GetInputContext.
|
|
|
|
|
|
2005-07-10 19:30:55 -03:00
|
|
|
|
- Patches #749830, #1144555: allow UNIX mmap size to default to current
|
2005-03-03 07:22:44 -04:00
|
|
|
|
file size.
|
|
|
|
|
|
2005-02-28 15:39:44 -04:00
|
|
|
|
- Added functional.partial(). See PEP309.
|
|
|
|
|
|
2005-02-27 16:33:25 -04:00
|
|
|
|
- Patch #1093585: raise a ValueError for negative history items in readline.
|
|
|
|
|
{remove_history,replace_history}
|
|
|
|
|
|
2005-01-23 11:16:08 -04:00
|
|
|
|
- The spwd module has been added, allowing access to the shadow password
|
|
|
|
|
database.
|
2005-01-23 05:27:24 -04:00
|
|
|
|
|
2005-01-16 04:57:39 -04:00
|
|
|
|
- stat_float_times is now True.
|
|
|
|
|
|
2004-12-16 12:23:40 -04:00
|
|
|
|
- array.array objects are now picklable.
|
|
|
|
|
|
2004-12-07 03:05:57 -04:00
|
|
|
|
- the cPickle module no longer accepts the deprecated None option in the
|
|
|
|
|
args tuple returned by __reduce__().
|
|
|
|
|
|
2004-12-05 05:25:51 -04:00
|
|
|
|
- itertools.islice() now accepts None for the start and step arguments.
|
|
|
|
|
This allows islice() to work more readily with slices:
|
|
|
|
|
islice(s.start, s.stop, s.step)
|
|
|
|
|
|
2005-01-13 00:12:31 -04:00
|
|
|
|
- datetime.datetime() now has a strptime class method which can be used to
|
|
|
|
|
create datetime object using a string and format.
|
2004-12-02 04:59:14 -04:00
|
|
|
|
|
|
|
|
|
Library
|
|
|
|
|
-------
|
|
|
|
|
|
2006-02-28 17:57:43 -04:00
|
|
|
|
- PEP 343: new module contextlib.py defines decorator @contextmanager
|
|
|
|
|
and helpful context managers nested() and closing().
|
|
|
|
|
|
2006-02-27 15:56:30 -04:00
|
|
|
|
- The compiler package now supports future imports after the module docstring.
|
|
|
|
|
|
2006-02-20 04:40:38 -04:00
|
|
|
|
- Bug #1413790: zipfile now sanitizes absolute archive names that are
|
|
|
|
|
not allowed by the specs.
|
|
|
|
|
|
|
|
|
|
- Bug #1413790: zipfile now sanitizes absolute archive names that are
|
|
|
|
|
not allowed by the specs.
|
|
|
|
|
|
2006-02-19 10:57:47 -04:00
|
|
|
|
- Patch #1215184: FileInput now can be given an opening hook which can
|
|
|
|
|
be used to control how files are opened.
|
|
|
|
|
|
2006-02-19 10:12:34 -04:00
|
|
|
|
- Patch #1212287: fileinput.input() now has a mode parameter for
|
|
|
|
|
specifying the file mode input files should be opened with.
|
|
|
|
|
|
2006-02-19 09:56:17 -04:00
|
|
|
|
- Patch #1215184: fileinput now has a fileno() function for getting the
|
|
|
|
|
current file number.
|
|
|
|
|
|
2006-02-19 09:26:36 -04:00
|
|
|
|
- Patch #1349274: gettext.install() now optionally installs additional
|
|
|
|
|
translation functions other than _() in the builtin namespace.
|
|
|
|
|
|
2006-02-19 05:51:27 -04:00
|
|
|
|
- Patch #1337756: fileinput now accepts Unicode filenames.
|
|
|
|
|
|
2006-02-18 17:10:56 -04:00
|
|
|
|
- Patch #1373643: The chunk module can now read chunks larger than
|
|
|
|
|
two gigabytes.
|
|
|
|
|
|
2006-02-17 09:35:13 -04:00
|
|
|
|
- Patch #1417555: SimpleHTTPServer now returns Last-Modified headers.
|
|
|
|
|
|
2006-02-17 05:52:53 -04:00
|
|
|
|
- Bug #1430298: It is now possible to send a mail with an empty
|
|
|
|
|
return address using smtplib.
|
|
|
|
|
|
2006-02-17 05:48:14 -04:00
|
|
|
|
- Bug #1432260: The names of lambda functions are now properly displayed
|
|
|
|
|
in pydoc.
|
2006-02-17 05:45:40 -04:00
|
|
|
|
|
2006-02-05 13:09:41 -04:00
|
|
|
|
- Patch #1412872: zipfile now sets the creator system to 3 (Unix)
|
|
|
|
|
unless the system is Win32.
|
|
|
|
|
|
2006-02-27 12:50:01 -04:00
|
|
|
|
- Patch #1349118: urllib now supports user:pass@ style proxy
|
2006-01-24 11:51:21 -04:00
|
|
|
|
specifications, raises IOErrors when proxies for unsupported protocols
|
|
|
|
|
are defined, and uses the https proxy on https redirections.
|
|
|
|
|
|
2006-01-21 03:20:56 -04:00
|
|
|
|
- Bug #902075: urllib2 now supports 'host:port' style proxy specifications.
|
|
|
|
|
|
|
|
|
|
- Bug #1407902: Add support for sftp:// URIs to urlparse.
|
2006-01-20 13:24:23 -04:00
|
|
|
|
|
2006-01-20 05:07:35 -04:00
|
|
|
|
- Bug #1371247: Update Windows locale identifiers in locale.py.
|
|
|
|
|
|
2006-01-14 03:05:13 -04:00
|
|
|
|
- Bug #1394565: SimpleHTTPServer now doesn't choke on query parameters
|
2006-01-13 13:05:56 -04:00
|
|
|
|
any more.
|
2006-01-20 05:07:35 -04:00
|
|
|
|
|
2006-01-13 12:59:46 -04:00
|
|
|
|
- Bug #1403410: The warnings module now doesn't get confused
|
|
|
|
|
when it can't find out the module name it generates a warning for.
|
2006-01-20 05:07:35 -04:00
|
|
|
|
|
2006-01-08 06:45:39 -04:00
|
|
|
|
- Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature.
|
|
|
|
|
|
2005-12-23 17:44:36 -04:00
|
|
|
|
- Patch #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode
|
|
|
|
|
|
2005-12-23 17:27:46 -04:00
|
|
|
|
- Patch #1117398: cookielib.LWPCookieJar and .MozillaCookieJar now raise
|
|
|
|
|
LoadError as documented, instead of IOError. For compatibility,
|
|
|
|
|
LoadError subclasses IOError.
|
|
|
|
|
|
2005-12-16 18:49:23 -04:00
|
|
|
|
- Added the hashlib module. It provides secure hash functions for MD5 and
|
2005-12-16 19:13:57 -04:00
|
|
|
|
SHA1, 224, 256, 384, and 512. Note that recent developments make the
|
|
|
|
|
historic MD5 and SHA1 unsuitable for cryptographic-strength applications.
|
|
|
|
|
In <http://mail.python.org/pipermail/python-dev/2005-December/058850.html>
|
|
|
|
|
Ronald L. Rivest offered this advice for Python:
|
|
|
|
|
|
|
|
|
|
"The consensus of researchers in this area (at least as
|
|
|
|
|
expressed at the NIST Hash Function Workshop 10/31/05),
|
|
|
|
|
is that SHA-256 is a good choice for the time being, but
|
|
|
|
|
that research should continue, and other alternatives may
|
|
|
|
|
arise from this research. The larger SHA's also seem OK."
|
2005-12-16 18:49:23 -04:00
|
|
|
|
|
2005-12-12 14:54:55 -04:00
|
|
|
|
- Added a subset of Fredrik Lundh's ElementTree package. Available
|
|
|
|
|
modules are xml.etree.ElementTree, xml.etree.ElementPath, and
|
|
|
|
|
xml.etree.ElementInclude, from ElementTree 1.2.6.
|
|
|
|
|
|
2005-11-27 12:59:04 -04:00
|
|
|
|
- Patch #1162825: Support non-ASCII characters in IDLE window titles.
|
|
|
|
|
|
2005-11-26 12:50:44 -04:00
|
|
|
|
- Bug #1365984: urllib now opens "data:" URLs again.
|
|
|
|
|
|
2005-11-22 22:15:50 -04:00
|
|
|
|
- Patch #1314396: prevent deadlock for threading.Thread.join() when an exception
|
|
|
|
|
is raised within the method itself on a previous call (e.g., passing in an
|
|
|
|
|
illegal argument)
|
|
|
|
|
|
2005-11-02 19:04:26 -04:00
|
|
|
|
- Bug #1340337: change time.strptime() to always return ValueError when there
|
|
|
|
|
is an error in the format string.
|
|
|
|
|
|
2005-10-03 11:16:44 -03:00
|
|
|
|
- Patch #754022: Greatly enhanced webbrowser.py (by Oleg Broytmann).
|
|
|
|
|
|
2005-10-09 16:38:21 -03:00
|
|
|
|
- Bug #729103: pydoc.py: Fix docother() method to accept additional
|
2005-10-01 13:32:31 -03:00
|
|
|
|
"parent" argument.
|
|
|
|
|
|
2005-09-29 17:49:16 -03:00
|
|
|
|
- Patch #1300515: xdrlib.py: Fix pack_fstring() to really use null bytes
|
|
|
|
|
for padding.
|
|
|
|
|
|
2005-09-29 17:16:07 -03:00
|
|
|
|
- Bug #1296004: httplib.py: Limit maximal amount of data read from the
|
|
|
|
|
socket to avoid a MemoryError on Windows.
|
|
|
|
|
|
2005-09-20 04:02:49 -03:00
|
|
|
|
- Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
|
|
|
|
|
to get the correct encoding.
|
|
|
|
|
|
|
|
|
|
- Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
|
|
|
|
|
languages.
|
|
|
|
|
|
2005-09-18 05:34:39 -03:00
|
|
|
|
- Patch #1268314: Cache lines in StreamReader.readlines for performance.
|
|
|
|
|
|
2005-09-14 23:34:56 -03:00
|
|
|
|
- Bug #1290505: Fix clearing the regex cache for time.strptime().
|
|
|
|
|
|
2005-08-27 07:07:56 -03:00
|
|
|
|
- Bug #1167128: Fix size of a symlink in a tarfile to be 0.
|
|
|
|
|
|
2005-08-26 05:51:34 -03:00
|
|
|
|
- Patch #810023: Fix off-by-one bug in urllib.urlretrieve reporthook
|
|
|
|
|
functionality.
|
|
|
|
|
|
2005-08-25 08:03:38 -03:00
|
|
|
|
- Bug #1163178: Make IDNA return an empty string when the input is empty.
|
|
|
|
|
|
2005-08-24 19:34:21 -03:00
|
|
|
|
- Patch #848017: Make Cookie more RFC-compliant. Use CRLF as default output
|
|
|
|
|
separator and do not output trailing semicola.
|
|
|
|
|
|
2005-08-24 15:46:39 -03:00
|
|
|
|
- Patch #1062060: urllib.urlretrieve() now raises a new exception, named
|
|
|
|
|
ContentTooShortException, when the actually downloaded size does not
|
|
|
|
|
match the Content-Length header.
|
|
|
|
|
|
2005-08-24 11:55:22 -03:00
|
|
|
|
- Bug #1121494: distutils.dir_utils.mkpath now accepts Unicode strings.
|
|
|
|
|
|
2005-08-24 04:38:12 -03:00
|
|
|
|
- Bug #1178484: Return complete lines from codec stream readers
|
|
|
|
|
even if there is an exception in later lines, resulting in
|
2005-10-09 16:38:21 -03:00
|
|
|
|
correct line numbers for decoding errors in source code.
|
2005-08-24 04:38:12 -03:00
|
|
|
|
|
2005-08-24 04:36:17 -03:00
|
|
|
|
- Bug #1192315: Disallow negative arguments to clear() in pdb.
|
|
|
|
|
|
2005-08-07 17:51:04 -03:00
|
|
|
|
- Patch #827386: Support absolute source paths in msvccompiler.py.
|
|
|
|
|
|
2005-08-03 04:30:12 -03:00
|
|
|
|
- Patch #1105730: Apply the new implementation of commonprefix in posixpath
|
|
|
|
|
to ntpath, macpath, os2emxpath and riscospath.
|
|
|
|
|
|
2005-07-26 21:00:44 -03:00
|
|
|
|
- Fix a problem in Tkinter introduced by SF patch #869468: delete bogus
|
|
|
|
|
__hasattr__ and __delattr__ methods on class Tk that were breaking
|
|
|
|
|
Tkdnd.
|
|
|
|
|
|
2005-07-17 17:27:41 -03:00
|
|
|
|
- Bug #1015140: disambiguated the term "article id" in nntplib docs and
|
|
|
|
|
docstrings to either "article number" or "message id".
|
|
|
|
|
|
2005-07-15 06:13:21 -03:00
|
|
|
|
- Bug #1238170: threading.Thread.__init__ no longer has "kwargs={}" as a
|
|
|
|
|
parameter, but uses the usual "kwargs=None".
|
|
|
|
|
|
2005-08-22 21:57:07 -03:00
|
|
|
|
- textwrap now processes text chunks at O(n) speed instead of O(n**2).
|
2005-07-15 03:53:35 -03:00
|
|
|
|
Patch #1209527 (Contributed by Connelly).
|
|
|
|
|
|
2005-07-14 03:40:47 -03:00
|
|
|
|
- urllib2 has now an attribute 'httpresponses' mapping from HTTP status code
|
|
|
|
|
to W3C name (404 -> 'Not Found'). RFE #1216944.
|
|
|
|
|
|
2005-07-04 14:16:07 -03:00
|
|
|
|
- Bug #1177468: Don't cache the /dev/urandom file descriptor for os.urandom,
|
|
|
|
|
as this can cause problems with apps closing all file descriptors.
|
|
|
|
|
|
2005-06-26 19:54:58 -03:00
|
|
|
|
- Bug #839151: Fix an attempt to access sys.argv in the warnings module
|
2005-08-22 21:57:07 -03:00
|
|
|
|
it can be missing in embedded interpreters
|
2005-06-26 19:54:58 -03:00
|
|
|
|
|
2005-06-26 19:09:06 -03:00
|
|
|
|
- Bug #1155638: Fix a bug which affected HTTP 0.9 responses in httplib.
|
|
|
|
|
|
2005-06-26 18:36:25 -03:00
|
|
|
|
- Bug #1100201: Cross-site scripting was possible on BaseHTTPServer via
|
|
|
|
|
error messages.
|
|
|
|
|
|
2005-06-26 18:09:38 -03:00
|
|
|
|
- Bug #1108948: Cookie.py produced invalid JavaScript code.
|
|
|
|
|
|
2005-06-21 04:43:58 -03:00
|
|
|
|
- The tokenize module now detects and reports indentation errors.
|
|
|
|
|
Bug #1224621.
|
|
|
|
|
|
2005-06-10 08:05:19 -03:00
|
|
|
|
- The tokenize module has a new untokenize() function to support a full
|
|
|
|
|
roundtrip from lexed tokens back to Python sourcecode. In addition,
|
|
|
|
|
the generate_tokens() function now accepts a callable argument that
|
|
|
|
|
terminates by raising StopIteration.
|
|
|
|
|
|
2005-06-04 06:20:03 -03:00
|
|
|
|
- Bug #1196315: fix weakref.WeakValueDictionary constructor.
|
|
|
|
|
|
2005-06-03 11:28:50 -03:00
|
|
|
|
- Bug #1213894: os.path.realpath didn't resolve symlinks that were the first
|
|
|
|
|
component of the path.
|
|
|
|
|
|
2005-05-14 17:54:16 -03:00
|
|
|
|
- Patch #1120353: The xmlrpclib module provides better, more transparent,
|
|
|
|
|
support for datetime.{datetime,date,time} objects. With use_datetime set
|
|
|
|
|
to True, applications shouldn't have to fiddle with the DateTime wrapper
|
|
|
|
|
class at all.
|
|
|
|
|
|
2005-03-21 16:56:35 -04:00
|
|
|
|
- distutils.commands.upload was added to support uploading distribution
|
|
|
|
|
files to PyPI.
|
|
|
|
|
|
2005-03-31 09:57:38 -04:00
|
|
|
|
- distutils.commands.register now encodes the data as UTF-8 before posting
|
|
|
|
|
them to PyPI.
|
|
|
|
|
|
2005-03-27 06:47:39 -04:00
|
|
|
|
- decimal operator and comparison methods now return NotImplemented
|
|
|
|
|
instead of raising a TypeError when interacting with other types. This
|
|
|
|
|
allows other classes to implement __radd__ style methods and have them
|
|
|
|
|
work as expected.
|
|
|
|
|
|
2005-03-15 00:59:17 -04:00
|
|
|
|
- Bug #1163325: Decimal infinities failed to hash. Attempting to
|
|
|
|
|
hash a NaN raised an InvalidOperation instead of a TypeError.
|
|
|
|
|
|
2005-07-10 19:30:55 -03:00
|
|
|
|
- Patch #918101: Add tarfile open mode r|* for auto-detection of the
|
2005-03-05 08:47:42 -04:00
|
|
|
|
stream compression; add, for symmetry reasons, r:* as a synonym of r.
|
|
|
|
|
|
2005-03-04 15:40:34 -04:00
|
|
|
|
- Patch #1043890: Add extractall method to tarfile.
|
|
|
|
|
|
2005-03-04 09:50:17 -04:00
|
|
|
|
- Patch #1075887: Don't require MSVC in distutils if there is nothing
|
|
|
|
|
to build.
|
|
|
|
|
|
2005-03-03 19:12:42 -04:00
|
|
|
|
- Patch #1103407: Properly deal with tarfile iterators when untarring
|
|
|
|
|
symbolic links on Windows.
|
|
|
|
|
|
2005-07-10 19:30:55 -03:00
|
|
|
|
- Patch #645894: Use getrusage for computing the time consumption in
|
2005-03-03 07:39:45 -04:00
|
|
|
|
profile.py if available.
|
|
|
|
|
|
2005-03-03 07:08:03 -04:00
|
|
|
|
- Patch #1046831: Use get_python_version where appropriate in sysconfig.py.
|
|
|
|
|
|
2005-03-03 06:57:37 -04:00
|
|
|
|
- Patch #1117454: Remove code to special-case cookies without values
|
|
|
|
|
in LWPCookieJar.
|
|
|
|
|
|
2005-03-03 06:48:12 -04:00
|
|
|
|
- Patch #1117339: Add cookielib special name tests.
|
|
|
|
|
|
2005-03-03 05:46:07 -04:00
|
|
|
|
- Patch #1112812: Make bsddb/__init__.py more friendly for modulefinder.
|
|
|
|
|
|
2005-03-03 04:35:22 -04:00
|
|
|
|
- Patch #1110248: SYNC_FLUSH the zlib buffer for GZipFile.flush.
|
|
|
|
|
|
2005-03-03 04:17:42 -04:00
|
|
|
|
- Patch #1107973: Allow to iterate over the lines of a tarfile.ExFileObject.
|
|
|
|
|
|
2005-03-03 04:12:27 -04:00
|
|
|
|
- Patch #1104111: Alter setup.py --help and --help-commands.
|
|
|
|
|
|
2005-03-01 04:09:28 -04:00
|
|
|
|
- Patch #1121234: Properly cleanup _exit and tkerror commands.
|
|
|
|
|
|
2005-02-24 16:22:10 -04:00
|
|
|
|
- Patch #1049151: xdrlib now unpacks booleans as True or False.
|
|
|
|
|
|
2005-02-04 21:31:19 -04:00
|
|
|
|
- Fixed bug in a NameError bug in cookielib. Patch #1116583.
|
|
|
|
|
|
2005-02-03 11:01:24 -04:00
|
|
|
|
- Applied a security fix to SimpleXMLRPCserver (PSF-2005-001). This
|
|
|
|
|
disables recursive traversal through instance attributes, which can
|
|
|
|
|
be exploited in various ways.
|
|
|
|
|
|
2005-12-16 19:13:57 -04:00
|
|
|
|
- Bug #1222790: in SimpleXMLRPCServer, set the reuse-address and close-on-exec
|
2005-12-04 11:07:41 -04:00
|
|
|
|
flags on the HTTP listening socket.
|
|
|
|
|
|
2005-12-04 11:36:57 -04:00
|
|
|
|
- Bug #792570: SimpleXMLRPCServer had problems if the request grew too large.
|
|
|
|
|
Fixed by reading the HTTP body in chunks instead of one big socket.read().
|
|
|
|
|
|
2005-12-16 19:13:57 -04:00
|
|
|
|
- Patches #893642, #1039083: add allow_none, encoding arguments to constructors of
|
2005-12-04 12:34:40 -04:00
|
|
|
|
SimpleXMLRPCServer and CGIXMLRPCRequestHandler.
|
|
|
|
|
|
2005-01-29 09:29:23 -04:00
|
|
|
|
- Bug #1110478: Revert os.environ.update to do putenv again.
|
|
|
|
|
|
2005-01-20 15:20:16 -04:00
|
|
|
|
- Bug #1103844: fix distutils.install.dump_dirs() with negated options.
|
|
|
|
|
|
2005-01-16 04:40:58 -04:00
|
|
|
|
- os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
|
|
|
|
|
|
2005-01-11 23:25:27 -04:00
|
|
|
|
- Enhancements to the csv module:
|
|
|
|
|
|
|
|
|
|
+ Dialects are now validated by the underlying C code, better
|
2005-07-22 18:49:32 -03:00
|
|
|
|
reflecting its capabilities, and improving its compliance with
|
2005-07-10 19:30:55 -03:00
|
|
|
|
PEP 305.
|
2005-01-11 23:25:27 -04:00
|
|
|
|
+ Dialect parameter parsing has been re-implemented to improve error
|
|
|
|
|
reporting.
|
|
|
|
|
+ quotechar=None and quoting=QUOTE_NONE now work the way PEP 305
|
|
|
|
|
dictates.
|
|
|
|
|
+ the parser now removes the escapechar prefix from escaped characters.
|
2005-01-12 05:45:18 -04:00
|
|
|
|
+ when quoting=QUOTE_NONNUMERIC, the writer now tests for numeric
|
2005-01-13 07:30:54 -04:00
|
|
|
|
types, rather than any object than can be represented as a numeric.
|
2005-01-12 05:45:18 -04:00
|
|
|
|
+ when quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fields
|
|
|
|
|
to floats.
|
2005-01-13 07:30:54 -04:00
|
|
|
|
+ reader now allows \r characters to be quoted (previously it only allowed
|
|
|
|
|
\n to be quoted).
|
2005-01-12 03:44:42 -04:00
|
|
|
|
+ writer doublequote handling improved.
|
2005-01-11 23:25:27 -04:00
|
|
|
|
+ Dialect classes passed to the module are no longer instantiated by
|
|
|
|
|
the module before being parsed (the former validation scheme required
|
|
|
|
|
this, but the mechanism was unreliable).
|
|
|
|
|
+ The dialect registry now contains instances of the internal
|
|
|
|
|
C-coded dialect type, rather than references to python objects.
|
|
|
|
|
+ the internal c-coded dialect type is now immutable.
|
|
|
|
|
+ register_dialect now accepts the same keyword dialect specifications
|
|
|
|
|
as the reader and writer, allowing the user to register dialects
|
|
|
|
|
without first creating a dialect class.
|
|
|
|
|
+ a configurable limit to the size of parsed fields has been added -
|
|
|
|
|
previously, an unmatched quote character could result in the entire
|
|
|
|
|
file being read into the field buffer before an error was reported.
|
2005-01-11 23:45:10 -04:00
|
|
|
|
+ A new module method csv.field_size_limit() has been added that sets
|
2005-01-11 23:25:27 -04:00
|
|
|
|
the parser field size limit (returning the former limit). The initial
|
|
|
|
|
limit is 128kB.
|
2005-01-12 07:17:16 -04:00
|
|
|
|
+ A line_num attribute has been added to the reader object, which tracks
|
|
|
|
|
the number of lines read from the source iterator. This is not
|
|
|
|
|
the same as the number of records returned, as records can span
|
|
|
|
|
multiple lines.
|
2005-01-11 23:25:27 -04:00
|
|
|
|
+ reader and writer objects were not being registered with the cyclic-GC.
|
|
|
|
|
This has been fixed.
|
|
|
|
|
|
2005-01-07 22:43:53 -04:00
|
|
|
|
- _DummyThread objects in the threading module now delete self.__block that is
|
|
|
|
|
inherited from _Thread since it uses up a lock allocated by 'thread'. The
|
|
|
|
|
lock primitives tend to be limited in number and thus should not be wasted on
|
|
|
|
|
a _DummyThread object. Fixes bug #1089632.
|
|
|
|
|
|
2005-01-07 04:15:41 -04:00
|
|
|
|
- The imghdr module now detects Exif files.
|
|
|
|
|
|
2004-12-20 19:51:53 -04:00
|
|
|
|
- StringIO.truncate() now correctly adjusts the size attribute.
|
|
|
|
|
(Bug #951915).
|
|
|
|
|
|
2004-12-10 17:58:14 -04:00
|
|
|
|
- locale.py now uses an updated locale alias table (built using
|
|
|
|
|
Tools/i18n/makelocalealias.py, a tool to parse the X11 locale
|
|
|
|
|
alias file); the encoding lookup was enhanced to use Python's
|
2005-08-22 21:57:07 -03:00
|
|
|
|
encoding alias table.
|
2004-12-10 17:58:14 -04:00
|
|
|
|
|
2004-12-07 08:02:02 -04:00
|
|
|
|
- moved deprecated modules to Lib/lib-old: whrandom, tzparse, statcache.
|
|
|
|
|
|
2004-12-07 03:05:57 -04:00
|
|
|
|
- the pickle module no longer accepts the deprecated None option in the
|
|
|
|
|
args tuple returned by __reduce__().
|
|
|
|
|
|
2004-12-06 23:25:18 -04:00
|
|
|
|
- optparse now optionally imports gettext. This allows its use in setup.py.
|
|
|
|
|
|
2004-12-05 01:20:42 -04:00
|
|
|
|
- the pickle module no longer uses the deprecated bin parameter.
|
|
|
|
|
|
2004-12-04 23:58:17 -04:00
|
|
|
|
- the shelve module no longer uses the deprecated binary parameter.
|
|
|
|
|
|
2004-12-04 23:28:00 -04:00
|
|
|
|
- the pstats module no longer uses the deprecated ignore() method.
|
|
|
|
|
|
2004-12-04 21:58:09 -04:00
|
|
|
|
- the filecmp module no longer uses the deprecated use_statcache argument.
|
|
|
|
|
|
2004-12-04 17:21:53 -04:00
|
|
|
|
- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
|
|
|
|
|
extended or overridden by subclasses. Formerly, the subclassed method would
|
|
|
|
|
be ignored by the rest of the module. (Bug #1078905).
|
|
|
|
|
|
2004-12-02 04:59:14 -04:00
|
|
|
|
- heapq.nsmallest() and heapq.nlargest() now support key= arguments with
|
2004-12-03 04:30:39 -04:00
|
|
|
|
the same meaning as in list.sort().
|
2004-12-02 04:59:14 -04:00
|
|
|
|
|
2004-12-22 08:50:50 -04:00
|
|
|
|
- Bug #1076985: ``codecs.StreamReader.readline()`` now calls ``read()`` only
|
|
|
|
|
once when a size argument is given. This prevents a buffer overflow in the
|
|
|
|
|
tokenizer with very long source lines.
|
|
|
|
|
|
2006-01-01 17:48:54 -04:00
|
|
|
|
- Bug #1083110: ``zlib.decompress.flush()`` would segfault if called
|
|
|
|
|
immediately after creating the object, without any intervening
|
|
|
|
|
``.decompress()`` calls.
|
2004-12-28 16:10:48 -04:00
|
|
|
|
|
2005-01-16 16:48:27 -04:00
|
|
|
|
- The reconvert.quote function can now emit triple-quoted strings. The
|
|
|
|
|
reconvert module now has some simple documentation.
|
2004-12-02 04:59:14 -04:00
|
|
|
|
|
2005-02-18 09:22:43 -04:00
|
|
|
|
- ``UserString.MutableString`` now supports negative indices in
|
|
|
|
|
``__setitem__`` and ``__delitem__``
|
|
|
|
|
|
2005-03-04 22:53:17 -04:00
|
|
|
|
- Bug #1149508: ``textwrap`` now handles hyphenated numbers (eg. "2004-03-05")
|
|
|
|
|
correctly.
|
|
|
|
|
|
2005-04-21 18:32:03 -03:00
|
|
|
|
- Partial fixes for SF bugs #1163244 and #1175396: If a chunk read by
|
|
|
|
|
``codecs.StreamReader.readline()`` has a trailing "\r", read one more
|
|
|
|
|
character even if the user has passed a size parameter to get a proper
|
|
|
|
|
line ending. Remove the special handling of a "\r\n" that has been split
|
|
|
|
|
between two lines.
|
|
|
|
|
|
2005-08-30 07:23:14 -03:00
|
|
|
|
- Bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
|
|
|
|
|
about illegal code points. The codec now supports PEP 293 style error
|
|
|
|
|
handlers.
|
|
|
|
|
|
2005-09-01 09:04:29 -03:00
|
|
|
|
- Bug #1235646: ``codecs.StreamRecoder.next()`` now reencodes the data it reads
|
2005-09-01 08:56:53 -03:00
|
|
|
|
from the input stream, so that the output is a byte string in the correct
|
|
|
|
|
encoding instead of a unicode string.
|
2005-03-04 22:53:17 -04:00
|
|
|
|
|
2005-09-14 05:54:39 -03:00
|
|
|
|
- Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
|
|
|
|
|
considering it exactly like a '*'.
|
|
|
|
|
|
2005-10-09 16:42:27 -03:00
|
|
|
|
- Bug #1245379: Add "unicode-1-1-utf-7" as an alias for "utf-7" to
|
|
|
|
|
``encodings.aliases``.
|
2005-09-14 05:54:39 -03:00
|
|
|
|
|
2005-11-21 15:10:07 -04:00
|
|
|
|
- ` uu.encode()`` and ``uu.decode()`` now support unicode filenames.
|
|
|
|
|
|
2006-01-31 14:34:13 -04:00
|
|
|
|
- Patch #1413711: Certain patterns of differences were making difflib
|
|
|
|
|
touch the recursion limit.
|
|
|
|
|
|
2004-12-02 04:59:14 -04:00
|
|
|
|
Build
|
|
|
|
|
-----
|
|
|
|
|
|
2006-02-17 04:40:11 -04:00
|
|
|
|
- Patch #1432345: Make python compile on DragonFly.
|
|
|
|
|
|
2006-02-14 16:42:55 -04:00
|
|
|
|
- Build support for Win64-AMD64 was added.
|
|
|
|
|
|
2006-02-11 11:55:14 -04:00
|
|
|
|
- Patch #1428494: Prefer linking against ncursesw over ncurses library.
|
|
|
|
|
|
2006-01-08 06:07:33 -04:00
|
|
|
|
- Patch #881820: look for openpty and forkpty also in libbsd.
|
|
|
|
|
|
2006-01-03 03:42:14 -04:00
|
|
|
|
- The sources of zlib are now part of the Python distribution (zlib 1.2.3).
|
|
|
|
|
The zlib module is now builtin on Windows.
|
|
|
|
|
|
2005-12-30 08:31:38 -04:00
|
|
|
|
- Use -xcode=pic32 for CCSHARED on Solaris with SunPro.
|
|
|
|
|
|
2005-08-07 18:09:30 -03:00
|
|
|
|
- Bug #1189330: configure did not correctly determine the necessary
|
|
|
|
|
value of LINKCC if python was built with GCC 4.0.
|
|
|
|
|
|
2005-07-25 23:29:21 -03:00
|
|
|
|
- Upgrade Windows build to zlib 1.2.3 which eliminates a potential security
|
|
|
|
|
vulnerability in zlib 1.2.1 and 1.2.2.
|
|
|
|
|
|
2005-04-24 19:26:38 -03:00
|
|
|
|
- EXTRA_CFLAGS has been introduced as an environment variable to hold compiler
|
|
|
|
|
flags that change binary compatibility. Changes were also made to
|
|
|
|
|
distutils.sysconfig to also use the environment variable when used during
|
2005-04-25 04:14:03 -03:00
|
|
|
|
compilation of the interpreter and of C extensions through distutils.
|
2005-04-24 19:26:38 -03:00
|
|
|
|
|
2005-03-29 09:47:59 -04:00
|
|
|
|
- SF patch 1171735: Darwin 8's headers are anal about POSIX compliance,
|
|
|
|
|
and linking has changed (prebinding is now deprecated, and libcc_dynamic
|
|
|
|
|
no longer exists). This configure patch makes things right.
|
|
|
|
|
|
2005-03-08 11:03:08 -04:00
|
|
|
|
- Bug #1158607: Build with --disable-unicode again.
|
|
|
|
|
|
2005-02-15 20:07:19 -04:00
|
|
|
|
- spwdmodule.c is built only if either HAVE_GETSPNAM or HAVE_HAVE_GETSPENT is
|
|
|
|
|
defined. Discovered as a result of not being able to build on OS X.
|
|
|
|
|
|
2004-12-06 20:42:59 -04:00
|
|
|
|
- setup.py now uses the directories specified in LDFLAGS using the -L option
|
|
|
|
|
and in CPPFLAGS using the -I option for adding library and include
|
|
|
|
|
directories, respectively, for compiling extension modules against. This has
|
|
|
|
|
led to the core being compiled using the values in CPPFLAGS. It also removes
|
|
|
|
|
the need for the special-casing of both DarwinPorts and Fink for darwin since
|
|
|
|
|
the proper directories can be specified in LDFLAGS (``-L/sw/lib`` for Fink,
|
|
|
|
|
``-L/opt/local/lib`` for DarwinPorts) and CPPFLAGS (``-I/sw/include`` for
|
|
|
|
|
Fink, ``-I/opt/local/include`` for DarwinPorts).
|
|
|
|
|
|
2005-02-10 16:48:03 -04:00
|
|
|
|
- Test in configure.in that checks for tzset no longer dependent on tm->tm_zone
|
|
|
|
|
to exist in the struct (not required by either ISO C nor the UNIX 2 spec).
|
|
|
|
|
Tests for sanity in tzname when HAVE_TZNAME defined were also defined.
|
|
|
|
|
Closes bug #1096244. Thanks Gregory Bond.
|
|
|
|
|
|
2004-12-02 04:59:14 -04:00
|
|
|
|
C API
|
|
|
|
|
-----
|
|
|
|
|
|
2005-08-16 00:47:52 -03:00
|
|
|
|
- Added a C API for set and frozenset objects.
|
|
|
|
|
|
2004-12-03 07:45:13 -04:00
|
|
|
|
- Removed PyRange_New().
|
|
|
|
|
|
2005-10-06 17:29:57 -03:00
|
|
|
|
- Patch #1313939: PyUnicode_DecodeCharmap() accepts a unicode string as the
|
|
|
|
|
mapping argument now. This string is used as a mapping table. Byte values
|
|
|
|
|
greater than the length of the string and 0xFFFE are treated as undefined
|
|
|
|
|
mappings.
|
|
|
|
|
|
2004-12-02 04:59:14 -04:00
|
|
|
|
|
|
|
|
|
Tests
|
|
|
|
|
-----
|
|
|
|
|
|
2005-01-23 05:19:22 -04:00
|
|
|
|
- In test_os, st_?time is now truncated before comparing it with ST_?TIME.
|
2004-12-02 04:59:14 -04:00
|
|
|
|
|
2005-12-10 13:44:27 -04:00
|
|
|
|
- Patch #1276356: New resource "urlfetch" is implemented. This enables
|
|
|
|
|
even impatient people to run tests that require remote files.
|
|
|
|
|
|
2005-02-13 18:53:22 -04:00
|
|
|
|
|
|
|
|
|
Documentation
|
|
|
|
|
-------------
|
|
|
|
|
|
2006-01-20 05:34:29 -04:00
|
|
|
|
- Bug #1402224: Add warning to dl docs about crashes.
|
|
|
|
|
|
2006-01-20 05:14:36 -04:00
|
|
|
|
- Bug #1396471: Document that Windows' ftell() can return invalid
|
|
|
|
|
values for text files with UNIX-style line endings.
|
|
|
|
|
|
2005-09-14 17:42:00 -03:00
|
|
|
|
- Bug #1274828: Document os.path.splitunc().
|
|
|
|
|
|
2005-08-24 04:31:33 -03:00
|
|
|
|
- Bug #1190204: Clarify which directories are searched by site.py.
|
|
|
|
|
|
2005-08-24 04:26:55 -03:00
|
|
|
|
- Bug #1193849: Clarify os.path.expanduser() documentation.
|
|
|
|
|
|
2005-08-02 07:28:08 -03:00
|
|
|
|
- Bug #1243192: re.UNICODE and re.LOCALE affect \d, \D, \s and \S.
|
|
|
|
|
|
2005-07-18 05:53:17 -03:00
|
|
|
|
- Bug #755617: Document the effects of os.chown() on Windows.
|
|
|
|
|
|
2005-06-26 18:09:38 -03:00
|
|
|
|
- Patch #1180012: The documentation for modulefinder is now in the library reference.
|
|
|
|
|
|
|
|
|
|
- Patch #1213031: Document that os.chown() accepts argument values of -1.
|
|
|
|
|
|
|
|
|
|
- Bug #1190563: Document os.waitpid() return value with WNOHANG flag.
|
|
|
|
|
|
|
|
|
|
- Bug #1175022: Correct the example code for property().
|
|
|
|
|
|
2005-06-25 18:08:46 -03:00
|
|
|
|
- Document the IterableUserDict class in the UserDict module.
|
|
|
|
|
Closes bug #1166582.
|
|
|
|
|
|
2005-02-13 18:53:22 -04:00
|
|
|
|
- Remove all latent references for "Macintosh" that referred to semantics for
|
|
|
|
|
Mac OS 9 and change to reflect the state for OS X.
|
|
|
|
|
Closes patch #1095802. Thanks Jack Jansen.
|
|
|
|
|
|
2004-12-02 04:59:14 -04:00
|
|
|
|
Mac
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
2005-07-16 23:36:59 -03:00
|
|
|
|
New platforms
|
|
|
|
|
-------------
|
|
|
|
|
|
|
|
|
|
- FreeBSD 7 support is added.
|
|
|
|
|
|
2004-12-02 04:59:14 -04:00
|
|
|
|
|
|
|
|
|
Tools/Demos
|
|
|
|
|
-----------
|
|
|
|
|
|
2006-03-01 00:28:00 -04:00
|
|
|
|
- Created Misc/Vim/vim_syntax.py to auto-generate a python.vim file in that
|
|
|
|
|
directory for syntax highlighting in Vim. Vim directory was added and placed
|
|
|
|
|
vimrc to it (was previous up a level).
|
|
|
|
|
|
2005-08-24 15:32:30 -03:00
|
|
|
|
- Added two new files to Tools/scripts: pysource.py, which recursively
|
|
|
|
|
finds Python source files, and findnocoding.py, which finds Python
|
|
|
|
|
source files that need an encoding declaration.
|
|
|
|
|
Patch #784089, credits to Oleg Broytmann.
|
|
|
|
|
|
2005-06-26 18:09:38 -03:00
|
|
|
|
- Bug #1072853: pindent.py used an uninitialized variable.
|
|
|
|
|
|
2005-04-09 07:53:34 -03:00
|
|
|
|
- Patch #1177597: Correct Complex.__init__.
|
2004-12-02 04:59:14 -04:00
|
|
|
|
|
2006-01-01 17:48:54 -04:00
|
|
|
|
- Fixed a display glitch in Pynche, which could cause the right arrow to
|
|
|
|
|
wiggle over by a pixel.
|
2004-12-02 04:59:14 -04:00
|
|
|
|
|
2004-11-29 21:28:55 -04:00
|
|
|
|
What's New in Python 2.4 final?
|
|
|
|
|
===============================
|
2004-11-23 14:06:08 -04:00
|
|
|
|
|
2004-11-29 21:28:55 -04:00
|
|
|
|
*Release date: 30-NOV-2004*
|
2004-11-23 14:06:08 -04:00
|
|
|
|
|
|
|
|
|
Core and builtins
|
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
|
|
- Bug 875692: Improve signal handling, especially when using threads, by
|
|
|
|
|
forcing an early re-execution of PyEval_EvalFrame() "periodic" code when
|
|
|
|
|
things_to_do is not cleared by Py_MakePendingCalls().
|
|
|
|
|
|
|
|
|
|
|
2004-11-30 07:53:10 -04:00
|
|
|
|
What's New in Python 2.4 (release candidate 1)
|
|
|
|
|
==============================================
|
2004-11-04 01:23:17 -04:00
|
|
|
|
|
2004-11-18 08:32:27 -04:00
|
|
|
|
*Release date: 18-NOV-2004*
|
2004-11-04 01:23:17 -04:00
|
|
|
|
|
|
|
|
|
Core and builtins
|
|
|
|
|
-----------------
|
|
|
|
|
|
2004-11-08 00:30:21 -04:00
|
|
|
|
- Bug 1061968: Fixes in 2.4a3 to address thread bug 1010677 reintroduced
|
|
|
|
|
the years-old thread shutdown race bug 225673. Numeric history lesson
|
|
|
|
|
aside, all bugs in all three reports are fixed now.
|
|
|
|
|
|
2004-11-04 01:23:17 -04:00
|
|
|
|
|
2004-11-04 00:31:30 -04:00
|
|
|
|
Library
|
|
|
|
|
-------
|
|
|
|
|
|
|
|
|
|
- Bug 1052242: If exceptions are raised by an atexit handler function an
|
|
|
|
|
attempt is made to execute the remaining handlers. The last exception
|
|
|
|
|
raised is re-raised.
|
|
|
|
|
|
2004-11-08 18:07:37 -04:00
|
|
|
|
- ``doctest``'s new support for adding ``pdb.set_trace()`` calls to
|
|
|
|
|
doctests was broken in a dramatic but shallow way. Fixed.
|
|
|
|
|
|
2004-11-13 12:18:32 -04:00
|
|
|
|
- Bug 1065388: ``calendar``'s ``day_name``, ``day_abbr``, ``month_name``,
|
|
|
|
|
and ``month_abbr`` attributes emulate sequences of locale-correct
|
|
|
|
|
spellings of month and day names. Because the locale can change at
|
|
|
|
|
any time, the correct spelling is recomputed whenever one of these is
|
|
|
|
|
indexed. In the worst case, the index may be a slice object, so these
|
|
|
|
|
recomputed every day or month name each time they were indexed. This is
|
|
|
|
|
much slower than necessary in the usual case, when the index is just an
|
|
|
|
|
integer. In that case, only the single spelling needed is recomputed
|
|
|
|
|
now; and, when the index is a slice object, only the spellings needed
|
|
|
|
|
by the slice are recomputed now.
|
|
|
|
|
|
2004-11-08 18:07:37 -04:00
|
|
|
|
- Patch 1061679: Added ``__all__`` to pickletools.py.
|
2004-11-06 19:45:48 -04:00
|
|
|
|
|
2004-11-04 01:23:17 -04:00
|
|
|
|
Build
|
|
|
|
|
-----
|
|
|
|
|
|
2004-11-06 21:19:00 -04:00
|
|
|
|
- Bug 1034277 / Patch 1035255: Remove compilation of core against CoreServices
|
|
|
|
|
and CoreFoundation on OS X. Involved removing PyMac_GetAppletScriptFile()
|
|
|
|
|
which has no known users. Thanks Bob Ippolito.
|
2004-11-04 01:23:17 -04:00
|
|
|
|
|
|
|
|
|
C API
|
|
|
|
|
-----
|
|
|
|
|
|
2004-11-18 05:41:45 -04:00
|
|
|
|
- The PyRange_New() function is deprecated.
|
|
|
|
|
|
2004-11-04 01:23:17 -04:00
|
|
|
|
|
2004-10-17 22:32:09 -03:00
|
|
|
|
What's New in Python 2.4 beta 2?
|
|
|
|
|
================================
|
|
|
|
|
|
2004-11-03 02:21:37 -04:00
|
|
|
|
*Release date: 03-NOV-2004*
|
2004-10-17 22:32:09 -03:00
|
|
|
|
|
2004-10-23 00:43:54 -03:00
|
|
|
|
License
|
|
|
|
|
-------
|
|
|
|
|
|
|
|
|
|
The Python Software Foundation changed the license under which Python
|
|
|
|
|
is released, to remove Python version numbers. There were no other
|
|
|
|
|
changes to the license. So, for example, wherever the license for
|
|
|
|
|
Python 2.3 said "Python 2.3", the new license says "Python". The
|
|
|
|
|
intent is to make it possible to refer to the PSF license in a more
|
|
|
|
|
durable way. For example, some people say they're confused by that
|
|
|
|
|
the Open Source Initiative's entry for the Python Software Foundation
|
|
|
|
|
License::
|
|
|
|
|
|
|
|
|
|
http://www.opensource.org/licenses/PythonSoftFoundation.php
|
|
|
|
|
|
|
|
|
|
says "Python 2.1.1" all over it, wondering whether it applies only
|
|
|
|
|
to Python 2.1.1.
|
|
|
|
|
|
|
|
|
|
The official name of the new license is the Python Software Foundation
|
|
|
|
|
License Version 2.
|
|
|
|
|
|
2004-10-17 22:32:09 -03:00
|
|
|
|
Core and builtins
|
|
|
|
|
-----------------
|
|
|
|
|
|
2004-10-30 20:09:22 -03:00
|
|
|
|
- Bug #1055820 Cyclic garbage collection was not protecting against that
|
|
|
|
|
calling a live weakref to a piece of cyclic trash could resurrect an
|
|
|
|
|
insane mutation of the trash if any Python code ran during gc (via
|
|
|
|
|
running a dead object's __del__ method, running another callback on a
|
|
|
|
|
weakref to a dead object, or via any Python code run in any other thread
|
|
|
|
|
that managed to obtain the GIL while a __del__ or callback was running
|
|
|
|
|
in the thread doing gc). The most likely symptom was "impossible"
|
2005-11-22 11:14:44 -04:00
|
|
|
|
``AttributeError`` exceptions, appearing seemingly at random, on weakly
|
2004-10-30 20:09:22 -03:00
|
|
|
|
referenced objects. The cure was to clear all weakrefs to unreachable
|
|
|
|
|
objects before allowing any callbacks to run.
|
|
|
|
|
|
2004-10-25 22:52:37 -03:00
|
|
|
|
- Bug #1054139 _PyString_Resize() now invalidates its cached hash value.
|
2004-10-17 22:32:09 -03:00
|
|
|
|
|
|
|
|
|
Extension Modules
|
|
|
|
|
-----------------
|
|
|
|
|
|
2004-10-23 21:10:06 -03:00
|
|
|
|
- Bug #1048870: the compiler now generates distinct code objects for
|
|
|
|
|
functions with identical bodies. This was producing confusing
|
|
|
|
|
traceback messages which pointed to the function where the code
|
|
|
|
|
object was first defined rather than the function being executed.
|
2004-10-17 22:32:09 -03:00
|
|
|
|
|
|
|
|
|
Library
|
|
|
|
|
-------
|
|
|
|
|
|
2004-10-31 23:52:43 -04:00
|
|
|
|
- Patch #1056967 changes the semantics of Template.safe_substitute() so that
|
|
|
|
|
no ValueError is raised on an 'invalid' match group. Now the delimiter is
|
|
|
|
|
returned.
|
|
|
|
|
|
2004-10-23 21:32:24 -03:00
|
|
|
|
- Bug #1052503 pdb.runcall() was not passing along keyword arguments.
|
|
|
|
|
|
2004-10-20 05:21:57 -03:00
|
|
|
|
- Bug #902037: XML.sax.saxutils.prepare_input_source() now combines relative
|
|
|
|
|
paths with a base path before checking os.path.isfile().
|
|
|
|
|
|
2004-10-20 04:17:16 -03:00
|
|
|
|
- The whichdb module can now be run from the command line.
|
|
|
|
|
|
2004-10-17 22:37:57 -03:00
|
|
|
|
- Bug #1045381: time.strptime() can now infer the date using %U or %W (week of
|
|
|
|
|
the year) when the day of the week and year are also specified.
|
2004-10-17 22:32:09 -03:00
|
|
|
|
|
2004-10-19 16:54:41 -03:00
|
|
|
|
- Bug #1048816: fix bug in Ctrl-K at start of line in curses.textpad.Textbox
|
|
|
|
|
|
2004-10-20 08:56:15 -03:00
|
|
|
|
- Bug #1017553: fix bug in tarfile.filemode()
|
|
|
|
|
|
2004-10-26 06:53:46 -03:00
|
|
|
|
- Patch #737473: fix bug that old source code is shown in tracebacks even if
|
2004-10-26 06:16:42 -03:00
|
|
|
|
the source code is updated and reloaded.
|
|
|
|
|
|
2004-10-17 22:32:09 -03:00
|
|
|
|
Build
|
|
|
|
|
-----
|
|
|
|
|
|
2004-10-26 06:53:46 -03:00
|
|
|
|
- Patch #1044395: --enable-shared is allowed in FreeBSD also.
|
2004-10-17 22:32:09 -03:00
|
|
|
|
|
2004-09-06 20:30:27 -03:00
|
|
|
|
What's New in Python 2.4 beta 1?
|
|
|
|
|
================================
|
|
|
|
|
|
2004-10-15 05:07:21 -03:00
|
|
|
|
*Release date: 15-OCT-2004*
|
2004-09-06 20:30:27 -03:00
|
|
|
|
|
|
|
|
|
Core and builtins
|
|
|
|
|
-----------------
|
|
|
|
|
|
2004-10-23 00:43:54 -03:00
|
|
|
|
- Patch #975056: Restartable signals were not correctly disabled on
|
2004-10-13 11:55:56 -03:00
|
|
|
|
BSD systems. Consistently use PyOS_setsig() instead of signal().
|
|
|
|
|
|
2004-10-09 22:58:44 -03:00
|
|
|
|
- The internal portable implementation of thread-local storage (TLS), used
|
|
|
|
|
by the ``PyGILState_Ensure()``/``PyGILState_Release()`` API, was not
|
|
|
|
|
thread-correct. This could lead to a variety of problems, up to and
|
|
|
|
|
including segfaults. See bug 1041645 for an example.
|
|
|
|
|
|
2004-10-07 03:46:25 -03:00
|
|
|
|
- Added a command line option, -m module, which searches sys.path for the
|
|
|
|
|
module and then runs it. (Contributed by Nick Coghlan.)
|
|
|
|
|
|
2004-09-22 15:44:21 -03:00
|
|
|
|
- The bytecode optimizer now folds tuples of constants into a single
|
|
|
|
|
constant.
|
|
|
|
|
|
2004-09-23 05:06:40 -03:00
|
|
|
|
- SF bug #513866: Float/long comparison anomaly. Prior to 2.4b1, when
|
|
|
|
|
an integer was compared to a float, the integer was coerced to a float.
|
|
|
|
|
That could yield spurious overflow errors (if the integer was very
|
|
|
|
|
large), and to anomalies such as
|
|
|
|
|
``long(1e200)+1 == 1e200 == long(1e200)-1``. Coercion to float is no
|
|
|
|
|
longer performed, and cases like ``long(1e200)-1 < 1e200``,
|
|
|
|
|
``long(1e200)+1 > 1e200`` and ``(1 << 20000) > 1e200`` are computed
|
|
|
|
|
correctly now.
|
2004-09-06 20:30:27 -03:00
|
|
|
|
|
|
|
|
|
Extension modules
|
|
|
|
|
-----------------
|
|
|
|
|
|
2004-09-30 23:13:16 -03:00
|
|
|
|
- ``collections.deque`` objects didn't play quite right with garbage
|
|
|
|
|
collection, which could lead to a segfault in a release build, or
|
2004-10-07 03:46:25 -03:00
|
|
|
|
an assert failure in a debug build. Also, added overflow checks,
|
|
|
|
|
better detection of mutation during iteration, and shielded deque
|
|
|
|
|
comparisons from unusual subclass overrides of the __iter__() method.
|
2004-09-06 20:30:27 -03:00
|
|
|
|
|
|
|
|
|
Library
|
|
|
|
|
-------
|
2004-09-22 15:03:47 -03:00
|
|
|
|
|
2004-10-14 07:02:08 -03:00
|
|
|
|
- Patch 1046644: distutils build_ext grew two new options - --swig for
|
2004-10-23 00:43:54 -03:00
|
|
|
|
specifying the swig executable to use, and --swig-opts to specify
|
2004-10-14 07:02:08 -03:00
|
|
|
|
options to pass to swig. --swig-opts="-c++" is the new way to spell
|
|
|
|
|
--swig-cpp.
|
|
|
|
|
|
2004-10-13 12:54:17 -03:00
|
|
|
|
- Patch 983206: distutils now obeys environment variable LDSHARED, if
|
|
|
|
|
it is set.
|
|
|
|
|
|
2004-10-12 12:32:10 -03:00
|
|
|
|
- Added Peter Astrand's subprocess.py module. See PEP 324 for details.
|
2004-10-12 12:26:28 -03:00
|
|
|
|
|
2004-10-05 23:11:37 -03:00
|
|
|
|
- time.strptime() now properly escapes timezones and all other locale-specific
|
|
|
|
|
strings for regex-specific symbols. Was breaking under Japanese Windows when
|
|
|
|
|
the timezone was specified as "Tokyo (standard time)".
|
|
|
|
|
Closes bug #1039270.
|
|
|
|
|
|
2004-10-03 00:16:19 -03:00
|
|
|
|
- Updates for the email package:
|
2004-10-22 03:22:54 -03:00
|
|
|
|
|
2004-10-11 11:32:47 -03:00
|
|
|
|
+ email.Utils.formatdate() grew a 'usegmt' argument for HTTP support.
|
2004-10-03 00:16:19 -03:00
|
|
|
|
+ All deprecated APIs that in email 2.x issued warnings have been removed:
|
|
|
|
|
_encoder argument to the MIMEText constructor, Message.add_payload(),
|
|
|
|
|
Utils.dump_address_pair(), Utils.decode(), Utils.encode()
|
|
|
|
|
+ New deprecations: Generator.__call__(), Message.get_type(),
|
|
|
|
|
Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
|
|
|
|
|
the Parser constructor. These will be removed in email 3.1.
|
|
|
|
|
+ Support for Python earlier than 2.3 has been removed (see PEP 291).
|
|
|
|
|
+ All defect classes have been renamed to end in 'Defect'.
|
|
|
|
|
+ Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
|
|
|
|
|
added to messages that claim to be multipart but really aren't.
|
|
|
|
|
+ Updates to documentation.
|
|
|
|
|
|
2004-09-24 00:41:05 -03:00
|
|
|
|
- re's findall() and finditer() functions now take an optional flags argument
|
|
|
|
|
just like the compile(), search(), and match() functions. Also, documented
|
|
|
|
|
the previously existing start and stop parameters for the findall() and
|
|
|
|
|
finditer() methods of regular expression objects.
|
|
|
|
|
|
2004-09-22 15:03:47 -03:00
|
|
|
|
- rfc822 Messages now support iterating over the headers.
|
2004-09-06 20:30:27 -03:00
|
|
|
|
|
2004-09-18 06:08:52 -03:00
|
|
|
|
- The (undocumented) tarfile.Tarfile.membernames has been removed;
|
|
|
|
|
applications should use the getmember function.
|
|
|
|
|
|
2004-09-18 06:03:49 -03:00
|
|
|
|
- httplib now offers symbolic constants for the HTTP status codes.
|
|
|
|
|
|
2004-09-15 22:30:50 -03:00
|
|
|
|
- SF bug #1028306: Trying to compare a ``datetime.date`` to a
|
|
|
|
|
``datetime.datetime`` mistakenly compared only the year, month and day.
|
|
|
|
|
Now it acts like a mixed-type comparison: ``False`` for ``==``,
|
|
|
|
|
``True`` for ``!=``, and raises ``TypeError`` for other comparison
|
|
|
|
|
operators. Because datetime is a subclass of date, comparing only the
|
|
|
|
|
base class (date) members can still be done, if that's desired, by
|
|
|
|
|
forcing using of the approprate date method; e.g.,
|
|
|
|
|
``a_date.__eq__(a_datetime)`` is true if and only if the year, month
|
|
|
|
|
and day members of ``a_date`` and ``a_datetime`` are equal.
|
|
|
|
|
|
2004-09-12 21:52:51 -03:00
|
|
|
|
- bdist_rpm now supports command line options --force-arch,
|
|
|
|
|
{pre,post}-install, {pre,post}-uninstall, and
|
2004-09-10 03:32:54 -03:00
|
|
|
|
{prep,build,install,clean,verify}-script.
|
2004-09-12 21:52:51 -03:00
|
|
|
|
|
2004-09-07 17:24:22 -03:00
|
|
|
|
- SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
|
|
|
|
|
decoding incomplete input (when the input stream is temporarily exhausted).
|
|
|
|
|
``codecs.StreamReader`` now implements buffering, which enables proper
|
|
|
|
|
readline support for the UTF-16 decoders. ``codecs.StreamReader.read()``
|
|
|
|
|
has a new argument ``chars`` which specifies the number of characters to
|
|
|
|
|
return. ``codecs.StreamReader.readline()`` and
|
|
|
|
|
``codecs.StreamReader.readlines()`` have a new argument ``keepends``.
|
|
|
|
|
Trailing "\n"s will be stripped from the lines if ``keepends`` is false.
|
2004-09-06 20:30:27 -03:00
|
|
|
|
|
2004-09-26 02:13:18 -03:00
|
|
|
|
- The documentation for doctest is greatly expanded, and now covers all
|
|
|
|
|
the new public features (of which there are many).
|
|
|
|
|
|
2004-09-13 05:53:15 -03:00
|
|
|
|
- ``doctest.master`` was put back in, and ``doctest.testmod()`` once again
|
2004-09-12 21:52:51 -03:00
|
|
|
|
updates it. This isn't good, because every ``testmod()`` call
|
|
|
|
|
contributes to bloating the "hidden" state of ``doctest.master``, but
|
|
|
|
|
some old code apparently relies on it. For now, all we can do is
|
|
|
|
|
encourage people to stitch doctests together via doctest's unittest
|
2004-09-26 02:13:18 -03:00
|
|
|
|
integration features instead.
|
2004-09-12 21:52:51 -03:00
|
|
|
|
|
2004-09-14 14:58:31 -03:00
|
|
|
|
- httplib now handles ipv6 address/port pairs.
|
|
|
|
|
|
2004-10-03 12:40:25 -03:00
|
|
|
|
- SF bug #1017864: ConfigParser now correctly handles default keys,
|
|
|
|
|
processing them with ``ConfigParser.optionxform`` when supplied,
|
|
|
|
|
consistent with the handling of config file entries and runtime-set
|
|
|
|
|
options.
|
|
|
|
|
|
2004-10-03 12:55:09 -03:00
|
|
|
|
- SF bug #997050: Document, test, & check for non-string values in
|
|
|
|
|
ConfigParser. Moved the new string-only restriction added in
|
|
|
|
|
rev. 1.65 to the SafeConfigParser class, leaving existing
|
|
|
|
|
ConfigParser & RawConfigParser behavior alone, and documented the
|
|
|
|
|
conditions under which non-string values work.
|
|
|
|
|
|
2004-09-06 20:30:27 -03:00
|
|
|
|
Build
|
|
|
|
|
-----
|
|
|
|
|
|
2004-09-28 01:08:11 -03:00
|
|
|
|
- Building on darwin now includes /opt/local/include and /opt/local/lib for
|
|
|
|
|
building extension modules. This is so as to include software installed as
|
|
|
|
|
a DarwinPorts port <http://darwinports.opendarwin.org/>
|
|
|
|
|
|
2004-09-23 16:11:32 -03:00
|
|
|
|
- pyport.h now defines a Py_IS_NAN macro. It works as-is when the
|
|
|
|
|
platform C computes true for ``x != x`` if and only if X is a NaN.
|
|
|
|
|
Other platforms can override the default definition with a platform-
|
|
|
|
|
specific spelling in that platform's pyconfig.h. You can also override
|
|
|
|
|
pyport.h's default Py_IS_INFINITY definition now.
|
2004-09-06 20:30:27 -03:00
|
|
|
|
|
|
|
|
|
C API
|
|
|
|
|
-----
|
|
|
|
|
|
2004-10-10 23:40:51 -03:00
|
|
|
|
- SF patch 1044089: New function ``PyEval_ThreadsInitialized()`` returns
|
|
|
|
|
non-zero if PyEval_InitThreads() has been called.
|
|
|
|
|
|
|
|
|
|
- The undocumented and unused extern int ``_PyThread_Started`` was removed.
|
|
|
|
|
|
2004-10-09 23:47:33 -03:00
|
|
|
|
- The C API calls ``PyInterpreterState_New()`` and ``PyThreadState_New()``
|
|
|
|
|
are two of the very few advertised as being safe to call without holding
|
|
|
|
|
the GIL. However, this wasn't true in a debug build, as bug 1041645
|
|
|
|
|
demonstrated. In a debug build, Python redirects the ``PyMem`` family
|
|
|
|
|
of calls to Python's small-object allocator, to get the benefit of
|
|
|
|
|
its extra debugging capabilities. But Python's small-object allocator
|
|
|
|
|
isn't threadsafe, relying on the GIL to avoid the expense of doing its
|
|
|
|
|
own locking. ``PyInterpreterState_New()`` and ``PyThreadState_New()``
|
|
|
|
|
call the platform ``malloc()`` directly now, regardless of build type.
|
|
|
|
|
|
2004-09-23 05:06:40 -03:00
|
|
|
|
- PyLong_AsUnsignedLong[Mask] now support int objects as well.
|
|
|
|
|
|
2004-09-07 17:24:22 -03:00
|
|
|
|
- SF patch #998993: ``PyUnicode_DecodeUTF8Stateful`` and
|
|
|
|
|
``PyUnicode_DecodeUTF16Stateful`` have been added, which implement stateful
|
|
|
|
|
decoding.
|
2004-09-06 20:30:27 -03:00
|
|
|
|
|
|
|
|
|
Tests
|
|
|
|
|
-----
|
|
|
|
|
|
|
|
|
|
- test__locale ported to unittest
|
|
|
|
|
|
|
|
|
|
Mac
|
|
|
|
|
---
|
|
|
|
|
|
2004-10-03 13:27:09 -03:00
|
|
|
|
- ``plistlib`` now supports non-dict root objects. There is also a new
|
|
|
|
|
interface for reading and writing plist files: ``readPlist(pathOrFile)``
|
|
|
|
|
and ``writePlist(rootObject, pathOrFile)``
|
2004-09-06 20:30:27 -03:00
|
|
|
|
|
|
|
|
|
Tools/Demos
|
|
|
|
|
-----------
|
|
|
|
|
|
2004-10-03 16:03:19 -03:00
|
|
|
|
- The text file comparison scripts ``ndiff.py`` and ``diff.py`` now
|
|
|
|
|
read the input files in universal-newline mode. This spares them
|
|
|
|
|
from consuming a great deal of time to deduce the useless result that,
|
|
|
|
|
e.g., a file with Windows line ends and a file with Linux line ends
|
|
|
|
|
have no lines in common.
|
2004-09-06 20:30:27 -03:00
|
|
|
|
|
|
|
|
|
|
2004-08-07 11:03:33 -03:00
|
|
|
|
What's New in Python 2.4 alpha 3?
|
|
|
|
|
=================================
|
|
|
|
|
|
2004-09-02 13:37:15 -03:00
|
|
|
|
*Release date: 02-SEP-2004*
|
2004-08-07 11:03:33 -03:00
|
|
|
|
|
|
|
|
|
Core and builtins
|
|
|
|
|
-----------------
|
|
|
|
|
|
2004-09-12 21:52:51 -03:00
|
|
|
|
- SF patch #1007189: ``from ... import ...`` statements now allow the name
|
2004-08-31 07:07:13 -03:00
|
|
|
|
list to be surrounded by parentheses.
|
|
|
|
|
|
2004-08-29 19:16:50 -03:00
|
|
|
|
- Some speedups for long arithmetic, thanks to Trevor Perrin. Gradeschool
|
|
|
|
|
multiplication was sped a little by optimizing the C code. Gradeschool
|
|
|
|
|
squaring was sped by about a factor of 2, by exploiting that about half
|
|
|
|
|
the digit products are duplicates in a square. Because exponentiation
|
|
|
|
|
uses squaring often, this also speeds long power. For example, the time
|
|
|
|
|
to compute 17**1000000 dropped from about 14 seconds to 9 on my box due
|
|
|
|
|
to this much. The cutoff for Karatsuba multiplication was raised,
|
|
|
|
|
since gradeschool multiplication got quicker, and the cutoff was
|
SF patch 936813: fast modular exponentiation
This checkin is adapted from part 2 (of 3) of Trevor Perrin's patch set.
BACKWARD INCOMPATIBILITY: SHIFT must now be divisible by 5. AFAIK,
nobody will care. long_pow() could be complicated to worm around that,
if necessary.
long_pow():
- BUGFIX: This leaked the base and power when the power was negative
(and so the computation delegated to float pow).
- Instead of doing right-to-left exponentiation, do left-to-right. This
is more efficient for small bases, which is the common case.
- In addition, if the exponent is large (more than FIVEARY_CUTOFF
digits), precompute [a**i % c for i in range(32)], and go left to
right 5 bits at a time.
l_divmod():
- The signature changed so that callers who don't want the quotient,
or don't want the remainder, can pass NULL in the slot they don't
want. This saves them from having to declare a vrbl for unwanted
stuff, and remembering to decref it.
long_mod(), long_div(), long_classic_div():
- Adjust to new l_divmod() signature, and simplified as a result.
2004-08-29 23:44:38 -03:00
|
|
|
|
aggressively small regardless. The exponentiation algorithm was switched
|
|
|
|
|
from right-to-left to left-to-right, which is more efficient for small
|
|
|
|
|
bases. In addition, if the exponent is large, the algorithm now does
|
|
|
|
|
5 bits (instead of 1 bit) at a time. That cut the time to compute
|
|
|
|
|
17**1000000 on my box in half again, down to about 4.5 seconds.
|
2004-08-29 19:16:50 -03:00
|
|
|
|
|
2004-08-24 23:14:08 -03:00
|
|
|
|
- OverflowWarning is no longer generated. PEP 237 scheduled this to
|
|
|
|
|
occur in Python 2.3, but since OverflowWarning was disabled by default,
|
|
|
|
|
nobody realized it was still being generated. On the chance that user
|
|
|
|
|
code is still using them, the Python builtin OverflowWarning, and
|
|
|
|
|
corresponding C API PyExc_OverflowWarning, will exist until Python 2.5.
|
|
|
|
|
|
2004-08-19 08:31:58 -03:00
|
|
|
|
- Py_InitializeEx has been added.
|
|
|
|
|
|
2004-08-15 04:21:25 -03:00
|
|
|
|
- Fix the order of application of decorators. The proper order is bottom-up;
|
|
|
|
|
the first decorator listed is the last one called.
|
|
|
|
|
|
2004-08-13 00:18:29 -03:00
|
|
|
|
- SF patch #1005778. Fix a seg fault if the list size changed while
|
|
|
|
|
calling list.index(). This could happen if a rich comparison function
|
|
|
|
|
modified the list.
|
|
|
|
|
|
2004-08-12 15:12:44 -03:00
|
|
|
|
- The ``func_name`` (a.k.a. ``__name__``) attribute of user-defined
|
|
|
|
|
functions is now writable.
|
|
|
|
|
|
2004-08-12 15:09:00 -03:00
|
|
|
|
- code_new (a.k.a new.code()) now checks its arguments sufficiently
|
|
|
|
|
carefully that passing them on to PyCode_New() won't trigger calls
|
|
|
|
|
to Py_FatalError() or PyErr_BadInternalCall(). It is still the case
|
|
|
|
|
that the returned code object might be entirely insane.
|
|
|
|
|
|
2004-08-07 23:43:33 -03:00
|
|
|
|
- Subclasses of string can no longer be interned. The semantics of
|
|
|
|
|
interning were not clear here -- a subclass could be mutable, for
|
|
|
|
|
example -- and had bugs. Explicitly interning a subclass of string
|
|
|
|
|
via intern() will raise a TypeError. Internal operations that attempt
|
|
|
|
|
to intern a string subclass will have no effect.
|
2004-08-07 16:20:05 -03:00
|
|
|
|
|
2004-08-08 04:24:22 -03:00
|
|
|
|
- Bug 1003935: xrange() could report bogus OverflowErrors. Documented
|
|
|
|
|
what xrange() intends, and repaired tests accordingly.
|
|
|
|
|
|
2004-08-07 11:03:33 -03:00
|
|
|
|
Extension modules
|
|
|
|
|
-----------------
|
|
|
|
|
|
2004-08-29 13:34:40 -03:00
|
|
|
|
- difflib now supports HTML side-by-side diff.
|
|
|
|
|
|
2004-08-29 12:46:35 -03:00
|
|
|
|
- os.urandom has been added for systems that support sources of random
|
|
|
|
|
data.
|
|
|
|
|
|
2004-08-21 03:55:43 -03:00
|
|
|
|
- Patch 1012740: truncate() on a writeable cStringIO now resets the
|
|
|
|
|
position to the end of the stream. This is consistent with the original
|
|
|
|
|
StringIO module and avoids inadvertently resurrecting data that was
|
|
|
|
|
supposed to have been truncated away.
|
|
|
|
|
|
2004-08-09 01:51:41 -03:00
|
|
|
|
- Added socket.socketpair().
|
|
|
|
|
|
2004-08-25 21:37:31 -03:00
|
|
|
|
- Added CurrentByteIndex, CurrentColumnNumber, CurrentLineNumber
|
|
|
|
|
members to xml.parsers.expat.XMLParser object.
|
|
|
|
|
|
2004-09-12 21:52:51 -03:00
|
|
|
|
- The mpz, rotor, and xreadlines modules, all deprecated in earlier
|
2004-08-31 10:50:43 -03:00
|
|
|
|
versions of Python, have now been removed.
|
|
|
|
|
|
2004-08-07 11:03:33 -03:00
|
|
|
|
Library
|
|
|
|
|
-------
|
|
|
|
|
|
2004-08-30 11:13:04 -03:00
|
|
|
|
- Patch #934356: if a module defines __all__, believe that rather than using
|
2004-09-12 21:52:51 -03:00
|
|
|
|
heuristics for filtering out imported names.
|
2004-08-30 11:13:04 -03:00
|
|
|
|
|
2004-08-30 07:19:56 -03:00
|
|
|
|
- Patch #941486: added os.path.lexists(), which returns True for broken
|
|
|
|
|
symlinks, unlike os.path.exists().
|
|
|
|
|
|
2004-08-30 03:14:31 -03:00
|
|
|
|
- the random module now uses os.urandom() for seeding if it is available.
|
|
|
|
|
Added a new generator based on os.urandom().
|
|
|
|
|
|
2004-08-29 13:34:40 -03:00
|
|
|
|
- difflib and diff.py can now generate HTML.
|
|
|
|
|
|
2004-08-25 10:04:53 -03:00
|
|
|
|
- bdist_rpm now includes version and release in the BuildRoot, and
|
|
|
|
|
replaces - by ``_`` in version and release.
|
2004-08-25 10:00:34 -03:00
|
|
|
|
|
2004-08-25 08:37:43 -03:00
|
|
|
|
- distutils build/build_scripts now has an -e option to specify the
|
|
|
|
|
path to the Python interpreter for installed scripts.
|
|
|
|
|
|
2004-08-24 23:22:30 -03:00
|
|
|
|
- PEP 292 classes Template and SafeTemplate are added to the string module.
|
|
|
|
|
|
2004-08-18 10:57:44 -03:00
|
|
|
|
- tarfile now generates GNU tar files by default.
|
|
|
|
|
|
2004-08-18 09:46:26 -03:00
|
|
|
|
- HTTPResponse has now a getheaders method.
|
|
|
|
|
|
2004-08-18 09:40:31 -03:00
|
|
|
|
- Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
|
|
|
|
|
Percivall.
|
|
|
|
|
|
2004-08-18 09:27:40 -03:00
|
|
|
|
- logging.handlers.SMTPHandler.date_time has been removed;
|
|
|
|
|
the class now uses email.Utils.formatdate to generate the time stamp.
|
|
|
|
|
|
2004-08-18 08:06:45 -03:00
|
|
|
|
- A new function tkFont.nametofont was added to return an existing
|
|
|
|
|
font. The Font class constructor now has an additional exists argument
|
|
|
|
|
which, if True, requests to return/configure an existing font, rather
|
2004-08-21 03:55:43 -03:00
|
|
|
|
than creating a new one.
|
2004-08-18 08:06:45 -03:00
|
|
|
|
|
2004-08-17 23:51:32 -03:00
|
|
|
|
- Updated the decimal package's min() and max() methods to match the
|
|
|
|
|
latest revision of the General Decimal Arithmetic Specification.
|
|
|
|
|
Quiet NaNs are ignored and equal values are sorted based on sign
|
|
|
|
|
and exponent.
|
|
|
|
|
|
|
|
|
|
- The decimal package's Context.copy() method now returns deep copies.
|
|
|
|
|
|
|
|
|
|
- Deprecated sys.exitfunc in favor of the atexit module. The sys.exitfunc
|
2005-07-22 15:39:19 -03:00
|
|
|
|
attribute will be kept around for backwards compatibility and atexit
|
2004-08-17 23:51:32 -03:00
|
|
|
|
will just become the one preferred way to do it.
|
|
|
|
|
|
2004-08-15 11:32:06 -03:00
|
|
|
|
- patch #675551: Add get_history_item and replace_history_item functions
|
|
|
|
|
to the readline module.
|
|
|
|
|
|
2004-08-14 12:19:28 -03:00
|
|
|
|
- bug #989672: pdb.doc and the help messages for the help_d and help_u methods
|
2004-08-15 11:32:06 -03:00
|
|
|
|
of the pdb.Pdb class gives have been corrected. d(own) goes to a newer
|
|
|
|
|
frame, u(p) to an older frame, not the other way around.
|
2004-08-14 12:19:28 -03:00
|
|
|
|
|
2004-08-14 12:01:53 -03:00
|
|
|
|
- bug #990669: os.path.realpath() will resolve symlinks before normalizing the
|
|
|
|
|
path, as normalizing the path may alter the meaning of the path if it
|
|
|
|
|
contains symlinks.
|
|
|
|
|
|
2004-08-14 11:03:03 -03:00
|
|
|
|
- bug #851123: shutil.copyfile will raise an exception when trying to copy a
|
|
|
|
|
file onto a link to itself. Thanks Gregory Ball.
|
|
|
|
|
|
2004-08-13 15:46:24 -03:00
|
|
|
|
- bug #570300: Fix inspect to resolve file locations using os.path.realpath()
|
|
|
|
|
so as to properly list all functions in a module when the module itself is
|
|
|
|
|
reached through a symlink. Thanks Johannes Gijsbers.
|
|
|
|
|
|
2004-08-07 23:43:33 -03:00
|
|
|
|
- doctest refactoring continued. See the docs for details. As part of
|
|
|
|
|
this effort, some old and little- (never?) used features are now
|
|
|
|
|
deprecated: the Tester class, the module is_private() function, and the
|
|
|
|
|
isprivate argument to testmod(). The Tester class supplied a feeble
|
|
|
|
|
"by hand" way to combine multiple doctests, if you knew exactly what
|
|
|
|
|
you were doing. The newer doctest features for unittest integration
|
|
|
|
|
already did a better job of that, are stronger now than ever, and the
|
|
|
|
|
new DocTestRunner class is a saner foundation if you want to do it by
|
|
|
|
|
hand. The "private name" filtering gimmick was a mistake from the
|
|
|
|
|
start, and testmod() changed long ago to ignore it by default. If
|
|
|
|
|
you want to filter out tests, the new DocTestFinder class can be used
|
|
|
|
|
to return a list of all doctests, and you can filter that list by
|
|
|
|
|
any computable criteria before passing it to a DocTestRunner instance.
|
|
|
|
|
|
2004-08-15 14:04:33 -03:00
|
|
|
|
- Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)).
|
|
|
|
|
|
2004-08-07 11:03:33 -03:00
|
|
|
|
Tools/Demos
|
|
|
|
|
-----------
|
|
|
|
|
|
2004-08-17 23:51:32 -03:00
|
|
|
|
- IDLE's shortcut keys for windows are now case insensitive so that
|
|
|
|
|
Control-V works the same as Control-v.
|
|
|
|
|
|
2004-08-16 09:10:12 -03:00
|
|
|
|
- pygettext.py: Generate POT-Creation-Date header in ISO format.
|
|
|
|
|
|
2004-08-07 11:03:33 -03:00
|
|
|
|
Build
|
|
|
|
|
-----
|
|
|
|
|
|
SF patch 936813: fast modular exponentiation
This checkin is adapted from part 2 (of 3) of Trevor Perrin's patch set.
BACKWARD INCOMPATIBILITY: SHIFT must now be divisible by 5. AFAIK,
nobody will care. long_pow() could be complicated to worm around that,
if necessary.
long_pow():
- BUGFIX: This leaked the base and power when the power was negative
(and so the computation delegated to float pow).
- Instead of doing right-to-left exponentiation, do left-to-right. This
is more efficient for small bases, which is the common case.
- In addition, if the exponent is large (more than FIVEARY_CUTOFF
digits), precompute [a**i % c for i in range(32)], and go left to
right 5 bits at a time.
l_divmod():
- The signature changed so that callers who don't want the quotient,
or don't want the remainder, can pass NULL in the slot they don't
want. This saves them from having to declare a vrbl for unwanted
stuff, and remembering to decref it.
long_mod(), long_div(), long_classic_div():
- Adjust to new l_divmod() signature, and simplified as a result.
2004-08-29 23:44:38 -03:00
|
|
|
|
- Backward incompatibility: longintrepr.h now triggers a compile-time
|
|
|
|
|
error if SHIFT (the number of bits in a Python long "digit") isn't
|
|
|
|
|
divisible by 5. This new requirement allows simple code for the new
|
|
|
|
|
5-bits-at-a-time long_pow() implementation. If necessary, the
|
|
|
|
|
restriction could be removed (by complicating long_pow(), or by
|
|
|
|
|
falling back to the 1-bit-at-a-time algorithm), but there are no
|
|
|
|
|
plans to do so.
|
|
|
|
|
|
2004-08-25 22:44:07 -03:00
|
|
|
|
- bug #991962: When building with --disable-toolbox-glue on Darwin no
|
|
|
|
|
attempt to build Mac-specific modules occurs.
|
|
|
|
|
|
2004-08-12 15:19:17 -03:00
|
|
|
|
- The --with-tsc flag to configure to enable VM profiling with the
|
|
|
|
|
processor's timestamp counter now works on PPC platforms.
|
|
|
|
|
|
2004-08-15 11:32:06 -03:00
|
|
|
|
- patch #1006629: Define _XOPEN_SOURCE to 500 on Solaris 8/9 to match
|
|
|
|
|
GCC's definition and avoid redefinition warnings.
|
|
|
|
|
|
2004-08-16 08:35:51 -03:00
|
|
|
|
- Detect pthreads support (provided by gnu pth pthread emulation) on
|
|
|
|
|
GNU/k*BSD systems.
|
|
|
|
|
|
2004-08-19 14:52:37 -03:00
|
|
|
|
- bug #1005737, #1007249: Fixed several build problems and warnings
|
|
|
|
|
found on old/legacy C compilers of HP-UX, IRIX and Tru64.
|
|
|
|
|
|
2004-08-07 11:03:33 -03:00
|
|
|
|
C API
|
|
|
|
|
-----
|
|
|
|
|
|
2004-08-30 11:27:11 -03:00
|
|
|
|
..
|
|
|
|
|
|
2004-08-07 11:03:33 -03:00
|
|
|
|
Documentation
|
|
|
|
|
-------------
|
|
|
|
|
|
2004-08-21 12:13:52 -03:00
|
|
|
|
- patch #1005936, bug #1009373: fix index entries which contain
|
|
|
|
|
an underscore when viewed with Acrobat.
|
|
|
|
|
|
|
|
|
|
- bug #990669: os.path.normpath may alter the meaning of a path if
|
|
|
|
|
it contains symbolic links. This has been documented in a comment
|
|
|
|
|
since 1992, but is now in the library reference as well.
|
2004-08-14 11:41:32 -03:00
|
|
|
|
|
2004-08-07 11:03:33 -03:00
|
|
|
|
New platforms
|
|
|
|
|
-------------
|
|
|
|
|
|
2004-08-18 12:13:41 -03:00
|
|
|
|
- FreeBSD 6 is now supported.
|
|
|
|
|
|
2004-08-07 11:03:33 -03:00
|
|
|
|
Tests
|
|
|
|
|
-----
|
|
|
|
|
|
2004-08-30 11:27:11 -03:00
|
|
|
|
..
|
|
|
|
|
|
2004-08-07 11:03:33 -03:00
|
|
|
|
Windows
|
|
|
|
|
-------
|
|
|
|
|
|
2004-08-12 15:37:10 -03:00
|
|
|
|
- Boosted the stack reservation for python.exe and pythonw.exe from
|
|
|
|
|
the default 1MB to 2MB. Stack frames under VC 7.1 for 2.4 are enough
|
|
|
|
|
bigger than under VC 6.0 for 2.3.4 that deeply recursive progams
|
|
|
|
|
within the default sys.getrecursionlimit() default value of 1000 were
|
|
|
|
|
able to suffer undetected C stack overflows. The standard test program
|
|
|
|
|
test_compiler was one such program. If a Python process on Windows
|
|
|
|
|
"just vanishes" without a trace, and without an error message of any
|
|
|
|
|
kind, but with an exit code of 128, undetected stack overflow may be
|
|
|
|
|
the problem.
|
|
|
|
|
|
2004-08-07 11:03:33 -03:00
|
|
|
|
Mac
|
|
|
|
|
---
|
|
|
|
|
|
2004-08-30 11:27:11 -03:00
|
|
|
|
..
|
|
|
|
|
|
2004-08-07 11:03:33 -03:00
|
|
|
|
|
2004-07-09 04:30:10 -03:00
|
|
|
|
What's New in Python 2.4 alpha 2?
|
|
|
|
|
=================================
|
|
|
|
|
|
2004-08-05 04:21:01 -03:00
|
|
|
|
*Release date: 05-AUG-2004*
|
2004-07-09 04:30:10 -03:00
|
|
|
|
|
|
|
|
|
Core and builtins
|
|
|
|
|
-----------------
|
|
|
|
|
|
2004-08-06 15:43:09 -03:00
|
|
|
|
- Patch #980695: Implements efficient string concatenation for statements
|
|
|
|
|
of the form s=s+t and s+=t. This will vary across implementations.
|
|
|
|
|
Accordingly, the str.join() method is strongly preferred for performance
|
|
|
|
|
sensitive code.
|
|
|
|
|
|
2004-08-02 03:24:59 -03:00
|
|
|
|
- PEP-0318, Function Decorators have been added to the language. These are
|
2004-08-30 11:27:11 -03:00
|
|
|
|
implemented using the Java-style @decorator syntax, like so::
|
2004-09-12 21:52:51 -03:00
|
|
|
|
|
2004-08-02 03:24:59 -03:00
|
|
|
|
@staticmethod
|
|
|
|
|
def foo(bar):
|
2004-09-12 21:52:51 -03:00
|
|
|
|
|
2004-08-05 04:21:01 -03:00
|
|
|
|
(The PEP needs to be updated to reflect the current state)
|
2004-08-02 03:24:59 -03:00
|
|
|
|
|
2004-08-02 00:48:03 -03:00
|
|
|
|
- When importing a module M raises an exception, Python no longer leaves M
|
|
|
|
|
in sys.modules. Before 2.4a2 it did, and a subsequent import of M would
|
|
|
|
|
succeed, picking up a module object from sys.modules reflecting as much
|
|
|
|
|
of the initialization of M as completed before the exception was raised.
|
|
|
|
|
Subsequent imports got no indication that M was in a partially-
|
|
|
|
|
initialized state, and the importers could get into arbitrarily bad
|
|
|
|
|
trouble as a result (the M they got was in an unintended state,
|
|
|
|
|
arbitrarily far removed from M's author's intent). Now subsequent
|
|
|
|
|
imports of M will continue raising exceptions (but if, for example, the
|
|
|
|
|
source code for M is edited between import attempts, then perhaps later
|
|
|
|
|
attempts will succeed, or raise a different exception).
|
|
|
|
|
|
|
|
|
|
This can break existing code, but in such cases the code was probably
|
|
|
|
|
working before by accident. In the Python source, the only case of
|
|
|
|
|
breakage discovered was in a test accidentally relying on a damaged
|
|
|
|
|
module remaining in sys.modules. Cases are also known where tests
|
|
|
|
|
deliberately provoking import errors remove damaged modules from
|
|
|
|
|
sys.modules themselves, and such tests will break now if they do an
|
|
|
|
|
unconditional del sys.modules[M].
|
|
|
|
|
|
2004-07-23 13:14:57 -03:00
|
|
|
|
- u'%s' % obj will now try obj.__unicode__() first and fallback to
|
|
|
|
|
obj.__str__() if no __unicode__ method can be found.
|
|
|
|
|
|
2004-07-10 19:20:32 -03:00
|
|
|
|
- Patch #550732: Add PyArg_VaParseTupleAndKeywords(). Analogous to
|
2004-07-11 16:26:19 -03:00
|
|
|
|
PyArg_VaParse(). Both are now documented. Thanks Greg Chapman.
|
2004-07-10 19:20:32 -03:00
|
|
|
|
|
2004-07-09 04:30:10 -03:00
|
|
|
|
- Allow string and unicode return types from .encode()/.decode()
|
2004-07-11 16:26:19 -03:00
|
|
|
|
methods on string and unicode objects. Added unicode.decode()
|
2004-07-09 04:30:10 -03:00
|
|
|
|
which was missing for no apparent reason.
|
|
|
|
|
|
2004-07-11 16:26:19 -03:00
|
|
|
|
- An attempt to fix the mess that is Python's behaviour with
|
2004-07-09 04:30:10 -03:00
|
|
|
|
signal handlers and threads, complicated by readline's behaviour.
|
|
|
|
|
It's quite possible that there are still bugs here.
|
|
|
|
|
|
2004-07-14 16:08:28 -03:00
|
|
|
|
- Added C macros Py_CLEAR and Py_VISIT to ease the implementation of
|
|
|
|
|
types that support garbage collection.
|
|
|
|
|
|
2004-07-16 09:16:48 -03:00
|
|
|
|
- Compiler now treats None as a constant.
|
|
|
|
|
|
2004-07-19 13:29:17 -03:00
|
|
|
|
- The type of values returned by __int__, __float__, __long__,
|
|
|
|
|
__oct__, and __hex__ are now checked. Returning an invalid type
|
|
|
|
|
will cause a TypeError to be raised. This matches the behavior of
|
|
|
|
|
Jython.
|
|
|
|
|
|
2004-07-22 15:44:01 -03:00
|
|
|
|
- Implemented bind_textdomain_codeset() in locale module.
|
|
|
|
|
|
2004-08-04 03:33:51 -03:00
|
|
|
|
- Added a workaround for proper string operations in BSDs. str.split
|
|
|
|
|
and str.is* methods can now work correctly with UTF-8 locales.
|
|
|
|
|
|
2004-08-04 14:40:38 -03:00
|
|
|
|
- Bug #989185: unicode.iswide() and unicode.width() is dropped and
|
|
|
|
|
the East Asian Width support is moved to unicodedata extension
|
|
|
|
|
module.
|
2004-08-04 04:38:35 -03:00
|
|
|
|
|
2004-08-04 14:36:41 -03:00
|
|
|
|
- Patch #941229: The source code encoding in interactive mode
|
|
|
|
|
now refers sys.stdin.encoding not just ISO-8859-1 anymore. This
|
|
|
|
|
allows for non-latin-1 users to write unicode strings directly.
|
|
|
|
|
|
2004-07-09 04:30:10 -03:00
|
|
|
|
Extension modules
|
|
|
|
|
-----------------
|
|
|
|
|
|
2004-07-27 02:22:33 -03:00
|
|
|
|
- cpickle now supports the same keyword arguments as pickle.
|
|
|
|
|
|
2004-07-09 04:30:10 -03:00
|
|
|
|
Library
|
|
|
|
|
-------
|
|
|
|
|
|
2004-08-05 09:43:30 -03:00
|
|
|
|
- Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and
|
|
|
|
|
TIS-620
|
|
|
|
|
|
2004-08-04 15:46:34 -03:00
|
|
|
|
- Thanks to Edward Loper, doctest has been massively refactored, and
|
|
|
|
|
many new features were added. Full docs will appear later. For now
|
|
|
|
|
the doctest module comments and new test cases give good coverage.
|
|
|
|
|
The refactoring provides many hook points for customizing behavior
|
|
|
|
|
(such as how to report errors, and how to compare expected to actual
|
|
|
|
|
output). New features include a <BLANKLINE> marker for expected
|
|
|
|
|
output containing blank lines, options to produce unified or context
|
|
|
|
|
diffs when actual output doesn't match expectations, an option to
|
|
|
|
|
normalize whitespace before comparing, and an option to use an
|
|
|
|
|
ellipsis to signify "don't care" regions of output.
|
|
|
|
|
|
2004-08-03 15:45:31 -03:00
|
|
|
|
- Tkinter now supports the wish -sync and -use options.
|
|
|
|
|
|
2004-08-03 14:58:55 -03:00
|
|
|
|
- The following methods in time support passing of None: ctime(), gmtime(),
|
|
|
|
|
and localtime(). If None is provided, the current time is used (the
|
|
|
|
|
same as when the argument is omitted).
|
|
|
|
|
[SF bug 658254, patch 663482]
|
|
|
|
|
|
2004-08-03 11:36:32 -03:00
|
|
|
|
- nntplib does now allow to ignore a .netrc file.
|
|
|
|
|
|
2004-08-03 09:59:55 -03:00
|
|
|
|
- urllib2 now recognizes Basic authentication even if other authentication
|
|
|
|
|
schemes are offered.
|
|
|
|
|
|
2004-08-01 19:48:06 -03:00
|
|
|
|
- Bug #1001053. wave.open() now accepts unicode filenames.
|
|
|
|
|
|
2004-07-27 18:02:02 -03:00
|
|
|
|
- gzip.GzipFile has a new fileno() method, to retrieve the handle of the
|
|
|
|
|
underlying file object (provided it has a fileno() method). This is
|
|
|
|
|
needed if you want to use os.fsync() on a GzipFile.
|
|
|
|
|
|
2004-07-27 02:07:19 -03:00
|
|
|
|
- imaplib has two new methods: deleteacl and myrights.
|
|
|
|
|
|
2004-07-26 09:40:50 -03:00
|
|
|
|
- nntplib has two new methods: description and descriptions. They
|
|
|
|
|
use a more RFC-compliant way of getting a newsgroup description.
|
|
|
|
|
|
2004-07-20 23:21:58 -03:00
|
|
|
|
- Bug #993394. Fix a possible red herring of KeyError in 'threading' being
|
|
|
|
|
raised during interpreter shutdown from a registered function with atexit
|
|
|
|
|
when dummy_threading is being used.
|
|
|
|
|
|
2004-07-20 19:07:44 -03:00
|
|
|
|
- Bug #857297/Patch #916874. Fix an error when extracting a hard link
|
|
|
|
|
from a tarfile.
|
|
|
|
|
|
2004-07-20 18:54:18 -03:00
|
|
|
|
- Patch #846659. Fix an error in tarfile.py when using
|
2004-07-21 21:54:37 -03:00
|
|
|
|
GNU longname/longlink creation.
|
2004-07-20 18:54:18 -03:00
|
|
|
|
|
2004-07-18 20:58:17 -03:00
|
|
|
|
- The obsolete FCNTL.py has been deleted. The builtin fcntl module
|
|
|
|
|
has been available (on platforms that support fcntl) since Python
|
|
|
|
|
1.5a3, and all FCNTL.py did is export fcntl's names, after generating
|
|
|
|
|
a deprecation warning telling you to use fcntl directly.
|
|
|
|
|
|
2004-07-18 00:06:29 -03:00
|
|
|
|
- Several new unicode codecs are added: big5hkscs, euc_jis_2004,
|
|
|
|
|
iso2022_jp_2004, shift_jis_2004.
|
|
|
|
|
|
2004-07-11 21:45:14 -03:00
|
|
|
|
- Bug #788520. Queue.{get, get_nowait, put, put_nowait} have new
|
|
|
|
|
implementations, exploiting Conditions (which didn't exist at the time
|
|
|
|
|
Queue was introduced). A minor semantic change is that the Full and
|
|
|
|
|
Empty exceptions raised by non-blocking calls now occur only if the
|
|
|
|
|
queue truly was full or empty at the instant the queue was checked (of
|
|
|
|
|
course the Queue may no longer be full or empty by the time a calling
|
|
|
|
|
thread sees those exceptions, though). Before, the exceptions could
|
|
|
|
|
also be raised if it was "merely inconvenient" for the implementation
|
|
|
|
|
to determine the true state of the Queue (because the Queue was locked
|
|
|
|
|
by some other method in progress).
|
|
|
|
|
|
2004-07-11 16:26:19 -03:00
|
|
|
|
- Bugs #979794 and #980117: difflib.get_grouped_opcodes() now handles the
|
|
|
|
|
case of comparing two empty lists. This affected both context_diff() and
|
|
|
|
|
unified_diff(),
|
2004-07-10 20:54:07 -03:00
|
|
|
|
|
2004-07-10 20:14:30 -03:00
|
|
|
|
- Bug #980938: smtplib now prints debug output to sys.stderr.
|
|
|
|
|
|
2004-07-10 19:55:15 -03:00
|
|
|
|
- Bug #930024: posixpath.realpath() now handles infinite loops in symlinks by
|
|
|
|
|
returning the last point in the path that was not part of any loop. Thanks
|
|
|
|
|
AM Kuchling.
|
|
|
|
|
|
2004-07-10 17:42:22 -03:00
|
|
|
|
- Bug #980327: ntpath not handles compressing erroneous slashes between the
|
|
|
|
|
drive letter and the rest of the path. Also clearly handles UNC addresses now
|
|
|
|
|
as well. Thanks Paul Moore.
|
|
|
|
|
|
2004-07-10 16:13:42 -03:00
|
|
|
|
- bug #679953: zipfile.py should now work for files over 2 GB. The packed data
|
|
|
|
|
for file sizes (compressed and uncompressed) was being stored as signed
|
|
|
|
|
instead of unsigned.
|
|
|
|
|
|
2004-07-11 16:26:19 -03:00
|
|
|
|
- decimal.py now only uses signals in the IBM spec. The other conditions are
|
2004-07-09 07:02:53 -03:00
|
|
|
|
no longer part of the public API.
|
|
|
|
|
|
2004-07-10 13:16:06 -03:00
|
|
|
|
- codecs module now has two new generic APIs: encode() and decode()
|
|
|
|
|
which don't restrict the return types (unlike the unicode and
|
|
|
|
|
string methods of the same name).
|
|
|
|
|
|
2004-07-11 16:26:19 -03:00
|
|
|
|
- Non-blocking SSL sockets work again; they were broken in Python 2.3.
|
2004-07-10 18:21:55 -03:00
|
|
|
|
SF patch 945642.
|
|
|
|
|
|
2004-07-14 16:08:28 -03:00
|
|
|
|
- doctest unittest integration improvements:
|
|
|
|
|
|
|
|
|
|
o Improved the unitest test output for doctest-based unit tests
|
|
|
|
|
|
|
|
|
|
o Can now pass setUp and tearDown functions when creating
|
|
|
|
|
DocTestSuites.
|
|
|
|
|
|
|
|
|
|
- The threading module has a new class, local, for creating objects
|
|
|
|
|
that provide thread-local data.
|
|
|
|
|
|
2004-07-19 12:38:11 -03:00
|
|
|
|
- Bug #990307: when keep_empty_values is True, cgi.parse_qsl()
|
|
|
|
|
no longer returns spurious empty fields.
|
|
|
|
|
|
2004-07-22 15:44:01 -03:00
|
|
|
|
- Implemented bind_textdomain_codeset() in gettext module.
|
|
|
|
|
|
|
|
|
|
- Introduced in gettext module the l*gettext() family of functions,
|
|
|
|
|
which return translation strings encoded in the preferred encoding,
|
|
|
|
|
as informed by locale module's getpreferredencoding().
|
|
|
|
|
|
2004-07-31 13:16:11 -03:00
|
|
|
|
- optparse module (and tests) upgraded to Optik 1.5a1. Changes:
|
|
|
|
|
|
|
|
|
|
- Add expansion of default values in help text: the string
|
|
|
|
|
"%default" in an option's help string is expanded to str() of
|
|
|
|
|
that option's default value, or "none" if no default value.
|
2004-08-02 00:48:03 -03:00
|
|
|
|
|
2004-07-31 13:16:11 -03:00
|
|
|
|
- Bug #955889: option default values that happen to be strings are
|
|
|
|
|
now processed in the same way as values from the command line; this
|
|
|
|
|
allows generation of nicer help when using custom types. Can
|
|
|
|
|
be disabled with parser.set_process_default_values(False).
|
|
|
|
|
|
|
|
|
|
- Bug #960515: don't crash when generating help for callback
|
|
|
|
|
options that specify 'type', but not 'dest' or 'metavar'.
|
|
|
|
|
|
|
|
|
|
- Feature #815264: change the default help format for short options
|
|
|
|
|
that take an argument from e.g. "-oARG" to "-o ARG"; add
|
|
|
|
|
set_short_opt_delimiter() and set_long_opt_delimiter() methods to
|
|
|
|
|
HelpFormatter to allow (slight) customization of the formatting.
|
|
|
|
|
|
|
|
|
|
- Patch #736940: internationalize Optik: all built-in user-
|
|
|
|
|
targeted literal strings are passed through gettext.gettext(). (If
|
|
|
|
|
you want translations (.po files), they're not included with Python
|
|
|
|
|
-- you'll find them in the Optik source distribution from
|
|
|
|
|
http://optik.sourceforge.net/ .)
|
|
|
|
|
|
|
|
|
|
- Bug #878453: respect $COLUMNS environment variable for
|
|
|
|
|
wrapping help output.
|
|
|
|
|
|
|
|
|
|
- Feature #988122: expand "%prog" in the 'description' passed
|
|
|
|
|
to OptionParser, just like in the 'usage' and 'version' strings.
|
|
|
|
|
(This is *not* done in the 'description' passed to OptionGroup.)
|
2004-07-19 12:38:11 -03:00
|
|
|
|
|
2004-07-09 04:30:10 -03:00
|
|
|
|
C API
|
|
|
|
|
-----
|
|
|
|
|
|
2004-08-02 00:48:03 -03:00
|
|
|
|
- PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx(): if an
|
|
|
|
|
error occurs while loading the module, these now delete the module's
|
|
|
|
|
entry from sys.modules. All ways of loading modules eventually call
|
|
|
|
|
one of these, so this is an error-case change in semantics for all
|
|
|
|
|
ways of loading modules. In rare cases, a module loader may wish
|
|
|
|
|
to keep a module object in sys.modules despite that the module's
|
|
|
|
|
code cannot be executed. In such cases, the module loader must
|
|
|
|
|
arrange to reinsert the name and module object in sys.modules.
|
|
|
|
|
PyImport_ReloadModule() has been changed to reinsert the original
|
|
|
|
|
module object into sys.modules if the module reload fails, so that
|
|
|
|
|
its visible semantics have not changed.
|
|
|
|
|
|
2004-07-11 16:26:19 -03:00
|
|
|
|
- A large pile of datetime field-extraction macros is now documented,
|
|
|
|
|
thanks to Anthony Tuininga (patch #986010).
|
|
|
|
|
|
2004-07-14 16:08:28 -03:00
|
|
|
|
Documentation
|
|
|
|
|
-------------
|
|
|
|
|
|
2004-07-24 20:00:24 -03:00
|
|
|
|
- Improved the tutorial on creating types in C.
|
2004-07-14 16:08:28 -03:00
|
|
|
|
|
|
|
|
|
- point out the importance of reassigning data members before
|
2004-08-07 11:00:39 -03:00
|
|
|
|
assigning their values
|
2004-07-14 16:08:28 -03:00
|
|
|
|
|
2004-08-07 10:59:22 -03:00
|
|
|
|
- correct my misconception about return values from visitprocs. Sigh.
|
2004-07-14 16:08:28 -03:00
|
|
|
|
|
|
|
|
|
- mention the labor saving Py_VISIT and Py_CLEAR macros.
|
|
|
|
|
|
2004-07-24 20:00:24 -03:00
|
|
|
|
- Major rewrite of the math module docs, to address common confusions.
|
2004-07-14 16:08:28 -03:00
|
|
|
|
|
2004-07-09 04:30:10 -03:00
|
|
|
|
Tests
|
|
|
|
|
-----
|
|
|
|
|
|
2004-07-21 21:54:37 -03:00
|
|
|
|
- The test data files for the decimal test suite are now installed on
|
2004-07-12 06:33:39 -03:00
|
|
|
|
platforms that use the Makefile.
|
|
|
|
|
|
2004-07-21 21:54:37 -03:00
|
|
|
|
- SF patch 995225: The test file testtar.tar accidentally contained
|
|
|
|
|
CVS keywords (like $Id$), which could cause spurious failures in
|
|
|
|
|
test_tarfile.py depending on how the test file was checked out.
|
|
|
|
|
|
2004-07-09 04:30:10 -03:00
|
|
|
|
|
2003-08-01 02:01:54 -03:00
|
|
|
|
What's New in Python 2.4 alpha 1?
|
|
|
|
|
=================================
|
|
|
|
|
|
2004-07-08 02:59:43 -03:00
|
|
|
|
*Release date: 08-JUL-2004*
|
2003-08-01 02:01:54 -03:00
|
|
|
|
|
|
|
|
|
Core and builtins
|
|
|
|
|
-----------------
|
|
|
|
|
|
2004-07-02 15:57:45 -03:00
|
|
|
|
- weakref.ref is now the type object also known as
|
|
|
|
|
weakref.ReferenceType; it can be subclassed like any other new-style
|
|
|
|
|
class. There's less per-entry overhead in WeakValueDictionary
|
|
|
|
|
objects now (one object instead of three).
|
|
|
|
|
|
2004-07-02 05:56:20 -03:00
|
|
|
|
- Bug #951851: Python crashed when reading import table of certain
|
|
|
|
|
Windows DLLs.
|
|
|
|
|
|
2004-08-02 05:30:07 -03:00
|
|
|
|
- Bug #215126. The locals argument to eval(), execfile(), and exec now
|
|
|
|
|
accept any mapping type.
|
2004-07-02 03:41:07 -03:00
|
|
|
|
|
2004-06-27 13:51:46 -03:00
|
|
|
|
- marshal now shares interned strings. This change introduces
|
|
|
|
|
a new .pyc magic.
|
|
|
|
|
|
2004-06-11 11:41:18 -03:00
|
|
|
|
- Bug #966623. classes created with type() in an exec(, {}) don't
|
|
|
|
|
have a __module__, but code in typeobject assumed it would always
|
|
|
|
|
be there.
|
|
|
|
|
|
2004-06-08 15:52:54 -03:00
|
|
|
|
- Python no longer relies on the LC_NUMERIC locale setting to be
|
|
|
|
|
the "C" locale; as a result, it no longer tries to prevent changing
|
|
|
|
|
the LC_NUMERIC category.
|
|
|
|
|
|
2004-06-07 20:04:33 -03:00
|
|
|
|
- Bug #952807: Unpickling pickled instances of subclasses of
|
|
|
|
|
datetime.date, datetime.datetime and datetime.time could yield insane
|
|
|
|
|
objects. Thanks to Jiwon Seo for a fix.
|
|
|
|
|
|
2004-06-07 12:12:44 -03:00
|
|
|
|
- Bug #845802: Python crashes when __init__.py is a directory.
|
|
|
|
|
|
2004-06-03 08:10:58 -03:00
|
|
|
|
- Unicode objects received two new methods: iswide() and width().
|
|
|
|
|
These query East Asian width information, as specified in Unicode
|
|
|
|
|
TR11.
|
2004-06-02 13:49:17 -03:00
|
|
|
|
|
2004-06-01 03:36:24 -03:00
|
|
|
|
- Improved the tuple hashing algorithm to give fewer collisions in
|
|
|
|
|
common cases. Fixes bug #942952.
|
|
|
|
|
|
2004-05-19 05:20:33 -03:00
|
|
|
|
- Implemented generator expressions (PEP 289). Coded by Jiwon Seo.
|
|
|
|
|
|
2004-03-24 17:57:10 -04:00
|
|
|
|
- Enabled the profiling of C extension functions (and builtins) - check
|
2004-07-04 12:41:59 -03:00
|
|
|
|
new documentation and modified profile and bdb modules for more details
|
2004-03-24 17:57:10 -04:00
|
|
|
|
|
2004-03-21 16:24:07 -04:00
|
|
|
|
- Set file.name to the object passed to open (instead of a new string)
|
|
|
|
|
|
2004-03-21 14:37:23 -04:00
|
|
|
|
- Moved tracebackobject into traceback.h and renamed to PyTracebackObject
|
|
|
|
|
|
2004-03-21 11:12:00 -04:00
|
|
|
|
- Optimized the byte coding for multiple assignments like "a,b=b,a" and
|
|
|
|
|
"a,b,c=1,2,3". Improves their speed by 25% to 30%.
|
|
|
|
|
|
2004-03-20 18:52:14 -04:00
|
|
|
|
- Limit the nested depth of a tuple for the second argument to isinstance()
|
|
|
|
|
and issubclass() to the recursion limit of the interpreter.
|
|
|
|
|
Fixes bug #858016 .
|
|
|
|
|
|
2004-03-18 05:48:12 -04:00
|
|
|
|
- Optimized dict iterators, creating separate types for each
|
|
|
|
|
and having them reveal their length. Also optimized the
|
|
|
|
|
methods: keys(), values(), and items().
|
|
|
|
|
|
2004-03-07 03:31:06 -04:00
|
|
|
|
- Implemented a newcode opcode, LIST_APPEND, that simplifies
|
|
|
|
|
the generated bytecode for list comprehensions and further
|
|
|
|
|
improves their performance (about 35%).
|
|
|
|
|
|
2004-02-19 15:35:22 -04:00
|
|
|
|
- Implemented rich comparisons for floats, which seems to make
|
|
|
|
|
comparisons involving NaNs somewhat less surprising when the
|
|
|
|
|
underlying C compiler actually implements C99 semantics.
|
|
|
|
|
|
2004-02-15 00:06:39 -04:00
|
|
|
|
- Optimized list.extend() to save memory and no longer create
|
|
|
|
|
intermediate sequences. Also, extend() now pre-allocates the
|
|
|
|
|
needed memory whenever the length of the iterable is known in
|
|
|
|
|
advance -- this halves the time to extend the list.
|
|
|
|
|
|
* Optimized list appends and pops by making fewer calls the underlying system
realloc(). This is achieved by tracking the overallocation size in a new
field and using that information to skip calls to realloc() whenever
possible.
* Simplified and tightened the amount of overallocation. For larger lists,
this overallocates by 1/8th (compared to the previous scheme which ranged
between 1/4th to 1/32nd over-allocation). For smaller lists (n<6), the
maximum overallocation is one byte (formerly it could be upto eight bytes).
This saves memory in applications with large numbers of small lists.
* Eliminated the NRESIZE macro in favor of a new, static list_resize function
that encapsulates the resizing logic. Coverting this back to macro would
give a small (under 1%) speed-up. This was too small to warrant the loss
of readability, maintainability, and de-coupling.
* Some functions using NRESIZE had grown unnecessarily complex in their
efforts to bend to the macro's calling pattern. With the new list_resize
function in place, those other functions could be simplified. That is
being saved for a separate patch.
* The ob_item==NULL check could be eliminated from the new list_resize
function. This would entail finding each piece of code that sets ob_item
to NULL and adding a new line to invalidate the overallocation tracking
field. Rather than impose a new requirement on other pieces of list code,
it was preferred to leave the NULL check in place and retain the benefits
of decoupling, maintainability and information hiding (only PyList_New()
and list_sort() need to know about the new field). This approach also
reduces the odds of breaking an extension module.
(Collaborative effort by Raymond Hettinger, Hye-Shik Chang, Tim Peters,
and Armin Rigo.)
2004-02-13 07:36:39 -04:00
|
|
|
|
- Optimized list resize operations to make fewer calls to the system
|
|
|
|
|
realloc(). Significantly speeds up list appends, list pops,
|
2005-03-18 06:28:24 -04:00
|
|
|
|
list comprehensions, and the list constructor (when the input iterable
|
* Optimized list appends and pops by making fewer calls the underlying system
realloc(). This is achieved by tracking the overallocation size in a new
field and using that information to skip calls to realloc() whenever
possible.
* Simplified and tightened the amount of overallocation. For larger lists,
this overallocates by 1/8th (compared to the previous scheme which ranged
between 1/4th to 1/32nd over-allocation). For smaller lists (n<6), the
maximum overallocation is one byte (formerly it could be upto eight bytes).
This saves memory in applications with large numbers of small lists.
* Eliminated the NRESIZE macro in favor of a new, static list_resize function
that encapsulates the resizing logic. Coverting this back to macro would
give a small (under 1%) speed-up. This was too small to warrant the loss
of readability, maintainability, and de-coupling.
* Some functions using NRESIZE had grown unnecessarily complex in their
efforts to bend to the macro's calling pattern. With the new list_resize
function in place, those other functions could be simplified. That is
being saved for a separate patch.
* The ob_item==NULL check could be eliminated from the new list_resize
function. This would entail finding each piece of code that sets ob_item
to NULL and adding a new line to invalidate the overallocation tracking
field. Rather than impose a new requirement on other pieces of list code,
it was preferred to leave the NULL check in place and retain the benefits
of decoupling, maintainability and information hiding (only PyList_New()
and list_sort() need to know about the new field). This approach also
reduces the odds of breaking an extension module.
(Collaborative effort by Raymond Hettinger, Hye-Shik Chang, Tim Peters,
and Armin Rigo.)
2004-02-13 07:36:39 -04:00
|
|
|
|
length is not known).
|
|
|
|
|
|
|
|
|
|
- Changed the internal list over-allocation scheme. For larger lists,
|
|
|
|
|
overallocation ranged between 3% and 25%. Now, it is a constant 12%.
|
2004-02-14 14:34:46 -04:00
|
|
|
|
For smaller lists (n<8), overallocation was upto eight elements. Now,
|
|
|
|
|
the overallocation is no more than three elements -- this improves space
|
* Optimized list appends and pops by making fewer calls the underlying system
realloc(). This is achieved by tracking the overallocation size in a new
field and using that information to skip calls to realloc() whenever
possible.
* Simplified and tightened the amount of overallocation. For larger lists,
this overallocates by 1/8th (compared to the previous scheme which ranged
between 1/4th to 1/32nd over-allocation). For smaller lists (n<6), the
maximum overallocation is one byte (formerly it could be upto eight bytes).
This saves memory in applications with large numbers of small lists.
* Eliminated the NRESIZE macro in favor of a new, static list_resize function
that encapsulates the resizing logic. Coverting this back to macro would
give a small (under 1%) speed-up. This was too small to warrant the loss
of readability, maintainability, and de-coupling.
* Some functions using NRESIZE had grown unnecessarily complex in their
efforts to bend to the macro's calling pattern. With the new list_resize
function in place, those other functions could be simplified. That is
being saved for a separate patch.
* The ob_item==NULL check could be eliminated from the new list_resize
function. This would entail finding each piece of code that sets ob_item
to NULL and adding a new line to invalidate the overallocation tracking
field. Rather than impose a new requirement on other pieces of list code,
it was preferred to leave the NULL check in place and retain the benefits
of decoupling, maintainability and information hiding (only PyList_New()
and list_sort() need to know about the new field). This approach also
reduces the odds of breaking an extension module.
(Collaborative effort by Raymond Hettinger, Hye-Shik Chang, Tim Peters,
and Armin Rigo.)
2004-02-13 07:36:39 -04:00
|
|
|
|
utilization for applications that have large numbers of small lists.
|
|
|
|
|
|
2004-05-05 02:37:53 -03:00
|
|
|
|
- Most list bodies now get re-used rather than freed. Speeds up list
|
|
|
|
|
instantiation and deletion by saving calls to malloc() and free().
|
|
|
|
|
|
2004-03-04 04:25:44 -04:00
|
|
|
|
- The dict.update() method now accepts all the same argument forms
|
|
|
|
|
as the dict() constructor. This now includes item lists and/or
|
|
|
|
|
keyword arguments.
|
|
|
|
|
|
2004-02-12 11:28:27 -04:00
|
|
|
|
- Support for arbitrary objects supporting the read-only buffer
|
|
|
|
|
interface as the co_code field of code objects (something that was
|
|
|
|
|
only possible to create from C code) has been removed.
|
|
|
|
|
|
2004-02-06 00:15:22 -04:00
|
|
|
|
- Made omitted callback and None equivalent for weakref.ref() and
|
|
|
|
|
weakref.proxy(); the None case wasn't handled correctly in all
|
|
|
|
|
cases.
|
|
|
|
|
|
|
|
|
|
- Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy()
|
|
|
|
|
assumed that initial existing entries in an object's weakref list
|
|
|
|
|
would not be removed while allocating a new weakref object. Since
|
|
|
|
|
GC could be invoked at that time, however, that assumption was
|
|
|
|
|
invalid. In a truly obscure case of GC being triggered during
|
|
|
|
|
creation for a new weakref object for an referent which already
|
|
|
|
|
has a weakref without a callback which is only referenced from
|
|
|
|
|
cyclic trash, a memory error can occur. This consistently created a
|
|
|
|
|
segfault in a debug build, but provided less predictable behavior in
|
|
|
|
|
a release build.
|
|
|
|
|
|
2004-02-02 09:39:01 -04:00
|
|
|
|
- input() builtin function now respects compiler flags such as
|
|
|
|
|
__future__ statements. SF patch 876178.
|
|
|
|
|
|
2003-12-05 13:43:47 -04:00
|
|
|
|
- Removed PendingDeprecationWarning from apply(). apply() remains
|
2003-12-15 15:24:34 -04:00
|
|
|
|
deprecated, but the nuisance warning will not be issued.
|
2003-12-05 13:43:47 -04:00
|
|
|
|
|
2003-12-01 17:35:27 -04:00
|
|
|
|
- At Python shutdown time (Py_Finalize()), 2.3 called cyclic garbage
|
|
|
|
|
collection twice, both before and after tearing down modules. The
|
|
|
|
|
call after tearing down modules has been disabled, because too much
|
|
|
|
|
of Python has been torn down then for __del__ methods and weakref
|
|
|
|
|
callbacks to execute sanely. The most common symptom was a sequence
|
|
|
|
|
of uninformative messages on stderr when Python shut down, produced
|
|
|
|
|
by threads trying to raise exceptions, but unable to report the nature
|
|
|
|
|
of their problems because too much of the sys module had already been
|
|
|
|
|
destroyed.
|
|
|
|
|
|
2003-11-29 19:52:13 -04:00
|
|
|
|
- Removed FutureWarnings related to hex/oct literals and conversions
|
|
|
|
|
and left shifts. (Thanks to Kalle Svensson for SF patch 849227.)
|
|
|
|
|
This addresses most of the remaining semantic changes promised by
|
|
|
|
|
PEP 237, except for repr() of a long, which still shows the trailing
|
|
|
|
|
'L'. The PEP appears to promise warnings for operations that
|
|
|
|
|
changed semantics compared to Python 2.3, but this is not
|
|
|
|
|
implemented; we've suffered through enough warnings related to
|
|
|
|
|
hex/oct literals and I think it's best to be silent now.
|
|
|
|
|
|
2003-11-26 04:21:35 -04:00
|
|
|
|
- For str and unicode objects, the ljust(), center(), and rjust()
|
|
|
|
|
methods now accept an optional argument specifying a fill
|
|
|
|
|
character other than a space.
|
|
|
|
|
|
2003-11-22 19:55:50 -04:00
|
|
|
|
- When method objects have an attribute that can be satisfied either
|
|
|
|
|
by the function object or by the method object, the function
|
|
|
|
|
object's attribute usually wins. Christian Tismer pointed out that
|
|
|
|
|
that this is really a mistake, because this only happens for special
|
|
|
|
|
methods (like __reduce__) where the method object's version is
|
|
|
|
|
really more appropriate than the function's attribute. So from now
|
|
|
|
|
on, all method attributes will have precedence over function
|
|
|
|
|
attributes with the same name.
|
|
|
|
|
|
2003-11-20 17:21:46 -04:00
|
|
|
|
- Critical bugfix, for SF bug 839548: if a weakref with a callback,
|
|
|
|
|
its callback, and its weakly referenced object, all became part of
|
|
|
|
|
cyclic garbage during a single run of garbage collection, the order
|
|
|
|
|
in which they were torn down was unpredictable. It was possible for
|
|
|
|
|
the callback to see partially-torn-down objects, leading to immediate
|
|
|
|
|
segfaults, or, if the callback resurrected garbage objects, to
|
|
|
|
|
resurrect insane objects that caused segfaults (or other surprises)
|
|
|
|
|
later. In one sense this wasn't surprising, because Python's cyclic gc
|
|
|
|
|
had no knowledge of Python's weakref objects. It does now. When
|
|
|
|
|
weakrefs with callbacks become part of cyclic garbage now, those
|
|
|
|
|
weakrefs are cleared first. The callbacks don't trigger then,
|
|
|
|
|
preventing the problems. If you need callbacks to trigger, then just
|
|
|
|
|
as when cyclic gc is not involved, you need to write your code so
|
|
|
|
|
that weakref objects outlive the objects they weakly reference.
|
2003-11-16 12:17:49 -04:00
|
|
|
|
|
2003-11-12 16:43:28 -04:00
|
|
|
|
- Critical bugfix, for SF bug 840829: if cyclic garbage collection
|
|
|
|
|
happened to occur during a weakref callback for a new-style class
|
|
|
|
|
instance, subtle memory corruption was the result (in a release build;
|
|
|
|
|
in a debug build, a segfault occurred reliably very soon after).
|
|
|
|
|
This has been repaired.
|
|
|
|
|
|
2003-11-20 17:21:46 -04:00
|
|
|
|
- Compiler flags set in PYTHONSTARTUP are now active in __main__.
|
|
|
|
|
|
|
|
|
|
- Added two builtin types, set() and frozenset().
|
|
|
|
|
|
2003-11-06 10:06:48 -04:00
|
|
|
|
- Added a reversed() builtin function that returns a reverse iterator
|
|
|
|
|
over a sequence.
|
|
|
|
|
|
2003-12-17 16:43:33 -04:00
|
|
|
|
- Added a sorted() builtin function that returns a new sorted list
|
2004-05-31 16:27:59 -03:00
|
|
|
|
from any iterable.
|
2003-12-17 16:43:33 -04:00
|
|
|
|
|
2003-10-19 15:30:01 -03:00
|
|
|
|
- CObjects are now mutable (on the C level) through PyCObject_SetVoidPtr.
|
|
|
|
|
|
2003-10-16 00:41:09 -03:00
|
|
|
|
- list.sort() now supports three keyword arguments: cmp, key, and reverse.
|
|
|
|
|
The key argument can be a function of one argument that extracts a
|
|
|
|
|
comparison key from the original record: mylist.sort(key=str.lower).
|
|
|
|
|
The reverse argument is a boolean value and if True will change the
|
|
|
|
|
sort order as if the comparison arguments were reversed. In addition,
|
|
|
|
|
the documentation has been amended to provide a guarantee that all sorts
|
|
|
|
|
starting with Py2.3 are guaranteed to be stable (the relative order of
|
|
|
|
|
records with equal keys is unchanged).
|
|
|
|
|
|
2003-09-22 08:14:40 -03:00
|
|
|
|
- Added test whether wchar_t is signed or not. A signed wchar_t is not
|
|
|
|
|
usable as internal unicode type base for Py_UNICODE since the
|
|
|
|
|
unicode implementation assumes an unsigned type.
|
|
|
|
|
|
2003-09-16 16:41:39 -03:00
|
|
|
|
- Fixed a bug in the cache of length-one Unicode strings that could
|
|
|
|
|
lead to a seg fault. The specific problem occurred when an earlier,
|
|
|
|
|
non-fatal error left an uninitialized Unicode object in the
|
|
|
|
|
freelist.
|
|
|
|
|
|
2003-08-27 01:55:52 -03:00
|
|
|
|
- The % formatting operator now supports '%F' which is equivalent to
|
|
|
|
|
'%f'. This has always been documented but never implemented.
|
|
|
|
|
|
2003-08-14 22:16:37 -03:00
|
|
|
|
- complex(obj) could leak a little memory if obj wasn't a string or
|
|
|
|
|
number.
|
|
|
|
|
|
2003-08-02 04:42:57 -03:00
|
|
|
|
- zip() with no arguments now returns an empty list instead of raising
|
|
|
|
|
a TypeError exception.
|
|
|
|
|
|
2003-10-08 18:08:29 -03:00
|
|
|
|
- obj.__contains__() now returns True/False instead of 1/0. SF patch
|
|
|
|
|
820195.
|
|
|
|
|
|
2003-10-28 08:05:48 -04:00
|
|
|
|
- Python no longer tries to be smart about recursive comparisons.
|
|
|
|
|
When comparing containers with cyclic references to themselves it
|
|
|
|
|
will now just hit the recursion limit. See SF patch 825639.
|
|
|
|
|
|
2004-07-04 12:41:59 -03:00
|
|
|
|
- str and unicode builtin types now have an rsplit() method that is
|
2003-12-15 15:24:34 -04:00
|
|
|
|
same as split() except that it scans the string from the end
|
|
|
|
|
working towards the beginning. See SF feature request 801847.
|
2003-12-15 14:51:19 -04:00
|
|
|
|
|
2004-02-08 00:21:26 -04:00
|
|
|
|
- Fixed a bug in object.__reduce_ex__ when using protocol 2. Failure
|
|
|
|
|
to clear the error when attempts to get the __getstate__ attribute
|
|
|
|
|
fail caused intermittent errors and odd behavior.
|
|
|
|
|
|
2004-03-10 22:42:45 -04:00
|
|
|
|
- buffer objects based on other objects no longer cache a pointer to
|
|
|
|
|
the data and the data length. Instead, the appropriate tp_as_buffer
|
2004-05-31 16:27:59 -03:00
|
|
|
|
method is called as necessary.
|
2004-03-10 22:42:45 -04:00
|
|
|
|
|
2004-05-31 16:27:59 -03:00
|
|
|
|
- fixed: if a file is opened with an explicit buffer size >= 1, repeated
|
2004-04-04 04:01:35 -03:00
|
|
|
|
close() calls would attempt to free() the buffer already free()ed on
|
|
|
|
|
the first call.
|
|
|
|
|
|
2004-03-10 22:42:45 -04:00
|
|
|
|
|
2003-08-01 02:01:54 -03:00
|
|
|
|
Extension modules
|
|
|
|
|
-----------------
|
|
|
|
|
|
2004-06-27 21:50:43 -03:00
|
|
|
|
- Added socket.getservbyport(), and make the second argument in
|
|
|
|
|
getservbyname() and getservbyport() optional.
|
|
|
|
|
|
2004-06-19 23:50:16 -03:00
|
|
|
|
- time module code that deals with input POSIX timestamps will now raise
|
|
|
|
|
ValueError if more than a second is lost in precision when the
|
|
|
|
|
timestamp is cast to the platform C time_t type. There's no chance
|
|
|
|
|
that the platform will do anything sensible with the result in such
|
|
|
|
|
cases. This includes ctime(), localtime() and gmtime(). Assorted
|
|
|
|
|
fromtimestamp() and utcfromtimestamp() methods in the datetime module
|
|
|
|
|
were also protected. Closes bugs #919012 and 975996.
|
2004-06-19 17:50:47 -03:00
|
|
|
|
|
2004-06-03 09:47:26 -03:00
|
|
|
|
- fcntl.ioctl now warns if the mutate flag is not specified.
|
|
|
|
|
|
2004-06-02 06:57:56 -03:00
|
|
|
|
- nt now properly allows to refer to UNC roots, e.g. in nt.stat().
|
|
|
|
|
|
2004-05-31 00:09:25 -03:00
|
|
|
|
- the weakref module now supports additional objects: array.array,
|
|
|
|
|
sre.pattern_objects, file objects, and sockets.
|
|
|
|
|
|
2004-04-04 05:51:41 -03:00
|
|
|
|
- operator.isMappingType() and operator.isSequenceType() now give
|
|
|
|
|
fewer false positives.
|
|
|
|
|
|
2004-03-23 19:16:54 -04:00
|
|
|
|
- socket.sslerror is now a subclass of socket.error . Also added
|
|
|
|
|
socket.error to the socket module's C API.
|
|
|
|
|
|
2004-07-04 12:41:59 -03:00
|
|
|
|
- Bug #920575: A problem where the _locale module segfaults on
|
2004-03-21 15:34:30 -04:00
|
|
|
|
nl_langinfo(ERA) caused by GNU libc's illegal NULL return is fixed.
|
|
|
|
|
|
2004-03-14 00:37:50 -04:00
|
|
|
|
- array objects now support the copy module. Also, their resizing
|
2004-07-04 12:41:59 -03:00
|
|
|
|
scheme has been updated to match that used for list objects. This improves
|
2004-03-14 01:43:59 -04:00
|
|
|
|
the performance (speed and memory usage) of append() operations.
|
2004-08-29 04:50:43 -03:00
|
|
|
|
Also, array.array() and array.extend() now accept any iterable argument
|
|
|
|
|
for repeated appends without needing to create another temporary array.
|
2004-03-13 14:18:51 -04:00
|
|
|
|
|
2004-03-08 14:22:35 -04:00
|
|
|
|
- cStringIO.writelines() now accepts any iterable argument and writes
|
|
|
|
|
the lines one at a time rather than joining them and writing once.
|
|
|
|
|
Made a parallel change to StringIO.writelines(). Saves memory and
|
|
|
|
|
makes suitable for use with generator expressions.
|
|
|
|
|
|
2004-03-02 00:38:10 -04:00
|
|
|
|
- time.strftime() now checks that the values in its time tuple argument
|
|
|
|
|
are within the proper boundaries to prevent possible crashes from the
|
|
|
|
|
platform's C library implementation of strftime(). Can possibly
|
|
|
|
|
break code that uses values outside the range that didn't cause
|
|
|
|
|
problems previously (such as sitting day of year to 0). Fixes bug
|
|
|
|
|
#897625.
|
|
|
|
|
|
2004-01-31 08:34:17 -04:00
|
|
|
|
- The socket module now supports Bluetooth sockets, if the
|
|
|
|
|
system has <bluetooth/bluetooth.h>
|
|
|
|
|
|
2004-01-29 02:37:52 -04:00
|
|
|
|
- Added a collections module containing a new datatype, deque(),
|
|
|
|
|
offering high-performance, thread-safe, memory friendly appends
|
|
|
|
|
and pops on either side of the deque.
|
|
|
|
|
|
|
|
|
|
- Several modules now take advantage of collections.deque() for
|
|
|
|
|
improved performance: Queue, mutex, shlex, threading, and pydoc.
|
|
|
|
|
|
2003-12-01 09:18:39 -04:00
|
|
|
|
- The operator module has two new functions, attrgetter() and
|
|
|
|
|
itemgetter() which are useful for creating fast data extractor
|
|
|
|
|
functions for map(), list.sort(), itertools.groupby(), and
|
|
|
|
|
other functions that expect a function argument.
|
|
|
|
|
|
2003-11-27 15:40:22 -04:00
|
|
|
|
- socket.SHUT_{RD,WR,RDWR} was added.
|
|
|
|
|
|
2003-11-10 02:44:44 -04:00
|
|
|
|
- os.getsid was added.
|
|
|
|
|
|
2003-10-23 20:54:57 -03:00
|
|
|
|
- The pwd module incorrectly advertised its struct type as
|
|
|
|
|
struct_pwent; this has been renamed to struct_passwd. (The old name
|
|
|
|
|
is still supported for backwards compatibility.)
|
|
|
|
|
|
2003-10-21 12:41:59 -03:00
|
|
|
|
- The xml.parsers.expat module now provides Expat 1.95.7.
|
|
|
|
|
|
2003-10-03 10:57:37 -03:00
|
|
|
|
- socket.IPPROTO_IPV6 was added.
|
|
|
|
|
|
2003-09-20 13:08:33 -03:00
|
|
|
|
- readline.clear_history was added.
|
|
|
|
|
|
2003-09-10 16:37:42 -03:00
|
|
|
|
- select.select() now accepts sequences for its first three arguments.
|
|
|
|
|
|
2003-08-08 09:20:03 -03:00
|
|
|
|
- cStringIO now supports the f.closed attribute.
|
|
|
|
|
|
2003-08-05 03:33:56 -03:00
|
|
|
|
- The signal module now exposes SIGRTMIN and SIGRTMAX (if available).
|
|
|
|
|
|
2003-08-13 20:11:04 -03:00
|
|
|
|
- curses module now supports use_default_colors(). [patch #739124]
|
|
|
|
|
|
2003-10-04 05:04:04 -03:00
|
|
|
|
- Bug #811028: ncurses.h breakage on FreeBSD/MacOS X
|
|
|
|
|
|
|
|
|
|
- Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI
|
|
|
|
|
|
2003-10-17 19:13:16 -03:00
|
|
|
|
- Implemented non-recursive SRE matching scheme (#757624).
|
|
|
|
|
|
|
|
|
|
- Implemented (?(id/name)yes|no) support in SRE (#572936).
|
|
|
|
|
|
2003-10-24 05:45:23 -03:00
|
|
|
|
- random.seed() with no arguments or None uses time.time() as a default
|
|
|
|
|
seed. Modified to match Py2.2 behavior and use fractional seconds so
|
|
|
|
|
that successive runs are more likely to produce different sequences.
|
|
|
|
|
|
|
|
|
|
- random.Random has a new method, getrandbits(k), which returns an int
|
|
|
|
|
with k random bits. This method is now an optional part of the API
|
|
|
|
|
for user defined generators. Any generator that defines genrandbits()
|
|
|
|
|
can now use randrange() for ranges with a length >= 2**53. Formerly,
|
|
|
|
|
randrange would return only even numbers for ranges that large (see
|
|
|
|
|
SF bug #812202). Generators that do not define genrandbits() now
|
|
|
|
|
issue a warning when randrange() is called with a range that large.
|
|
|
|
|
|
2003-12-06 12:23:06 -04:00
|
|
|
|
- itertools has a new function, groupby() for aggregating iterables
|
|
|
|
|
into groups sharing the same key (as determined by a key function).
|
|
|
|
|
It offers some of functionality of SQL's groupby keyword and of
|
|
|
|
|
the Unix uniq filter.
|
2004-03-25 12:55:12 -04:00
|
|
|
|
|
2004-07-04 12:41:59 -03:00
|
|
|
|
- itertools now has a new tee() function which produces two independent
|
2003-10-24 05:45:23 -03:00
|
|
|
|
iterators from a single iterable.
|
|
|
|
|
|
|
|
|
|
- itertools.izip() with no arguments now returns an empty iterator instead
|
|
|
|
|
of raising a TypeError exception.
|
|
|
|
|
|
2004-02-13 20:02:45 -04:00
|
|
|
|
- Fixed #853061: allow BZ2Compressor.compress() to receive an empty string
|
|
|
|
|
as parameter.
|
|
|
|
|
|
2003-08-01 02:01:54 -03:00
|
|
|
|
Library
|
|
|
|
|
-------
|
2004-07-11 16:26:19 -03:00
|
|
|
|
|
2006-02-08 08:53:56 -04:00
|
|
|
|
- Added a new module: cProfile, a C profiler with the same interface as the
|
|
|
|
|
profile module. cProfile avoids some of the drawbacks of the hotshot
|
|
|
|
|
profiler and provides a bit more information than the other two profilers.
|
|
|
|
|
Based on "lsprof" (patch #1212837).
|
|
|
|
|
|
2005-08-22 15:02:59 -03:00
|
|
|
|
- Bug #1266283: The new function "lexists" is now in os.path.__all__.
|
|
|
|
|
|
2004-07-06 14:52:32 -03:00
|
|
|
|
- Bug #981530: Fix UnboundLocalError in shutil.rmtree(). This affects
|
|
|
|
|
the documented behavior: the function passed to the onerror()
|
|
|
|
|
handler can now also be os.listdir.
|
2003-08-01 02:01:54 -03:00
|
|
|
|
|
2004-07-03 00:54:54 -03:00
|
|
|
|
- Bug #754449: threading.Thread objects no longer mask exceptions raised during
|
|
|
|
|
interpreter shutdown with another exception from attempting to handle the
|
|
|
|
|
original exception.
|
2004-07-03 00:52:35 -03:00
|
|
|
|
|
2004-07-10 13:11:03 -03:00
|
|
|
|
- Added decimal.py per PEP 327.
|
2004-07-01 08:01:35 -03:00
|
|
|
|
|
2004-06-29 01:08:23 -03:00
|
|
|
|
- Bug #981299: rsync is now a recognized protocol in urlparse that uses a
|
|
|
|
|
"netloc" portion of a URL.
|
2004-06-29 01:02:40 -03:00
|
|
|
|
|
2004-06-19 18:11:35 -03:00
|
|
|
|
- Bug #919012: shutil.move() will not try to move a directory into itself.
|
|
|
|
|
Thanks Johannes Gijsbers.
|
|
|
|
|
|
2004-06-18 22:02:51 -03:00
|
|
|
|
- Bug #934282: pydoc.stripid() is now case-insensitive. Thanks Robin Becker.
|
|
|
|
|
|
2004-06-14 04:40:10 -03:00
|
|
|
|
- Bug #823209: cmath.log() now takes an optional base argument so that its
|
2004-06-18 22:02:51 -03:00
|
|
|
|
API matches math.log().
|
2004-06-14 04:40:10 -03:00
|
|
|
|
|
2004-06-11 14:16:46 -03:00
|
|
|
|
- Bug #957381: distutils bdist_rpm no longer fails on recent RPM versions
|
2004-08-31 07:07:13 -03:00
|
|
|
|
that generate a -debuginfo.rpm
|
2004-06-11 14:16:46 -03:00
|
|
|
|
|
2004-06-08 05:29:33 -03:00
|
|
|
|
- os.path.devnull has been added for all supported platforms.
|
|
|
|
|
|
2004-06-05 15:37:53 -03:00
|
|
|
|
- Fixed #877165: distutils now picks the right C++ compiler command
|
|
|
|
|
on cygwin and mingw32.
|
|
|
|
|
|
2004-06-05 10:30:56 -03:00
|
|
|
|
- urllib.urlopen().readline() now handles HTTP/0.9 correctly.
|
|
|
|
|
|
2004-06-04 22:12:51 -03:00
|
|
|
|
- refactored site.py into functions. Also wrote regression tests for the
|
|
|
|
|
module.
|
|
|
|
|
|
2004-06-25 20:02:59 -03:00
|
|
|
|
- The distutils install command now supports the --home option and
|
|
|
|
|
installation scheme for all platforms.
|
|
|
|
|
|
2004-06-30 06:06:29 -03:00
|
|
|
|
- asyncore.loop now has a repeat count parameter that defaults to
|
2004-06-30 06:09:38 -03:00
|
|
|
|
looping forever.
|
2004-06-30 06:06:29 -03:00
|
|
|
|
|
2004-05-31 16:27:59 -03:00
|
|
|
|
- The distutils sdist command now ignores all .svn directories, in
|
|
|
|
|
addition to CVS and RCS directories. .svn directories hold
|
|
|
|
|
administrative files for the Subversion source control system.
|
|
|
|
|
|
2004-05-31 15:22:40 -03:00
|
|
|
|
- Added a new module: cookielib. Automatic cookie handling for HTTP
|
|
|
|
|
clients. Also, support for cookielib has been added to urllib2, so
|
|
|
|
|
urllib2.urlopen() can transparently handle cookies.
|
|
|
|
|
|
2004-05-19 16:56:44 -03:00
|
|
|
|
- stringprep.py now uses built-in set() instead of sets.Set().
|
|
|
|
|
|
2004-05-11 12:10:59 -03:00
|
|
|
|
- Bug #876278: Unbounded recursion in modulefinder
|
|
|
|
|
|
2004-05-05 22:54:36 -03:00
|
|
|
|
- Bug #780300: Swap public and system ID in LexicalHandler.startDTD.
|
|
|
|
|
Applications relying on the wrong order need to be corrected.
|
|
|
|
|
|
2004-04-20 18:11:11 -03:00
|
|
|
|
- Bug #926075: Fixed a bug that returns a wrong pattern object
|
|
|
|
|
for a string or unicode object in sre.compile() when a different
|
|
|
|
|
type pattern with the same value exists.
|
|
|
|
|
|
2004-04-07 13:03:02 -03:00
|
|
|
|
- Added countcallers arg to trace.Trace class (--trackcalls command line arg
|
|
|
|
|
when run from the command prompt).
|
|
|
|
|
|
2004-03-25 12:55:12 -04:00
|
|
|
|
- Fixed a caching bug in platform.platform() where the argument of 'terse' was
|
|
|
|
|
not taken into consideration when caching value.
|
|
|
|
|
|
2004-03-23 14:44:39 -04:00
|
|
|
|
- Added two new command-line arguments for profile (output file and
|
|
|
|
|
default sort).
|
|
|
|
|
|
2004-03-22 16:12:56 -04:00
|
|
|
|
- Added global runctx function to profile module
|
|
|
|
|
|
2004-03-21 11:29:41 -04:00
|
|
|
|
- Add hlist missing entryconfigure and entrycget methods.
|
|
|
|
|
|
2004-03-19 04:11:56 -04:00
|
|
|
|
- The ptcp154 codec was added for Kazakh character set support.
|
|
|
|
|
|
2004-02-15 17:19:18 -04:00
|
|
|
|
- Support non-anonymous ftp URLs in urllib2.
|
|
|
|
|
|
2004-07-04 12:41:59 -03:00
|
|
|
|
- The encodings package will now apply codec name aliases
|
2004-01-20 14:24:34 -04:00
|
|
|
|
first before starting to try the import of the codec module.
|
|
|
|
|
This simplifies overriding built-in codecs with external
|
|
|
|
|
packages, e.g. the included CJK codecs with the JapaneseCodecs
|
|
|
|
|
package, by adjusting the aliases dictionary in encodings.aliases
|
|
|
|
|
accordingly.
|
|
|
|
|
|
2004-01-03 21:13:43 -04:00
|
|
|
|
- base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and
|
|
|
|
|
decoding standards.
|
|
|
|
|
|
2003-12-14 01:29:45 -04:00
|
|
|
|
- urllib2 now supports processors. A processor is a handler that
|
|
|
|
|
implements an xxx_request or xxx_response method. These methods are
|
|
|
|
|
called for all requests.
|
|
|
|
|
|
2003-12-05 16:28:07 -04:00
|
|
|
|
- distutils compilers now compile source files in the same order as
|
|
|
|
|
they are passed to the compiler.
|
|
|
|
|
|
2003-12-03 16:26:05 -04:00
|
|
|
|
- pprint.pprint() and pprint.pformat() now have additional parameters
|
|
|
|
|
indent, width and depth.
|
|
|
|
|
|
2003-12-03 16:15:28 -04:00
|
|
|
|
- Patch #750542: pprint now will pretty print subclasses of list, tuple
|
|
|
|
|
and dict too, as long as they don't overwrite __repr__().
|
|
|
|
|
|
2003-11-28 15:42:56 -04:00
|
|
|
|
- Bug #848614: distutils' msvccompiler fails to find the MSVC6
|
|
|
|
|
compiler because of incomplete registry entries.
|
|
|
|
|
|
2003-11-19 15:51:55 -04:00
|
|
|
|
- httplib.HTTP.putrequest now offers to omit the implicit Accept-Encoding.
|
|
|
|
|
|
2003-11-14 06:33:20 -04:00
|
|
|
|
- Patch #841977: modulefinder didn't find extension modules in packages
|
|
|
|
|
|
2003-11-10 02:44:44 -04:00
|
|
|
|
- imaplib.IMAP4.thread was added.
|
|
|
|
|
|
2003-11-09 22:27:19 -04:00
|
|
|
|
- Plugged a minor hole in tempfile.mktemp() due to the use of
|
|
|
|
|
os.path.exists(), switched to using os.lstat() directly if possible.
|
|
|
|
|
|
2004-01-05 06:13:35 -04:00
|
|
|
|
- bisect.py and heapq.py now have underlying C implementations
|
2004-06-10 02:03:17 -03:00
|
|
|
|
for better performance.
|
|
|
|
|
|
2004-06-11 14:16:46 -03:00
|
|
|
|
- heapq.py has two new functions, nsmallest() and nlargest().
|
2003-11-08 06:24:38 -04:00
|
|
|
|
|
2003-11-05 19:03:00 -04:00
|
|
|
|
- traceback.format_exc has been added (similar to print_exc but it returns
|
|
|
|
|
a string).
|
|
|
|
|
|
2003-10-31 09:49:36 -04:00
|
|
|
|
- xmlrpclib.MultiCall has been added.
|
|
|
|
|
|
2003-10-31 08:52:35 -04:00
|
|
|
|
- poplib.POP3_SSL has been added.
|
|
|
|
|
|
2003-10-12 14:37:01 -03:00
|
|
|
|
- tmpfile.mkstemp now returns an absolute path even if dir is relative.
|
|
|
|
|
|
2003-10-12 01:38:48 -03:00
|
|
|
|
- urlparse is RFC 2396 compliant.
|
|
|
|
|
|
2003-10-03 11:07:07 -03:00
|
|
|
|
- The fieldnames argument to the csv module's DictReader constructor is now
|
|
|
|
|
optional. If omitted, the first row of the file will be used as the
|
|
|
|
|
list of fieldnames.
|
|
|
|
|
|
2003-09-23 17:21:01 -03:00
|
|
|
|
- encodings.bz2_codec was added for access to bz2 compression
|
|
|
|
|
using "a long string".encode('bz2')
|
|
|
|
|
|
2003-09-22 12:03:11 -03:00
|
|
|
|
- Various improvements to unittest.py, realigned with PyUnit CVS.
|
|
|
|
|
|
2003-09-20 12:52:21 -03:00
|
|
|
|
- dircache now passes exceptions to the caller, instead of returning
|
|
|
|
|
empty lists.
|
|
|
|
|
|
2003-09-12 03:33:37 -03:00
|
|
|
|
- The bsddb module and dbhash module now support the iterator and
|
|
|
|
|
mapping protocols which make them more substitutable for dictionaries
|
|
|
|
|
and shelves.
|
|
|
|
|
|
2003-09-06 16:52:12 -03:00
|
|
|
|
- The csv module's DictReader and DictWriter classes now accept keyword
|
|
|
|
|
arguments. This was an omission in the initial implementation.
|
|
|
|
|
|
2003-08-19 00:59:09 -03:00
|
|
|
|
- The email package handles some RFC 2231 parameters with missing
|
2003-09-03 01:09:49 -03:00
|
|
|
|
CHARSET fields better. It also includes a patch to parameter
|
|
|
|
|
parsing when semicolons appear inside quotes.
|
2003-08-19 00:59:09 -03:00
|
|
|
|
|
2003-08-17 05:34:09 -03:00
|
|
|
|
- sets.py now runs under Py2.2. In addition, the argument restrictions
|
|
|
|
|
for most set methods (but not the operators) have been relaxed to
|
2003-11-19 11:52:14 -04:00
|
|
|
|
allow any iterable.
|
2003-08-15 18:17:04 -03:00
|
|
|
|
|
2003-08-05 09:32:41 -03:00
|
|
|
|
- _strptime.py now has a behind-the-scenes caching mechanism for the most
|
2003-08-05 03:27:04 -03:00
|
|
|
|
recent TimeRE instance used along with the last five unique directive
|
|
|
|
|
patterns. The overall module was also made more thread-safe.
|
|
|
|
|
|
2003-08-05 09:32:41 -03:00
|
|
|
|
- random.cunifvariate() and random.stdgamma() were deprecated in Py2.3
|
|
|
|
|
and removed in Py2.4.
|
|
|
|
|
|
2003-11-04 10:35:49 -04:00
|
|
|
|
- Bug #823328: urllib2.py's HTTP Digest Auth support works again.
|
|
|
|
|
|
2004-01-17 10:59:36 -04:00
|
|
|
|
- Patch #873597: CJK codecs are imported into rank of default codecs.
|
|
|
|
|
|
2003-08-01 02:01:54 -03:00
|
|
|
|
Tools/Demos
|
|
|
|
|
-----------
|
|
|
|
|
|
2004-01-27 10:49:04 -04:00
|
|
|
|
- A hotshotmain script was added to the Tools/scripts directory that
|
|
|
|
|
makes it easy to run a script under control of the hotshot profiler.
|
|
|
|
|
|
2003-10-28 12:24:00 -04:00
|
|
|
|
- The db2pickle and pickle2db scripts can now dump/load gdbm files.
|
|
|
|
|
|
2004-03-03 13:42:08 -04:00
|
|
|
|
- The file order on the command line of the pickle2db script was reversed.
|
|
|
|
|
It is now [ picklefile ] dbfile. This provides better symmetry with
|
|
|
|
|
db2pickle. The file arguments to both scripts are now source followed by
|
|
|
|
|
destination in situations where both files are given.
|
|
|
|
|
|
2003-09-10 16:04:13 -03:00
|
|
|
|
- The pydoc script will display a link to the module documentation for
|
|
|
|
|
modules determined to be part of the core distribution. The documentation
|
|
|
|
|
base directory defaults to http://www.python.org/doc/current/lib/ but can
|
|
|
|
|
be changed by setting the PYTHONDOCS environment variable.
|
|
|
|
|
|
2003-08-25 01:39:55 -03:00
|
|
|
|
- texcheck.py now detects double word errors.
|
|
|
|
|
|
2003-08-18 20:52:09 -03:00
|
|
|
|
- md5sum.py mistakenly opened input files in text mode by default, a
|
|
|
|
|
silent and dangerous change from previous releases. It once again
|
|
|
|
|
opens input files in binary mode by default. The -t and -b flags
|
|
|
|
|
remain for compatibility with the 2.3 release, but -b is the default
|
|
|
|
|
now.
|
|
|
|
|
|
2003-08-01 02:01:54 -03:00
|
|
|
|
- py-electric-colon now works when pending-delete/delete-selection mode is
|
|
|
|
|
in effect
|
|
|
|
|
|
|
|
|
|
- py-help-at-point is no longer bound to the F1 key - it's still bound to
|
|
|
|
|
C-c C-h
|
|
|
|
|
|
2003-09-03 00:20:37 -03:00
|
|
|
|
- Pynche was fixed to not crash when there is no ~/.pynche file and no
|
|
|
|
|
-d option was given.
|
|
|
|
|
|
2003-08-01 02:01:54 -03:00
|
|
|
|
Build
|
|
|
|
|
-----
|
|
|
|
|
|
2004-06-26 01:03:06 -03:00
|
|
|
|
- Bug #978645: Modules/getpath.c now builds properly in --disable-framework
|
|
|
|
|
build under OS X.
|
|
|
|
|
|
2004-06-17 23:47:22 -03:00
|
|
|
|
- Profiling using gprof is now available if Python is configured with
|
|
|
|
|
--enable-profiling.
|
|
|
|
|
|
2004-06-08 05:17:44 -03:00
|
|
|
|
- Profiling the VM using the Pentium TSC is now possible if Python
|
|
|
|
|
is configured --with-tsc.
|
|
|
|
|
|
2004-06-04 10:55:13 -03:00
|
|
|
|
- In order to find libraries, setup.py now also looks in /lib64, for use
|
|
|
|
|
on AMD64.
|
|
|
|
|
|
2004-04-14 04:55:31 -03:00
|
|
|
|
- Bug #934635: Fixed a bug where the configure script couldn't detect
|
|
|
|
|
getaddrinfo() properly if the KAME stack had SCTP support.
|
|
|
|
|
|
2004-02-10 12:50:21 -04:00
|
|
|
|
- Support for missing ANSI C header files (limits.h, stddef.h, etc) was
|
|
|
|
|
removed.
|
|
|
|
|
|
2004-02-07 09:53:46 -04:00
|
|
|
|
- Systems requiring the D4, D6 or D7 variants of pthreads are no longer
|
|
|
|
|
supported (see PEP 11).
|
|
|
|
|
|
|
|
|
|
- Universal newline support can no longer be disabled (see PEP 11).
|
|
|
|
|
|
2004-01-17 10:22:44 -04:00
|
|
|
|
- Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11).
|
|
|
|
|
|
|
|
|
|
- Support for systems requiring --with-dl-dld or --with-sgi-dl was removed
|
|
|
|
|
(see PEP 11).
|
|
|
|
|
|
|
|
|
|
- Tests for sizeof(char) were removed since ANSI C mandates that
|
|
|
|
|
sizeof(char) must be 1.
|
|
|
|
|
|
2003-08-01 02:01:54 -03:00
|
|
|
|
C API
|
|
|
|
|
-----
|
|
|
|
|
|
2004-06-20 19:41:32 -03:00
|
|
|
|
- Thanks to Anthony Tuininga, the datetime module now supplies a C API
|
|
|
|
|
containing type-check macros and constructors. See new docs in the
|
|
|
|
|
Python/C API Reference Manual for details.
|
|
|
|
|
|
2004-06-19 23:50:16 -03:00
|
|
|
|
- Private function _PyTime_DoubleToTimet added, to convert a Python
|
|
|
|
|
timestamp (C double) to platform time_t with some out-of-bounds
|
|
|
|
|
checking. Declared in new header file timefuncs.h. It would be
|
|
|
|
|
good to expose some other internal timemodule.c functions there.
|
|
|
|
|
|
2004-06-01 12:22:42 -03:00
|
|
|
|
- New public functions PyEval_EvaluateFrame and PyGen_New to expose
|
|
|
|
|
generator objects.
|
|
|
|
|
|
2004-04-22 14:23:49 -03:00
|
|
|
|
- New public functions Py_IncRef() and Py_DecRef(), exposing the
|
|
|
|
|
functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for
|
2004-04-22 14:28:25 -03:00
|
|
|
|
runtime dynamic embedding of Python. See patch #938302, by Bob
|
|
|
|
|
Ippolito.
|
2004-04-22 14:23:49 -03:00
|
|
|
|
|
2004-03-12 04:04:00 -04:00
|
|
|
|
- Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's
|
|
|
|
|
underlying array of PyObject pointers. Useful for high speed looping.
|
|
|
|
|
|
2003-12-13 07:26:12 -04:00
|
|
|
|
- Created a new method flag, METH_COEXIST, which causes a method to be loaded
|
|
|
|
|
even if already defined by a slot wrapper. This allows a __contains__
|
|
|
|
|
method, for example, to co-exist with a defined sq_contains slot. This
|
|
|
|
|
is helpful because the PyCFunction can take advantage of optimized calls
|
|
|
|
|
whenever METH_O or METH_NOARGS flags are defined.
|
|
|
|
|
|
2003-11-25 17:12:14 -04:00
|
|
|
|
- Added a new function, PyDict_Contains(d, k) which is like
|
|
|
|
|
PySequence_Contains() but is specific to dictionaries and executes
|
|
|
|
|
about 10% faster.
|
|
|
|
|
|
2003-10-19 18:31:43 -03:00
|
|
|
|
- Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE.
|
|
|
|
|
Each return the singleton they mention after Py_INCREF()ing them.
|
|
|
|
|
|
2003-10-12 15:24:34 -03:00
|
|
|
|
- Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a
|
|
|
|
|
variable length argument list of Python objects without having to invoke
|
|
|
|
|
the more complex machinery of Py_BuildValue(). PyTuple_Pack(3, a, b, c)
|
|
|
|
|
is equivalent to Py_BuildValue("(OOO)", a, b, c).
|
|
|
|
|
|
2003-08-01 02:01:54 -03:00
|
|
|
|
Windows
|
|
|
|
|
-------
|
|
|
|
|
|
2003-11-30 18:10:15 -04:00
|
|
|
|
- The _winreg module could segfault when reading very large registry
|
|
|
|
|
values, due to unchecked alloca() calls (SF bug 851056). The fix is
|
|
|
|
|
uses either PyMem_Malloc(n) or PyString_FromStringAndSize(NULL, n),
|
|
|
|
|
as appropriate, followed by a size check.
|
|
|
|
|
|
2003-09-07 00:30:18 -03:00
|
|
|
|
- file.truncate() could misbehave if the file was open for update
|
|
|
|
|
(modes r+, rb+, w+, wb+), and the most recent file operation before
|
|
|
|
|
the truncate() call was an input operation. SF bug 801631.
|
|
|
|
|
|
2003-08-01 02:01:54 -03:00
|
|
|
|
|
2003-07-28 21:10:29 -03:00
|
|
|
|
What's New in Python 2.3 final?
|
|
|
|
|
===============================
|
|
|
|
|
|
|
|
|
|
*Release date: 29-Jul-2003*
|
|
|
|
|
|
|
|
|
|
IDLE
|
|
|
|
|
----
|
|
|
|
|
|
2003-07-29 14:22:57 -03:00
|
|
|
|
- Bug 778400: IDLE hangs when selecting "Edit with IDLE" from explorer.
|
|
|
|
|
This was unique to Windows, and was fixed by adding an -n switch to
|
|
|
|
|
the command the Windows installer creates to execute "Edit with IDLE"
|
|
|
|
|
context-menu actions.
|
|
|
|
|
|
2003-07-28 21:10:29 -03:00
|
|
|
|
- IDLE displays a new message upon startup: some "personal firewall"
|
|
|
|
|
kinds of programs (for example, ZoneAlarm) open a dialog of their
|
|
|
|
|
own when any program opens a socket. IDLE does use sockets, talking
|
|
|
|
|
on the computer's internal loopback interface. This connection is not
|
|
|
|
|
visible on any external interface and no data is sent to or received
|
|
|
|
|
from the Internet. So, if you get such a dialog when opening IDLE,
|
|
|
|
|
asking whether to let pythonw.exe talk to address 127.0.0.1, say yes,
|
|
|
|
|
and rest assured no communication external to your machine is taking
|
|
|
|
|
place. If you don't allow it, IDLE won't be able to start.
|
|
|
|
|
|
|
|
|
|
|
2003-07-21 11:25:23 -03:00
|
|
|
|
What's New in Python 2.3 release candidate 2?
|
|
|
|
|
=============================================
|
|
|
|
|
|
2003-07-23 21:15:46 -03:00
|
|
|
|
*Release date: 24-Jul-2003*
|
2003-07-21 11:25:23 -03:00
|
|
|
|
|
|
|
|
|
Core and builtins
|
|
|
|
|
-----------------
|
|
|
|
|
|
2003-07-22 15:10:15 -03:00
|
|
|
|
- It is now possible to import from zipfiles containing additional
|
2003-07-24 22:09:40 -03:00
|
|
|
|
data bytes before the zip compatible archive. Zipfiles containing a
|
2003-07-22 15:10:15 -03:00
|
|
|
|
comment at the end are still unsupported.
|
|
|
|
|
|
2003-07-21 11:25:23 -03:00
|
|
|
|
Extension modules
|
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
|
|
- A longstanding bug in the parser module's initialization could cause
|
|
|
|
|
fatal internal refcount confusion when the module got initialized more
|
|
|
|
|
than once. This has been fixed.
|
|
|
|
|
|
2003-07-21 14:17:10 -03:00
|
|
|
|
- Fixed memory leak in pyexpat; using the parser's ParseFile() method
|
|
|
|
|
with open files that aren't instances of the standard file type
|
|
|
|
|
caused an instance of the bound .read() method to be leaked on every
|
|
|
|
|
call.
|
|
|
|
|
|
2003-07-24 22:09:40 -03:00
|
|
|
|
- Fixed some leaks in the locale module.
|
|
|
|
|
|
2003-07-21 11:25:23 -03:00
|
|
|
|
Library
|
|
|
|
|
-------
|
|
|
|
|
|
2003-07-24 22:09:40 -03:00
|
|
|
|
- Lib/encodings/rot_13.py when used as a script, now more properly
|
|
|
|
|
uses the first Python interpreter on your path.
|
|
|
|
|
|
|
|
|
|
- Removed caching of TimeRE (and thus LocaleTime) in _strptime.py to
|
|
|
|
|
fix a locale related bug in the test suite. Although another patch
|
|
|
|
|
was needed to actually fix the problem, the cache code was not
|
|
|
|
|
restored.
|
|
|
|
|
|
2003-07-27 17:23:49 -03:00
|
|
|
|
IDLE
|
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
- Calltips patches.
|
2003-07-24 22:09:40 -03:00
|
|
|
|
|
2003-07-21 11:25:23 -03:00
|
|
|
|
Build
|
|
|
|
|
-----
|
|
|
|
|
|
2003-07-24 22:09:40 -03:00
|
|
|
|
- For MacOSX, added -mno-fused-madd to BASECFLAGS to fix test_coercion
|
|
|
|
|
on Panther (OSX 10.3).
|
|
|
|
|
|
2003-07-21 11:25:23 -03:00
|
|
|
|
C API
|
|
|
|
|
-----
|
|
|
|
|
|
|
|
|
|
Windows
|
|
|
|
|
-------
|
|
|
|
|
|
2003-07-21 23:50:01 -03:00
|
|
|
|
- The tempfile module could do insane imports on Windows if PYTHONCASEOK
|
|
|
|
|
was set, making temp file creation impossible. Repaired.
|
|
|
|
|
|
2003-07-24 22:09:40 -03:00
|
|
|
|
- Add a patch to workaround pthread_sigmask() bugs in Cygwin.
|
|
|
|
|
|
2003-07-21 11:25:23 -03:00
|
|
|
|
Mac
|
|
|
|
|
---
|
|
|
|
|
|
2003-07-24 22:09:40 -03:00
|
|
|
|
- Various fixes to pimp.
|
|
|
|
|
|
|
|
|
|
- Scripts runs with pythonw no longer had full window manager access.
|
|
|
|
|
|
|
|
|
|
- Don't force boot-disk-only install, for reasons unknown it causes
|
|
|
|
|
more problems than it solves.
|
|
|
|
|
|
2003-07-21 11:25:23 -03:00
|
|
|
|
|
2003-07-17 14:57:58 -03:00
|
|
|
|
What's New in Python 2.3 release candidate 1?
|
|
|
|
|
=============================================
|
2003-06-30 01:18:48 -03:00
|
|
|
|
|
2003-07-18 17:10:02 -03:00
|
|
|
|
*Release date: 18-Jul-2003*
|
|
|
|
|
|
2003-06-30 01:18:48 -03:00
|
|
|
|
Core and builtins
|
|
|
|
|
-----------------
|
|
|
|
|
|
2003-07-06 15:36:54 -03:00
|
|
|
|
- The new function sys.getcheckinterval() returns the last value set
|
|
|
|
|
by sys.setcheckinterval().
|
|
|
|
|
|
2003-07-17 14:57:58 -03:00
|
|
|
|
- Several bugs in the symbol table phase of the compiler have been
|
|
|
|
|
fixed. Errors could be lost and compilation could fail without
|
2003-07-17 16:19:05 -03:00
|
|
|
|
reporting an error. SF patch 763201.
|
2003-07-17 14:57:58 -03:00
|
|
|
|
|
|
|
|
|
- The interpreter is now more robust about importing the warnings
|
|
|
|
|
module. In an executable generated by freeze or similar programs,
|
|
|
|
|
earlier versions of 2.3 would fail if the warnings module could
|
2003-07-17 16:19:05 -03:00
|
|
|
|
not be found on the file system. Fixes SF bug 771097.
|
2003-07-17 14:57:58 -03:00
|
|
|
|
|
|
|
|
|
- A warning about assignments to module attributes that shadow
|
|
|
|
|
builtins, present in earlier releases of 2.3, has been removed.
|
2003-07-21 11:25:23 -03:00
|
|
|
|
|
2003-07-17 14:57:58 -03:00
|
|
|
|
- It is not possible to create subclasses of builtin types like str
|
|
|
|
|
and tuple that define an itemsize. Earlier releases of Python 2.3
|
|
|
|
|
allowed this by mistake, leading to crashes and other problems.
|
|
|
|
|
|
|
|
|
|
- The thread_id is now initialized to 0 in a non-thread build. SF bug
|
2003-07-17 16:19:05 -03:00
|
|
|
|
770247.
|
|
|
|
|
|
|
|
|
|
- SF bug 762891: "del p[key]" on proxy object no longer raises SystemError.
|
2003-07-17 14:57:58 -03:00
|
|
|
|
|
2003-06-30 01:18:48 -03:00
|
|
|
|
Extension modules
|
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
|
|
- weakref.proxy() can now handle "del obj[i]" for proxy objects
|
|
|
|
|
defining __delitem__. Formerly, it generated a SystemError.
|
|
|
|
|
|
|
|
|
|
- SSL no longer crashes the interpreter when the remote side disconnects.
|
|
|
|
|
|
2003-07-16 17:11:34 -03:00
|
|
|
|
- On Unix the mmap module can again be used to map device files.
|
|
|
|
|
|
2003-07-01 02:16:08 -03:00
|
|
|
|
- time.strptime now exclusively uses the Python implementation
|
|
|
|
|
contained within the _strptime module.
|
|
|
|
|
|
2003-07-17 14:57:58 -03:00
|
|
|
|
- The print slot of weakref proxy objects was removed, because it was
|
|
|
|
|
not consistent with the object's repr slot.
|
|
|
|
|
|
|
|
|
|
- The mmap module only checks file size for regular files, not
|
2003-07-17 16:19:05 -03:00
|
|
|
|
character or block devices. SF patch 708374.
|
|
|
|
|
|
|
|
|
|
- The cPickle Pickler garbage collection support was fixed to traverse
|
|
|
|
|
the find_class attribute, if present.
|
|
|
|
|
|
2003-07-21 11:25:23 -03:00
|
|
|
|
- There are several fixes for the bsddb3 wrapper module.
|
2003-07-17 16:19:05 -03:00
|
|
|
|
|
|
|
|
|
bsddb3 no longer crashes if an environment is closed before a cursor
|
|
|
|
|
(SF bug 763298).
|
|
|
|
|
|
|
|
|
|
The DB and DBEnv set_get_returns_none function was extended to take
|
2003-07-20 15:00:54 -03:00
|
|
|
|
a level instead of a boolean flag. The new level 2 means that in
|
|
|
|
|
addition, cursor.set()/.get() methods return None instead of raising
|
|
|
|
|
an exception.
|
2003-07-17 16:19:05 -03:00
|
|
|
|
|
|
|
|
|
A typo was fixed in DBCursor.join_item(), preventing a crash.
|
|
|
|
|
|
2003-06-30 01:18:48 -03:00
|
|
|
|
Library
|
|
|
|
|
-------
|
|
|
|
|
|
2003-07-17 14:57:58 -03:00
|
|
|
|
- distutils now supports MSVC 7.1
|
|
|
|
|
|
2003-07-16 16:25:22 -03:00
|
|
|
|
- doctest now examines all docstrings by default. Previously, it would
|
|
|
|
|
skip over functions with private names (as indicated by the underscore
|
|
|
|
|
naming convention). The old default created too much of a risk that
|
|
|
|
|
user tests were being skipped inadvertently. Note, this change could
|
|
|
|
|
break code in the unlikely case that someone had intentionally put
|
|
|
|
|
failing tests in the docstrings of private functions. The breakage
|
|
|
|
|
is easily fixable by specifying the old behavior when calling testmod()
|
|
|
|
|
or Tester().
|
|
|
|
|
|
2003-07-17 14:57:58 -03:00
|
|
|
|
- There were several fixes to the way dumbdbms are closed. It's vital
|
|
|
|
|
that a dumbdbm database be closed properly, else the on-disk data
|
|
|
|
|
and directory files can be left in mutually inconsistent states.
|
|
|
|
|
dumbdbm.py's _Database.__del__() method attempted to close the
|
|
|
|
|
database properly, but a shutdown race in _Database._commit() could
|
|
|
|
|
prevent this from working, so that a program trusting __del__() to
|
|
|
|
|
get the on-disk files in synch could be badly surprised. The race
|
|
|
|
|
has been repaired. A sync() method was also added so that shelve
|
|
|
|
|
can guarantee data is written to disk.
|
2003-07-13 14:21:10 -03:00
|
|
|
|
|
2003-07-17 14:57:58 -03:00
|
|
|
|
The close() method can now be called more than once without complaint.
|
2003-07-12 23:22:03 -03:00
|
|
|
|
|
2003-07-01 17:01:55 -03:00
|
|
|
|
- The classes in threading.py are now new-style classes. That they
|
|
|
|
|
weren't before was an oversight.
|
|
|
|
|
|
2003-07-17 16:19:05 -03:00
|
|
|
|
- The urllib2 digest authentication handlers now define the correct
|
|
|
|
|
auth_header. The earlier versions would fail at runtime.
|
|
|
|
|
|
2003-07-01 11:59:46 -03:00
|
|
|
|
- SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods
|
|
|
|
|
when there are no lines.
|
|
|
|
|
|
2003-07-01 18:12:47 -03:00
|
|
|
|
- SF bug 763637: fix exception in Tkinter with after_cancel
|
|
|
|
|
which could occur with Tk 8.4
|
|
|
|
|
|
2003-07-17 14:57:58 -03:00
|
|
|
|
- SF bug 770601: CGIHTTPServer.py now passes the entire environment
|
|
|
|
|
to child processes.
|
|
|
|
|
|
2003-07-17 16:19:05 -03:00
|
|
|
|
- SF bug 765238: add filter to fnmatch's __all__.
|
|
|
|
|
|
|
|
|
|
- SF bug 748201: make time.strptime() error messages more helpful.
|
|
|
|
|
|
|
|
|
|
- SF patch 764470: Do not dump the args attribute of a Fault object in
|
|
|
|
|
xmlrpclib.
|
|
|
|
|
|
|
|
|
|
- SF patch 549151: urllib and urllib2 now redirect POSTs on 301
|
|
|
|
|
responses.
|
|
|
|
|
|
|
|
|
|
- SF patch 766650: The whichdb module was fixed to recognize dbm files
|
|
|
|
|
generated by gdbm on OS/2 EMX.
|
|
|
|
|
|
|
|
|
|
- SF bugs 763047 and 763052: fixes bug of timezone value being left as
|
|
|
|
|
-1 when ``time.tzname[0] == time.tzname[1] and not time.daylight``
|
|
|
|
|
is true when it should only when time.daylight is true.
|
|
|
|
|
|
|
|
|
|
- SF bug 764548: re now allows subclasses of str and unicode to be
|
|
|
|
|
used as patterns.
|
|
|
|
|
|
|
|
|
|
- SF bug 763637: In Tkinter, change after_cancel() to handle tuples
|
|
|
|
|
of varying sizes. Tk 8.4 returns a different number of values
|
|
|
|
|
than Tk 8.3.
|
|
|
|
|
|
|
|
|
|
- SF bug 763023: difflib.ratio() did not catch zero division.
|
|
|
|
|
|
|
|
|
|
- The Queue module now has an __all__ attribute.
|
2003-07-17 14:57:58 -03:00
|
|
|
|
|
2003-06-30 01:18:48 -03:00
|
|
|
|
Tools/Demos
|
|
|
|
|
-----------
|
|
|
|
|
|
2003-07-17 16:19:05 -03:00
|
|
|
|
- See Lib/idlelib/NEWS.txt for IDLE news.
|
|
|
|
|
|
2003-07-01 01:14:28 -03:00
|
|
|
|
- SF bug 753592: webchecker/wsgui now handles user supplied directories.
|
|
|
|
|
|
2003-07-17 16:19:05 -03:00
|
|
|
|
- The trace.py script has been removed. It is now in the standard library.
|
2003-07-17 14:57:58 -03:00
|
|
|
|
|
2003-06-30 01:18:48 -03:00
|
|
|
|
Build
|
|
|
|
|
-----
|
|
|
|
|
|
2003-07-17 16:19:05 -03:00
|
|
|
|
- Python now compiles with -fno-strict-aliasing if possible (SF bug 766696).
|
|
|
|
|
|
2003-07-17 14:57:58 -03:00
|
|
|
|
- The socket module compiles on IRIX 6.5.10.
|
|
|
|
|
|
2003-07-17 16:19:05 -03:00
|
|
|
|
- An irix64 system is treated the same way as an irix6 system (SF
|
|
|
|
|
patch 764560).
|
2003-07-17 14:57:58 -03:00
|
|
|
|
|
2003-07-17 16:19:05 -03:00
|
|
|
|
- Several definitions were missing on FreeBSD 5.x unless the
|
|
|
|
|
__BSD_VISIBLE symbol was defined. configure now defines it as
|
|
|
|
|
needed.
|
2003-07-17 14:57:58 -03:00
|
|
|
|
|
2003-06-30 01:18:48 -03:00
|
|
|
|
C API
|
|
|
|
|
-----
|
|
|
|
|
|
2003-07-17 16:19:05 -03:00
|
|
|
|
- Unicode objects now support mbcs as a built-in encoding, so the C
|
|
|
|
|
API can use it without deferring to the encodings package.
|
|
|
|
|
|
2003-06-30 01:18:48 -03:00
|
|
|
|
Windows
|
|
|
|
|
-------
|
|
|
|
|
|
2003-07-17 16:19:05 -03:00
|
|
|
|
- The Windows implementation of PyThread_start_new_thread() never
|
|
|
|
|
checked error returns from Windows functions correctly. As a result,
|
|
|
|
|
it could claim to start a new thread even when the Microsoft
|
|
|
|
|
_beginthread() function failed (due to "too many threads" -- this is
|
|
|
|
|
on the order of thousands when it happens). In these cases, the
|
|
|
|
|
Python exception ::
|
|
|
|
|
|
|
|
|
|
thread.error: can't start new thread
|
|
|
|
|
|
|
|
|
|
is raised now.
|
|
|
|
|
|
|
|
|
|
- SF bug 766669: Prevent a GPF on interpreter exit when sockets are in
|
|
|
|
|
use. The interpreter now calls WSACleanup() from Py_Finalize()
|
|
|
|
|
instead of from DLL teardown.
|
|
|
|
|
|
2003-06-30 01:18:48 -03:00
|
|
|
|
Mac
|
|
|
|
|
---
|
|
|
|
|
|
2003-07-17 16:19:05 -03:00
|
|
|
|
- Bundlebuilder now inherits default values in the right way. It was
|
2003-07-30 09:14:02 -03:00
|
|
|
|
previously possible for app bundles to get a type of "BNDL" instead
|
2003-07-17 16:19:05 -03:00
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
- Fixed two bugs in MacOSX framework handling.
|
2003-06-30 01:18:48 -03:00
|
|
|
|
|
2003-07-23 19:17:28 -03:00
|
|
|
|
- pythonw did not allow user interaction in 2.3rc1, this has been fixed.
|
|
|
|
|
|
|
|
|
|
- Python is now compiled with -mno-fused-madd, making all tests pass
|
|
|
|
|
on Panther.
|
|
|
|
|
|
2003-04-26 11:53:01 -03:00
|
|
|
|
What's New in Python 2.3 beta 2?
|
|
|
|
|
================================
|
|
|
|
|
|
2003-06-29 13:18:08 -03:00
|
|
|
|
*Release date: 29-Jun-2003*
|
2003-04-26 11:53:01 -03:00
|
|
|
|
|
|
|
|
|
Core and builtins
|
|
|
|
|
-----------------
|
|
|
|
|
|
2003-06-29 14:10:11 -03:00
|
|
|
|
- A program can now set the environment variable PYTHONINSPECT to some
|
|
|
|
|
string value in Python, and cause the interpreter to enter the
|
|
|
|
|
interactive prompt at program exit, as if Python had been invoked
|
|
|
|
|
with the -i option.
|
|
|
|
|
|
2003-06-17 02:05:49 -03:00
|
|
|
|
- list.index() now accepts optional start and stop arguments. Similar
|
|
|
|
|
changes were made to UserList.index(). SF feature request 754014.
|
|
|
|
|
|
2003-06-13 17:37:23 -03:00
|
|
|
|
- SF patch 751998 fixes an unwanted side effect of the previous fix
|
|
|
|
|
for SF bug 742860 (the next item).
|
|
|
|
|
|
2003-05-25 14:44:31 -03:00
|
|
|
|
- SF bug 742860: "WeakKeyDictionary __delitem__ uses iterkeys". This
|
|
|
|
|
wasn't threadsafe, was very inefficient (expected time O(len(dict))
|
|
|
|
|
instead of O(1)), and could raise a spurious RuntimeError if another
|
|
|
|
|
thread mutated the dict during __delitem__, or if a comparison function
|
|
|
|
|
mutated it. It also neglected to raise KeyError when the key wasn't
|
|
|
|
|
present; didn't raise TypeError when the key wasn't of a weakly
|
|
|
|
|
referencable type; and broke various more-or-less obscure dict
|
|
|
|
|
invariants by using a sequence of equality comparisons over the whole
|
|
|
|
|
set of dict keys instead of computing the key's hash code to narrow
|
|
|
|
|
the search to those keys with the same hash code. All of these are
|
|
|
|
|
considered to be bugs. A new implementation of __delitem__ repairs all
|
|
|
|
|
that, but note that fixing these bugs may change visible behavior in
|
|
|
|
|
code relying (whether intentionally or accidentally) on old behavior.
|
2003-05-24 22:45:11 -03:00
|
|
|
|
|
2003-06-29 14:25:39 -03:00
|
|
|
|
- SF bug 734869: Fixed a compiler bug that caused a fatal error when
|
|
|
|
|
compiling a list comprehension that contained another list comprehension
|
|
|
|
|
embedded in a lambda expression.
|
|
|
|
|
|
2003-05-24 17:18:24 -03:00
|
|
|
|
- SF bug 705231: builtin pow() no longer lets the platform C pow()
|
|
|
|
|
raise -1.0 to integer powers, because (at least) glibc gets it wrong
|
|
|
|
|
in some cases. The result should be -1.0 if the power is odd and 1.0
|
|
|
|
|
if the power is even, and any float with a sufficiently large exponent
|
|
|
|
|
is (mathematically) an exact even integer.
|
|
|
|
|
|
2003-06-29 14:25:39 -03:00
|
|
|
|
- SF bug 759227: A new-style class that implements __nonzero__() must
|
|
|
|
|
return a bool or int (but not an int subclass) from that method. This
|
|
|
|
|
matches the restriction on classic classes.
|
|
|
|
|
|
2003-05-10 04:10:12 -03:00
|
|
|
|
- The encoding attribute has been added for file objects, and set to
|
|
|
|
|
the terminal encoding on Unix and Windows.
|
|
|
|
|
|
2003-05-04 01:16:52 -03:00
|
|
|
|
- The softspace attribute of file objects became read-only by oversight.
|
|
|
|
|
It's writable again.
|
|
|
|
|
|
2003-05-06 22:28:47 -03:00
|
|
|
|
- Reverted a 2.3 beta 1 change to iterators for subclasses of list and
|
|
|
|
|
tuple. By default, the iterators now access data elements directly
|
|
|
|
|
instead of going through __getitem__. If __getitem__ access is
|
2003-07-16 17:11:34 -03:00
|
|
|
|
preferred, then __iter__ can be overridden.
|
2003-05-06 22:28:47 -03:00
|
|
|
|
|
2003-06-29 14:25:39 -03:00
|
|
|
|
- SF bug 735247: The staticmethod and super types participate in
|
|
|
|
|
garbage collection. Before this change, it was possible for leaks to
|
|
|
|
|
occur in functions with non-global free variables that used these types.
|
|
|
|
|
|
2003-04-26 11:53:01 -03:00
|
|
|
|
Extension modules
|
|
|
|
|
-----------------
|
|
|
|
|
|
2003-06-29 00:29:42 -03:00
|
|
|
|
- the socket module has a new exception, socket.timeout, to allow
|
|
|
|
|
timeouts to be handled separately from other socket errors.
|
|
|
|
|
|
2003-06-29 14:25:39 -03:00
|
|
|
|
- SF bug 751276: cPickle has fixed to propagate exceptions raised in
|
|
|
|
|
user code. In earlier versions, cPickle caught and ignored any
|
|
|
|
|
exception when it performed operations that it expected to raise
|
|
|
|
|
specific exceptions like AttributeError.
|
|
|
|
|
|
|
|
|
|
- cPickle Pickler and Unpickler objects now participate in garbage
|
|
|
|
|
collection.
|
|
|
|
|
|
2003-06-15 20:13:35 -03:00
|
|
|
|
- mimetools.choose_boundary() could return duplicate strings at times,
|
|
|
|
|
especially likely on Windows. The strings returned are now guaranteed
|
|
|
|
|
unique within a single program run.
|
|
|
|
|
|
2003-06-13 20:44:35 -03:00
|
|
|
|
- thread.interrupt_main() raises KeyboardInterrupt in the main thread.
|
|
|
|
|
dummy_thread has also been modified to try to simulate the behavior.
|
|
|
|
|
|
2003-05-18 00:15:10 -03:00
|
|
|
|
- array.array.insert() now treats negative indices as being relative
|
|
|
|
|
to the end of the array, just like list.insert() does. (SF bug #739313)
|
|
|
|
|
|
2003-05-17 12:57:00 -03:00
|
|
|
|
- The datetime module classes datetime, time, and timedelta are now
|
|
|
|
|
properly subclassable.
|
2003-05-17 02:55:19 -03:00
|
|
|
|
|
2003-05-09 05:19:48 -03:00
|
|
|
|
- _tkinter.{get|set}busywaitinterval was added.
|
|
|
|
|
|
2003-05-02 17:24:56 -03:00
|
|
|
|
- itertools.islice() now accepts stop=None as documented.
|
|
|
|
|
Fixes SF bug #730685.
|
|
|
|
|
|
2003-05-06 17:42:37 -03:00
|
|
|
|
- the bsddb185 module is built in one restricted instance -
|
|
|
|
|
/usr/include/db.h exists and defines HASHVERSION to be 2. This is true
|
|
|
|
|
for many BSD-derived systems.
|
|
|
|
|
|
2003-06-29 14:25:39 -03:00
|
|
|
|
|
2003-04-26 11:53:01 -03:00
|
|
|
|
Library
|
|
|
|
|
-------
|
|
|
|
|
|
2003-06-29 02:30:48 -03:00
|
|
|
|
- Some happy doctest extensions from Jim Fulton have been added to
|
|
|
|
|
doctest.py. These are already being used in Zope3. The two
|
|
|
|
|
primary ones:
|
|
|
|
|
|
|
|
|
|
doctest.debug(module, name) extracts the doctests from the named object
|
|
|
|
|
in the given module, puts them in a temp file, and starts pdb running
|
|
|
|
|
on that file. This is great when a doctest fails.
|
|
|
|
|
|
|
|
|
|
doctest.DocTestSuite(module=None) returns a synthesized unittest
|
|
|
|
|
TestSuite instance, to be run by the unittest framework, which
|
|
|
|
|
runs all the doctests in the module. This allows writing tests in
|
|
|
|
|
doctest style (which can be clearer and shorter than writing tests
|
|
|
|
|
in unittest style), without losing unittest's powerful testing
|
|
|
|
|
framework features (which doctest lacks).
|
|
|
|
|
|
A hack to ease compatibility with pre-2.3 Pythons: by default, doctest
now accepts "True" when a test expects "1", and similarly for "False"
versus "0". This is un-doctest-like, but on balance makes it much
more pleasant to write doctests that pass under 2.2 and 2.3. I expect
it to go away again, when 2.2 is forgotten. In the meantime, there's
a new doctest module constant that can be passed to a new optional
argument, if you want to turn this behavior off.
Note that this substitution is very simple-minded: the expected and
actual outputs have to consist of single tokens. No attempt is made,
e.g., to accept [True, False] when a test expects [1, 0]. This is a
simple hack for simple tests, and I intend to keep it that way.
2003-06-27 17:48:05 -03:00
|
|
|
|
- For compatibility with doctests created before 2.3, if an expected
|
|
|
|
|
output block consists solely of "1" and the actual output block
|
|
|
|
|
consists solely of "True", it's accepted as a match; similarly
|
|
|
|
|
for "0" and "False". This is quite un-doctest-like, but is practical.
|
|
|
|
|
The behavior can be disabled by passing the new doctest module
|
|
|
|
|
constant DONT_ACCEPT_TRUE_FOR_1 to the new optionflags optional
|
|
|
|
|
argument.
|
|
|
|
|
|
2003-06-29 14:25:39 -03:00
|
|
|
|
- ZipFile.testzip() now only traps BadZipfile exceptions. Previously,
|
|
|
|
|
a bare except caught to much and reported all errors as a problem
|
|
|
|
|
in the archive.
|
|
|
|
|
|
|
|
|
|
- The logging module now has a new function, makeLogRecord() making
|
|
|
|
|
LogHandler easier to interact with DatagramHandler and SocketHandler.
|
|
|
|
|
|
2003-06-17 09:58:31 -03:00
|
|
|
|
- The cgitb module has been extended to support plain text display (SF patch
|
|
|
|
|
569574).
|
|
|
|
|
|
2003-06-13 17:37:23 -03:00
|
|
|
|
- A brand new version of IDLE (from the IDLEfork project at
|
|
|
|
|
SourceForge) is now included as Lib/idlelib. The old Tools/idle is
|
|
|
|
|
no more.
|
|
|
|
|
|
2003-06-29 14:25:39 -03:00
|
|
|
|
- Added a new module: trace (documentation missing). This module used
|
|
|
|
|
to be distributed in Tools/scripts. It uses sys.settrace() to trace
|
|
|
|
|
code execution -- either function calls or individual lines. It can
|
|
|
|
|
generate tracing output during execution or a post-mortem report of
|
|
|
|
|
code coverage.
|
|
|
|
|
|
2003-06-16 17:38:15 -03:00
|
|
|
|
- The threading module has new functions settrace() and setprofile()
|
|
|
|
|
that cooperate with the functions of the same name in the sys
|
|
|
|
|
module. A function registered with the threading module will
|
2003-06-29 14:25:39 -03:00
|
|
|
|
be used for all threads it creates. The new trace module uses this
|
|
|
|
|
to provide tracing for code running in threads.
|
2003-06-16 17:38:15 -03:00
|
|
|
|
|
2003-06-13 16:28:47 -03:00
|
|
|
|
- copy.py: applied SF patch 707900, fixing bug 702858, by Steven
|
|
|
|
|
Taschuk. Copying a new-style class that had a reference to itself
|
|
|
|
|
didn't work. (The same thing worked fine for old-style classes.)
|
2003-06-14 04:10:06 -03:00
|
|
|
|
Builtin functions are now treated as atomic, fixing bug #746304.
|
2003-06-13 16:28:47 -03:00
|
|
|
|
|
2003-06-08 16:42:33 -03:00
|
|
|
|
- difflib.py has two new functions: context_diff() and unified_diff().
|
|
|
|
|
|
2003-05-15 22:46:51 -03:00
|
|
|
|
- More fixes to urllib (SF 549151): (a) When redirecting, always use
|
|
|
|
|
GET. This is common practice and more-or-less sanctioned by the
|
|
|
|
|
HTTP standard. (b) Add a handler for 307 redirection, which becomes
|
|
|
|
|
an error for POST, but a regular redirect for GET and HEAD
|
|
|
|
|
|
2003-05-13 15:01:19 -03:00
|
|
|
|
- Added optional 'onerror' argument to os.walk(), to control error
|
|
|
|
|
handling.
|
|
|
|
|
|
2003-05-03 06:09:02 -03:00
|
|
|
|
- inspect.is{method|data}descriptor was added, to allow pydoc display
|
|
|
|
|
__doc__ of data descriptors.
|
|
|
|
|
|
2003-04-29 18:07:16 -03:00
|
|
|
|
- Fixed socket speed loss caused by use of the _socketobject wrapper class
|
|
|
|
|
in socket.py.
|
|
|
|
|
|
2003-05-20 01:59:56 -03:00
|
|
|
|
- timeit.py now checks the current directory for imports.
|
|
|
|
|
|
2003-06-07 14:53:08 -03:00
|
|
|
|
- urllib2.py now knows how to order proxy classes, so the user doesn't
|
|
|
|
|
have to insert it in front of other classes, nor do dirty tricks like
|
|
|
|
|
inserting a "dummy" HTTPHandler after a ProxyHandler when building an
|
|
|
|
|
opener with proxy support.
|
|
|
|
|
|
2003-06-30 00:35:06 -03:00
|
|
|
|
- Iterators have been added for dbm keys.
|
|
|
|
|
|
|
|
|
|
- random.Random objects can now be pickled.
|
|
|
|
|
|
2003-04-26 11:53:01 -03:00
|
|
|
|
Tools/Demos
|
|
|
|
|
-----------
|
|
|
|
|
|
2003-06-14 06:03:46 -03:00
|
|
|
|
- pydoc now offers help on keywords and topics.
|
|
|
|
|
|
2003-06-13 17:37:23 -03:00
|
|
|
|
- Tools/idle is gone; long live Lib/idlelib.
|
|
|
|
|
|
2003-06-29 13:18:08 -03:00
|
|
|
|
- diff.py prints file diffs in context, unified, or ndiff formats,
|
|
|
|
|
providing a command line interface to difflib.py.
|
2003-06-08 20:10:15 -03:00
|
|
|
|
|
2003-05-10 00:30:13 -03:00
|
|
|
|
- texcheck.py is a new script for making a rough validation of Python LaTeX
|
|
|
|
|
files.
|
|
|
|
|
|
2003-04-26 11:53:01 -03:00
|
|
|
|
Build
|
|
|
|
|
-----
|
|
|
|
|
|
2003-07-16 17:11:34 -03:00
|
|
|
|
- Setting DESTDIR during 'make install' now allows specifying a
|
2003-05-11 17:25:35 -03:00
|
|
|
|
different root directory.
|
|
|
|
|
|
2003-04-26 11:53:01 -03:00
|
|
|
|
C API
|
|
|
|
|
-----
|
|
|
|
|
|
2003-05-21 18:29:48 -03:00
|
|
|
|
- PyType_Ready(): If a type declares that it participates in gc
|
|
|
|
|
(Py_TPFLAGS_HAVE_GC), and its base class does not, and its base class's
|
|
|
|
|
tp_free slot is the default _PyObject_Del, and type does not define
|
|
|
|
|
a tp_free slot itself, _PyObject_GC_Del is assigned to type->tp_free.
|
|
|
|
|
Previously _PyObject_Del was inherited, which could at best lead to a
|
|
|
|
|
segfault. In addition, if even after this magic the type's tp_free
|
|
|
|
|
slot is _PyObject_Del or NULL, and the type is a base type
|
|
|
|
|
(Py_TPFLAGS_BASETYPE), TypeError is raised: since the type is a base
|
|
|
|
|
type, its dealloc function must call type->tp_free, and since the type
|
|
|
|
|
is gc'able, tp_free must not be NULL or _PyObject_Del.
|
|
|
|
|
|
2003-06-30 00:35:06 -03:00
|
|
|
|
- PyThreadState_SetAsyncExc(): A new API (deliberately accessible only
|
|
|
|
|
from C) to interrupt a thread by sending it an exception. It is
|
|
|
|
|
intentional that you have to write your own C extension to call it
|
|
|
|
|
from Python.
|
|
|
|
|
|
|
|
|
|
|
2003-04-26 11:53:01 -03:00
|
|
|
|
New platforms
|
|
|
|
|
-------------
|
|
|
|
|
|
|
|
|
|
None this time.
|
|
|
|
|
|
|
|
|
|
Tests
|
|
|
|
|
-----
|
|
|
|
|
|
|
|
|
|
- test_imp rewritten so that it doesn't raise RuntimeError if run as a
|
|
|
|
|
side effect of being imported ("import test.autotest").
|
|
|
|
|
|
|
|
|
|
Windows
|
|
|
|
|
-------
|
|
|
|
|
|
2003-06-21 22:42:20 -03:00
|
|
|
|
- The Windows installer ships with Tcl/Tk 8.4.3 (upgraded from 8.4.1).
|
|
|
|
|
|
2003-05-08 15:13:59 -03:00
|
|
|
|
- The installer always suggested that Python be installed on the C:
|
|
|
|
|
drive, due to a hardcoded "C:" generated by the Wise installation
|
|
|
|
|
wizard. People with machines where C: is not the system drive
|
|
|
|
|
usually want Python installed on whichever drive is their system drive
|
|
|
|
|
instead. We removed the hardcoded "C:", and two testers on machines
|
|
|
|
|
where C: is not the system drive report that the installer now
|
|
|
|
|
suggests their system drive. Note that you can always select the
|
|
|
|
|
directory you want in the "Select Destination Directory" dialog --
|
|
|
|
|
that's what it's for.
|
|
|
|
|
|
2003-04-26 11:53:01 -03:00
|
|
|
|
Mac
|
|
|
|
|
---
|
|
|
|
|
|
2003-05-09 12:01:25 -03:00
|
|
|
|
- There's a new module called "autoGIL", which offers a mechanism to
|
|
|
|
|
automatically release the Global Interpreter Lock when an event loop
|
|
|
|
|
goes to sleep, allowing other threads to run. It's currently only
|
|
|
|
|
supported on OSX, in the Mach-O version.
|
2003-06-16 10:53:40 -03:00
|
|
|
|
- The OSA modules now allow direct access to properties of the
|
|
|
|
|
toplevel application class (in AppleScript terminology).
|
|
|
|
|
- The Package Manager can now update itself.
|
2003-04-26 11:53:01 -03:00
|
|
|
|
|
2003-06-30 00:35:06 -03:00
|
|
|
|
SourceForge Bugs and Patches Applied
|
|
|
|
|
------------------------------------
|
|
|
|
|
|
|
|
|
|
430160, 471893, 501716, 542562, 549151, 569574, 595837, 596434,
|
|
|
|
|
598163, 604210, 604716, 610332, 612627, 614770, 620190, 621891,
|
|
|
|
|
622042, 639139, 640236, 644345, 649742, 649742, 658233, 660022,
|
|
|
|
|
661318, 661676, 662807, 662923, 666219, 672855, 678325, 682347,
|
|
|
|
|
683486, 684981, 685773, 686254, 692776, 692959, 693094, 696777,
|
|
|
|
|
697989, 700827, 703666, 708495, 708604, 708901, 710733, 711902,
|
|
|
|
|
713722, 715782, 718286, 719359, 719367, 723136, 723831, 723962,
|
|
|
|
|
724588, 724767, 724767, 725942, 726150, 726446, 726869, 727051,
|
|
|
|
|
727719, 727719, 727805, 728277, 728563, 728656, 729096, 729103,
|
|
|
|
|
729293, 729297, 729300, 729317, 729395, 729622, 729817, 730170,
|
|
|
|
|
730296, 730594, 730685, 730826, 730963, 731209, 731403, 731504,
|
|
|
|
|
731514, 731626, 731635, 731643, 731644, 731644, 731689, 732124,
|
|
|
|
|
732143, 732234, 732284, 732284, 732479, 732761, 732783, 732951,
|
|
|
|
|
733667, 733781, 734118, 734231, 734869, 735051, 735293, 735527,
|
|
|
|
|
735613, 735694, 736962, 736962, 737970, 738066, 739313, 740055,
|
|
|
|
|
740234, 740301, 741806, 742126, 742741, 742860, 742860, 742911,
|
|
|
|
|
744041, 744104, 744238, 744687, 744877, 745055, 745478, 745525,
|
|
|
|
|
745620, 746012, 746304, 746366, 746801, 746953, 747348, 747667,
|
|
|
|
|
747954, 748846, 748849, 748973, 748975, 749191, 749210, 749759,
|
|
|
|
|
749831, 749911, 750008, 750092, 750542, 750595, 751038, 751107,
|
|
|
|
|
751276, 751451, 751916, 751941, 751956, 751998, 752671, 753451,
|
|
|
|
|
753602, 753617, 753845, 753925, 754014, 754340, 754447, 755031,
|
|
|
|
|
755087, 755147, 755245, 755683, 755987, 756032, 756996, 757058,
|
|
|
|
|
757229, 757818, 757821, 757822, 758112, 758910, 759227, 759889,
|
|
|
|
|
760257, 760703, 760792, 761104, 761337, 761519, 761830, 762455
|
|
|
|
|
|
|
|
|
|
|
2003-02-19 21:56:17 -04:00
|
|
|
|
What's New in Python 2.3 beta 1?
|
|
|
|
|
================================
|
|
|
|
|
|
2003-04-25 16:19:52 -03:00
|
|
|
|
*Release date: 25-Apr-2003*
|
2003-02-19 21:56:17 -04:00
|
|
|
|
|
|
|
|
|
Core and builtins
|
|
|
|
|
-----------------
|
|
|
|
|
|
2003-04-23 16:35:25 -03:00
|
|
|
|
- New format codes B, H, I, k and K have been implemented for
|
|
|
|
|
PyArg_ParseTuple and PyBuild_Value.
|
|
|
|
|
|
2003-04-22 05:12:33 -03:00
|
|
|
|
- New builtin function sum(seq, start=0) returns the sum of all the
|
|
|
|
|
items in iterable object seq, plus start (items are normally numbers,
|
|
|
|
|
and cannot be strings).
|
|
|
|
|
|
2003-04-19 15:15:10 -03:00
|
|
|
|
- bool() called without arguments now returns False rather than
|
|
|
|
|
raising an exception. This is consistent with calling the
|
|
|
|
|
constructors for the other builtin types -- called without argument
|
|
|
|
|
they all return the false value of that type. (SF patch #724135)
|
|
|
|
|
|
2003-04-17 13:53:26 -03:00
|
|
|
|
- In support of PEP 269 (making the pgen parser generator accessible
|
|
|
|
|
from Python), some changes to the pgen code structure were made; a
|
|
|
|
|
few files that used to be linked only with pgen are now linked with
|
|
|
|
|
Python itself.
|
|
|
|
|
|
2003-04-16 18:13:23 -03:00
|
|
|
|
- The repr() of a weakref object now shows the __name__ attribute of
|
|
|
|
|
the referenced object, if it has one.
|
|
|
|
|
|
2003-04-16 16:40:58 -03:00
|
|
|
|
- super() no longer ignores data descriptors, except __class__. See
|
|
|
|
|
the thread started at
|
|
|
|
|
http://mail.python.org/pipermail/python-dev/2003-April/034338.html
|
|
|
|
|
|
2003-04-14 17:58:14 -03:00
|
|
|
|
- list.insert(i, x) now interprets negative i as it would be
|
|
|
|
|
interpreted by slicing, so negative values count from the end of the
|
|
|
|
|
list. This was the only place where such an interpretation was not
|
|
|
|
|
placed on a list index.
|
|
|
|
|
|
2003-04-11 15:43:06 -03:00
|
|
|
|
- range() now works even if the arguments are longs with magnitude
|
|
|
|
|
larger than sys.maxint, as long as the total length of the sequence
|
|
|
|
|
fits. E.g., range(2**100, 2**101, 2**100) is the following list:
|
|
|
|
|
[1267650600228229401496703205376L]. (SF patch #707427.)
|
|
|
|
|
|
Reworked has_finalizer() to use the new _PyObject_Lookup() instead
of PyObject_HasAttr(); the former promises never to execute
arbitrary Python code. Undid many of the changes recently made to
worm around the worst consequences of that PyObject_HasAttr() could
execute arbitrary Python code.
Compatibility is hard to discuss, because the dangerous cases are
so perverse, and much of this appears to rely on implementation
accidents.
To start with, using hasattr() to check for __del__ wasn't only
dangerous, in some cases it was wrong: if an instance of an old-
style class didn't have "__del__" in its instance dict or in any
base class dict, but a getattr hook said __del__ existed, then
hasattr() said "yes, this object has a __del__". But
instance_dealloc() ignores the possibility of getattr hooks when
looking for a __del__, so while object.__del__ succeeds, no
__del__ method is called when the object is deleted. gc was
therefore incorrect in believing that the object had a finalizer.
The new method doesn't suffer that problem (like instance_dealloc(),
_PyObject_Lookup() doesn't believe __del__ exists in that case), but
does suffer a somewhat opposite-- and even more obscure --oddity:
if an instance of an old-style class doesn't have "__del__" in its
instance dict, and a base class does have "__del__" in its dict,
and the first base class with a "__del__" associates it with a
descriptor (an object with a __get__ method), *and* if that
descriptor raises an exception when __get__ is called, then
(a) the current method believes the instance does have a __del__,
but (b) hasattr() does not believe the instance has a __del__.
While these disagree, I believe the new method is "more correct":
because the descriptor *will* be called when the object is
destructed, it can execute arbitrary Python code at the time the
object is destructed, and that's really what gc means by "has a
finalizer": not specifically a __del__ method, but more generally
the possibility of executing arbitrary Python code at object
destruction time. Code in a descriptor's __get__() executed at
destruction time can be just as problematic as code in a
__del__() executed then.
So I believe the new method is better on all counts.
Bugfix candidate, but it's unclear to me how all this differs in
the 2.2 branch (e.g., new-style and old-style classes already
took different gc paths in 2.3 before this last round of patches,
but don't in the 2.2 branch).
2003-04-07 16:21:15 -03:00
|
|
|
|
- Some horridly obscure problems were fixed involving interaction
|
|
|
|
|
between garbage collection and old-style classes with "ambitious"
|
|
|
|
|
getattr hooks. If an old-style instance didn't have a __del__ method,
|
|
|
|
|
but did have a __getattr__ hook, and the instance became reachable
|
|
|
|
|
only from an unreachable cycle, and the hook resurrected or deleted
|
|
|
|
|
unreachable objects when asked to resolve "__del__", anything up to
|
|
|
|
|
a segfault could happen. That's been repaired.
|
|
|
|
|
|
2003-03-06 19:54:28 -04:00
|
|
|
|
- dict.pop now takes an optional argument specifying a default
|
|
|
|
|
value to return if the key is not in the dict. If a default is not
|
|
|
|
|
given and the key is not found, a KeyError will still be raised.
|
|
|
|
|
Parallel changes were made to UserDict.UserDict and UserDict.DictMixin.
|
|
|
|
|
[SF patch #693753] (contributed by Michael Stone.)
|
|
|
|
|
|
2003-03-05 11:13:47 -04:00
|
|
|
|
- sys.getfilesystemencoding() was added to expose
|
|
|
|
|
Py_FileSystemDefaultEncoding.
|
2003-02-28 23:20:41 -04:00
|
|
|
|
|
|
|
|
|
- New function sys.exc_clear() clears the current exception. This is
|
|
|
|
|
rarely needed, but can sometimes be useful to release objects
|
|
|
|
|
referenced by the traceback held in sys.exc_info()[2]. (SF patch
|
|
|
|
|
#693195.)
|
|
|
|
|
|
2003-02-23 19:11:41 -04:00
|
|
|
|
- On 64-bit systems, a dictionary could contain duplicate long/int keys
|
|
|
|
|
if the key value was larger than 2**32. See SF bug #689659.
|
2003-02-19 21:56:17 -04:00
|
|
|
|
|
2003-03-18 20:35:36 -04:00
|
|
|
|
- Fixed SF bug #663074. The codec system was using global static
|
2003-03-31 12:15:13 -04:00
|
|
|
|
variables to store internal data. As a result, any attempts to use the
|
2003-03-18 20:35:36 -04:00
|
|
|
|
unicode system with multiple active interpreters, or successive
|
|
|
|
|
interpreter executions, would fail.
|
|
|
|
|
|
2003-03-31 14:07:50 -04:00
|
|
|
|
- "%c" % u"a" now returns a unicode string instead of raising a
|
2003-04-02 12:37:24 -04:00
|
|
|
|
TypeError. u"%c" % 0xffffffff now raises a OverflowError instead
|
2003-04-02 12:57:59 -04:00
|
|
|
|
of a ValueError to be consistent with "%c" % 256. See SF patch #710127.
|
2003-03-31 14:07:50 -04:00
|
|
|
|
|
2003-02-19 21:56:17 -04:00
|
|
|
|
Extension modules
|
|
|
|
|
-----------------
|
|
|
|
|
|
2003-04-25 02:52:37 -03:00
|
|
|
|
- The socket module now provides the functions inet_pton and inet_ntop
|
|
|
|
|
for converting between string and packed representation of IP
|
|
|
|
|
addresses. There is also a new module variable, has_ipv6, which is
|
|
|
|
|
True iff the current Python has IPv6 support. See SF patch #658327.
|
|
|
|
|
|
2003-04-16 16:42:51 -03:00
|
|
|
|
- Tkinter wrappers around Tcl variables now pass objects directly
|
|
|
|
|
to Tcl, instead of first converting them to strings.
|
|
|
|
|
|
2003-04-14 14:59:34 -03:00
|
|
|
|
- The .*? pattern in the re module is now special-cased to avoid the
|
|
|
|
|
recursion limit. (SF patch #720991 -- many thanks to Gary Herron
|
|
|
|
|
and Greg Chapman.)
|
|
|
|
|
|
2003-04-09 16:06:21 -03:00
|
|
|
|
- New function sys.call_tracing() allows pdb to debug code
|
|
|
|
|
recursively.
|
|
|
|
|
|
2003-04-08 14:17:17 -03:00
|
|
|
|
- New function gc.get_referents(obj) returns a list of objects
|
2003-04-08 13:39:48 -03:00
|
|
|
|
directly referenced by obj. In effect, it exposes what the object's
|
|
|
|
|
tp_traverse slot does, and can be helpful when debugging memory
|
|
|
|
|
leaks.
|
|
|
|
|
|
2003-04-03 00:49:12 -04:00
|
|
|
|
- The iconv module has been removed from this release.
|
|
|
|
|
|
2003-03-20 14:32:13 -04:00
|
|
|
|
- The platform-independent routines for packing floats in IEEE formats
|
|
|
|
|
(struct.pack's <f, >f, <d, and >d codes; pickle and cPickle's protocol 1
|
|
|
|
|
pickling of floats) ignored that rounding can cause a carry to
|
|
|
|
|
propagate. The worst consequence was that, in rare cases, <f and >f
|
|
|
|
|
could produce strings that, when unpacked again, were a factor of 2
|
|
|
|
|
away from the original float. This has been fixed. See SF bug
|
|
|
|
|
#705836.
|
|
|
|
|
|
2003-07-16 17:11:34 -03:00
|
|
|
|
- New function time.tzset() provides access to the C library tzset()
|
2003-03-14 17:51:36 -04:00
|
|
|
|
function, if supported. (SF patch #675422.)
|
|
|
|
|
|
2003-03-03 17:16:39 -04:00
|
|
|
|
- Using createfilehandler, deletefilehandler, createtimerhandler functions
|
|
|
|
|
on Tkinter.tkinter (_tkinter module) no longer crashes the interpreter.
|
|
|
|
|
See SF bug #692416.
|
|
|
|
|
|
2003-03-03 08:29:42 -04:00
|
|
|
|
- Modified the fcntl.ioctl() function to allow modification of a passed
|
|
|
|
|
mutable buffer (for details see the reference documentation).
|
|
|
|
|
|
2003-02-23 00:40:07 -04:00
|
|
|
|
- Made user requested changes to the itertools module.
|
|
|
|
|
Subsumed the times() function into repeat().
|
|
|
|
|
Added chain() and cycle().
|
2003-02-19 21:56:17 -04:00
|
|
|
|
|
2003-04-25 04:11:48 -03:00
|
|
|
|
- The rotor module is now deprecated; the encryption algorithm it uses
|
2003-04-24 10:19:56 -03:00
|
|
|
|
is not believed to be secure, and including crypto code with Python
|
|
|
|
|
has implications for exporting and importing it in various countries.
|
|
|
|
|
|
2003-03-30 00:54:24 -04:00
|
|
|
|
- The socket module now always uses the _socketobject wrapper class, even on
|
|
|
|
|
platforms which have dup(2). The makefile() method is built directly
|
|
|
|
|
on top of the socket without duplicating the file descriptor, allowing
|
|
|
|
|
timeouts to work properly.
|
|
|
|
|
|
2003-02-19 21:56:17 -04:00
|
|
|
|
Library
|
|
|
|
|
-------
|
|
|
|
|
|
2003-04-25 04:11:48 -03:00
|
|
|
|
- New generator function os.walk() is an easy-to-use alternative to
|
|
|
|
|
os.path.walk(). See os module docs for details. os.path.walk()
|
|
|
|
|
isn't deprecated at this time, but may become deprecated in a
|
|
|
|
|
future release.
|
|
|
|
|
|
2003-04-24 08:36:11 -03:00
|
|
|
|
- Added new module "platform" which provides a wide range of tools
|
|
|
|
|
for querying platform dependent features.
|
|
|
|
|
|
2003-04-24 13:45:05 -03:00
|
|
|
|
- netrc now allows ASCII punctuation characters in passwords.
|
2003-04-23 16:06:08 -03:00
|
|
|
|
|
2003-04-19 17:59:03 -03:00
|
|
|
|
- shelve now supports the optional writeback argument, and exposes
|
|
|
|
|
pickle protocol versions.
|
|
|
|
|
|
2003-04-19 15:04:57 -03:00
|
|
|
|
- Several methods of nntplib.NNTP have grown an optional file argument
|
|
|
|
|
which specifies a file where to divert the command's output
|
|
|
|
|
(already supported by the body() method). (SF patch #720468)
|
|
|
|
|
|
2003-04-18 18:04:39 -03:00
|
|
|
|
- The self-documenting XML server library DocXMLRPCServer was added.
|
|
|
|
|
|
2003-04-18 07:39:54 -03:00
|
|
|
|
- Support for internationalized domain names has been added through
|
|
|
|
|
the 'idna' and 'punycode' encodings, the 'stringprep' module, the
|
|
|
|
|
'mkstringprep' tool, and enhancements to the socket and httplib
|
|
|
|
|
modules.
|
|
|
|
|
|
2003-04-16 06:46:13 -03:00
|
|
|
|
- htmlentitydefs has two new dictionaries: name2codepoint maps
|
|
|
|
|
HTML entity names to Unicode codepoints (as integers).
|
|
|
|
|
codepoint2name is the reverse mapping. See SF patch #722017.
|
|
|
|
|
|
2003-04-09 16:06:21 -03:00
|
|
|
|
- pdb has a new command, "debug", which lets you step through
|
|
|
|
|
arbitrary code from the debugger's (pdb) prompt.
|
|
|
|
|
|
2003-04-04 18:56:42 -04:00
|
|
|
|
- unittest.failUnlessEqual and its equivalent unittest.assertEqual now
|
|
|
|
|
return 'not a == b' rather than 'a != b'. This gives the desired
|
|
|
|
|
result for classes that define __eq__ without defining __ne__.
|
|
|
|
|
|
Reworked has_finalizer() to use the new _PyObject_Lookup() instead
of PyObject_HasAttr(); the former promises never to execute
arbitrary Python code. Undid many of the changes recently made to
worm around the worst consequences of that PyObject_HasAttr() could
execute arbitrary Python code.
Compatibility is hard to discuss, because the dangerous cases are
so perverse, and much of this appears to rely on implementation
accidents.
To start with, using hasattr() to check for __del__ wasn't only
dangerous, in some cases it was wrong: if an instance of an old-
style class didn't have "__del__" in its instance dict or in any
base class dict, but a getattr hook said __del__ existed, then
hasattr() said "yes, this object has a __del__". But
instance_dealloc() ignores the possibility of getattr hooks when
looking for a __del__, so while object.__del__ succeeds, no
__del__ method is called when the object is deleted. gc was
therefore incorrect in believing that the object had a finalizer.
The new method doesn't suffer that problem (like instance_dealloc(),
_PyObject_Lookup() doesn't believe __del__ exists in that case), but
does suffer a somewhat opposite-- and even more obscure --oddity:
if an instance of an old-style class doesn't have "__del__" in its
instance dict, and a base class does have "__del__" in its dict,
and the first base class with a "__del__" associates it with a
descriptor (an object with a __get__ method), *and* if that
descriptor raises an exception when __get__ is called, then
(a) the current method believes the instance does have a __del__,
but (b) hasattr() does not believe the instance has a __del__.
While these disagree, I believe the new method is "more correct":
because the descriptor *will* be called when the object is
destructed, it can execute arbitrary Python code at the time the
object is destructed, and that's really what gc means by "has a
finalizer": not specifically a __del__ method, but more generally
the possibility of executing arbitrary Python code at object
destruction time. Code in a descriptor's __get__() executed at
destruction time can be just as problematic as code in a
__del__() executed then.
So I believe the new method is better on all counts.
Bugfix candidate, but it's unclear to me how all this differs in
the 2.2 branch (e.g., new-style and old-style classes already
took different gc paths in 2.3 before this last round of patches,
but don't in the 2.2 branch).
2003-04-07 16:21:15 -03:00
|
|
|
|
- sgmllib now supports SGML marked sections, in particular the
|
2003-03-30 10:25:40 -04:00
|
|
|
|
MS Office extensions.
|
|
|
|
|
|
2003-03-09 01:33:33 -04:00
|
|
|
|
- The urllib module now offers support for the iterator protocol.
|
|
|
|
|
SF patch 698520 contributed by Brett Cannon.
|
|
|
|
|
|
2003-03-05 21:56:12 -04:00
|
|
|
|
- New module timeit provides a simple framework for timing the
|
|
|
|
|
execution speed of expressions and statements.
|
|
|
|
|
|
2003-03-01 20:19:49 -04:00
|
|
|
|
- sets.Set objects now support mixed-type __eq__ and __ne__, instead
|
|
|
|
|
of raising TypeError. If x is a Set object and y is a non-Set object,
|
|
|
|
|
x == y is False, and x != y is True. This is akin to the change made
|
|
|
|
|
for mixed-type comparisons of datetime objects in 2.3a2; more info
|
|
|
|
|
about the rationale is in the NEWS entry for that. See also SF bug
|
|
|
|
|
report <http://www.python.org/sf/693121>.
|
|
|
|
|
|
2003-03-03 13:32:15 -04:00
|
|
|
|
- On Unix platforms, if os.listdir() is called with a Unicode argument,
|
|
|
|
|
it now returns Unicode strings. (This behavior was added earlier
|
|
|
|
|
to the Windows NT/2k/XP version of os.listdir().)
|
2003-02-19 21:56:17 -04:00
|
|
|
|
|
2003-02-28 18:09:33 -04:00
|
|
|
|
- Distutils: both 'py_modules' and 'packages' keywords can now be specified
|
|
|
|
|
in core.setup(). Previously you could supply one or the other, but
|
|
|
|
|
not both of them. (SF patch #695090 from Bernhard Herzog)
|
|
|
|
|
|
2003-03-20 19:36:55 -04:00
|
|
|
|
- New csv package makes it easy to read/write CSV files.
|
|
|
|
|
|
2003-04-17 18:31:33 -03:00
|
|
|
|
- Module shlex has been extended to allow posix-like shell parsings,
|
|
|
|
|
including a split() function for easy spliting of quoted strings and
|
|
|
|
|
commands. An iterator interface was also implemented.
|
|
|
|
|
|
2003-02-19 21:56:17 -04:00
|
|
|
|
Tools/Demos
|
|
|
|
|
-----------
|
|
|
|
|
|
2003-04-17 21:45:59 -03:00
|
|
|
|
- New script combinerefs.py helps analyze new PYTHONDUMPREFS output.
|
|
|
|
|
See the module docstring for details.
|
|
|
|
|
|
2003-02-19 21:56:17 -04:00
|
|
|
|
Build
|
|
|
|
|
-----
|
|
|
|
|
|
2003-02-23 19:45:35 -04:00
|
|
|
|
- Fix problem building on OSF1 because the compiler only accepted
|
|
|
|
|
preprocessor directives that start in column 1. (SF bug #691793.)
|
2003-02-19 21:56:17 -04:00
|
|
|
|
|
|
|
|
|
C API
|
|
|
|
|
-----
|
|
|
|
|
|
2003-04-17 14:29:22 -03:00
|
|
|
|
- Added PyGC_Collect(), equivalent to calling gc.collect().
|
|
|
|
|
|
2003-04-15 12:12:39 -03:00
|
|
|
|
- PyThreadState_GetDict() was changed not to raise an exception or
|
|
|
|
|
issue a fatal error when no current thread state is available. This
|
|
|
|
|
makes it possible to print dictionaries when no thread is active.
|
|
|
|
|
|
2003-04-17 14:29:22 -03:00
|
|
|
|
- LONG_LONG was renamed to PY_LONG_LONG. Extensions that use this and
|
|
|
|
|
need compatibility with previous versions can use this:
|
2003-04-25 21:21:31 -03:00
|
|
|
|
|
2003-04-17 14:29:22 -03:00
|
|
|
|
#ifndef PY_LONG_LONG
|
|
|
|
|
#define PY_LONG_LONG LONG_LONG
|
|
|
|
|
#endif
|
2003-03-29 06:06:18 -04:00
|
|
|
|
|
2003-03-17 15:46:11 -04:00
|
|
|
|
- Added PyObject_SelfIter() to fill the tp_iter slot for the
|
2003-03-17 04:24:35 -04:00
|
|
|
|
typical case where the method returns its self argument.
|
|
|
|
|
|
2003-03-07 11:13:17 -04:00
|
|
|
|
- The extended type structure used for heap types (new-style
|
|
|
|
|
classes defined by Python code using a class statement) is now
|
|
|
|
|
exported from object.h as PyHeapTypeObject. (SF patch #696193.)
|
2003-02-19 21:56:17 -04:00
|
|
|
|
|
|
|
|
|
New platforms
|
|
|
|
|
-------------
|
|
|
|
|
|
2003-04-25 21:21:31 -03:00
|
|
|
|
None this time.
|
2003-02-19 21:56:17 -04:00
|
|
|
|
|
|
|
|
|
Tests
|
|
|
|
|
-----
|
|
|
|
|
|
2003-02-28 15:57:03 -04:00
|
|
|
|
- test_timeout now requires -u network to be passed to regrtest to run.
|
|
|
|
|
See SF bug #692988.
|
2003-02-19 21:56:17 -04:00
|
|
|
|
|
|
|
|
|
Windows
|
|
|
|
|
-------
|
|
|
|
|
|
2003-04-22 23:39:17 -03:00
|
|
|
|
- os.fsync() now exists on Windows, and calls the Microsoft _commit()
|
|
|
|
|
function.
|
|
|
|
|
|
2003-04-09 16:39:06 -03:00
|
|
|
|
- New function winsound.MessageBeep() wraps the Win32 API
|
|
|
|
|
MessageBeep().
|
2003-02-19 21:56:17 -04:00
|
|
|
|
|
|
|
|
|
Mac
|
|
|
|
|
---
|
|
|
|
|
|
2003-03-03 13:32:15 -04:00
|
|
|
|
- os.listdir() now returns Unicode strings on MacOS X when called with
|
|
|
|
|
a Unicode argument. See the general news item under "Library".
|
2003-02-25 17:42:15 -04:00
|
|
|
|
|
2003-02-24 07:04:17 -04:00
|
|
|
|
- A new method MacOS.WMAvailable() returns true if it is safe to access
|
|
|
|
|
the window manager, false otherwise.
|
2003-03-01 20:19:49 -04:00
|
|
|
|
|
2003-03-24 08:13:54 -04:00
|
|
|
|
- EasyDialogs dialogs are now movable-modal, and if the application is
|
|
|
|
|
currently in the background they will ask to be moved to the foreground
|
|
|
|
|
before displaying.
|
Reworked has_finalizer() to use the new _PyObject_Lookup() instead
of PyObject_HasAttr(); the former promises never to execute
arbitrary Python code. Undid many of the changes recently made to
worm around the worst consequences of that PyObject_HasAttr() could
execute arbitrary Python code.
Compatibility is hard to discuss, because the dangerous cases are
so perverse, and much of this appears to rely on implementation
accidents.
To start with, using hasattr() to check for __del__ wasn't only
dangerous, in some cases it was wrong: if an instance of an old-
style class didn't have "__del__" in its instance dict or in any
base class dict, but a getattr hook said __del__ existed, then
hasattr() said "yes, this object has a __del__". But
instance_dealloc() ignores the possibility of getattr hooks when
looking for a __del__, so while object.__del__ succeeds, no
__del__ method is called when the object is deleted. gc was
therefore incorrect in believing that the object had a finalizer.
The new method doesn't suffer that problem (like instance_dealloc(),
_PyObject_Lookup() doesn't believe __del__ exists in that case), but
does suffer a somewhat opposite-- and even more obscure --oddity:
if an instance of an old-style class doesn't have "__del__" in its
instance dict, and a base class does have "__del__" in its dict,
and the first base class with a "__del__" associates it with a
descriptor (an object with a __get__ method), *and* if that
descriptor raises an exception when __get__ is called, then
(a) the current method believes the instance does have a __del__,
but (b) hasattr() does not believe the instance has a __del__.
While these disagree, I believe the new method is "more correct":
because the descriptor *will* be called when the object is
destructed, it can execute arbitrary Python code at the time the
object is destructed, and that's really what gc means by "has a
finalizer": not specifically a __del__ method, but more generally
the possibility of executing arbitrary Python code at object
destruction time. Code in a descriptor's __get__() executed at
destruction time can be just as problematic as code in a
__del__() executed then.
So I believe the new method is better on all counts.
Bugfix candidate, but it's unclear to me how all this differs in
the 2.2 branch (e.g., new-style and old-style classes already
took different gc paths in 2.3 before this last round of patches,
but don't in the 2.2 branch).
2003-04-07 16:21:15 -03:00
|
|
|
|
|
2003-04-01 18:33:37 -04:00
|
|
|
|
- OSA Scripting support has improved a lot, and gensuitemodule.py can now
|
2003-04-11 12:37:20 -03:00
|
|
|
|
be used by mere mortals. The documentation is now also more or less
|
|
|
|
|
complete.
|
Reworked has_finalizer() to use the new _PyObject_Lookup() instead
of PyObject_HasAttr(); the former promises never to execute
arbitrary Python code. Undid many of the changes recently made to
worm around the worst consequences of that PyObject_HasAttr() could
execute arbitrary Python code.
Compatibility is hard to discuss, because the dangerous cases are
so perverse, and much of this appears to rely on implementation
accidents.
To start with, using hasattr() to check for __del__ wasn't only
dangerous, in some cases it was wrong: if an instance of an old-
style class didn't have "__del__" in its instance dict or in any
base class dict, but a getattr hook said __del__ existed, then
hasattr() said "yes, this object has a __del__". But
instance_dealloc() ignores the possibility of getattr hooks when
looking for a __del__, so while object.__del__ succeeds, no
__del__ method is called when the object is deleted. gc was
therefore incorrect in believing that the object had a finalizer.
The new method doesn't suffer that problem (like instance_dealloc(),
_PyObject_Lookup() doesn't believe __del__ exists in that case), but
does suffer a somewhat opposite-- and even more obscure --oddity:
if an instance of an old-style class doesn't have "__del__" in its
instance dict, and a base class does have "__del__" in its dict,
and the first base class with a "__del__" associates it with a
descriptor (an object with a __get__ method), *and* if that
descriptor raises an exception when __get__ is called, then
(a) the current method believes the instance does have a __del__,
but (b) hasattr() does not believe the instance has a __del__.
While these disagree, I believe the new method is "more correct":
because the descriptor *will* be called when the object is
destructed, it can execute arbitrary Python code at the time the
object is destructed, and that's really what gc means by "has a
finalizer": not specifically a __del__ method, but more generally
the possibility of executing arbitrary Python code at object
destruction time. Code in a descriptor's __get__() executed at
destruction time can be just as problematic as code in a
__del__() executed then.
So I believe the new method is better on all counts.
Bugfix candidate, but it's unclear to me how all this differs in
the 2.2 branch (e.g., new-style and old-style classes already
took different gc paths in 2.3 before this last round of patches,
but don't in the 2.2 branch).
2003-04-07 16:21:15 -03:00
|
|
|
|
|
2003-04-01 18:33:37 -04:00
|
|
|
|
- The IDE (in a framework build) now includes introductory documentation
|
|
|
|
|
in Apple Help Viewer format.
|
2003-02-19 21:56:17 -04:00
|
|
|
|
|
|
|
|
|
|
2003-01-01 05:51:12 -04:00
|
|
|
|
What's New in Python 2.3 alpha 2?
|
|
|
|
|
=================================
|
|
|
|
|
|
2003-02-19 14:18:47 -04:00
|
|
|
|
*Release date: 19-Feb-2003*
|
2003-01-01 05:51:12 -04:00
|
|
|
|
|
|
|
|
|
Core and builtins
|
2003-02-12 17:46:11 -04:00
|
|
|
|
-----------------
|
2003-01-01 05:51:12 -04:00
|
|
|
|
|
2003-02-19 12:34:11 -04:00
|
|
|
|
- Negative positions returned from PEP 293 error callbacks are now
|
|
|
|
|
treated as being relative to the end of the input string. Positions
|
|
|
|
|
that are out of bounds raise an IndexError.
|
|
|
|
|
|
2003-02-19 11:25:10 -04:00
|
|
|
|
- sys.path[0] (the directory from which the script is loaded) is now
|
|
|
|
|
turned into an absolute pathname, unless it is the empty string.
|
|
|
|
|
(SF patch #664376.)
|
|
|
|
|
|
2003-02-13 18:07:59 -04:00
|
|
|
|
- Finally fixed the bug in compile() and exec where a string ending
|
|
|
|
|
with an indented code block but no newline would raise SyntaxError.
|
|
|
|
|
This would have been a four-line change in parsetok.c... Except
|
|
|
|
|
codeop.py depends on this behavior, so a compilation flag had to be
|
|
|
|
|
invented that causes the tokenizer to revert to the old behavior;
|
|
|
|
|
this required extra changes to 2 .h files, 2 .c files, and 2 .py
|
2003-02-13 18:19:20 -04:00
|
|
|
|
files. (Fixes SF bug #501622.)
|
2003-02-13 18:07:59 -04:00
|
|
|
|
|
2003-02-13 12:30:16 -04:00
|
|
|
|
- If a new-style class defines neither __new__ nor __init__, its
|
|
|
|
|
constructor would ignore all arguments. This is changed now: the
|
|
|
|
|
constructor refuses arguments in this case. This might break code
|
|
|
|
|
that worked under Python 2.2. The simplest fix is to add a no-op
|
2003-02-19 19:31:51 -04:00
|
|
|
|
__init__: ``def __init__(self, *args, **kw): pass``.
|
2003-02-13 12:30:16 -04:00
|
|
|
|
|
2003-02-12 13:05:26 -04:00
|
|
|
|
- Through a bytecode optimizer bug (and I bet you didn't even know
|
|
|
|
|
Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants
|
|
|
|
|
with a leading minus sign would come out with the wrong sign.
|
|
|
|
|
("Unsigned" hex/oct constants are those with a face value in the
|
|
|
|
|
range sys.maxint+1 through sys.maxint*2+1, inclusive; these have
|
|
|
|
|
always been interpreted as negative numbers through sign folding.)
|
|
|
|
|
E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would
|
|
|
|
|
come out as -4294967295. This was the case in Python 2.2 through
|
|
|
|
|
2.2.2 and 2.3a1, and in Python 2.4 it will once again have that
|
|
|
|
|
value, but according to PEP 237 it really needs to be 1 now. This
|
|
|
|
|
will be backported to Python 2.2.3 a well. (SF #660455)
|
|
|
|
|
|
2003-02-12 16:48:22 -04:00
|
|
|
|
- int(s, base) sometimes sign-folds hex and oct constants; it only
|
|
|
|
|
does this when base is 0 and s.strip() starts with a '0'. When the
|
|
|
|
|
sign is actually folded, as in int("0xffffffff", 0) on a 32-bit
|
|
|
|
|
machine, which returns -1, a FutureWarning is now issued; in Python
|
|
|
|
|
2.4, this will return 4294967295L, as do int("+0xffffffff", 0) and
|
|
|
|
|
int("0xffffffff", 16) right now. (PEP 347)
|
|
|
|
|
|
2003-02-11 23:58:38 -04:00
|
|
|
|
- super(X, x): x may now be a proxy for an X instance, i.e.
|
|
|
|
|
issubclass(x.__class__, X) but not issubclass(type(x), X).
|
|
|
|
|
|
2003-02-11 23:32:58 -04:00
|
|
|
|
- isinstance(x, X): if X is a new-style class, this is now equivalent
|
|
|
|
|
to issubclass(type(x), X) or issubclass(x.__class__, X). Previously
|
|
|
|
|
only type(x) was tested. (For classic classes this was already the
|
|
|
|
|
case.)
|
|
|
|
|
|
2003-02-10 05:57:08 -04:00
|
|
|
|
- compile(), eval() and the exec statement now fully support source code
|
|
|
|
|
passed as unicode strings.
|
|
|
|
|
|
2003-02-09 22:12:43 -04:00
|
|
|
|
- int subclasses can be initialized with longs if the value fits in an int.
|
|
|
|
|
See SF bug #683467.
|
|
|
|
|
|
2003-02-02 03:51:32 -04:00
|
|
|
|
- long(string, base) takes time linear in len(string) when base is a power
|
|
|
|
|
of 2 now. It used to take time quadratic in len(string).
|
|
|
|
|
|
2003-01-25 18:46:11 -04:00
|
|
|
|
- filter returns now Unicode results for Unicode arguments.
|
|
|
|
|
|
2003-01-03 15:16:14 -04:00
|
|
|
|
- raw_input can now return Unicode objects.
|
|
|
|
|
|
2003-01-02 16:51:08 -04:00
|
|
|
|
- List objects' sort() method now accepts None as the comparison function.
|
|
|
|
|
Passing None is semantically identical to calling sort() with no
|
|
|
|
|
arguments.
|
|
|
|
|
|
2003-01-13 16:13:12 -04:00
|
|
|
|
- Fixed crash when printing a subclass of str and __str__ returned self.
|
|
|
|
|
See SF bug #667147.
|
|
|
|
|
|
2003-01-28 15:21:24 -04:00
|
|
|
|
- Fixed an invalid RuntimeWarning and an undetected error when trying
|
2003-01-31 18:27:17 -04:00
|
|
|
|
to convert a long integer into a float which couldn't fit.
|
2003-01-28 15:21:24 -04:00
|
|
|
|
See SF bug #676155.
|
|
|
|
|
|
2003-02-06 12:16:50 -04:00
|
|
|
|
- Function objects now have a __module__ attribute that is bound to
|
2003-02-06 12:00:15 -04:00
|
|
|
|
the name of the module in which the function was defined. This
|
2003-02-06 12:16:50 -04:00
|
|
|
|
applies for C functions and methods as well as functions and methods
|
|
|
|
|
defined in Python. This attribute is used by pickle.whichmodule(),
|
|
|
|
|
which changes the behavior of whichmodule slightly. In Python 2.2
|
|
|
|
|
whichmodule() returns "__main__" for functions that are not defined
|
|
|
|
|
at the top-level of a module (examples: methods, nested functions).
|
|
|
|
|
Now whichmodule() will return the proper module name.
|
2003-02-06 12:00:15 -04:00
|
|
|
|
|
2003-01-01 05:51:12 -04:00
|
|
|
|
Extension modules
|
|
|
|
|
-----------------
|
|
|
|
|
|
2003-02-18 12:36:28 -04:00
|
|
|
|
- operator.isNumberType() now checks that the object has a nb_int or
|
|
|
|
|
nb_float slot, rather than simply checking whether it has a non-NULL
|
|
|
|
|
tp_as_number pointer.
|
|
|
|
|
|
2003-02-12 17:46:11 -04:00
|
|
|
|
- The imp module now has ways to acquire and release the "import
|
|
|
|
|
lock": imp.acquire_lock() and imp.release_lock(). Note: this is a
|
|
|
|
|
reentrant lock, so releasing the lock only truly releases it when
|
|
|
|
|
this is the last release_lock() call. You can check with
|
|
|
|
|
imp.lock_held(). (SF bug #580952 and patch #683257.)
|
|
|
|
|
|
2003-02-19 21:38:31 -04:00
|
|
|
|
- Change to cPickle to match pickle.py (see below and PEP 307).
|
|
|
|
|
|
2003-02-09 21:54:06 -04:00
|
|
|
|
- Fix some bugs in the parser module. SF bug #678518.
|
|
|
|
|
|
2003-02-03 16:45:52 -04:00
|
|
|
|
- Thanks to Scott David Daniels, a subtle bug in how the zlib
|
2003-02-03 16:53:14 -04:00
|
|
|
|
extension implemented flush() was fixed. Scott also rewrote the
|
2003-02-03 16:45:52 -04:00
|
|
|
|
zlib test suite using the unittest module. (SF bug #640230 and
|
|
|
|
|
patch #678531.)
|
|
|
|
|
|
2003-01-31 20:10:11 -04:00
|
|
|
|
- Added an itertools module containing high speed, memory efficient
|
|
|
|
|
looping constructs inspired by tools from Haskell and SML.
|
|
|
|
|
|
2003-01-27 18:22:50 -04:00
|
|
|
|
- The SSL module now handles sockets with a timeout set correctly (SF
|
|
|
|
|
patch #675750, fixing SF bug #675552).
|
|
|
|
|
|
2003-01-07 16:55:26 -04:00
|
|
|
|
- os/posixmodule has grown the sysexits.h constants (EX_OK and friends).
|
|
|
|
|
|
2003-01-07 16:34:19 -04:00
|
|
|
|
- Fixed broken threadstate swap in readline that could cause fatal
|
|
|
|
|
errors when a readline hook was being invoked while a background
|
|
|
|
|
thread was active. (SF bugs #660476 and #513033.)
|
|
|
|
|
|
2003-01-01 05:51:12 -04:00
|
|
|
|
- fcntl now exposes the strops.h I_* constants.
|
|
|
|
|
|
2003-01-24 11:31:31 -04:00
|
|
|
|
- Fix a crash on Solaris that occurred when calling close() on
|
|
|
|
|
an mmap'ed file which was already closed. (SF patch #665913)
|
|
|
|
|
|
2003-03-11 17:43:55 -04:00
|
|
|
|
- Fixed several serious bugs in the zipimport implementation.
|
2003-02-19 21:38:31 -04:00
|
|
|
|
|
2003-01-02 15:10:19 -04:00
|
|
|
|
- datetime changes:
|
|
|
|
|
|
2003-04-14 19:01:58 -03:00
|
|
|
|
The date class is now properly subclassable. (SF bug #720908)
|
|
|
|
|
|
2003-01-08 16:40:01 -04:00
|
|
|
|
The datetime and datetimetz classes have been collapsed into a single
|
|
|
|
|
datetime class, and likewise the time and timetz classes into a single
|
|
|
|
|
time class. Previously, a datetimetz object with tzinfo=None acted
|
|
|
|
|
exactly like a datetime object, and similarly for timetz. This wasn't
|
|
|
|
|
enough of a difference to justify distinct classes, and life is simpler
|
|
|
|
|
now.
|
|
|
|
|
|
2003-01-02 15:10:19 -04:00
|
|
|
|
today() and now() now round system timestamps to the closest
|
2003-01-04 02:03:15 -04:00
|
|
|
|
microsecond <http://www.python.org/sf/661086>. This repairs an
|
|
|
|
|
irritation most likely seen on Windows systems.
|
2003-01-02 15:10:19 -04:00
|
|
|
|
|
2003-01-22 00:45:50 -04:00
|
|
|
|
In dt.astimezone(tz), if tz.utcoffset(dt) returns a duration,
|
2003-01-02 17:28:08 -04:00
|
|
|
|
ValueError is raised if tz.dst(dt) returns None (2.3a1 treated it
|
2003-01-04 02:03:15 -04:00
|
|
|
|
as 0 instead, but a tzinfo subclass wishing to participate in
|
|
|
|
|
time zone conversion has to take a stand on whether it supports
|
|
|
|
|
DST; if you don't care about DST, then code dst() to return 0 minutes,
|
|
|
|
|
meaning that DST is never in effect).
|
2003-01-02 17:28:08 -04:00
|
|
|
|
|
2003-01-03 18:35:24 -04:00
|
|
|
|
The tzinfo methods utcoffset() and dst() must return a timedelta object
|
|
|
|
|
(or None) now. In 2.3a1 they could also return an int or long, but that
|
|
|
|
|
was an unhelpfully redundant leftover from an earlier version wherein
|
2003-01-02 17:28:08 -04:00
|
|
|
|
they couldn't return a timedelta. TOOWTDI.
|
|
|
|
|
|
2003-01-03 18:35:24 -04:00
|
|
|
|
The example tzinfo class for local time had a bug. It was replaced
|
|
|
|
|
by a later example coded by Guido.
|
|
|
|
|
|
2003-01-22 00:45:50 -04:00
|
|
|
|
datetime.astimezone(tz) no longer raises an exception when the
|
2003-01-04 02:03:15 -04:00
|
|
|
|
input datetime has no UTC equivalent in tz. For typical "hybrid" time
|
|
|
|
|
zones (a single tzinfo subclass modeling both standard and daylight
|
|
|
|
|
time), this case can arise one hour per year, at the hour daylight time
|
2003-01-22 00:45:50 -04:00
|
|
|
|
ends. See new docs for details. In short, the new behavior mimics
|
|
|
|
|
the local wall clock's behavior of repeating an hour in local time.
|
|
|
|
|
|
|
|
|
|
dt.astimezone() can no longer be used to convert between naive and aware
|
|
|
|
|
datetime objects. If you merely want to attach, or remove, a tzinfo
|
|
|
|
|
object, without any conversion of date and time members, use
|
|
|
|
|
dt.replace(tzinfo=whatever) instead, where "whatever" is None or a
|
|
|
|
|
tzinfo subclass instance.
|
|
|
|
|
|
|
|
|
|
A new method tzinfo.fromutc(dt) can be overridden in tzinfo subclasses
|
|
|
|
|
to give complete control over how a UTC time is to be converted to
|
|
|
|
|
a local time. The default astimezone() implementation calls fromutc()
|
|
|
|
|
as its last step, so a tzinfo subclass can affect that too by overriding
|
|
|
|
|
fromutc(). It's expected that the default fromutc() implementation will
|
|
|
|
|
be suitable as-is for "almost all" time zone subclasses, but the
|
|
|
|
|
creativity of political time zone fiddling appears unbounded -- fromutc()
|
|
|
|
|
allows the highly motivated to emulate any scheme expressible in Python.
|
2003-01-04 02:03:15 -04:00
|
|
|
|
|
2003-01-23 15:58:02 -04:00
|
|
|
|
datetime.now(): The optional tzinfo argument was undocumented (that's
|
|
|
|
|
repaired), and its name was changed to tz ("tzinfo" is overloaded enough
|
|
|
|
|
already). With a tz argument, now(tz) used to return the local date
|
|
|
|
|
and time, and attach tz to it, without any conversion of date and time
|
|
|
|
|
members. This was less than useful. Now now(tz) returns the current
|
2003-02-19 19:31:51 -04:00
|
|
|
|
date and time as local time in tz's time zone, akin to ::
|
|
|
|
|
|
2003-01-23 15:58:02 -04:00
|
|
|
|
tz.fromutc(datetime.utcnow().replace(tzinfo=utc))
|
2003-02-19 19:31:51 -04:00
|
|
|
|
|
2003-01-23 15:58:02 -04:00
|
|
|
|
where "utc" is an instance of a tzinfo subclass modeling UTC. Without
|
|
|
|
|
a tz argument, now() continues to return the current local date and time,
|
|
|
|
|
as a naive datetime object.
|
|
|
|
|
|
2003-01-23 16:53:10 -04:00
|
|
|
|
datetime.fromtimestamp(): Like datetime.now() above, this had less than
|
|
|
|
|
useful behavior when the optional tinzo argument was specified. See
|
|
|
|
|
also SF bug report <http://www.python.org/sf/660872>.
|
|
|
|
|
|
date and datetime comparison: when we don't know how to
compare against "the other" argument, we raise TypeError,
in order to prevent comparison from falling back to the
default (and worse than useless, in this case) comparison
by object address.
That's fine so far as it goes, but leaves no way for
another date/datetime object to make itself comparable
to our objects. For example, it leaves Marc-Andre no way
to teach mxDateTime dates how to compare against Python
dates.
Discussion on Python-Dev raised a number of impractical
ideas, and the simple one implemented here: when we don't
know how to compare against "the other" argument, we raise
TypeError *unless* the other object has a timetuple attr.
In that case, we return NotImplemented instead, and Python
will give the other object a shot at handling the
comparison then.
Note that comparisons of time and timedelta objects still
suffer the original problem, though.
2003-01-24 18:36:34 -04:00
|
|
|
|
date and datetime comparison: In order to prevent comparison from
|
|
|
|
|
falling back to the default compare-object-addresses strategy, these
|
|
|
|
|
raised TypeError whenever they didn't understand the other object type.
|
|
|
|
|
They still do, except when the other object has a "timetuple" attribute,
|
|
|
|
|
in which case they return NotImplemented now. This gives other
|
|
|
|
|
datetime objects (e.g., mxDateTime) a chance to intercept the
|
|
|
|
|
comparison.
|
|
|
|
|
|
2003-02-07 18:50:28 -04:00
|
|
|
|
date, time, datetime and timedelta comparison: When the exception
|
|
|
|
|
for mixed-type comparisons in the last paragraph doesn't apply, if
|
|
|
|
|
the comparison is == then False is returned, and if the comparison is
|
|
|
|
|
!= then True is returned. Because dict lookup and the "in" operator
|
2003-02-19 19:31:51 -04:00
|
|
|
|
only invoke __eq__, this allows, for example, ::
|
2003-02-07 18:50:28 -04:00
|
|
|
|
|
|
|
|
|
if some_datetime in some_sequence:
|
2003-02-19 19:31:51 -04:00
|
|
|
|
|
|
|
|
|
and ::
|
|
|
|
|
|
2003-02-07 18:50:28 -04:00
|
|
|
|
some_dict[some_timedelta] = whatever
|
|
|
|
|
|
|
|
|
|
to work as expected, without raising TypeError just because the
|
|
|
|
|
sequence is heterogeneous, or the dict has mixed-type keys. [This
|
|
|
|
|
seems like a good idea to implement for all mixed-type comparisons
|
|
|
|
|
that don't want to allow falling back to address comparison.]
|
|
|
|
|
|
2003-01-04 14:17:36 -04:00
|
|
|
|
The constructors building a datetime from a timestamp could raise
|
|
|
|
|
ValueError if the platform C localtime()/gmtime() inserted "leap
|
|
|
|
|
seconds". Leap seconds are ignored now. On such platforms, it's
|
|
|
|
|
possible to have timestamps that differ by a second, yet where
|
|
|
|
|
datetimes constructed from them are equal.
|
|
|
|
|
|
2003-01-31 18:27:17 -04:00
|
|
|
|
The pickle format of date, time and datetime objects has changed
|
|
|
|
|
completely. The undocumented pickler and unpickler functions no
|
2003-01-31 22:54:15 -04:00
|
|
|
|
longer exist. The undocumented __setstate__() and __getstate__()
|
|
|
|
|
methods no longer exist either.
|
2003-01-31 18:27:17 -04:00
|
|
|
|
|
2003-01-01 05:51:12 -04:00
|
|
|
|
Library
|
|
|
|
|
-------
|
|
|
|
|
|
2003-02-19 21:38:31 -04:00
|
|
|
|
- The logging module was updated slightly; the WARN level was renamed
|
|
|
|
|
to WARNING, and the matching function/method warn() to warning().
|
|
|
|
|
|
|
|
|
|
- The pickle and cPickle modules were updated with a new pickling
|
|
|
|
|
protocol (documented by pickletools.py, see below) and several
|
|
|
|
|
extensions to the pickle customization API (__reduce__, __setstate__
|
|
|
|
|
etc.). The copy module now uses more of the pickle customization
|
|
|
|
|
API to copy objects that don't implement __copy__ or __deepcopy__.
|
|
|
|
|
See PEP 307 for details.
|
|
|
|
|
|
|
|
|
|
- The distutils "register" command now uses http://www.python.org/pypi
|
|
|
|
|
as the default repository. (See PEP 301.)
|
|
|
|
|
|
2003-02-17 05:20:23 -04:00
|
|
|
|
- the platform dependent path related variables sep, altsep, extsep,
|
|
|
|
|
pathsep, curdir, pardir and defpath are now defined in the platform
|
2003-02-17 08:26:23 -04:00
|
|
|
|
dependent path modules (e.g. ntpath.py) rather than os.py, so these
|
2003-03-01 20:19:49 -04:00
|
|
|
|
variables are now available via os.path. They continue to be
|
|
|
|
|
available from the os module.
|
2003-02-17 08:26:23 -04:00
|
|
|
|
(see <http://www.python.org/sf/680789>).
|
2003-02-17 05:20:23 -04:00
|
|
|
|
|
2003-02-05 14:29:34 -04:00
|
|
|
|
- array.array was added to the types repr.py knows about (see
|
|
|
|
|
<http://www.python.org/sf/680789>).
|
|
|
|
|
|
2003-01-27 14:51:48 -04:00
|
|
|
|
- The new pickletools.py contains lots of documentation about pickle
|
|
|
|
|
internals, and supplies some helpers for working with pickles, such as
|
|
|
|
|
a symbolic pickle disassembler.
|
|
|
|
|
|
2003-01-22 14:17:25 -04:00
|
|
|
|
- Xmlrpclib.py now supports the builtin boolean type.
|
|
|
|
|
|
2003-01-15 07:51:06 -04:00
|
|
|
|
- py_compile has a new 'doraise' flag and a new PyCompileError
|
|
|
|
|
exception.
|
|
|
|
|
|
2003-01-15 07:37:23 -04:00
|
|
|
|
- SimpleXMLRPCServer now supports CGI through the CGIXMLRPCRequestHandler
|
|
|
|
|
class.
|
|
|
|
|
|
2003-01-14 12:45:04 -04:00
|
|
|
|
- The sets module now raises TypeError in __cmp__, to clarify that
|
|
|
|
|
sets are not intended to be three-way-compared; the comparison
|
|
|
|
|
operators are overloaded as subset/superset tests.
|
|
|
|
|
|
2003-01-07 19:03:05 -04:00
|
|
|
|
- Bastion.py and rexec.py are disabled. These modules are not safe in
|
|
|
|
|
Python 2.2. or 2.3.
|
|
|
|
|
|
2003-02-19 19:31:51 -04:00
|
|
|
|
- realpath is now exported when doing ``from poxixpath import *``.
|
2003-01-03 14:12:28 -04:00
|
|
|
|
It is also exported for ntpath, macpath, and os2emxpath.
|
|
|
|
|
See SF bug #659228.
|
|
|
|
|
|
2003-01-05 19:19:43 -04:00
|
|
|
|
- New module tarfile from Lars Gust<73>bel provides a comprehensive interface
|
|
|
|
|
to tar archive files with transparent gzip and bzip2 compression.
|
|
|
|
|
See SF patch #651082.
|
|
|
|
|
|
2003-01-06 02:51:36 -04:00
|
|
|
|
- urlparse can now parse imap:// URLs. See SF feature request #618024.
|
2003-01-02 23:30:21 -04:00
|
|
|
|
|
2003-01-10 19:24:32 -04:00
|
|
|
|
- Tkinter.Canvas.scan_dragto() provides an optional parameter to support
|
|
|
|
|
the gain value which is passed to Tk. SF bug# 602259.
|
|
|
|
|
|
2003-01-25 22:45:47 -04:00
|
|
|
|
- Fix logging.handlers.SysLogHandler protocol when using UNIX domain sockets.
|
2003-01-27 14:51:48 -04:00
|
|
|
|
See SF patch #642974.
|
2003-01-25 22:45:47 -04:00
|
|
|
|
|
2003-02-25 13:46:20 -04:00
|
|
|
|
- The dospath module was deleted. Use the ntpath module when manipulating
|
|
|
|
|
DOS paths from other platforms.
|
|
|
|
|
|
2003-01-01 05:51:12 -04:00
|
|
|
|
Tools/Demos
|
|
|
|
|
-----------
|
|
|
|
|
|
2003-02-03 11:17:25 -04:00
|
|
|
|
- Two new scripts (db2pickle.py and pickle2db.py) were added to the
|
|
|
|
|
Tools/scripts directory to facilitate conversion from the old bsddb module
|
|
|
|
|
to the new one. While the user-visible API of the new module is
|
|
|
|
|
compatible with the old one, it's likely that the version of the
|
|
|
|
|
underlying database library has changed. To convert from the old library,
|
|
|
|
|
run the db2pickle.py script using the old version of Python to convert it
|
|
|
|
|
to a pickle file. After upgrading Python, run the pickle2db.py script
|
|
|
|
|
using the new version of Python to reconstitute your database. For
|
|
|
|
|
example:
|
|
|
|
|
|
2003-02-03 11:48:10 -04:00
|
|
|
|
% python2.2 db2pickle.py -h some.db > some.pickle
|
|
|
|
|
% python2.3 pickle2db.py -h some.db.new < some.pickle
|
2003-02-03 11:17:25 -04:00
|
|
|
|
|
|
|
|
|
Run the scripts without any args to get a usage message.
|
|
|
|
|
|
2003-01-02 23:30:21 -04:00
|
|
|
|
|
2003-01-01 05:51:12 -04:00
|
|
|
|
Build
|
|
|
|
|
-----
|
|
|
|
|
|
2003-02-14 15:29:22 -04:00
|
|
|
|
- The audio driver tests (test_ossaudiodev.py and
|
|
|
|
|
test_linuxaudiodev.py) are no longer run by default. This is
|
|
|
|
|
because they don't always work, depending on your hardware and
|
2003-02-19 19:31:51 -04:00
|
|
|
|
software. To run these tests, you must use an invocation like ::
|
|
|
|
|
|
2003-02-14 15:29:22 -04:00
|
|
|
|
./python Lib/test/regrtest.py -u audio test_ossaudiodev
|
|
|
|
|
|
2003-01-01 16:07:49 -04:00
|
|
|
|
- On systems which build using the configure script, compiler flags which
|
|
|
|
|
used to be lumped together using the OPT flag have been split into two
|
|
|
|
|
groups, OPT and BASECFLAGS. OPT is meant to carry just optimization- and
|
|
|
|
|
debug-related flags like "-g" and "-O3". BASECFLAGS is meant to carry
|
|
|
|
|
compiler flags that are required to get a clean compile. On some
|
|
|
|
|
platforms (many Linux flavors in particular) BASECFLAGS will be empty by
|
|
|
|
|
default. On others, such as Mac OS X and SCO, it will contain required
|
|
|
|
|
flags. This change allows people building Python to override OPT without
|
|
|
|
|
fear of clobbering compiler flags which are required to get a clean build.
|
|
|
|
|
|
|
|
|
|
- On Darwin/Mac OS X platforms, /sw/lib and /sw/include are added to the
|
|
|
|
|
relevant search lists in setup.py. This allows users building Python to
|
|
|
|
|
take advantage of the many packages available from the fink project
|
|
|
|
|
<http://fink.sf.net/>.
|
|
|
|
|
|
|
|
|
|
- A new Makefile target, scriptsinstall, installs a number of useful scripts
|
|
|
|
|
from the Tools/scripts directory.
|
|
|
|
|
|
2003-01-01 05:51:12 -04:00
|
|
|
|
C API
|
|
|
|
|
-----
|
|
|
|
|
|
2003-02-19 19:31:51 -04:00
|
|
|
|
- PyEval_GetFrame() is now declared to return a ``PyFrameObject *``
|
|
|
|
|
instead of a plain ``PyObject *``. (SF patch #686601.)
|
2003-02-19 11:53:17 -04:00
|
|
|
|
|
2003-02-18 12:36:28 -04:00
|
|
|
|
- PyNumber_Check() now checks that the object has a nb_int or nb_float
|
|
|
|
|
slot, rather than simply checking whether it has a non-NULL
|
|
|
|
|
tp_as_number pointer.
|
|
|
|
|
|
2003-02-11 16:39:59 -04:00
|
|
|
|
- A C type that inherits from a base type that defines tp_as_buffer
|
|
|
|
|
will now inherit the tp_as_buffer pointer if it doesn't define one.
|
|
|
|
|
(SF #681367)
|
|
|
|
|
|
2003-02-04 16:59:40 -04:00
|
|
|
|
- The PyArg_Parse functions now issue a DeprecationWarning if a float
|
|
|
|
|
argument is provided when an integer is specified (this affects the 'b',
|
|
|
|
|
'B', 'h', 'H', 'i', and 'l' codes). Future versions of Python will
|
|
|
|
|
raise a TypeError.
|
2003-01-24 18:15:53 -04:00
|
|
|
|
|
2003-01-01 05:51:12 -04:00
|
|
|
|
Tests
|
|
|
|
|
-----
|
|
|
|
|
|
2003-03-26 12:03:16 -04:00
|
|
|
|
- Several tests weren't being run from regrtest.py (test_timeout.py,
|
2003-02-19 21:38:31 -04:00
|
|
|
|
test_tarfile.py, test_netrc.py, test_multifile.py,
|
|
|
|
|
test_importhooks.py and test_imp.py). Now they are. (Note to
|
|
|
|
|
developers: please read Lib/test/README when creating a new test, to
|
|
|
|
|
make sure to do it right! All tests need to use either unittest or
|
|
|
|
|
pydoc.)
|
|
|
|
|
|
|
|
|
|
- Added test_posix.py, a test suite for the posix module.
|
|
|
|
|
|
|
|
|
|
- Added test_hexoct.py, a test suite for hex/oct constant folding.
|
2003-01-02 23:30:21 -04:00
|
|
|
|
|
2003-01-01 05:51:12 -04:00
|
|
|
|
Windows
|
|
|
|
|
-------
|
|
|
|
|
|
2003-02-19 14:18:47 -04:00
|
|
|
|
- The timeout code for socket connect() didn't work right; this has
|
|
|
|
|
now been fixed. test_timeout.py should pass (at least most of the
|
|
|
|
|
time).
|
|
|
|
|
|
2003-01-31 16:45:41 -04:00
|
|
|
|
- distutils' msvccompiler class now passes the preprocessor options to
|
|
|
|
|
the resource compiler. See SF patch #669198.
|
|
|
|
|
|
2003-01-24 11:31:31 -04:00
|
|
|
|
- The bsddb module now ships with Sleepycat's 4.1.25.NC, the latest
|
|
|
|
|
release without strong cryptography.
|
|
|
|
|
|
2003-01-08 11:14:55 -04:00
|
|
|
|
- sys.path[0], if it contains a directory name, is now always an
|
2003-02-19 21:38:31 -04:00
|
|
|
|
absolute pathname. (SF patch #664376.)
|
2003-01-08 11:14:55 -04:00
|
|
|
|
|
2003-01-02 12:02:27 -04:00
|
|
|
|
- The new logging package is now installed by the Windows installer. It
|
|
|
|
|
wasn't in 2.3a1 due to oversight.
|
|
|
|
|
|
2003-01-01 05:51:12 -04:00
|
|
|
|
Mac
|
|
|
|
|
---
|
|
|
|
|
|
2003-01-27 11:21:39 -04:00
|
|
|
|
- There are new dialogs EasyDialogs.AskFileForOpen, AskFileForSave
|
|
|
|
|
and AskFolder. The old macfs.StandardGetFile and friends are deprecated.
|
2003-02-07 18:50:28 -04:00
|
|
|
|
|
2003-02-06 19:10:45 -04:00
|
|
|
|
- Most of the standard library now uses pathnames or FSRefs in preference
|
|
|
|
|
of FSSpecs, and use the underlying Carbon.File and Carbon.Folder modules
|
|
|
|
|
in stead of macfs. macfs will probably be deprecated in the future.
|
2003-01-27 14:51:48 -04:00
|
|
|
|
|
2003-01-27 11:21:39 -04:00
|
|
|
|
- Type Carbon.File.FSCatalogInfo and supporting methods have been implemented.
|
|
|
|
|
This also makes macfs.FSSpec.SetDates() work again.
|
2003-03-01 20:19:49 -04:00
|
|
|
|
|
2003-02-16 19:00:53 -04:00
|
|
|
|
- There is a new module pimp, the package install manager for Python, and
|
|
|
|
|
accompanying applet PackageManager. These allow you to easily download
|
|
|
|
|
and install pretested extension packages either in source or binary
|
|
|
|
|
form. Only in MacPython-OSX.
|
2003-03-01 20:19:49 -04:00
|
|
|
|
|
2003-02-16 19:00:53 -04:00
|
|
|
|
- Applets are now built with bundlebuilder in MacPython-OSX, which should make
|
2003-02-18 19:32:47 -04:00
|
|
|
|
them more robust and also provides a path towards BuildApplication. The
|
|
|
|
|
downside of this change is that applets can no longer be run from the
|
|
|
|
|
Terminal window, this will hopefully be fixed in the 2.3b1.
|
2003-01-02 23:30:21 -04:00
|
|
|
|
|
2003-01-01 05:51:12 -04:00
|
|
|
|
|
2001-12-21 17:36:50 -04:00
|
|
|
|
What's New in Python 2.3 alpha 1?
|
|
|
|
|
=================================
|
|
|
|
|
|
2002-12-31 11:47:36 -04:00
|
|
|
|
*Release date: 31-Dec-2002*
|
2002-09-20 11:16:59 -03:00
|
|
|
|
|
2001-12-21 17:36:50 -04:00
|
|
|
|
Type/class unification and new-style classes
|
2002-09-20 11:16:59 -03:00
|
|
|
|
--------------------------------------------
|
2002-11-23 12:28:12 -04:00
|
|
|
|
|
2002-11-26 10:48:23 -04:00
|
|
|
|
- One can now assign to __bases__ and __name__ of new-style classes.
|
|
|
|
|
|
2002-11-23 12:28:12 -04:00
|
|
|
|
- dict() now accepts keyword arguments so that dict(one=1, two=2)
|
|
|
|
|
is the equivalent of {"one": 1, "two": 2}. Accordingly,
|
2002-11-23 05:45:04 -04:00
|
|
|
|
the existing (but undocumented) 'items' keyword argument has
|
2002-11-23 12:28:12 -04:00
|
|
|
|
been eliminated. This means that dict(items=someMapping) now has
|
2002-11-23 05:45:04 -04:00
|
|
|
|
a different meaning than before.
|
|
|
|
|
|
2002-11-19 16:49:15 -04:00
|
|
|
|
- int() now returns a long object if the argument is outside the
|
2003-01-02 23:30:21 -04:00
|
|
|
|
integer range, so int("4" * 1000), int(1e200) and int(1L<<1000) will
|
2002-11-19 16:49:15 -04:00
|
|
|
|
all return long objects instead of raising an OverflowError.
|
2001-12-21 17:36:50 -04:00
|
|
|
|
|
2002-11-15 10:42:34 -04:00
|
|
|
|
- Assignment to __class__ is disallowed if either the old or the new
|
2002-08-12 00:42:03 -03:00
|
|
|
|
class is a statically allocated type object (such as defined by an
|
2002-08-19 11:25:03 -03:00
|
|
|
|
extension module). This prevents anomalies like 2.__class__ = bool.
|
2002-08-12 00:42:03 -03:00
|
|
|
|
|
|
|
|
|
- New-style object creation and deallocation have been sped up
|
|
|
|
|
significantly; they are now faster than classic instance creation
|
|
|
|
|
and deallocation.
|
|
|
|
|
|
|
|
|
|
- The __slots__ variable can now mention "private" names, and the
|
|
|
|
|
right thing will happen (e.g. __slots__ = ["__foo"]).
|
|
|
|
|
|
|
|
|
|
- The built-ins slice() and buffer() are now callable types. The
|
|
|
|
|
types classobj (formerly class), code, function, instance, and
|
|
|
|
|
instancemethod (formerly instance-method), which have no built-in
|
|
|
|
|
names but are accessible through the types module, are now also
|
|
|
|
|
callable. The type dict-proxy is renamed to dictproxy.
|
|
|
|
|
|
|
|
|
|
- Cycles going through the __class__ link of a new-style instance are
|
|
|
|
|
now detected by the garbage collector.
|
|
|
|
|
|
|
|
|
|
- Classes using __slots__ are now properly garbage collected.
|
|
|
|
|
[SF bug 519621]
|
|
|
|
|
|
|
|
|
|
- Tightened the __slots__ rules: a slot name must be a valid Python
|
|
|
|
|
identifier.
|
|
|
|
|
|
|
|
|
|
- The constructor for the module type now requires a name argument and
|
|
|
|
|
takes an optional docstring argument. Previously, this constructor
|
|
|
|
|
ignored its arguments. As a consequence, deriving a class from a
|
|
|
|
|
module (not from the module type) is now illegal; previously this
|
|
|
|
|
created an unnamed module, just like invoking the module type did.
|
|
|
|
|
[SF bug 563060]
|
|
|
|
|
|
|
|
|
|
- A new type object, 'basestring', is added. This is a common base type
|
|
|
|
|
for 'str' and 'unicode', and can be used instead of
|
|
|
|
|
types.StringTypes, e.g. to test whether something is "a string":
|
|
|
|
|
isinstance(x, basestring) is True for Unicode and 8-bit strings. This
|
|
|
|
|
is an abstract base class and cannot be instantiated directly.
|
|
|
|
|
|
|
|
|
|
- Changed new-style class instantiation so that when C's __new__
|
|
|
|
|
method returns something that's not a C instance, its __init__ is
|
|
|
|
|
not called. [SF bug #537450]
|
|
|
|
|
|
|
|
|
|
- Fixed super() to work correctly with class methods. [SF bug #535444]
|
|
|
|
|
|
|
|
|
|
- If you try to pickle an instance of a class that has __slots__ but
|
|
|
|
|
doesn't define or override __getstate__, a TypeError is now raised.
|
|
|
|
|
This is done by adding a bozo __getstate__ to the class that always
|
|
|
|
|
raises TypeError. (Before, this would appear to be pickled, but the
|
|
|
|
|
state of the slots would be lost.)
|
|
|
|
|
|
2001-12-21 17:36:50 -04:00
|
|
|
|
Core and builtins
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------------
|
2001-12-21 17:36:50 -04:00
|
|
|
|
|
2002-12-30 18:59:32 -04:00
|
|
|
|
- Import from zipfiles is now supported. The name of a zipfile placed
|
2002-12-31 06:22:38 -04:00
|
|
|
|
on sys.path causes the import statement to look for importable Python
|
|
|
|
|
modules (with .py, pyc and .pyo extensions) and packages inside the
|
|
|
|
|
zipfile. The zipfile import follows the specification (though not
|
|
|
|
|
the sample implementation) of PEP 273. The semantics of __path__ are
|
2002-12-30 18:59:32 -04:00
|
|
|
|
compatible with those that have been implemented in Jython since
|
|
|
|
|
Jython 2.1.
|
|
|
|
|
|
2003-03-11 17:43:55 -04:00
|
|
|
|
- PEP 302 has been accepted. Although it was initially developed to
|
2003-01-02 12:02:27 -04:00
|
|
|
|
support zipimport, it offers a new, general import hook mechanism.
|
2002-12-31 06:22:38 -04:00
|
|
|
|
Several new variables have been added to the sys module:
|
|
|
|
|
sys.meta_path, sys.path_hooks, and sys.path_importer_cache; these
|
|
|
|
|
make extending the import statement much more convenient than
|
|
|
|
|
overriding the __import__ built-in function. For a description of
|
|
|
|
|
these, see PEP 302.
|
|
|
|
|
|
2002-12-17 12:15:34 -04:00
|
|
|
|
- A frame object's f_lineno attribute can now be written to from a
|
|
|
|
|
trace function to change which line will execute next. A command to
|
|
|
|
|
exploit this from pdb has been added. [SF patch #643835]
|
|
|
|
|
|
2002-12-12 14:01:43 -04:00
|
|
|
|
- The _codecs support module for codecs.py was turned into a builtin
|
|
|
|
|
module to assure that at least the builtin codecs are available
|
|
|
|
|
to the Python parser for source code decoding according to PEP 263.
|
|
|
|
|
|
2002-12-12 12:41:44 -04:00
|
|
|
|
- issubclass now supports a tuple as the second argument, just like
|
|
|
|
|
isinstance does. ``issubclass(X, (A, B))`` is equivalent to
|
|
|
|
|
``issubclass(X, A) or issubclass(X, B)``.
|
|
|
|
|
|
2002-11-12 18:08:10 -04:00
|
|
|
|
- Thanks to Armin Rigo, the last known way to provoke a system crash
|
|
|
|
|
by cleverly arranging for a comparison function to mutate a list
|
|
|
|
|
during a list.sort() operation has been fixed. The effect of
|
|
|
|
|
attempting to mutate a list, or even to inspect its contents or
|
|
|
|
|
length, while a sort is in progress, is not defined by the language.
|
|
|
|
|
The C implementation of Python 2.3 attempts to detect mutations,
|
|
|
|
|
and raise ValueError if one occurs, but there's no guarantee that
|
|
|
|
|
all mutations will be caught, or that any will be caught across
|
|
|
|
|
releases or implementations.
|
|
|
|
|
|
2002-10-05 06:46:48 -03:00
|
|
|
|
- Unicode file name processing for Windows (PEP 277) is implemented.
|
2002-10-07 23:44:31 -03:00
|
|
|
|
All platforms now have an os.path.supports_unicode_filenames attribute,
|
|
|
|
|
which is set to True on Windows NT/2000/XP, and False elsewhere.
|
2002-10-05 06:46:48 -03:00
|
|
|
|
|
2002-09-02 10:14:32 -03:00
|
|
|
|
- Codec error handling callbacks (PEP 293) are implemented.
|
|
|
|
|
Error handling in unicode.encode or str.decode can now be customized.
|
|
|
|
|
|
2002-08-19 18:43:18 -03:00
|
|
|
|
- A subtle change to the semantics of the built-in function intern():
|
|
|
|
|
interned strings are no longer immortal. You must keep a reference
|
|
|
|
|
to the return value intern() around to get the benefit.
|
|
|
|
|
|
2002-08-16 00:38:10 -03:00
|
|
|
|
- Use of 'None' as a variable, argument or attribute name now
|
|
|
|
|
issues a SyntaxWarning. In the future, None may become a keyword.
|
|
|
|
|
|
2002-08-15 11:59:02 -03:00
|
|
|
|
- SET_LINENO is gone. co_lnotab is now consulted to determine when to
|
|
|
|
|
call the trace function. C code that accessed f_lineno should call
|
2002-12-17 12:15:34 -04:00
|
|
|
|
PyCode_Addr2Line instead (f_lineno is still there, but only kept up
|
|
|
|
|
to date when there is a trace function set).
|
2002-08-15 11:59:02 -03:00
|
|
|
|
|
2002-08-14 13:11:30 -03:00
|
|
|
|
- There's a new warning category, FutureWarning. This is used to warn
|
|
|
|
|
about a number of situations where the value or sign of an integer
|
|
|
|
|
result will change in Python 2.4 as a result of PEP 237 (integer
|
|
|
|
|
unification). The warnings implement stage B0 mentioned in that
|
|
|
|
|
PEP. The warnings are about the following situations:
|
|
|
|
|
|
|
|
|
|
- Octal and hex literals without 'L' prefix in the inclusive range
|
|
|
|
|
[0x80000000..0xffffffff]; these are currently negative ints, but
|
|
|
|
|
in Python 2.4 they will be positive longs with the same bit
|
|
|
|
|
pattern.
|
|
|
|
|
|
|
|
|
|
- Left shifts on integer values that cause the outcome to lose
|
|
|
|
|
bits or have a different sign than the left operand. To be
|
|
|
|
|
precise: x<<n where this currently doesn't yield the same value
|
|
|
|
|
as long(x)<<n; in Python 2.4, the outcome will be long(x)<<n.
|
|
|
|
|
|
|
|
|
|
- Conversions from ints to string that show negative values as
|
|
|
|
|
unsigned ints in the inclusive range [0x80000000..0xffffffff];
|
|
|
|
|
this affects the functions hex() and oct(), and the string
|
|
|
|
|
formatting codes %u, %o, %x, and %X. In Python 2.4, these will
|
|
|
|
|
show signed values (e.g. hex(-1) currently returns "0xffffffff";
|
|
|
|
|
in Python 2.4 it will return "-0x1").
|
|
|
|
|
|
2002-12-30 22:12:42 -04:00
|
|
|
|
- The bits manipulated under the cover by sys.setcheckinterval() have
|
|
|
|
|
been changed. Both the check interval and the ticker used to be
|
|
|
|
|
per-thread values. They are now just a pair of global variables.
|
|
|
|
|
In addition, the default check interval was boosted from 10 to 100
|
|
|
|
|
bytecode instructions. This may have some effect on systems that
|
|
|
|
|
relied on the old default value. In particular, in multi-threaded
|
|
|
|
|
applications which try to be highly responsive, response time will
|
|
|
|
|
increase by some (perhaps imperceptible) amount.
|
2002-09-03 18:25:14 -03:00
|
|
|
|
|
2002-08-12 14:36:03 -03:00
|
|
|
|
- When multiplying very large integers, a version of the so-called
|
|
|
|
|
Karatsuba algorithm is now used. This is most effective if the
|
|
|
|
|
inputs have roughly the same size. If they both have about N digits,
|
|
|
|
|
Karatsuba multiplication has O(N**1.58) runtime (the exponent is
|
|
|
|
|
log_base_2(3)) instead of the previous O(N**2). Measured results may
|
2002-08-16 00:40:07 -03:00
|
|
|
|
be better or worse than that, depending on platform quirks. Besides
|
|
|
|
|
the O() improvement in raw instruction count, the Karatsuba algorithm
|
|
|
|
|
appears to have much better cache behavior on extremely large integers
|
|
|
|
|
(starting in the ballpark of a million bits). Note that this is a
|
|
|
|
|
simple implementation, and there's no intent here to compete with,
|
|
|
|
|
e.g., GMP. It gives a very nice speedup when it applies, but a package
|
|
|
|
|
devoted to fast large-integer arithmetic should run circles around it.
|
2002-08-11 23:31:19 -03:00
|
|
|
|
|
2002-08-11 09:23:04 -03:00
|
|
|
|
- u'%c' will now raise a ValueError in case the argument is an
|
|
|
|
|
integer outside the valid range of Unicode code point ordinals.
|
|
|
|
|
|
2002-08-09 14:16:30 -03:00
|
|
|
|
- The tempfile module has been overhauled for enhanced security. The
|
|
|
|
|
mktemp() function is now deprecated; new, safe replacements are
|
|
|
|
|
mkstemp() (for files) and mkdtemp() (for directories), and the
|
|
|
|
|
higher-level functions NamedTemporaryFile() and TemporaryFile().
|
|
|
|
|
Use of some global variables in this module is also deprecated; the
|
|
|
|
|
new functions have keyword arguments to provide the same
|
|
|
|
|
functionality. All Lib, Tools and Demo modules that used the unsafe
|
|
|
|
|
interfaces have been updated to use the safe replacements. Thanks
|
|
|
|
|
to Zack Weinberg!
|
|
|
|
|
|
2002-08-09 12:57:34 -03:00
|
|
|
|
- When x is an object whose class implements __mul__ and __rmul__,
|
|
|
|
|
1.0*x would correctly invoke __rmul__, but 1*x would erroneously
|
|
|
|
|
invoke __mul__. This was due to the sequence-repeat code in the int
|
|
|
|
|
type. This has been fixed now.
|
|
|
|
|
|
2002-08-06 14:01:51 -03:00
|
|
|
|
- Previously, "str1 in str2" required str1 to be a string of length 1.
|
|
|
|
|
This restriction has been relaxed to allow str1 to be a string of
|
|
|
|
|
any length. Thus "'el' in 'hello world'" returns True now.
|
|
|
|
|
|
2002-08-06 13:20:26 -03:00
|
|
|
|
- File objects are now their own iterators. For a file f, iter(f) now
|
|
|
|
|
returns f (unless f is closed), and f.next() is similar to
|
|
|
|
|
f.readline() when EOF is not reached; however, f.next() uses a
|
|
|
|
|
readahead buffer that messes up the file position, so mixing
|
|
|
|
|
f.next() and f.readline() (or other methods) doesn't work right.
|
|
|
|
|
Calling f.seek() drops the readahead buffer, but other operations
|
|
|
|
|
don't. It so happens that this gives a nice additional speed boost
|
|
|
|
|
to "for line in file:"; the xreadlines method and corresponding
|
2002-08-09 14:17:07 -03:00
|
|
|
|
module are now obsolete. Thanks to Oren Tirosh!
|
2002-08-06 13:20:26 -03:00
|
|
|
|
|
2002-08-05 11:17:20 -03:00
|
|
|
|
- Encoding declarations (PEP 263, phase 1) have been implemented. A
|
|
|
|
|
comment of the form "# -*- coding: <encodingname> -*-" in the first
|
|
|
|
|
or second line of a Python source file indicates the encoding.
|
2002-08-04 14:29:52 -03:00
|
|
|
|
|
2002-07-31 23:34:51 -03:00
|
|
|
|
- list.sort() has a new implementation. While cross-platform results
|
|
|
|
|
may vary, and in data-dependent ways, this is much faster on many
|
|
|
|
|
kinds of partially ordered lists than the previous implementation,
|
|
|
|
|
and reported to be just as fast on randomly ordered lists on
|
|
|
|
|
several major platforms. This sort is also stable (if A==B and A
|
|
|
|
|
precedes B in the list at the start, A precedes B after the sort too),
|
|
|
|
|
although the language definition does not guarantee stability. A
|
|
|
|
|
potential drawback is that list.sort() may require temp space of
|
2002-09-30 12:23:01 -03:00
|
|
|
|
len(list)*2 bytes (``*4`` on a 64-bit machine). It's therefore possible
|
2002-07-31 23:34:51 -03:00
|
|
|
|
for list.sort() to raise MemoryError now, even if a comparison function
|
|
|
|
|
does not. See <http://www.python.org/sf/587076> for full details.
|
|
|
|
|
|
2002-07-23 00:44:35 -03:00
|
|
|
|
- All standard iterators now ensure that, once StopIteration has been
|
|
|
|
|
raised, all future calls to next() on the same iterator will also
|
|
|
|
|
raise StopIteration. There used to be various counterexamples to
|
|
|
|
|
this behavior, which could caused confusion or subtle program
|
|
|
|
|
breakage, without any benefits. (Note that this is still an
|
|
|
|
|
iterator's responsibility; the iterator framework does not enforce
|
|
|
|
|
this.)
|
|
|
|
|
|
2002-07-15 22:32:30 -03:00
|
|
|
|
- Ctrl+C handling on Windows has been made more consistent with
|
|
|
|
|
other platforms. KeyboardInterrupt can now reliably be caught,
|
2002-08-19 11:25:03 -03:00
|
|
|
|
and Ctrl+C at an interactive prompt no longer terminates the
|
2002-07-15 22:32:30 -03:00
|
|
|
|
process under NT/2k/XP (it never did under Win9x). Ctrl+C will
|
2002-08-11 23:31:19 -03:00
|
|
|
|
interrupt time.sleep() in the main thread, and any child processes
|
|
|
|
|
created via the popen family (on win2k; we can't make win9x work
|
2002-08-10 03:26:31 -03:00
|
|
|
|
reliably) are also interrupted (as generally happens on for Linux/Unix.)
|
|
|
|
|
[SF bugs 231273, 439992 and 581232]
|
2002-07-15 22:32:30 -03:00
|
|
|
|
|
2002-10-07 23:44:31 -03:00
|
|
|
|
- sys.getwindowsversion() has been added on Windows. This
|
|
|
|
|
returns a tuple with information about the version of Windows
|
|
|
|
|
currently running.
|
|
|
|
|
|
2002-06-24 21:25:30 -03:00
|
|
|
|
- Slices and repetitions of buffer objects now consistently return
|
|
|
|
|
a string. Formerly, strings would be returned most of the time,
|
|
|
|
|
but a buffer object would be returned when the repetition count
|
|
|
|
|
was one or when the slice range was all inclusive.
|
|
|
|
|
|
2002-06-17 07:43:59 -03:00
|
|
|
|
- Unicode objects in sys.path are no longer ignored but treated
|
|
|
|
|
as directory names.
|
|
|
|
|
|
2002-06-13 21:50:42 -03:00
|
|
|
|
- Fixed string.startswith and string.endswith builtin methods
|
|
|
|
|
so they accept negative indices. [SF bug 493951]
|
|
|
|
|
|
2002-06-12 00:45:21 -03:00
|
|
|
|
- Fixed a bug with a continue inside a try block and a yield in the
|
|
|
|
|
finally clause. [SF bug 567538]
|
|
|
|
|
|
2002-06-11 07:55:12 -03:00
|
|
|
|
- Most builtin sequences now support "extended slices", i.e. slices
|
2002-06-13 08:41:07 -03:00
|
|
|
|
with a third "stride" parameter. For example, "hello world"[::-1]
|
|
|
|
|
gives "dlrow olleh".
|
2002-06-11 07:55:12 -03:00
|
|
|
|
|
2002-05-29 12:54:55 -03:00
|
|
|
|
- A new warning PendingDeprecationWarning was added to provide
|
|
|
|
|
direction on features which are in the process of being deprecated.
|
|
|
|
|
The warning will not be printed by default. To see the pending
|
|
|
|
|
deprecations, use -Walways::PendingDeprecationWarning::
|
|
|
|
|
as a command line option or warnings.filterwarnings() in code.
|
|
|
|
|
|
2002-05-02 18:28:26 -03:00
|
|
|
|
- Deprecated features of xrange objects have been removed as
|
|
|
|
|
promised. The start, stop, and step attributes and the tolist()
|
|
|
|
|
method no longer exist. xrange repetition and slicing have been
|
|
|
|
|
removed.
|
|
|
|
|
|
2002-04-26 16:40:56 -03:00
|
|
|
|
- New builtin function enumerate(x), from PEP 279. Example:
|
|
|
|
|
enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
|
|
|
|
|
The argument can be an arbitrary iterable object.
|
|
|
|
|
|
2002-04-25 22:58:53 -03:00
|
|
|
|
- The assert statement no longer tests __debug__ at runtime. This means
|
|
|
|
|
that assert statements cannot be disabled by assigning a false value
|
|
|
|
|
to __debug__.
|
|
|
|
|
|
2002-04-15 10:36:47 -03:00
|
|
|
|
- A method zfill() was added to str and unicode, that fills a numeric
|
|
|
|
|
string to the left with zeros. For example,
|
|
|
|
|
"+123".zfill(6) -> "+00123".
|
|
|
|
|
|
2002-04-15 09:36:47 -03:00
|
|
|
|
- Complex numbers supported divmod() and the // and % operators, but
|
|
|
|
|
these make no sense. Since this was documented, they're being
|
|
|
|
|
deprecated now.
|
|
|
|
|
|
2002-04-26 17:11:29 -03:00
|
|
|
|
- String and unicode methods lstrip(), rstrip() and strip() now take
|
|
|
|
|
an optional argument that specifies the characters to strip. For
|
|
|
|
|
example, "Foo!!!?!?!?".rstrip("?!") -> "Foo".
|
2002-04-12 21:59:05 -03:00
|
|
|
|
|
2002-11-27 09:10:40 -04:00
|
|
|
|
- There's a new dictionary constructor (a class method of the dict
|
|
|
|
|
class), dict.fromkeys(iterable, value=None). It constructs a
|
|
|
|
|
dictionary with keys taken from the iterable and all values set to a
|
|
|
|
|
single value. It can be used for building sets and for removing
|
|
|
|
|
duplicates from sequences.
|
2002-11-27 03:29:33 -04:00
|
|
|
|
|
2002-04-12 16:22:48 -03:00
|
|
|
|
- Added a new dict method pop(key). This removes and returns the
|
|
|
|
|
value corresponding to key. [SF patch #539949]
|
|
|
|
|
|
2002-04-04 11:21:33 -04:00
|
|
|
|
- A new built-in type, bool, has been added, as well as built-in
|
|
|
|
|
names for its two values, True and False. Comparisons and sundry
|
|
|
|
|
other operations that return a truth value have been changed to
|
2002-05-07 17:58:03 -03:00
|
|
|
|
return a bool instead. Read PEP 285 for an explanation of why this
|
2002-04-04 11:21:33 -04:00
|
|
|
|
is backward compatible.
|
|
|
|
|
|
2002-03-28 21:07:24 -04:00
|
|
|
|
- Fixed two bugs reported as SF #535905: under certain conditions,
|
|
|
|
|
deallocating a deeply nested structure could cause a segfault in the
|
|
|
|
|
garbage collector, due to interaction with the "trashcan" code;
|
|
|
|
|
access to the current frame during destruction of a local variable
|
|
|
|
|
could access a pointer to freed memory.
|
|
|
|
|
|
2002-06-18 18:20:13 -03:00
|
|
|
|
- The optional object allocator ("pymalloc") has been enabled by
|
|
|
|
|
default. The recommended practice for memory allocation and
|
|
|
|
|
deallocation has been streamlined. A header file is included,
|
|
|
|
|
Misc/pymemcompat.h, which can be bundled with 3rd party extensions
|
|
|
|
|
and lets them use the same API with Python versions from 1.5.2
|
|
|
|
|
onwards.
|
2002-03-22 13:06:59 -04:00
|
|
|
|
|
2002-03-03 17:30:27 -04:00
|
|
|
|
- PyErr_Display will provide file and line information for all exceptions
|
|
|
|
|
that have an attribute print_file_and_line, not just SyntaxErrors.
|
|
|
|
|
|
2002-02-09 07:28:43 -04:00
|
|
|
|
- The UTF-8 codec will now encode and decode Unicode surrogates
|
|
|
|
|
correctly and without raising exceptions for unpaired ones.
|
|
|
|
|
|
2002-08-15 11:01:14 -03:00
|
|
|
|
- Universal newlines (PEP 278) is implemented. Briefly, using 'U'
|
|
|
|
|
instead of 'r' when opening a text file for reading changes the line
|
|
|
|
|
ending convention so that any of '\r', '\r\n', and '\n' is
|
|
|
|
|
recognized (even mixed in one file); all three are converted to
|
|
|
|
|
'\n', the standard Python line end character.
|
|
|
|
|
|
2002-01-01 15:07:13 -04:00
|
|
|
|
- file.xreadlines() now raises a ValueError if the file is closed:
|
|
|
|
|
Previously, an xreadlines object was returned which would raise
|
|
|
|
|
a ValueError when the xreadlines.next() method was called.
|
|
|
|
|
|
2002-05-07 17:58:03 -03:00
|
|
|
|
- sys.exit() inadvertently allowed more than one argument.
|
2002-03-27 09:03:09 -04:00
|
|
|
|
An exception will now be raised if more than one argument is used.
|
|
|
|
|
|
2002-12-16 10:09:22 -04:00
|
|
|
|
- Changed evaluation order of dictionary literals to conform to the
|
|
|
|
|
general left to right evaluation order rule. Now {f1(): f2()} will
|
|
|
|
|
evaluate f1 first.
|
2002-12-16 09:54:02 -04:00
|
|
|
|
|
2002-12-16 14:12:53 -04:00
|
|
|
|
- Fixed bug #521782: when a file was in non-blocking mode, file.read()
|
|
|
|
|
could silently lose data or wrongly throw an unknown error.
|
|
|
|
|
|
2002-12-30 16:22:23 -04:00
|
|
|
|
- The sq_repeat, sq_inplace_repeat, sq_concat and sq_inplace_concat
|
|
|
|
|
slots are now always tried after trying the corresponding nb_* slots.
|
|
|
|
|
This fixes a number of minor bugs (see bug #624807).
|
|
|
|
|
|
2003-01-10 19:29:48 -04:00
|
|
|
|
- Fix problem with dynamic loading on 64-bit AIX (see bug #639945).
|
|
|
|
|
|
2001-12-21 17:36:50 -04:00
|
|
|
|
Extension modules
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------------
|
2001-12-21 17:36:50 -04:00
|
|
|
|
|
2003-01-18 19:22:20 -04:00
|
|
|
|
- Added three operators to the operator module:
|
|
|
|
|
operator.pow(a,b) which is equivalent to: a**b.
|
|
|
|
|
operator.is_(a,b) which is equivalent to: a is b.
|
|
|
|
|
operator.is_not(a,b) which is equivalent to: a is not b.
|
|
|
|
|
|
2002-12-31 08:55:15 -04:00
|
|
|
|
- posix.openpty now works on all systems that have /dev/ptmx.
|
|
|
|
|
|
2002-12-30 18:59:32 -04:00
|
|
|
|
- A module zipimport exists to support importing code from zip
|
|
|
|
|
archives.
|
|
|
|
|
|
2002-12-16 16:57:22 -04:00
|
|
|
|
- The new datetime module supplies classes for manipulating dates and
|
|
|
|
|
times. The basic design came from the Zope "fishbowl process", and
|
|
|
|
|
favors practical commercial applications over calendar esoterica. See
|
|
|
|
|
|
|
|
|
|
http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage
|
|
|
|
|
|
2002-11-26 05:28:05 -04:00
|
|
|
|
- _tkinter now returns Tcl objects, instead of strings. Objects which
|
|
|
|
|
have Python equivalents are converted to Python objects, other objects
|
|
|
|
|
are wrapped. This can be configured through the wantobjects method,
|
2002-11-26 17:39:48 -04:00
|
|
|
|
or Tkinter.wantobjects.
|
2002-11-26 05:28:05 -04:00
|
|
|
|
|
2002-12-30 17:03:26 -04:00
|
|
|
|
- The PyBSDDB wrapper around the Sleepycat Berkeley DB library has
|
|
|
|
|
been added as the package bsddb. The traditional bsddb module is
|
|
|
|
|
still available in source code, but not built automatically anymore,
|
|
|
|
|
and is now named bsddb185. This supports Berkeley DB versions from
|
2003-02-03 11:17:25 -04:00
|
|
|
|
3.0 to 4.1. For help converting your databases from the old module (which
|
|
|
|
|
probably used an obsolete version of Berkeley DB) to the new module, see
|
|
|
|
|
the db2pickle.py and pickle2db.py scripts described in the Tools/Demos
|
|
|
|
|
section above.
|
2002-11-19 04:12:57 -04:00
|
|
|
|
|
2002-11-23 18:08:15 -04:00
|
|
|
|
- unicodedata was updated to Unicode 3.2. It supports normalization
|
|
|
|
|
and names for Hangul syllables and CJK unified ideographs.
|
2002-11-23 08:22:32 -04:00
|
|
|
|
|
2002-11-02 13:46:24 -04:00
|
|
|
|
- resource.getrlimit() now returns longs instead of ints.
|
|
|
|
|
|
2002-10-26 11:42:02 -03:00
|
|
|
|
- readline now dynamically adjusts its input/output stream if
|
|
|
|
|
sys.stdin/stdout changes.
|
|
|
|
|
|
2002-10-01 15:18:58 -03:00
|
|
|
|
- The _tkinter module (and hence Tkinter) has dropped support for
|
|
|
|
|
Tcl/Tk 8.0 and 8.1. Only Tcl/Tk versions 8.2, 8.3 and 8.4 are
|
|
|
|
|
supported.
|
|
|
|
|
|
2002-09-16 14:26:24 -03:00
|
|
|
|
- cPickle.BadPickleGet is now a class.
|
|
|
|
|
|
2002-10-16 15:28:36 -03:00
|
|
|
|
- The time stamps in os.stat_result are floating point numbers
|
|
|
|
|
after stat_float_times has been called.
|
2002-09-09 11:24:16 -03:00
|
|
|
|
|
2002-09-05 18:48:07 -03:00
|
|
|
|
- If the size passed to mmap.mmap() is larger than the length of the
|
|
|
|
|
file on non-Windows platforms, a ValueError is raised. [SF bug 585792]
|
|
|
|
|
|
2002-08-06 13:20:26 -03:00
|
|
|
|
- The xreadlines module is slated for obsolescence.
|
|
|
|
|
|
2002-07-23 00:32:08 -03:00
|
|
|
|
- The strptime function in the time module is now always available (a
|
|
|
|
|
Python implementation is used when the C library doesn't define it).
|
|
|
|
|
|
2002-06-14 18:31:18 -03:00
|
|
|
|
- The 'new' module is no longer an extension, but a Python module that
|
|
|
|
|
only exists for backwards compatibility. Its contents are no longer
|
|
|
|
|
functions but callable type objects.
|
|
|
|
|
|
2002-04-28 22:37:32 -03:00
|
|
|
|
- The bsddb.*open functions can now take 'None' as a filename.
|
2002-04-22 23:11:05 -03:00
|
|
|
|
This will create a temporary in-memory bsddb that won't be
|
2002-04-28 22:37:32 -03:00
|
|
|
|
written to disk.
|
2002-04-22 23:11:05 -03:00
|
|
|
|
|
2002-12-31 09:20:15 -04:00
|
|
|
|
- posix.getloadavg, posix.lchown, posix.killpg, posix.mknod, and
|
|
|
|
|
posix.getpgid have been added where available.
|
2002-04-14 07:19:44 -03:00
|
|
|
|
|
2002-11-03 13:20:12 -04:00
|
|
|
|
- The locale module now exposes the C library's gettext interface. It
|
|
|
|
|
also has a new function getpreferredencoding.
|
2002-03-27 14:49:02 -04:00
|
|
|
|
|
2002-03-14 15:06:01 -04:00
|
|
|
|
- A security hole ("double free") was found in zlib-1.1.3, a popular
|
|
|
|
|
third party compression library used by some Python modules. The
|
|
|
|
|
hole was quickly plugged in zlib-1.1.4, and the Windows build of
|
|
|
|
|
Python now ships with zlib-1.1.4.
|
|
|
|
|
|
2002-04-08 18:28:20 -03:00
|
|
|
|
- pwd, grp, and resource return enhanced tuples now, with symbolic
|
|
|
|
|
field names.
|
2002-03-01 06:47:37 -04:00
|
|
|
|
|
2002-03-01 06:27:01 -04:00
|
|
|
|
- array.array is now a type object. A new format character
|
|
|
|
|
'u' indicates Py_UNICODE arrays. For those, .tounicode and
|
|
|
|
|
.fromunicode methods are available. Arrays now support __iadd__
|
|
|
|
|
and __imul__.
|
|
|
|
|
|
2002-01-01 17:14:12 -04:00
|
|
|
|
- dl now builds on every system that has dlfcn.h. Failure in case
|
2002-01-01 16:18:30 -04:00
|
|
|
|
of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open
|
|
|
|
|
is called.
|
|
|
|
|
|
2002-09-03 10:25:17 -03:00
|
|
|
|
- The sys module acquired a new attribute, api_version, which evaluates
|
|
|
|
|
to the value of the PYTHON_API_VERSION macro with which the
|
|
|
|
|
interpreter was compiled.
|
|
|
|
|
|
2002-11-06 10:06:53 -04:00
|
|
|
|
- Fixed bug #470582: sre module would return a tuple (None, 'a', 'ab')
|
|
|
|
|
when applying the regular expression '^((a)c)?(ab)$' on 'ab'. It now
|
|
|
|
|
returns (None, None, 'ab'), as expected. Also fixed handling of
|
2002-11-06 14:44:26 -04:00
|
|
|
|
lastindex/lastgroup match attributes in similar cases. For example,
|
2002-11-06 10:06:53 -04:00
|
|
|
|
when running the expression r'(a)(b)?b' over 'ab', lastindex must be
|
|
|
|
|
1, not 2.
|
|
|
|
|
|
2002-11-06 23:28:56 -04:00
|
|
|
|
- Fixed bug #581080: sre scanner was not checking the buffer limit
|
|
|
|
|
before increasing the current pointer. This was creating an infinite
|
|
|
|
|
loop in the search function, once the pointer exceeded the buffer
|
|
|
|
|
limit.
|
|
|
|
|
|
2002-11-07 12:23:55 -04:00
|
|
|
|
- The os.fdopen function now enforces a file mode starting with the
|
|
|
|
|
letter 'r', 'w' or 'a', otherwise a ValueError is raised. This fixes
|
|
|
|
|
bug #623464.
|
|
|
|
|
|
2003-01-03 14:02:15 -04:00
|
|
|
|
- The linuxaudiodev module is now deprecated; it is being replaced by
|
|
|
|
|
ossaudiodev. The interface has been extended to cover a lot more of
|
|
|
|
|
OSS (see www.opensound.com), including most DSP ioctls and the
|
|
|
|
|
OSS mixer API. Documentation forthcoming in 2.3a2.
|
|
|
|
|
|
2001-12-21 17:36:50 -04:00
|
|
|
|
Library
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-12-21 17:36:50 -04:00
|
|
|
|
|
2003-01-03 12:33:49 -04:00
|
|
|
|
- imaplib.py now supports SSL (Tino Lange and Piers Lauder).
|
|
|
|
|
|
2002-12-31 12:38:01 -04:00
|
|
|
|
- Freeze's modulefinder.py has been moved to the standard library;
|
|
|
|
|
slightly improved so it will issue less false missing submodule
|
|
|
|
|
reports (see sf path #643711 for details). Documentation will follow
|
|
|
|
|
with Python 2.3a2.
|
|
|
|
|
|
2002-12-31 09:11:54 -04:00
|
|
|
|
- os.path exposes getctime.
|
|
|
|
|
|
2002-12-29 16:14:11 -04:00
|
|
|
|
- unittest.py now has two additional methods called assertAlmostEqual()
|
2003-03-11 17:43:55 -04:00
|
|
|
|
and failIfAlmostEqual(). They implement an approximate comparison
|
2002-12-29 16:14:11 -04:00
|
|
|
|
by rounding the difference between the two arguments and comparing
|
2003-03-11 17:43:55 -04:00
|
|
|
|
the result to zero. Approximate comparison is essential for
|
2002-12-29 16:14:11 -04:00
|
|
|
|
unit tests of floating point results.
|
|
|
|
|
|
2002-12-25 12:37:19 -04:00
|
|
|
|
- calendar.py now depends on the new datetime module rather than
|
|
|
|
|
the time module. As a result, the range of allowable dates
|
|
|
|
|
has been increased.
|
|
|
|
|
|
2002-12-17 12:15:34 -04:00
|
|
|
|
- pdb has a new 'j(ump)' command to select the next line to be
|
|
|
|
|
executed.
|
|
|
|
|
|
2002-12-12 15:13:44 -04:00
|
|
|
|
- The distutils created windows installers now can run a
|
|
|
|
|
postinstallation script.
|
|
|
|
|
|
2002-11-22 04:23:09 -04:00
|
|
|
|
- doctest.testmod can now be called without argument, which means to
|
|
|
|
|
test the current module.
|
|
|
|
|
|
2003-03-11 17:43:55 -04:00
|
|
|
|
- When canceling a server that implemented threading with a keyboard
|
2002-11-22 04:08:44 -04:00
|
|
|
|
interrupt, the server would shut down but not terminate (waiting on
|
|
|
|
|
client threads). A new member variable, daemon_threads, was added to
|
|
|
|
|
the ThreadingMixIn class in SocketServer.py to make it explicit that
|
|
|
|
|
this behavior needs to be controlled.
|
|
|
|
|
|
2002-11-15 09:19:58 -04:00
|
|
|
|
- A new module, optparse, provides a fancy alternative to getopt for
|
2002-11-15 10:42:34 -04:00
|
|
|
|
command line parsing. It is a slightly modified version of Greg
|
2002-11-15 09:19:58 -04:00
|
|
|
|
Ward's Optik package.
|
|
|
|
|
|
2002-11-15 02:46:14 -04:00
|
|
|
|
- UserDict.py now defines a DictMixin class which defines all dictionary
|
|
|
|
|
methods for classes that already have a minimum mapping interface.
|
|
|
|
|
This greatly simplifies writing classes that need to be substitutable
|
|
|
|
|
for dictionaries (such as the shelve module).
|
|
|
|
|
|
|
|
|
|
- shelve.py now subclasses from UserDict.DictMixin. Now shelve supports
|
|
|
|
|
all dictionary methods. This eases the transition to persistent
|
2002-11-15 10:42:34 -04:00
|
|
|
|
storage for scripts originally written with dictionaries in mind.
|
2002-11-15 02:46:14 -04:00
|
|
|
|
|
2002-12-08 14:36:24 -04:00
|
|
|
|
- shelve.open and the various classes in shelve.py now accept an optional
|
|
|
|
|
binary flag, which defaults to False. If True, the values stored in the
|
|
|
|
|
shelf are binary pickles.
|
|
|
|
|
|
2002-11-13 12:29:18 -04:00
|
|
|
|
- A new package, logging, implements the logging API defined by PEP
|
|
|
|
|
282. The code is written by Vinay Sajip.
|
|
|
|
|
|
2002-11-06 12:53:44 -04:00
|
|
|
|
- StreamReader, StreamReaderWriter and StreamRecoder in the codecs
|
|
|
|
|
modules are iterators now.
|
|
|
|
|
|
2002-11-05 16:38:55 -04:00
|
|
|
|
- gzip.py now handles files exceeding 2GB. Files over 4GB also work
|
|
|
|
|
now (provided the OS supports it, and Python is configured with large
|
|
|
|
|
file support), but in that case the underlying gzip file format can
|
|
|
|
|
record only the least-significant 32 bits of the file size, so that
|
|
|
|
|
some tools working with gzipped files may report an incorrect file
|
|
|
|
|
size.
|
2002-11-04 15:50:11 -04:00
|
|
|
|
|
2002-10-26 11:50:45 -03:00
|
|
|
|
- xml.sax.saxutils.unescape has been added, to replace entity references
|
|
|
|
|
with their entity value.
|
|
|
|
|
|
2002-10-15 12:11:13 -03:00
|
|
|
|
- Queue.Queue.{put,get} now support an optional timeout argument.
|
|
|
|
|
|
2002-10-13 07:28:04 -03:00
|
|
|
|
- Various features of Tk 8.4 are exposed in Tkinter.py. The multiple
|
|
|
|
|
option of tkFileDialog is exposed as function askopenfile{,name}s.
|
2002-10-13 07:22:08 -03:00
|
|
|
|
|
2002-10-13 07:28:04 -03:00
|
|
|
|
- Various configure methods of Tkinter have been stream-lined, so that
|
|
|
|
|
tag_configure, image_configure, window_configure now return a
|
2002-11-04 15:50:11 -04:00
|
|
|
|
dictionary when invoked with no argument.
|
2002-10-10 11:36:13 -03:00
|
|
|
|
|
2002-10-09 18:40:48 -03:00
|
|
|
|
- Importing the readline module now no longer has the side effect of
|
|
|
|
|
calling setlocale(LC_CTYPE, ""). The initial "C" locale, or
|
|
|
|
|
whatever locale is explicitly set by the user, is preserved. If you
|
|
|
|
|
want repr() of 8-bit strings in your preferred encoding to preserve
|
|
|
|
|
all printable characters of that encoding, you have to add the
|
|
|
|
|
following code to your $PYTHONSTARTUP file or to your application's
|
|
|
|
|
main():
|
|
|
|
|
|
|
|
|
|
import locale
|
|
|
|
|
locale.setlocale(locale.LC_CTYPE, "")
|
|
|
|
|
|
2002-10-07 10:23:24 -03:00
|
|
|
|
- shutil.move was added. shutil.copytree now reports errors as an
|
|
|
|
|
exception at the end, instead of printing error messages.
|
|
|
|
|
|
2002-10-04 08:55:21 -03:00
|
|
|
|
- Encoding name normalization was generalized to not only
|
|
|
|
|
replace hyphens with underscores, but also all other non-alphanumeric
|
|
|
|
|
characters (with the exception of the dot which is used for Python
|
|
|
|
|
package names during lookup). The aliases.py mapping was updated
|
|
|
|
|
to the new standard.
|
|
|
|
|
|
2002-09-06 13:15:58 -03:00
|
|
|
|
- mimetypes has two new functions: guess_all_extensions() which
|
|
|
|
|
returns a list of all known extensions for a mime type, and
|
|
|
|
|
add_type() which adds one mapping between a mime type and
|
|
|
|
|
an extension to the database.
|
|
|
|
|
|
2002-08-19 13:25:46 -03:00
|
|
|
|
- New module: sets, defines the class Set that implements a mutable
|
|
|
|
|
set type using the keys of a dict to represent the set. There's
|
|
|
|
|
also a class ImmutableSet which is useful when you need sets of sets
|
|
|
|
|
or when you need to use sets as dict keys, and a class BaseSet which
|
2002-12-09 04:56:06 -04:00
|
|
|
|
is the base class of the two.
|
2002-08-19 13:25:46 -03:00
|
|
|
|
|
2002-11-12 13:41:57 -04:00
|
|
|
|
- Added random.sample(population,k) for random sampling without replacement.
|
2002-11-12 18:08:10 -04:00
|
|
|
|
Returns a k length list of unique elements chosen from the population.
|
2002-11-12 13:41:57 -04:00
|
|
|
|
|
2002-08-16 00:40:07 -03:00
|
|
|
|
- random.randrange(-sys.maxint-1, sys.maxint) no longer raises
|
|
|
|
|
OverflowError. That is, it now accepts any combination of 'start'
|
|
|
|
|
and 'stop' arguments so long as each is in the range of Python's
|
|
|
|
|
bounded integers.
|
|
|
|
|
|
2002-12-29 19:03:38 -04:00
|
|
|
|
- Thanks to Raymond Hettinger, random.random() now uses a new core
|
|
|
|
|
generator. The Mersenne Twister algorithm is implemented in C,
|
|
|
|
|
threadsafe, faster than the previous generator, has an astronomically
|
|
|
|
|
large period (2**19937-1), creates random floats to full 53-bit
|
|
|
|
|
precision, and may be the most widely tested random number generator
|
|
|
|
|
in existence.
|
|
|
|
|
|
|
|
|
|
The random.jumpahead(n) method has different semantics for the new
|
|
|
|
|
generator. Instead of jumping n steps ahead, it uses n and the
|
|
|
|
|
existing state to create a new state. This means that jumpahead()
|
|
|
|
|
continues to support multi-threaded code needing generators of
|
|
|
|
|
non-overlapping sequences. However, it will break code which relies
|
|
|
|
|
on jumpahead moving a specific number of steps forward.
|
|
|
|
|
|
|
|
|
|
The attributes random.whseed and random.__whseed have no meaning for
|
|
|
|
|
the new generator. Code using these attributes should switch to a
|
|
|
|
|
new class, random.WichmannHill which is provided for backward
|
|
|
|
|
compatibility and to make an alternate generator available.
|
|
|
|
|
|
2002-08-02 15:05:20 -03:00
|
|
|
|
- New "algorithms" module: heapq, implements a heap queue. Thanks to
|
|
|
|
|
Kevin O'Connor for the code and Fran<61>ois Pinard for an entertaining
|
|
|
|
|
write-up explaining the theory and practical uses of heaps.
|
|
|
|
|
|
2002-07-12 11:40:04 -03:00
|
|
|
|
- New encoding for the Palm OS character set: palmos.
|
|
|
|
|
|
2002-07-07 00:59:34 -03:00
|
|
|
|
- binascii.crc32() and the zipfile module had problems on some 64-bit
|
|
|
|
|
platforms. These have been fixed. On a platform with 8-byte C longs,
|
|
|
|
|
crc32() now returns a signed-extended 4-byte result, so that its value
|
|
|
|
|
as a Python int is equal to the value computed a 32-bit platform.
|
|
|
|
|
|
2002-06-30 12:05:00 -03:00
|
|
|
|
- xml.dom.minidom.toxml and toprettyxml now take an optional encoding
|
|
|
|
|
argument.
|
|
|
|
|
|
2002-06-10 18:39:42 -03:00
|
|
|
|
- Some fixes in the copy module: when an object is copied through its
|
|
|
|
|
__reduce__ method, there was no check for a __setstate__ method on
|
|
|
|
|
the result [SF patch 565085]; deepcopy should treat instances of
|
|
|
|
|
custom metaclasses the same way it treats instances of type 'type'
|
|
|
|
|
[SF patch 560794].
|
|
|
|
|
|
2002-06-07 09:40:52 -03:00
|
|
|
|
- Sockets now support timeout mode. After s.settimeout(T), where T is
|
|
|
|
|
a float expressing seconds, subsequent operations raise an exception
|
|
|
|
|
if they cannot be completed within T seconds. To disable timeout
|
2002-07-23 00:32:08 -03:00
|
|
|
|
mode, use s.settimeout(None). There's also a module function,
|
|
|
|
|
socket.setdefaulttimeout(T), which sets the default for all sockets
|
|
|
|
|
created henceforth.
|
2002-06-07 09:40:52 -03:00
|
|
|
|
|
|
|
|
|
- getopt.gnu_getopt was added. This supports GNU-style option
|
|
|
|
|
processing, where options can be mixed with non-option arguments.
|
2002-06-06 07:58:36 -03:00
|
|
|
|
|
2002-06-04 15:27:35 -03:00
|
|
|
|
- Stop using strings for exceptions. String objects used for
|
|
|
|
|
exceptions are now classes deriving from Exception. The objects
|
|
|
|
|
changed were: Tkinter.TclError, bdb.BdbQuit, macpath.norm_error,
|
|
|
|
|
tabnanny.NannyNag, and xdrlib.Error.
|
2002-06-04 14:14:07 -03:00
|
|
|
|
|
2002-06-04 12:16:29 -03:00
|
|
|
|
- Constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE,
|
|
|
|
|
BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte
|
|
|
|
|
Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and
|
|
|
|
|
big endian systems were added to the codecs module. The old names
|
|
|
|
|
BOM32_* and BOM64_* were off by a factor of 2.
|
|
|
|
|
|
2002-06-18 17:43:18 -03:00
|
|
|
|
- Added conversion functions math.degrees() and math.radians().
|
2002-05-13 01:17:32 -03:00
|
|
|
|
|
2002-12-14 15:51:34 -04:00
|
|
|
|
- math.log() now takes an optional argument: math.log(x[, base]).
|
|
|
|
|
|
2002-05-12 03:07:21 -03:00
|
|
|
|
- ftplib.retrlines() now tests for callback is None rather than testing
|
|
|
|
|
for False. Was causing an error when given a callback object which
|
|
|
|
|
was callable but also returned len() as zero. The change may
|
|
|
|
|
create new breakage if the caller relied on the undocumented behavior
|
|
|
|
|
and called with callback set to [] or some other False value not
|
|
|
|
|
identical to None.
|
|
|
|
|
|
2002-05-05 17:40:00 -03:00
|
|
|
|
- random.gauss() uses a piece of hidden state used by nothing else,
|
|
|
|
|
and the .seed() and .whseed() methods failed to reset it. In other
|
|
|
|
|
words, setting the seed didn't completely determine the sequence of
|
|
|
|
|
results produced by random.gauss(). It does now. Programs repeatedly
|
|
|
|
|
mixing calls to a seed method with calls to gauss() may see different
|
|
|
|
|
results now.
|
|
|
|
|
|
2002-05-01 17:33:53 -03:00
|
|
|
|
- The pickle.Pickler class grew a clear_memo() method to mimic that
|
|
|
|
|
provided by cPickle.Pickler.
|
|
|
|
|
|
2002-04-28 22:37:32 -03:00
|
|
|
|
- difflib's SequenceMatcher class now does a dynamic analysis of
|
|
|
|
|
which elements are so frequent as to constitute noise. For
|
|
|
|
|
comparing files as sequences of lines, this generally works better
|
|
|
|
|
than the IS_LINE_JUNK function, and function ndiff's linejunk
|
|
|
|
|
argument defaults to None now as a result. A happy benefit is
|
|
|
|
|
that SequenceMatcher may run much faster now when applied
|
|
|
|
|
to large files with many duplicate lines (for example, C program
|
|
|
|
|
text with lots of repeated "}" and "return NULL;" lines).
|
|
|
|
|
|
2002-04-23 10:29:43 -03:00
|
|
|
|
- New Text.dump() method in Tkinter module.
|
|
|
|
|
|
2002-04-17 17:33:40 -03:00
|
|
|
|
- New distutils commands for building packagers were added to
|
|
|
|
|
support pkgtool on Solaris and swinstall on HP-UX.
|
|
|
|
|
|
|
|
|
|
- distutils now has a new abstract binary packager base class
|
|
|
|
|
command/bdist_packager, which simplifies writing packagers.
|
|
|
|
|
This will hopefully provide the missing bits to encourage
|
|
|
|
|
people to submit more packagers, e.g. for Debian, FreeBSD
|
|
|
|
|
and other systems.
|
|
|
|
|
|
2002-06-18 17:43:18 -03:00
|
|
|
|
- The UTF-16, -LE and -BE stream readers now raise a
|
|
|
|
|
NotImplementedError for all calls to .readline(). Previously, they
|
|
|
|
|
used to just produce garbage or fail with an encoding error --
|
|
|
|
|
UTF-16 is a 2-byte encoding and the C lib's line reading APIs don't
|
2002-04-05 08:15:05 -04:00
|
|
|
|
work well with these.
|
|
|
|
|
|
2002-03-18 08:44:08 -04:00
|
|
|
|
- compileall now supports quiet operation.
|
|
|
|
|
|
2002-05-07 17:58:03 -03:00
|
|
|
|
- The BaseHTTPServer now implements optional HTTP/1.1 persistent
|
2002-03-17 14:37:22 -04:00
|
|
|
|
connections.
|
|
|
|
|
|
2002-02-16 14:23:30 -04:00
|
|
|
|
- socket module: the SSL support was broken out of the main
|
|
|
|
|
_socket module C helper and placed into a new _ssl helper
|
|
|
|
|
which now gets imported by socket.py if available and working.
|
|
|
|
|
|
2002-02-10 17:42:47 -04:00
|
|
|
|
- encodings package: added aliases for all supported IANA character
|
|
|
|
|
sets
|
|
|
|
|
|
2001-12-28 16:57:14 -04:00
|
|
|
|
- ftplib: to safeguard the user's privacy, anonymous login will use
|
|
|
|
|
"anonymous@" as default password, rather than the real user and host
|
|
|
|
|
name.
|
|
|
|
|
|
2002-01-10 09:50:31 -04:00
|
|
|
|
- webbrowser: tightened up the command passed to os.system() so that
|
|
|
|
|
arbitrary shell code can't be executed because a bogus URL was
|
|
|
|
|
passed in.
|
|
|
|
|
|
2002-01-31 20:52:29 -04:00
|
|
|
|
- gettext.translation has an optional fallback argument, and
|
2002-01-11 02:58:49 -04:00
|
|
|
|
gettext.find an optional all argument. Translations will now fallback
|
2002-11-21 17:45:32 -04:00
|
|
|
|
on a per-message basis. The module supports plural forms, by means
|
|
|
|
|
of gettext.[d]ngettext and Translation.[u]ngettext.
|
2002-01-11 02:33:28 -04:00
|
|
|
|
|
2002-01-12 07:27:42 -04:00
|
|
|
|
- distutils bdist commands now offer a --skip-build option.
|
|
|
|
|
|
2002-03-21 06:38:40 -04:00
|
|
|
|
- warnings.warn now accepts a Warning instance as first argument.
|
|
|
|
|
|
2002-04-04 15:36:15 -04:00
|
|
|
|
- The xml.sax.expatreader.ExpatParser class will no longer create
|
|
|
|
|
circular references by using itself as the locator that gets passed
|
|
|
|
|
to the content handler implementation. [SF bug #535474]
|
|
|
|
|
|
2002-05-19 21:14:24 -03:00
|
|
|
|
- The email.Parser.Parser class now properly parses strings regardless
|
|
|
|
|
of their line endings, which can be any of \r, \n, or \r\n (CR, LF,
|
|
|
|
|
or CRLF). Also, the Header class's constructor default arguments
|
|
|
|
|
has changed slightly so that an explicit maxlinelen value is always
|
2002-12-30 15:27:08 -04:00
|
|
|
|
honored, and so unicode conversion error handling can be specified.
|
2002-05-19 21:14:24 -03:00
|
|
|
|
|
2003-01-02 23:30:21 -04:00
|
|
|
|
- distutils' build_ext command now links C++ extensions with the C++
|
2002-11-05 12:50:05 -04:00
|
|
|
|
compiler available in the Makefile or CXX environment variable, if
|
2003-01-02 23:30:21 -04:00
|
|
|
|
running under \*nix.
|
2002-11-05 12:50:05 -04:00
|
|
|
|
|
|
|
|
|
- New module bz2: provides a comprehensive interface for the bz2 compression
|
|
|
|
|
library. It implements a complete file interface, one-shot (de)compression
|
|
|
|
|
functions, and types for sequential (de)compression.
|
|
|
|
|
|
2003-01-02 23:30:21 -04:00
|
|
|
|
- New pdb command 'pp' which is like 'p' except that it pretty-prints
|
2002-11-05 18:41:33 -04:00
|
|
|
|
the value of its expression argument.
|
|
|
|
|
|
2002-11-06 14:44:26 -04:00
|
|
|
|
- Now bdist_rpm distutils command understands a verify_script option in
|
|
|
|
|
the config file, including the contents of the referred filename in
|
|
|
|
|
the "%verifyscript" section of the rpm spec file.
|
|
|
|
|
|
2002-11-25 13:25:04 -04:00
|
|
|
|
- Fixed bug #495695: webbrowser module would run graphic browsers in a
|
|
|
|
|
unix environment even if DISPLAY was not set. Also, support for
|
|
|
|
|
skipstone browser was included.
|
|
|
|
|
|
2002-12-16 09:11:57 -04:00
|
|
|
|
- Fixed bug #636769: rexec would run unallowed code if subclasses of
|
|
|
|
|
strings were used as parameters for certain functions.
|
|
|
|
|
|
2001-12-21 17:36:50 -04:00
|
|
|
|
Tools/Demos
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------
|
2001-12-21 17:36:50 -04:00
|
|
|
|
|
2002-11-22 04:36:54 -04:00
|
|
|
|
- pygettext.py now supports globbing on Windows, and accepts module
|
|
|
|
|
names in addition to accepting file names.
|
|
|
|
|
|
2002-09-17 17:58:59 -03:00
|
|
|
|
- The SGI demos (Demo/sgi) have been removed. Nobody thought they
|
|
|
|
|
were interesting any more. (The SGI library modules and extensions
|
|
|
|
|
are still there; it is believed that at least some of these are
|
|
|
|
|
still used and useful.)
|
|
|
|
|
|
2002-08-05 12:24:19 -03:00
|
|
|
|
- IDLE supports the new encoding declarations (PEP 263); it can also
|
|
|
|
|
deal with legacy 8-bit files if they use the locale's encoding. It
|
|
|
|
|
allows non-ASCII strings in the interactive shell and executes them
|
|
|
|
|
in the locale's encoding.
|
2002-08-05 12:11:26 -03:00
|
|
|
|
|
2002-04-04 12:17:11 -04:00
|
|
|
|
- freeze.py now produces binaries which can import shared modules,
|
|
|
|
|
unlike before when this failed due to missing symbol exports in
|
|
|
|
|
the generated binary.
|
|
|
|
|
|
2001-12-21 17:36:50 -04:00
|
|
|
|
Build
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-12-21 17:36:50 -04:00
|
|
|
|
|
2002-11-06 17:59:33 -04:00
|
|
|
|
- On Unix, IDLE is now installed automatically.
|
|
|
|
|
|
2002-09-25 12:02:44 -03:00
|
|
|
|
- The fpectl module is not built by default; it's dangerous or useless
|
|
|
|
|
except in the hands of experts.
|
|
|
|
|
|
2002-07-31 23:34:51 -03:00
|
|
|
|
- The public Python C API will generally be declared using PyAPI_FUNC
|
2002-09-25 12:02:44 -03:00
|
|
|
|
and PyAPI_DATA macros, while Python extension module init functions
|
|
|
|
|
will be declared with PyMODINIT_FUNC. DL_EXPORT/DL_IMPORT macros
|
|
|
|
|
are deprecated.
|
2002-07-22 10:21:10 -03:00
|
|
|
|
|
2002-07-08 19:11:52 -03:00
|
|
|
|
- A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or
|
|
|
|
|
get into infinite loops, when a new-style class got garbage-collected.
|
|
|
|
|
Unfortunately, to avoid this, the way COUNT_ALLOCS works requires
|
|
|
|
|
that new-style classes be immortal in COUNT_ALLOCS builds. Note that
|
|
|
|
|
COUNT_ALLOCS is not enabled by default, in either release or debug
|
|
|
|
|
builds, and that new-style classes are immortal only in COUNT_ALLOCS
|
|
|
|
|
builds.
|
|
|
|
|
|
2002-07-07 00:59:34 -03:00
|
|
|
|
- Compiling out the cyclic garbage collector is no longer an option.
|
|
|
|
|
The old symbol WITH_CYCLE_GC is now ignored, and Python.h arranges
|
|
|
|
|
that it's always defined (for the benefit of any extension modules
|
|
|
|
|
that may be conditionalizing on it). A bonus is that any extension
|
|
|
|
|
type participating in cyclic gc can choose to participate in the
|
|
|
|
|
Py_TRASHCAN mechanism now too; in the absence of cyclic gc, this used
|
|
|
|
|
to require editing the core to teach the trashcan mechanism about the
|
|
|
|
|
new type.
|
|
|
|
|
|
2002-07-28 13:33:45 -03:00
|
|
|
|
- According to Annex F of the current C standard,
|
2002-07-03 00:31:20 -03:00
|
|
|
|
|
|
|
|
|
The Standard C macro HUGE_VAL and its float and long double analogs,
|
|
|
|
|
HUGE_VALF and HUGE_VALL, expand to expressions whose values are
|
|
|
|
|
positive infinities.
|
|
|
|
|
|
|
|
|
|
Python only uses the double HUGE_VAL, and only to #define its own symbol
|
|
|
|
|
Py_HUGE_VAL. Some platforms have incorrect definitions for HUGE_VAL.
|
|
|
|
|
pyport.h used to try to worm around that, but the workarounds triggered
|
|
|
|
|
other bugs on other platforms, so we gave up. If your platform defines
|
|
|
|
|
HUGE_VAL incorrectly, you'll need to #define Py_HUGE_VAL to something
|
|
|
|
|
that works on your platform. The only instance of this I'm sure about
|
|
|
|
|
is on an unknown subset of Cray systems, described here:
|
|
|
|
|
|
|
|
|
|
http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm
|
|
|
|
|
|
|
|
|
|
Presumably 2.3a1 breaks such systems. If anyone uses such a system, help!
|
|
|
|
|
|
2002-06-09 10:33:54 -03:00
|
|
|
|
- The configure option --without-doc-strings can be used to remove the
|
|
|
|
|
doc strings from the builtin functions and modules; this reduces the
|
|
|
|
|
size of the executable.
|
|
|
|
|
|
2002-08-15 11:01:14 -03:00
|
|
|
|
- The universal newlines option (PEP 278) is on by default. On Unix
|
|
|
|
|
it can be disabled by passing --without-universal-newlines to the
|
|
|
|
|
configure script. On other platforms, remove
|
|
|
|
|
WITH_UNIVERSAL_NEWLINES from pyconfig.h.
|
2002-04-21 04:30:30 -03:00
|
|
|
|
|
2002-03-29 12:28:31 -04:00
|
|
|
|
- On Unix, a shared libpython2.3.so can be created with --enable-shared.
|
|
|
|
|
|
2002-03-30 06:06:07 -04:00
|
|
|
|
- All uses of the CACHE_HASH, INTERN_STRINGS, and DONT_SHARE_SHORT_STRINGS
|
|
|
|
|
preprocessor symbols were eliminated. The internal decisions they
|
|
|
|
|
controlled stopped being experimental long ago.
|
2002-03-28 23:29:08 -04:00
|
|
|
|
|
2002-05-02 18:17:00 -03:00
|
|
|
|
- The tools used to build the documentation now work under Cygwin as
|
|
|
|
|
well as Unix.
|
|
|
|
|
|
2002-06-14 17:30:31 -03:00
|
|
|
|
- The bsddb and dbm module builds have been changed to try and avoid version
|
|
|
|
|
skew problems and disable linkage with Berkeley DB 1.85 unless the
|
|
|
|
|
installer knows what s/he's doing. See the section on building these
|
|
|
|
|
modules in the README file for details.
|
|
|
|
|
|
2001-12-21 17:36:50 -04:00
|
|
|
|
C API
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-12-21 17:36:50 -04:00
|
|
|
|
|
2002-11-18 12:19:39 -04:00
|
|
|
|
- PyNumber_Check() now returns true for string and unicode objects.
|
|
|
|
|
This is a result of these types having a partially defined
|
2002-11-18 12:27:16 -04:00
|
|
|
|
tp_as_number slot. (This is not a feature, but an indication that
|
2002-11-19 17:20:25 -04:00
|
|
|
|
PyNumber_Check() is not very useful to determine numeric behavior.
|
2002-11-18 12:27:16 -04:00
|
|
|
|
It may be deprecated.)
|
2002-11-18 12:19:39 -04:00
|
|
|
|
|
2002-08-19 18:43:18 -03:00
|
|
|
|
- The string object's layout has changed: the pointer member
|
|
|
|
|
ob_sinterned has been replaced by an int member ob_sstate. On some
|
|
|
|
|
platforms (e.g. most 64-bit systems) this may change the offset of
|
|
|
|
|
the ob_sval member, so as a precaution the API_VERSION has been
|
|
|
|
|
incremented. The apparently unused feature of "indirect interned
|
|
|
|
|
strings", supported by the ob_sinterned member, is gone. Interned
|
2003-03-11 17:43:55 -04:00
|
|
|
|
strings are now usually mortal; there is a new API,
|
2002-08-19 18:43:18 -03:00
|
|
|
|
PyString_InternImmortal() that creates immortal interned strings.
|
|
|
|
|
(The ob_sstate member can only take three values; however, while
|
|
|
|
|
making it a char saves a few bytes per string object on average, in
|
|
|
|
|
it also slowed things down a bit because ob_sval was no longer
|
|
|
|
|
aligned.)
|
|
|
|
|
|
2002-08-14 18:20:32 -03:00
|
|
|
|
- The Py_InitModule*() functions now accept NULL for the 'methods'
|
|
|
|
|
argument. Modules without global functions are becoming more common
|
|
|
|
|
now that factories can be types rather than functions.
|
|
|
|
|
|
2002-08-11 09:23:04 -03:00
|
|
|
|
- New C API PyUnicode_FromOrdinal() which exposes unichr() at C
|
|
|
|
|
level.
|
|
|
|
|
|
2002-07-29 11:27:41 -03:00
|
|
|
|
- New functions PyErr_SetExcFromWindowsErr() and
|
|
|
|
|
PyErr_SetExcFromWindowsErrWithFilename(). Similar to
|
|
|
|
|
PyErr_SetFromWindowsErrWithFilename() and
|
|
|
|
|
PyErr_SetFromWindowsErr(), but they allow to specify
|
|
|
|
|
the exception type to raise. Available on Windows.
|
|
|
|
|
|
2002-07-08 23:57:01 -03:00
|
|
|
|
- Py_FatalError() is now declared as taking a const char* argument. It
|
|
|
|
|
was previously declared without const. This should not affect working
|
|
|
|
|
code.
|
|
|
|
|
|
2002-05-08 05:44:21 -03:00
|
|
|
|
- Added new macro PySequence_ITEM(o, i) that directly calls
|
|
|
|
|
sq_item without rechecking that o is a sequence and without
|
|
|
|
|
adjusting for negative indices.
|
|
|
|
|
|
2002-05-02 18:28:26 -03:00
|
|
|
|
- PyRange_New() now raises ValueError if the fourth argument is not 1.
|
|
|
|
|
This is part of the removal of deprecated features of the xrange
|
|
|
|
|
object.
|
|
|
|
|
|
2002-04-25 23:49:14 -03:00
|
|
|
|
- PyNumber_Coerce() and PyNumber_CoerceEx() now also invoke the type's
|
|
|
|
|
coercion if both arguments have the same type but this type has the
|
|
|
|
|
CHECKTYPES flag set. This is to better support proxies.
|
|
|
|
|
|
2002-09-30 12:23:01 -03:00
|
|
|
|
- The type of tp_free has been changed from "``void (*)(PyObject *)``" to
|
|
|
|
|
"``void (*)(void *)``".
|
2002-04-12 20:00:08 -03:00
|
|
|
|
|
|
|
|
|
- PyObject_Del, PyObject_GC_Del are now functions instead of macros.
|
|
|
|
|
|
2002-04-07 22:38:42 -03:00
|
|
|
|
- A type can now inherit its metatype from its base type. Previously,
|
|
|
|
|
when PyType_Ready() was called, if ob_type was found to be NULL, it
|
|
|
|
|
was always set to &PyType_Type; now it is set to base->ob_type,
|
|
|
|
|
where base is tp_base, defaulting to &PyObject_Type.
|
|
|
|
|
|
|
|
|
|
- PyType_Ready() accidentally did not inherit tp_is_gc; now it does.
|
|
|
|
|
|
2002-05-08 11:14:41 -03:00
|
|
|
|
- The PyCore_* family of APIs have been removed.
|
2002-03-22 13:06:59 -04:00
|
|
|
|
|
2002-05-07 17:58:03 -03:00
|
|
|
|
- The "u#" parser marker will now pass through Unicode objects as-is
|
2002-01-09 12:21:27 -04:00
|
|
|
|
without going through the buffer API.
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
- The enumerators of cmp_op have been renamed to use the prefix ``PyCmp_``.
|
2002-01-01 15:59:11 -04:00
|
|
|
|
|
2001-12-25 15:07:38 -04:00
|
|
|
|
- An old #define of ANY as void has been removed from pyport.h. This
|
|
|
|
|
hasn't been used since Python's pre-ANSI days, and the #define has
|
|
|
|
|
been marked as obsolete since then. SF bug 495548 says it created
|
|
|
|
|
conflicts with other packages, so keeping it around wasn't harmless.
|
|
|
|
|
|
2001-12-21 17:36:50 -04:00
|
|
|
|
- Because Python's magic number scheme broke on January 1st, we decided
|
|
|
|
|
to stop Python development. Thanks for all the fish!
|
|
|
|
|
|
2002-03-10 20:24:00 -04:00
|
|
|
|
- Some of us don't like fish, so we changed Python's magic number
|
2002-02-09 07:28:43 -04:00
|
|
|
|
scheme to a new one. See Python/import.c for details.
|
|
|
|
|
|
2001-12-21 17:36:50 -04:00
|
|
|
|
New platforms
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------------
|
2001-12-21 17:36:50 -04:00
|
|
|
|
|
2002-12-06 08:48:53 -04:00
|
|
|
|
- OpenVMS is now supported.
|
|
|
|
|
|
2002-06-11 03:22:31 -03:00
|
|
|
|
- AtheOS is now supported.
|
|
|
|
|
|
2002-08-04 04:25:58 -03:00
|
|
|
|
- the EMX runtime environment on OS/2 is now supported.
|
|
|
|
|
|
2002-01-01 14:41:33 -04:00
|
|
|
|
- GNU/Hurd is now supported.
|
|
|
|
|
|
2001-12-21 17:36:50 -04:00
|
|
|
|
Tests
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
|
|
|
|
|
2002-11-26 17:44:56 -04:00
|
|
|
|
- The regrtest.py script's -u option now provides a way to say "allow
|
|
|
|
|
all resources except this one." For example, to allow everything
|
|
|
|
|
except bsddb, give the option '-uall,-bsddb'.
|
2001-12-21 17:36:50 -04:00
|
|
|
|
|
|
|
|
|
Windows
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-12-21 17:36:50 -04:00
|
|
|
|
|
2002-11-22 23:49:08 -04:00
|
|
|
|
- The Windows distribution now ships with version 4.0.14 of the
|
|
|
|
|
Sleepycat Berkeley database library. This should be a huge
|
|
|
|
|
improvement over the previous Berkeley DB 1.85, which had many
|
|
|
|
|
bugs.
|
|
|
|
|
XXX What are the licensing issues here?
|
2003-03-11 17:43:55 -04:00
|
|
|
|
XXX If a user has a database created with a previous version of
|
2002-11-23 14:48:06 -04:00
|
|
|
|
XXX Python, what must they do to convert it?
|
|
|
|
|
XXX I'm still not sure how to link this thing (see PCbuild/readme.txt).
|
2002-11-22 23:49:08 -04:00
|
|
|
|
XXX The version # is likely to change before 2.3a1.
|
2002-12-16 16:57:22 -04:00
|
|
|
|
|
|
|
|
|
- The Windows distribution now ships with a Secure Sockets Library (SLL)
|
2002-12-03 02:16:08 -04:00
|
|
|
|
module (_ssl.pyd)
|
2002-11-22 23:49:08 -04:00
|
|
|
|
|
2002-11-14 19:31:58 -04:00
|
|
|
|
- The Windows distribution now ships with Tcl/Tk version 8.4.1 (it
|
|
|
|
|
previously shipped with Tcl/Tk 8.3.2).
|
|
|
|
|
|
2002-11-11 15:51:33 -04:00
|
|
|
|
- When Python is built under a Microsoft compiler, sys.version now
|
|
|
|
|
includes the compiler version number (_MSC_VER). For example, under
|
2003-03-11 17:43:55 -04:00
|
|
|
|
MSVC 6, sys.version contains the substring "MSC v.1200 ". 1200 is
|
2002-11-11 15:51:33 -04:00
|
|
|
|
the value of _MSC_VER under MSVC 6.
|
|
|
|
|
|
2002-04-16 17:48:01 -03:00
|
|
|
|
- Sometimes the uninstall executable (UNWISE.EXE) vanishes. One cause
|
|
|
|
|
of that has been fixed in the installer (disabled Wise's "delete in-
|
|
|
|
|
use files" uninstall option).
|
|
|
|
|
|
2002-04-05 20:23:25 -04:00
|
|
|
|
- Fixed a bug in urllib's proxy handling in Windows. [SF bug #503031]
|
|
|
|
|
|
2002-04-04 16:02:04 -04:00
|
|
|
|
- The installer now installs Start menu shortcuts under (the local
|
|
|
|
|
equivalent of) "All Users" when doing an Admin install.
|
|
|
|
|
|
2002-03-10 20:24:00 -04:00
|
|
|
|
- file.truncate([newsize]) now works on Windows for all newsize values.
|
|
|
|
|
It used to fail if newsize didn't fit in 32 bits, reflecting a
|
|
|
|
|
limitation of MS _chsize (which is no longer used).
|
|
|
|
|
|
2002-02-01 07:27:43 -04:00
|
|
|
|
- os.waitpid() is now implemented for Windows, and can be used to block
|
|
|
|
|
until a specified process exits. This is similar to, but not exactly
|
|
|
|
|
the same as, os.waitpid() on POSIX systems. If you're waiting for
|
|
|
|
|
a specific process whose pid was obtained from one of the spawn()
|
|
|
|
|
functions, the same Python os.waitpid() code works across platforms.
|
2002-04-04 16:02:04 -04:00
|
|
|
|
See the docs for details. The docs were changed to clarify that
|
|
|
|
|
spawn functions return, and waitpid requires, a process handle on
|
|
|
|
|
Windows (not the same thing as a Windows process id).
|
2002-02-01 07:27:43 -04:00
|
|
|
|
|
2002-01-31 20:52:29 -04:00
|
|
|
|
- New tempfile.TemporaryFile implementation for Windows: this doesn't
|
2002-05-07 17:58:03 -03:00
|
|
|
|
need a TemporaryFileWrapper wrapper anymore, and should be immune
|
2002-01-31 20:52:29 -04:00
|
|
|
|
to a nasty problem: before 2.3, if you got a temp file on Windows, it
|
|
|
|
|
got wrapped in an object whose close() method first closed the
|
|
|
|
|
underlying file, then deleted the file. This usually worked fine.
|
|
|
|
|
However, the spawn family of functions on Windows create (at a low C
|
|
|
|
|
level) the same set of open files in the spawned process Q as were
|
|
|
|
|
open in the spawning process P. If a temp file f was among them, then
|
|
|
|
|
doing f.close() in P first closed P's C-level file handle on f, but Q's
|
|
|
|
|
C-level file handle on f remained open, so the attempt in P to delete f
|
|
|
|
|
blew up with a "Permission denied" error (Windows doesn't allow
|
|
|
|
|
deleting open files). This was surprising, subtle, and difficult to
|
|
|
|
|
work around.
|
|
|
|
|
|
|
|
|
|
- The os module now exports all the symbolic constants usable with the
|
|
|
|
|
low-level os.open() on Windows: the new constants in 2.3 are
|
|
|
|
|
O_NOINHERIT, O_SHORT_LIVED, O_TEMPORARY, O_RANDOM and O_SEQUENTIAL.
|
|
|
|
|
The others were also available in 2.2: O_APPEND, O_BINARY, O_CREAT,
|
|
|
|
|
O_EXCL, O_RDONLY, O_RDWR, O_TEXT, O_TRUNC and O_WRONLY. Contrary
|
|
|
|
|
to Microsoft docs, O_SHORT_LIVED does not seem to imply O_TEMPORARY
|
|
|
|
|
(so specify both if you want both; note that neither is useful unless
|
|
|
|
|
specified with O_CREAT too).
|
|
|
|
|
|
2001-12-21 17:36:50 -04:00
|
|
|
|
Mac
|
2002-09-20 11:16:59 -03:00
|
|
|
|
----
|
|
|
|
|
|
2002-12-23 07:25:49 -04:00
|
|
|
|
- Mac/Relnotes is gone, the release notes are now here.
|
|
|
|
|
|
2003-02-10 06:06:18 -04:00
|
|
|
|
- Python (the OSX-only, unix-based version, not the OS9-compatible CFM
|
|
|
|
|
version) now fully supports unicode strings as arguments to various file
|
|
|
|
|
system calls, eg. open(), file(), os.stat() and os.listdir().
|
|
|
|
|
|
2002-12-23 07:25:49 -04:00
|
|
|
|
- The current naming convention for Python on the Macintosh is that MacPython
|
|
|
|
|
refers to the unix-based OSX-only version, and MacPython-OS9 refers to the
|
|
|
|
|
CFM-based version that runs on both OS9 and OSX.
|
|
|
|
|
|
|
|
|
|
- All MacPython-OS9 functionality is now available in an OSX unix build,
|
|
|
|
|
including the Carbon modules, the IDE, OSA support, etc. A lot of this
|
|
|
|
|
will only work correctly in a framework build, though, because you cannot
|
|
|
|
|
talk to the window manager unless your application is run from a .app
|
|
|
|
|
bundle. There is a command line tool "pythonw" that runs your script
|
|
|
|
|
with an interpreter living in such a .app bundle, this interpreter should
|
|
|
|
|
be used to run any Python script using the window manager (including
|
|
|
|
|
Tkinter or wxPython scripts).
|
2003-01-02 12:02:27 -04:00
|
|
|
|
|
2002-12-30 18:42:43 -04:00
|
|
|
|
- Most of Mac/Lib has moved to Lib/plat-mac, which is again used both in
|
|
|
|
|
MacPython-OSX and MacPython-OS9. The only modules remaining in Mac/Lib
|
|
|
|
|
are specifically for MacPython-OS9 (CFM support, preference resources, etc).
|
2002-12-29 16:14:11 -04:00
|
|
|
|
|
2002-12-23 07:25:49 -04:00
|
|
|
|
- A new utility PythonLauncher will start a Python interpreter when a .py or
|
|
|
|
|
.pyw script is double-clicked in the Finder. By default .py scripts are
|
|
|
|
|
run with a normal Python interpreter in a Terminal window and .pyw
|
|
|
|
|
files are run with a window-aware pythonw interpreter without a Terminal
|
|
|
|
|
window, but all this can be customized.
|
2002-12-29 16:14:11 -04:00
|
|
|
|
|
2002-12-23 07:25:49 -04:00
|
|
|
|
- MacPython-OS9 is now Carbon-only, so it runs on Mac OS 9 or Mac OS X and
|
|
|
|
|
possibly on Mac OS 8.6 with the right CarbonLib installed, but not on earlier
|
|
|
|
|
releases.
|
2002-12-29 16:14:11 -04:00
|
|
|
|
|
2002-12-23 07:25:49 -04:00
|
|
|
|
- Many tools such as BuildApplet.py and gensuitemodule.py now support a command
|
|
|
|
|
line interface too.
|
2002-12-29 16:14:11 -04:00
|
|
|
|
|
2002-12-23 07:25:49 -04:00
|
|
|
|
- All the Carbon classes are now PEP253 compliant, meaning that you can
|
|
|
|
|
subclass them from Python. Most of the attributes have gone, you should
|
|
|
|
|
now use the accessor function call API, which is also what Apple's
|
|
|
|
|
documentation uses. Some attributes such as grafport.visRgn are still
|
|
|
|
|
available for convenience.
|
2002-12-29 16:14:11 -04:00
|
|
|
|
|
2002-12-23 07:25:49 -04:00
|
|
|
|
- New Carbon modules File (implementing the APIs in Files.h and Aliases.h)
|
|
|
|
|
and Folder (APIs from Folders.h). The old macfs builtin module is
|
|
|
|
|
gone, and replaced by a Python wrapper around the new modules.
|
|
|
|
|
|
|
|
|
|
- Pathname handling should now be fully consistent: MacPython-OSX always uses
|
|
|
|
|
unix pathnames and MacPython-OS9 always uses colon-separated Mac pathnames
|
|
|
|
|
(also when running on Mac OS X).
|
2002-12-29 16:14:11 -04:00
|
|
|
|
|
2002-12-23 07:25:49 -04:00
|
|
|
|
- New Carbon modules Help and AH give access to the Carbon Help Manager.
|
|
|
|
|
There are hooks in the IDE to allow accessing the Python documentation
|
|
|
|
|
(and Apple's Carbon and Cocoa documentation) through the Help Viewer.
|
|
|
|
|
See Mac/OSX/README for converting the Python documentation to a
|
2003-03-11 17:43:55 -04:00
|
|
|
|
Help Viewer compatible form and installing it.
|
2002-12-29 16:14:11 -04:00
|
|
|
|
|
2002-12-23 07:25:49 -04:00
|
|
|
|
- OSA support has been redesigned and the generated Python classes now
|
|
|
|
|
mirror the inheritance defined by the underlying OSA classes.
|
2002-12-29 16:14:11 -04:00
|
|
|
|
|
2002-12-23 07:25:49 -04:00
|
|
|
|
- MacPython no longer maps both \r and \n to \n on input for any text file.
|
|
|
|
|
This feature has been replaced by universal newline support (PEP278).
|
2003-01-08 16:40:01 -04:00
|
|
|
|
|
2003-01-08 12:29:17 -04:00
|
|
|
|
- The default encoding for Python sourcefiles in MacPython-OS9 is no longer
|
2003-02-19 21:52:48 -04:00
|
|
|
|
mac-roman (or whatever your local Mac encoding was) but "ascii", like on
|
2003-01-08 12:29:17 -04:00
|
|
|
|
other platforms. If you really need sourcefiles with Mac characters in them
|
|
|
|
|
you can change this in site.py.
|
2001-12-21 17:36:50 -04:00
|
|
|
|
|
2003-02-19 21:56:17 -04:00
|
|
|
|
|
2001-12-14 19:16:18 -04:00
|
|
|
|
What's New in Python 2.2 final?
|
|
|
|
|
===============================
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
*Release date: 21-Dec-2001*
|
|
|
|
|
|
2001-12-14 19:16:18 -04:00
|
|
|
|
Type/class unification and new-style classes
|
2002-09-20 11:16:59 -03:00
|
|
|
|
--------------------------------------------
|
2001-12-14 19:16:18 -04:00
|
|
|
|
|
2001-12-21 16:04:22 -04:00
|
|
|
|
- pickle.py, cPickle: allow pickling instances of new-style classes
|
|
|
|
|
with a custom metaclass.
|
|
|
|
|
|
2001-12-14 19:16:18 -04:00
|
|
|
|
Core and builtins
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------------
|
2001-12-14 19:16:18 -04:00
|
|
|
|
|
2001-12-21 16:04:22 -04:00
|
|
|
|
- weakref proxy object: when comparing, unwrap both arguments if both
|
|
|
|
|
are proxies.
|
|
|
|
|
|
2001-12-14 19:16:18 -04:00
|
|
|
|
Extension modules
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------------
|
2001-12-14 19:16:18 -04:00
|
|
|
|
|
2001-12-21 16:04:22 -04:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-12-14 19:16:18 -04:00
|
|
|
|
Library
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-12-14 19:16:18 -04:00
|
|
|
|
|
2001-12-21 16:04:22 -04:00
|
|
|
|
- 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
|
2002-05-07 17:58:03 -03:00
|
|
|
|
when run from the standard regression test.
|
2001-12-21 16:04:22 -04:00
|
|
|
|
|
2001-12-14 19:16:18 -04:00
|
|
|
|
Tools/Demos
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------
|
2001-12-14 19:16:18 -04:00
|
|
|
|
|
|
|
|
|
Build
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-12-14 19:16:18 -04:00
|
|
|
|
|
|
|
|
|
C API
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-12-14 19:16:18 -04:00
|
|
|
|
|
|
|
|
|
New platforms
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------------
|
2001-12-14 19:16:18 -04:00
|
|
|
|
|
|
|
|
|
Tests
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-12-14 19:16:18 -04:00
|
|
|
|
|
|
|
|
|
Windows
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-12-14 19:16:18 -04:00
|
|
|
|
|
2001-12-21 16:04:22 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-12-14 19:16:18 -04:00
|
|
|
|
Mac
|
2002-09-20 11:16:59 -03:00
|
|
|
|
----
|
2001-12-14 19:16:18 -04:00
|
|
|
|
|
2001-12-21 16:04:22 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-12-14 19:16:18 -04:00
|
|
|
|
|
2001-12-13 15:34:00 -04:00
|
|
|
|
What's New in Python 2.2c1?
|
2001-11-16 20:21:57 -04:00
|
|
|
|
===========================
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
*Release date: 14-Dec-2001*
|
|
|
|
|
|
2001-11-16 20:21:57 -04:00
|
|
|
|
Type/class unification and new-style classes
|
2002-09-20 11:16:59 -03:00
|
|
|
|
--------------------------------------------
|
2001-11-16 20:21:57 -04:00
|
|
|
|
|
2001-12-14 16:47:12 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-12-05 18:45:48 -04:00
|
|
|
|
- Fixed a leak: instance variables declared with __slots__ were never
|
|
|
|
|
deleted!
|
|
|
|
|
|
2001-12-02 20:54:52 -04:00
|
|
|
|
- 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.)
|
|
|
|
|
|
2001-12-03 11:46:59 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-12-04 17:02:07 -04:00
|
|
|
|
- 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__).
|
2001-12-03 11:46:59 -04:00
|
|
|
|
|
2001-12-05 15:46:42 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-11-16 20:21:57 -04:00
|
|
|
|
Core and builtins
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------------
|
2001-11-16 20:21:57 -04:00
|
|
|
|
|
2001-12-06 02:23:26 -04:00
|
|
|
|
- -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.
|
2001-12-11 17:43:14 -04:00
|
|
|
|
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).
|
2001-12-06 02:23:26 -04:00
|
|
|
|
|
2001-12-14 13:08:12 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-11-16 20:21:57 -04:00
|
|
|
|
Extension modules
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------------
|
2001-11-16 20:21:57 -04:00
|
|
|
|
|
2001-11-24 05:24:51 -04:00
|
|
|
|
- gc.get_referents was renamed to gc.get_referrers.
|
|
|
|
|
|
2001-11-16 20:21:57 -04:00
|
|
|
|
Library
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-11-16 20:21:57 -04:00
|
|
|
|
|
2001-12-07 16:35:43 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-11-25 10:35:58 -04:00
|
|
|
|
- webbrowser defaults to netscape.exe on OS/2 now.
|
|
|
|
|
|
2001-11-25 10:50:56 -04:00
|
|
|
|
- Tix.ResizeHandle exposes detach_widget, hide, and show.
|
|
|
|
|
|
2001-12-02 08:26:03 -04:00
|
|
|
|
- The charset alias windows_1252 has been added.
|
|
|
|
|
|
2001-12-14 16:47:12 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-11-16 20:21:57 -04:00
|
|
|
|
Tools/Demos
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------
|
2001-11-16 20:21:57 -04:00
|
|
|
|
|
2001-12-14 16:47:12 -04:00
|
|
|
|
- A new script called Tools/scripts/google.py was added, which fires
|
|
|
|
|
off a search on Google.
|
|
|
|
|
|
2001-11-16 20:21:57 -04:00
|
|
|
|
Build
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-11-16 20:21:57 -04:00
|
|
|
|
|
2001-12-14 16:47:12 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-12-06 17:47:20 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-11-16 20:21:57 -04:00
|
|
|
|
C API
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-11-16 20:21:57 -04:00
|
|
|
|
|
2001-12-11 14:51:08 -04:00
|
|
|
|
- New function PyDict_MergeFromSeq2() exposes the builtin dict
|
|
|
|
|
constructor's logic for updating a dictionary from an iterable object
|
|
|
|
|
producing key-value pairs.
|
|
|
|
|
|
2001-11-28 23:26:37 -04:00
|
|
|
|
- PyArg_ParseTupleAndKeywords() requires that the number of entries in
|
2001-12-11 14:51:08 -04:00
|
|
|
|
the keyword list equal the number of argument specifiers. This
|
2001-11-28 23:26:37 -04:00
|
|
|
|
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.
|
|
|
|
|
|
2001-11-16 20:21:57 -04:00
|
|
|
|
New platforms
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------------
|
2001-11-16 20:21:57 -04:00
|
|
|
|
|
|
|
|
|
Tests
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-11-16 20:21:57 -04:00
|
|
|
|
|
|
|
|
|
Windows
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-11-16 20:21:57 -04:00
|
|
|
|
|
|
|
|
|
Mac
|
2002-09-20 11:16:59 -03:00
|
|
|
|
----
|
2001-11-16 20:21:57 -04:00
|
|
|
|
|
2001-12-06 17:14:00 -04:00
|
|
|
|
- In unix-Python on Mac OS X (and darwin) sys.platform is now "darwin",
|
|
|
|
|
without any trailing digits.
|
2001-11-16 20:21:57 -04:00
|
|
|
|
|
2001-12-14 16:47:12 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
|
|
|
|
|
2001-10-19 14:55:30 -03:00
|
|
|
|
What's New in Python 2.2b2?
|
|
|
|
|
===========================
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
*Release date: 16-Nov-2001*
|
|
|
|
|
|
2001-10-19 14:55:30 -03:00
|
|
|
|
Type/class unification and new-style classes
|
2002-09-20 11:16:59 -03:00
|
|
|
|
--------------------------------------------
|
2001-10-19 14:55:30 -03:00
|
|
|
|
|
2001-11-15 16:27:54 -04:00
|
|
|
|
- Multiple inheritance mixing new-style and classic classes in the
|
|
|
|
|
list of base classes is now allowed, so this works now:
|
2001-11-15 16:02:21 -04:00
|
|
|
|
|
|
|
|
|
class Classic: pass
|
2001-11-15 16:27:54 -04:00
|
|
|
|
class Mixed(Classic, object): pass
|
2001-11-15 16:02:21 -04:00
|
|
|
|
|
|
|
|
|
The MRO (method resolution order) for each base class is respected
|
|
|
|
|
according to its kind, but the MRO for the derived class is computed
|
2002-05-07 17:58:03 -03:00
|
|
|
|
using new-style MRO rules if any base class is a new-style class.
|
2001-11-15 16:02:21 -04:00
|
|
|
|
This needs to be documented.
|
|
|
|
|
|
2001-10-29 18:25:45 -04:00
|
|
|
|
- The new builtin dictionary() constructor, and dictionary type, have
|
|
|
|
|
been renamed to dict. This reflects a decade of common usage.
|
|
|
|
|
|
2001-11-15 16:33:10 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-10-29 18:11:00 -04:00
|
|
|
|
- New-style classes can now have a __del__ method, which is called
|
|
|
|
|
when the instance is deleted (just like for classic classes).
|
|
|
|
|
|
2001-10-26 11:56:06 -03:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-10-21 21:43:43 -03:00
|
|
|
|
- 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__.
|
|
|
|
|
|
2001-10-27 19:28:54 -03:00
|
|
|
|
- The socket function has been converted to a type; see below.
|
|
|
|
|
|
2001-10-19 14:55:30 -03:00
|
|
|
|
Core and builtins
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------------
|
2001-10-19 14:55:30 -03:00
|
|
|
|
|
2001-11-09 17:06:24 -04:00
|
|
|
|
- Assignment to __debug__ raises SyntaxError at compile-time. This
|
|
|
|
|
was promised when 2.1c1 was released as "What's New in Python 2.1c1"
|
2001-11-16 12:17:27 -04:00
|
|
|
|
(see below) says.
|
2001-11-09 17:06:24 -04:00
|
|
|
|
|
2001-10-26 11:56:06 -03:00
|
|
|
|
- Clarified the error messages for unsupported operands to an operator
|
|
|
|
|
(like 1 + '').
|
|
|
|
|
|
2001-10-19 14:55:30 -03:00
|
|
|
|
Extension modules
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------------
|
2001-10-19 14:55:30 -03:00
|
|
|
|
|
2001-11-13 19:11:19 -04:00
|
|
|
|
- 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
|
2002-05-07 17:58:03 -03:00
|
|
|
|
uniform way because the mmap() signatures had diverged across
|
2001-11-13 19:11:19 -04:00
|
|
|
|
platforms. Thanks to Jay T Miller for repairing this!
|
|
|
|
|
|
2001-11-03 15:57:21 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-10-26 11:56:06 -03:00
|
|
|
|
- The socket module defines a new method for socket objects,
|
|
|
|
|
sendall(). This is like send() but may make multiple calls to
|
2001-10-27 19:28:54 -03:00
|
|
|
|
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.
|
2001-10-26 11:56:06 -03:00
|
|
|
|
|
|
|
|
|
- Various bugfixes to the curses module. There is now a test suite
|
|
|
|
|
for the curses module (you have to run it manually).
|
2001-10-22 13:37:10 -03:00
|
|
|
|
|
2001-10-29 23:03:03 -04:00
|
|
|
|
- binascii.b2a_base64 no longer places an arbitrary restriction of 57
|
|
|
|
|
bytes on its input.
|
|
|
|
|
|
2001-10-19 14:55:30 -03:00
|
|
|
|
Library
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-10-19 14:55:30 -03:00
|
|
|
|
|
2001-11-13 19:11:19 -04:00
|
|
|
|
- tkFileDialog exposes a Directory class and askdirectory
|
2001-11-07 18:38:08 -04:00
|
|
|
|
convenience function.
|
|
|
|
|
|
2001-11-03 15:35:43 -04:00
|
|
|
|
- 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.
|
2001-11-16 12:17:27 -04:00
|
|
|
|
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.
|
2001-11-03 15:35:43 -04:00
|
|
|
|
|
2001-11-02 19:48:20 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-10-22 22:59:54 -03:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-10-24 17:51:44 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-11-16 12:17:27 -04:00
|
|
|
|
- mimetypes.py has optional support for non-standard, but commonly
|
|
|
|
|
found types. guess_type() and guess_extension() now accept an
|
2002-09-20 11:16:59 -03:00
|
|
|
|
optional 'strict' flag, defaulting to true, which controls whether
|
2001-11-16 12:17:27 -04:00
|
|
|
|
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
|
2002-09-20 11:16:59 -03:00
|
|
|
|
hard coded to "GMT" timezone). An optional 'localtime' flag is
|
2001-11-16 12:17:27 -04:00
|
|
|
|
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.
|
|
|
|
|
|
2001-10-19 14:55:30 -03:00
|
|
|
|
Tools/Demos
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------
|
2001-10-19 14:55:30 -03:00
|
|
|
|
|
|
|
|
|
Build
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-10-19 14:55:30 -03:00
|
|
|
|
|
2001-11-16 12:17:27 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-10-19 14:55:30 -03:00
|
|
|
|
C API
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-10-19 14:55:30 -03:00
|
|
|
|
|
Generalize dictionary() to accept a sequence of 2-sequences. At the
outer level, the iterator protocol is used for memory-efficiency (the
outer sequence may be very large if fully materialized); at the inner
level, PySequence_Fast() is used for time-efficiency (these should
always be sequences of length 2).
dictobject.c, new functions PyDict_{Merge,Update}FromSeq2. These are
wholly analogous to PyDict_{Merge,Update}, but process a sequence-of-2-
sequences argument instead of a mapping object. For now, I left these
functions file static, so no corresponding doc changes. It's tempting
to change dict.update() to allow a sequence-of-2-seqs argument too.
Also changed the name of dictionary's keyword argument from "mapping"
to "x". Got a better name? "mapping_or_sequence_of_pairs" isn't
attractive, although more so than "mosop" <wink>.
abstract.h, abstract.tex: Added new PySequence_Fast_GET_SIZE function,
much faster than going thru the all-purpose PySequence_Size.
libfuncs.tex:
- Document dictionary().
- Fiddle tuple() and list() to admit that their argument is optional.
- The long-winded repetitions of "a sequence, a container that supports
iteration, or an iterator object" is getting to be a PITA. Many
months ago I suggested factoring this out into "iterable object",
where the definition of that could include being explicit about
generators too (as is, I'm not sure a reader outside of PythonLabs
could guess that "an iterator object" includes a generator call).
- Please check my curly braces -- I'm going blind <0.9 wink>.
abstract.c, PySequence_Tuple(): When PyObject_GetIter() fails, leave
its error msg alone now (the msg it produces has improved since
PySequence_Tuple was generalized to accept iterable objects, and
PySequence_Tuple was also stomping on the msg in cases it shouldn't
have even before PyObject_GetIter grew a better msg).
2001-10-26 02:06:50 -03:00
|
|
|
|
- New function PySequence_Fast_GET_SIZE() returns the size of a non-
|
|
|
|
|
NULL result from PySequence_Fast(), more quickly than calling
|
|
|
|
|
PySequence_Size().
|
|
|
|
|
|
2001-11-16 12:17:27 -04:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-10-19 14:55:30 -03:00
|
|
|
|
New platforms
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------------
|
2001-10-19 14:55:30 -03:00
|
|
|
|
|
2001-10-27 19:28:54 -03:00
|
|
|
|
- We've finally confirmed that this release builds on HP-UX 11.00,
|
|
|
|
|
*with* threads, and passes the test suite.
|
|
|
|
|
|
2001-11-04 22:51:07 -04:00
|
|
|
|
- Thanks to a series of patches from Michael Muller, Python may build
|
|
|
|
|
again under OS/2 Visual Age C++.
|
|
|
|
|
|
2001-10-24 17:51:44 -03:00
|
|
|
|
- Updated RISCOS port by Dietmar Schwertberger.
|
|
|
|
|
|
2001-10-19 14:55:30 -03:00
|
|
|
|
Tests
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-10-19 14:55:30 -03:00
|
|
|
|
|
2001-10-22 13:37:10 -03:00
|
|
|
|
- Added a test script for the curses module. It isn't run automatically;
|
|
|
|
|
regrtest.py must be run with '-u curses' to enable it.
|
|
|
|
|
|
2001-10-19 14:55:30 -03:00
|
|
|
|
Windows
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-10-19 14:55:30 -03:00
|
|
|
|
|
2001-11-16 12:17:27 -04:00
|
|
|
|
Mac
|
2002-09-20 11:16:59 -03:00
|
|
|
|
----
|
2001-11-16 12:17:27 -04:00
|
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
|
2001-10-19 14:55:30 -03:00
|
|
|
|
|
2001-09-28 18:53:42 -03:00
|
|
|
|
What's New in Python 2.2b1?
|
|
|
|
|
===========================
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
*Release date: 19-Oct-2001*
|
|
|
|
|
|
2001-09-28 18:53:42 -03:00
|
|
|
|
Type/class unification and new-style classes
|
2002-09-20 11:16:59 -03:00
|
|
|
|
--------------------------------------------
|
2001-09-28 18:53:42 -03:00
|
|
|
|
|
2001-10-15 19:03:32 -03:00
|
|
|
|
- New-style classes are now always dynamic (except for built-in and
|
2001-10-15 21:46:57 -03:00
|
|
|
|
extension types). There is no longer a performance penalty, and I
|
2001-10-15 19:03:32 -03:00
|
|
|
|
no longer see another reason to keep this baggage around. One relic
|
2001-10-15 21:46:57 -03:00
|
|
|
|
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
|
2001-10-15 19:03:32 -03:00
|
|
|
|
__defined__ attribute of new-style types no longer exists, for lack
|
|
|
|
|
of need: there is once again only one __dict__ (although in the
|
2001-10-15 21:46:57 -03:00
|
|
|
|
future a __cache__ may be resurrected with a similar function, if I
|
|
|
|
|
can prove that it actually speeds things up).
|
2001-10-04 16:46:06 -03:00
|
|
|
|
|
2001-10-04 03:43:12 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-10-16 18:34:49 -03:00
|
|
|
|
Core and builtins
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------------
|
2001-09-28 18:53:42 -03:00
|
|
|
|
|
2001-10-15 12:53:58 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-10-16 18:34:49 -03:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-10-22 15:41:51 -03:00
|
|
|
|
- Weak reference objects are now part of the core and offer a C API.
|
2001-10-18 15:18:06 -03:00
|
|
|
|
A bug which could allow a core dump when binary operations involved
|
2001-10-21 22:47:26 -03:00
|
|
|
|
proxy reference has been fixed. weakref.ReferenceError is now a
|
2001-10-19 02:35:40 -03:00
|
|
|
|
built-in exception.
|
2001-10-18 15:18:06 -03:00
|
|
|
|
|
2001-10-18 23:05:35 -03:00
|
|
|
|
- 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
|
2001-10-19 09:02:29 -03:00
|
|
|
|
require an 8-bit string or character buffer argument.
|
2001-10-18 23:05:35 -03:00
|
|
|
|
|
2001-10-19 02:35:40 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-10-16 18:34:49 -03:00
|
|
|
|
Extension modules
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------------
|
2001-10-16 18:34:49 -03:00
|
|
|
|
|
|
|
|
|
- thread.start_new_thread() now returns the thread ID (previously None).
|
|
|
|
|
|
2001-09-30 17:32:11 -03:00
|
|
|
|
- binascii has now two quopri support functions, a2b_qp and b2a_qp.
|
|
|
|
|
|
2001-10-18 22:31:59 -03:00
|
|
|
|
- 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
|
SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.
This is a big one, touching lots of files. Some of the platforms
aren't tested yet. Briefly, this changes the return value of the
os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the
time functions localtime(), gmtime(), and strptime() from tuples into
pseudo-sequences. When accessed as a sequence, they behave exactly as
before. But they also have attributes like st_mtime or tm_year. The
stat return value, moreover, has a few platform-specific attributes
that are not available through the sequence interface (because
everybody expects the sequence to have a fixed length, these couldn't
be added there). If your platform's struct stat doesn't define
st_blksize, st_blocks or st_rdev, they won't be accessible from Python
either.
(Still missing is a documentation update.)
2001-10-18 17:34:25 -03:00
|
|
|
|
attributes.
|
|
|
|
|
|
|
|
|
|
- time: localtime(), gmtime() and strptime() now return a
|
|
|
|
|
pseudo-sequence similar to the os.stat() return value, with
|
|
|
|
|
attributes like tm_year etc.
|
2001-10-04 19:46:41 -03:00
|
|
|
|
|
2001-10-16 18:34:49 -03:00
|
|
|
|
- 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.
|
2001-09-28 18:53:42 -03:00
|
|
|
|
|
2001-10-19 00:40:19 -03:00
|
|
|
|
- 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
|
2001-10-19 02:35:40 -03:00
|
|
|
|
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.
|
2001-10-19 00:40:19 -03:00
|
|
|
|
|
2001-10-16 18:34:49 -03:00
|
|
|
|
Library
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-10-16 18:13:49 -03:00
|
|
|
|
|
2001-10-02 00:53:41 -03:00
|
|
|
|
- doctest now excludes functions and classes not defined by the module
|
|
|
|
|
being tested, thanks to Tim Hochberg.
|
|
|
|
|
|
2001-10-22 15:41:51 -03:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-10-04 07:19:00 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-10-07 00:12:08 -03:00
|
|
|
|
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).
|
|
|
|
|
|
2001-10-09 02:31:56 -03:00
|
|
|
|
- Profile.calibrate() has a new implementation that should deliver
|
2001-10-09 17:51:19 -03:00
|
|
|
|
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).
|
|
|
|
|
|
2003-03-11 17:43:55 -04:00
|
|
|
|
Note that Profile.calibrate() must be overridden by subclasses.
|
2001-10-09 17:51:19 -03:00
|
|
|
|
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.
|
2001-10-09 02:31:56 -03:00
|
|
|
|
|
2001-09-30 17:32:11 -03:00
|
|
|
|
- quopri's encode and decode methods take an optional header parameter,
|
2001-10-16 17:42:52 -03:00
|
|
|
|
which indicates whether output is intended for the header 'Q'
|
|
|
|
|
encoding.
|
|
|
|
|
|
2001-10-18 15:02:07 -03:00
|
|
|
|
- The SocketServer.ThreadingMixIn class now closes the request after
|
|
|
|
|
finish_request() returns. (Not when it errors out though.)
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
- The nntplib module's NNTP.body() method has grown a 'file' argument
|
2001-10-19 02:35:40 -03:00
|
|
|
|
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.
|
|
|
|
|
|
2001-10-22 15:41:51 -03:00
|
|
|
|
- xml.dom.minidom NodeList objects now support the length attribute
|
|
|
|
|
and item() method as required by the DOM specifications.
|
|
|
|
|
|
2001-10-02 20:15:37 -03:00
|
|
|
|
Tools/Demos
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----------
|
2001-10-02 20:15:37 -03:00
|
|
|
|
|
|
|
|
|
- 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.
|
2001-09-28 18:53:42 -03:00
|
|
|
|
|
2001-10-19 02:35:40 -03:00
|
|
|
|
- The freeze tool has been made more robust, and two new options have
|
|
|
|
|
been added: -X and -E.
|
|
|
|
|
|
2001-09-28 18:53:42 -03:00
|
|
|
|
Build
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-09-28 18:53:42 -03:00
|
|
|
|
|
2001-10-19 02:35:40 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-09-28 18:53:42 -03:00
|
|
|
|
C API
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-09-28 18:53:42 -03:00
|
|
|
|
|
2001-10-18 16:20:25 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-09-30 02:09:37 -03:00
|
|
|
|
- PyLong_AsLongLong() now accepts int (as well as long) arguments.
|
|
|
|
|
Consequently, PyArg_ParseTuple's 'L' code also accepts int (as well
|
|
|
|
|
as long) arguments.
|
|
|
|
|
|
2001-10-16 18:13:49 -03:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-10-18 23:05:35 -03:00
|
|
|
|
- PyUnicode_FromEncodedObject() no longer accepts Unicode objects as
|
|
|
|
|
input.
|
|
|
|
|
|
2001-09-28 18:53:42 -03:00
|
|
|
|
New platforms
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------------
|
2001-09-28 18:53:42 -03:00
|
|
|
|
|
|
|
|
|
Tests
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-09-28 18:53:42 -03:00
|
|
|
|
|
|
|
|
|
Windows
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-09-28 18:53:42 -03:00
|
|
|
|
|
2001-10-09 19:39:40 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-10-01 14:58:40 -03:00
|
|
|
|
- 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
|
2002-09-30 12:23:01 -03:00
|
|
|
|
signal.signal(). For example::
|
2001-10-01 14:58:40 -03:00
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
# Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
|
|
|
|
|
# (SIGINT) behavior.
|
|
|
|
|
import signal
|
|
|
|
|
signal.signal(signal.SIGBREAK, signal.default_int_handler)
|
2001-10-01 14:58:40 -03:00
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
try:
|
2002-12-29 16:14:11 -04:00
|
|
|
|
while 1:
|
|
|
|
|
pass
|
2002-09-20 11:16:59 -03:00
|
|
|
|
except KeyboardInterrupt:
|
2002-12-29 16:14:11 -04:00
|
|
|
|
# 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"
|
2001-10-01 14:58:40 -03:00
|
|
|
|
|
2001-09-28 18:53:42 -03:00
|
|
|
|
|
2001-09-07 22:25:47 -03:00
|
|
|
|
What's New in Python 2.2a4?
|
|
|
|
|
===========================
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
*Release date: 28-Sep-2001*
|
|
|
|
|
|
2001-09-25 01:15:41 -03:00
|
|
|
|
Type/class unification and new-style classes
|
2002-09-20 11:16:59 -03:00
|
|
|
|
--------------------------------------------
|
2001-09-25 01:15:41 -03:00
|
|
|
|
|
|
|
|
|
- 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.)
|
2001-09-07 22:25:47 -03:00
|
|
|
|
|
2001-09-24 18:17:50 -03:00
|
|
|
|
- property() now takes 4 keyword arguments: fget, fset, fdel and doc.
|
2002-05-07 17:58:03 -03:00
|
|
|
|
These map to read-only attributes 'fget', 'fset', 'fdel', and '__doc__'
|
2001-09-24 18:17:50 -03:00
|
|
|
|
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.
|
|
|
|
|
|
2001-09-25 01:15:41 -03:00
|
|
|
|
- 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
|
2001-10-21 22:47:26 -03:00
|
|
|
|
*every* attribute access. A new __getattr__ hook more similar to the
|
2001-09-25 01:15:41 -03:00
|
|
|
|
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
|
2002-05-07 17:58:03 -03:00
|
|
|
|
a str subclass type, s[:] returned s as-is. Now it returns a str
|
2001-09-25 01:15:41 -03:00
|
|
|
|
with the same value as s.
|
|
|
|
|
|
2001-09-28 12:26:12 -03:00
|
|
|
|
- Provisional support for pickling new-style objects has been added.
|
|
|
|
|
|
2001-09-25 01:15:41 -03:00
|
|
|
|
Core
|
2002-09-20 11:16:59 -03:00
|
|
|
|
----
|
2001-09-25 01:15:41 -03:00
|
|
|
|
|
2001-09-23 01:06:05 -03:00
|
|
|
|
- file.writelines() now accepts any iterable object producing strings.
|
|
|
|
|
|
2001-09-20 09:59:37 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-10-21 22:47:26 -03:00
|
|
|
|
- PyFile_WriteObject now passes Unicode objects to the file's write
|
|
|
|
|
method. As a result, all file-like objects which may be the target
|
2001-09-19 10:47:32 -03:00
|
|
|
|
of a print statement must support Unicode objects, i.e. they must
|
|
|
|
|
at least convert them into ASCII strings.
|
|
|
|
|
|
2001-09-18 12:21:04 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-09-07 22:25:47 -03:00
|
|
|
|
Library
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-09-07 22:25:47 -03:00
|
|
|
|
|
2001-09-27 11:17:33 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-09-24 01:28:10 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-09-22 18:30:22 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-09-22 01:44:21 -03:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-09-19 08:33:31 -03:00
|
|
|
|
- The codecs module has grown four new helper APIs to access
|
|
|
|
|
builtin codecs: getencoder(), getdecoder(), getreader(),
|
|
|
|
|
getwriter().
|
|
|
|
|
|
2001-09-18 12:21:04 -03:00
|
|
|
|
- SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer)
|
|
|
|
|
simplifies writing XML RPC servers.
|
|
|
|
|
|
2001-09-28 14:01:02 -03:00
|
|
|
|
- os.path.realpath(): a new function that returns the absolute pathname
|
2001-09-18 12:21:04 -03:00
|
|
|
|
after interpretation of symbolic links. On non-Unix systems, this
|
|
|
|
|
is an alias for os.path.abspath().
|
|
|
|
|
|
2001-09-08 01:00:12 -03:00
|
|
|
|
- operator.indexOf() (PySequence_Index() in the C API) now works with any
|
|
|
|
|
iterable object.
|
|
|
|
|
|
2001-09-18 12:21:04 -03:00
|
|
|
|
- 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.
|
2001-09-14 13:35:16 -03:00
|
|
|
|
|
2001-09-18 12:21:04 -03:00
|
|
|
|
- mimetypes now recognizes more extensions and file types. At the
|
|
|
|
|
same time, some mappings not sanctioned by IANA were removed.
|
2001-09-14 13:35:16 -03:00
|
|
|
|
|
2001-09-18 12:21:04 -03:00
|
|
|
|
- The "compiler" package has been brought up to date to the state of
|
2001-09-20 02:30:24 -03:00
|
|
|
|
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.)
|
|
|
|
|
|
2001-09-07 22:25:47 -03:00
|
|
|
|
Build
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-09-07 22:25:47 -03:00
|
|
|
|
|
2001-09-18 12:21:04 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-09-07 22:25:47 -03:00
|
|
|
|
C API
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-09-07 22:25:47 -03:00
|
|
|
|
|
2001-09-18 12:21:04 -03:00
|
|
|
|
- The "structmember" API now supports some new flag bits to deny read
|
|
|
|
|
and/or write access to attributes in restricted execution mode.
|
|
|
|
|
|
2001-09-07 22:25:47 -03:00
|
|
|
|
New platforms
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------------
|
2001-09-07 22:25:47 -03:00
|
|
|
|
|
2001-09-18 12:21:04 -03:00
|
|
|
|
- Compaq's iPAQ handheld, running the "familiar" Linux distribution
|
|
|
|
|
(http://familiar.handhelds.org).
|
|
|
|
|
|
2001-09-07 22:25:47 -03:00
|
|
|
|
Tests
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-09-07 22:25:47 -03:00
|
|
|
|
|
2001-09-22 18:30:22 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-09-07 22:25:47 -03:00
|
|
|
|
Windows
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-09-07 22:25:47 -03:00
|
|
|
|
|
2001-09-18 12:21:04 -03:00
|
|
|
|
- Large file support now also works for files > 4GB, on filesystems
|
2001-09-22 18:30:22 -03:00
|
|
|
|
that support it (NTFS under Windows 2000). See "What's New in
|
|
|
|
|
Python 2.2a3" for more detail.
|
2001-09-18 12:21:04 -03:00
|
|
|
|
|
2001-09-07 22:25:47 -03:00
|
|
|
|
|
2001-08-22 18:36:50 -03:00
|
|
|
|
What's New in Python 2.2a3?
|
|
|
|
|
===========================
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
*Release Date: 07-Sep-2001*
|
|
|
|
|
|
2001-08-22 18:36:50 -03:00
|
|
|
|
Core
|
2002-09-20 11:16:59 -03:00
|
|
|
|
----
|
2001-08-22 18:36:50 -03:00
|
|
|
|
|
2001-09-04 02:14:19 -03:00
|
|
|
|
- Conversion of long to float now raises OverflowError if the long is too
|
|
|
|
|
big to represent as a C double.
|
|
|
|
|
|
2001-09-03 05:35:41 -03:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-09-03 02:47:38 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-09-02 00:40:59 -03:00
|
|
|
|
- Overflowing operations on plain ints now return a long int rather
|
2001-08-31 15:31:35 -03:00
|
|
|
|
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.
|
|
|
|
|
|
2001-09-04 00:26:15 -03:00
|
|
|
|
- A new command line option, -Q<arg>, is added to control run-time
|
2001-08-31 15:31:35 -03:00
|
|
|
|
warnings for the use of classic division. (See PEP 238.) Possible
|
2001-09-07 15:13:44 -03:00
|
|
|
|
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
|
2001-12-06 02:23:26 -04:00
|
|
|
|
(for use with fixdiv.py).
|
2002-09-20 11:16:59 -03:00
|
|
|
|
[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.
|
2001-08-31 15:31:35 -03:00
|
|
|
|
|
2001-09-02 00:40:59 -03:00
|
|
|
|
- Many built-in types can now be subclassed. This applies to int,
|
2001-08-31 15:31:35 -03:00
|
|
|
|
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.
|
|
|
|
|
|
2001-09-02 10:44:35 -03:00
|
|
|
|
- The dictionary constructor now takes an optional argument, a
|
|
|
|
|
mapping-like object, and initializes the dictionary from its
|
|
|
|
|
(key, value) pairs.
|
|
|
|
|
|
2001-09-02 00:40:59 -03:00
|
|
|
|
- A new built-in type, super, has been added. This facilitates making
|
2001-08-31 15:31:35 -03:00
|
|
|
|
"cooperative super calls" in a multiple inheritance setting. For an
|
|
|
|
|
explanation, see http://www.python.org/2.2/descrintro.html#cooperation
|
|
|
|
|
|
2001-09-06 19:02:58 -03:00
|
|
|
|
- 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
|
2001-08-31 15:31:35 -03:00
|
|
|
|
|
2001-09-02 00:40:59 -03:00
|
|
|
|
- The syntax of floating-point and imaginary literals has been
|
2001-08-30 17:51:59 -03:00
|
|
|
|
liberalized, to allow leading zeroes. Examples of literals now
|
|
|
|
|
legal that were SyntaxErrors before:
|
|
|
|
|
|
|
|
|
|
00.0 0e3 0100j 07.5 00000000000000000008.
|
|
|
|
|
|
2001-09-02 00:40:59 -03:00
|
|
|
|
- An old tokenizer bug allowed floating point literals with an incomplete
|
2001-08-28 17:56:27 -03:00
|
|
|
|
exponent, such as 1e and 3.1e-. Such literals now raise SyntaxError.
|
|
|
|
|
|
2001-08-22 18:36:50 -03:00
|
|
|
|
Library
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-08-22 18:36:50 -03:00
|
|
|
|
|
2001-09-06 05:54:16 -03:00
|
|
|
|
- telnetlib includes symbolic names for the options, and support for
|
2002-11-04 05:56:00 -04:00
|
|
|
|
setting an option negotiation callback. It also supports processing
|
|
|
|
|
of suboptions.
|
2001-09-06 05:54:16 -03:00
|
|
|
|
|
2001-09-05 19:36:56 -03:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-09-05 10:44:54 -03:00
|
|
|
|
- Asynchronous timeout actions are available through the new class
|
|
|
|
|
threading.Timer.
|
|
|
|
|
|
2001-09-04 21:53:45 -03:00
|
|
|
|
- math.log and math.log10 now return sensible results for even huge
|
|
|
|
|
long arguments. For example, math.log10(10 ** 10000) ~= 10000.0.
|
|
|
|
|
|
2001-09-02 00:40:59 -03:00
|
|
|
|
- A new function, imp.lock_held(), returns 1 when the import lock is
|
2001-08-30 02:16:13 -03:00
|
|
|
|
currently held. See the docs for the imp module.
|
|
|
|
|
|
2001-09-02 00:40:59 -03:00
|
|
|
|
- pickle, cPickle and marshal on 32-bit platforms can now correctly read
|
2001-08-28 23:28:42 -03:00
|
|
|
|
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.
|
|
|
|
|
|
2001-09-02 00:40:59 -03:00
|
|
|
|
- In restricted execution mode (using the rexec module), unmarshalling
|
2001-08-31 15:31:35 -03:00
|
|
|
|
code objects is no longer allowed. This plugs a security hole.
|
|
|
|
|
|
2001-09-06 13:05:17 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-08-22 18:36:50 -03:00
|
|
|
|
Tools
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-08-22 18:36:50 -03:00
|
|
|
|
|
2001-09-07 15:13:44 -03:00
|
|
|
|
- Tools/scripts/fixdiv.py has been added which can be used to fix
|
|
|
|
|
division operators as per PEP 238.
|
|
|
|
|
|
2001-08-22 18:36:50 -03:00
|
|
|
|
Build
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-08-22 18:36:50 -03:00
|
|
|
|
|
2001-09-07 15:13:44 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-09-04 19:08:56 -03:00
|
|
|
|
C API
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-09-04 19:08:56 -03:00
|
|
|
|
|
|
|
|
|
- New function PyObject_Dir(obj), like Python __builtin__.dir(obj).
|
2001-08-30 02:16:13 -03:00
|
|
|
|
|
2001-09-04 02:14:19 -03:00
|
|
|
|
- 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
|
2002-09-30 12:23:01 -03:00
|
|
|
|
errors are properly detected now. The proper way to check::
|
2001-09-04 02:14:19 -03:00
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
double x = PyLong_AsDouble(some_long_object);
|
|
|
|
|
if (x == -1.0 && PyErr_Occurred()) {
|
2002-12-29 16:14:11 -04:00
|
|
|
|
/* The conversion failed. */
|
2002-09-20 11:16:59 -03:00
|
|
|
|
}
|
2001-09-04 02:14:19 -03:00
|
|
|
|
|
2001-09-02 00:40:59 -03:00
|
|
|
|
- The GC API has been changed. Extensions that use the old API will still
|
2001-08-30 12:38:01 -03:00
|
|
|
|
compile but will not participate in GC. To upgrade an extension
|
|
|
|
|
module:
|
|
|
|
|
|
|
|
|
|
- rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC
|
2001-08-30 17:51:59 -03:00
|
|
|
|
|
2001-08-30 12:38:01 -03:00
|
|
|
|
- use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and
|
|
|
|
|
PyObject_GC_Del to deallocate them
|
2001-08-30 17:51:59 -03:00
|
|
|
|
|
2001-08-30 12:38:01 -03:00
|
|
|
|
- rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini
|
|
|
|
|
to PyObject_GC_UnTrack
|
2001-08-30 17:51:59 -03:00
|
|
|
|
|
2001-08-30 12:38:01 -03:00
|
|
|
|
- remove PyGC_HEAD_SIZE from object size calculations
|
|
|
|
|
|
|
|
|
|
- remove calls to PyObject_AS_GC and PyObject_FROM_GC
|
|
|
|
|
|
2001-09-02 00:40:59 -03:00
|
|
|
|
- Two new functions: PyString_FromFormat() and PyString_FromFormatV().
|
2001-08-31 15:31:35 -03:00
|
|
|
|
These can be used safely to construct string objects from a
|
|
|
|
|
sprintf-style format string (similar to the format string supported
|
|
|
|
|
by PyErr_Format()).
|
2001-08-30 02:16:13 -03:00
|
|
|
|
|
2001-08-22 18:36:50 -03:00
|
|
|
|
New platforms
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------------
|
2001-08-22 18:36:50 -03:00
|
|
|
|
|
2001-09-02 20:01:43 -03:00
|
|
|
|
- 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.
|
2001-09-02 00:40:59 -03:00
|
|
|
|
|
2001-08-22 18:36:50 -03:00
|
|
|
|
Tests
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-08-22 18:36:50 -03:00
|
|
|
|
|
|
|
|
|
Windows
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-08-22 18:36:50 -03:00
|
|
|
|
|
2001-09-05 21:32:15 -03:00
|
|
|
|
- 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
|
2001-09-11 20:18:51 -03:00
|
|
|
|
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.
|
2001-09-05 21:32:15 -03:00
|
|
|
|
|
2001-09-02 00:40:59 -03:00
|
|
|
|
- The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC
|
2001-08-27 03:37:48 -03:00
|
|
|
|
points to command.com (patch from Brian Quinlan).
|
|
|
|
|
|
2001-08-22 18:36:50 -03:00
|
|
|
|
|
2001-07-20 23:31:40 -03:00
|
|
|
|
What's New in Python 2.2a2?
|
|
|
|
|
===========================
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
*Release Date: 22-Aug-2001*
|
|
|
|
|
|
2001-08-17 15:39:25 -03:00
|
|
|
|
Build
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-08-17 15:39:25 -03:00
|
|
|
|
|
2001-08-22 17:26:56 -03:00
|
|
|
|
- Tim Peters developed a brand new Windows installer using Wise 8.1,
|
|
|
|
|
generously donated to us by Wise Solutions.
|
|
|
|
|
|
2001-08-17 15:39:25 -03:00
|
|
|
|
- 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.
|
2001-08-22 01:08:41 -03:00
|
|
|
|
|
2001-08-21 16:28:20 -03:00
|
|
|
|
- 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.
|
2001-08-17 15:39:25 -03:00
|
|
|
|
|
2001-08-22 01:08:41 -03:00
|
|
|
|
- The NeXT platform is no longer supported.
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
- The 'new' module is now statically linked.
|
2001-08-22 01:08:41 -03:00
|
|
|
|
|
2001-08-15 03:06:44 -03:00
|
|
|
|
Tools
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-08-15 03:06:44 -03:00
|
|
|
|
|
|
|
|
|
- The new Tools/scripts/cleanfuture.py can be used to automatically
|
2001-08-15 12:54:56 -03:00
|
|
|
|
edit out obsolete future statements from Python source code. See
|
2001-08-15 03:06:44 -03:00
|
|
|
|
the module docstring for details.
|
|
|
|
|
|
2001-07-20 23:31:40 -03:00
|
|
|
|
Tests
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-07-20 23:31:40 -03:00
|
|
|
|
|
2001-08-12 19:25:01 -03:00
|
|
|
|
- regrtest.py now knows which tests are expected to be skipped on some
|
2001-08-22 01:08:41 -03:00
|
|
|
|
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.
|
2001-08-12 19:25:01 -03:00
|
|
|
|
|
2001-07-20 23:31:40 -03:00
|
|
|
|
- Several new tests in the standard test suite, with special thanks to
|
|
|
|
|
Nick Mathewson.
|
|
|
|
|
|
|
|
|
|
Core
|
2002-09-20 11:16:59 -03:00
|
|
|
|
----
|
2001-07-20 23:31:40 -03:00
|
|
|
|
|
2001-08-22 01:08:41 -03:00
|
|
|
|
- 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>
|
|
|
|
|
|
2001-08-17 19:11:27 -03:00
|
|
|
|
- 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>.
|
|
|
|
|
|
2001-08-17 18:21:04 -03:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-07-31 11:24:31 -03:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-08-14 15:35:02 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-09-05 15:43:35 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-07-31 11:42:42 -03:00
|
|
|
|
Library
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-07-31 11:42:42 -03:00
|
|
|
|
|
2001-08-12 19:25:01 -03:00
|
|
|
|
- New class Differ and new functions ndiff() and restore() in difflib.py.
|
|
|
|
|
These package the algorithms used by the popular Tools/scripts/ndiff.py,
|
2001-08-15 03:06:44 -03:00
|
|
|
|
for programmatic reuse.
|
2001-08-12 19:25:01 -03:00
|
|
|
|
|
2001-07-31 11:42:42 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-08-22 01:08:41 -03:00
|
|
|
|
- Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings.
|
|
|
|
|
|
|
|
|
|
- Added function threading.BoundedSemaphore()
|
|
|
|
|
|
|
|
|
|
- Added Ka-Ping Yee's cgitb.py module.
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
- The 'new' module now exposes the CO_xxx flags.
|
2001-08-22 01:08:41 -03:00
|
|
|
|
|
2001-11-24 05:24:51 -04:00
|
|
|
|
- The gc module offers the get_referents function.
|
|
|
|
|
|
2001-07-31 11:42:42 -03:00
|
|
|
|
New platforms
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------------
|
2001-07-31 11:42:42 -03:00
|
|
|
|
|
|
|
|
|
C API
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-07-31 11:42:42 -03:00
|
|
|
|
|
2001-07-31 11:24:31 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-07-31 11:37:40 -03:00
|
|
|
|
- Unicode APIs now use name mangling to assure that mixing interpreters
|
2001-08-04 05:12:36 -03:00
|
|
|
|
and extensions using different Unicode widths is rendered next to
|
|
|
|
|
impossible. Trying to import an incompatible Unicode-aware extension
|
2001-07-31 11:37:40 -03:00
|
|
|
|
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.
|
|
|
|
|
|
2001-08-17 15:39:25 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-08-04 05:12:36 -03:00
|
|
|
|
Windows
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-08-04 05:12:36 -03:00
|
|
|
|
|
|
|
|
|
- "import module" now compiles module.pyw if it exists and nothing else
|
|
|
|
|
relevant is found.
|
|
|
|
|
|
2001-07-20 23:31:40 -03:00
|
|
|
|
|
2001-07-17 14:22:32 -03:00
|
|
|
|
What's New in Python 2.2a1?
|
2001-05-01 17:45:31 -03:00
|
|
|
|
===========================
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
*Release date: 18-Jul-2001*
|
|
|
|
|
|
2001-05-01 17:45:31 -03:00
|
|
|
|
Core
|
2002-09-20 11:16:59 -03:00
|
|
|
|
----
|
2001-05-14 04:05:58 -03:00
|
|
|
|
|
2001-08-02 01:15:00 -03:00
|
|
|
|
- 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
|
2002-08-19 11:25:03 -03:00
|
|
|
|
incompatibilities are found during alpha testing that cannot be
|
2001-08-02 01:15:00 -03:00
|
|
|
|
repaired.
|
|
|
|
|
|
2001-07-17 14:22:32 -03:00
|
|
|
|
- Generators were added; this is a new way to create an iterator (see
|
2001-07-17 15:48:00 -03:00
|
|
|
|
below) using what looks like a simple function containing one or
|
2001-07-17 14:22:32 -03:00
|
|
|
|
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.)
|
|
|
|
|
|
2001-05-22 05:58:23 -03:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-05-15 15:38:45 -03:00
|
|
|
|
- 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).
|
2001-06-02 02:27:19 -03:00
|
|
|
|
|
2001-05-15 15:38:45 -03:00
|
|
|
|
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 ("<22><><EFBFBD>".decode("latin-1")
|
|
|
|
|
will return u"<22><><EFBFBD>"). 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):
|
|
|
|
|
|
2002-09-20 11:16:59 -03:00
|
|
|
|
+---------+-----------+-----------+-----------------------------+
|
|
|
|
|
|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|
|
|
|
|
|
+---------+-----------+-----------+-----------------------------+
|
2001-05-15 15:38:45 -03:00
|
|
|
|
|
2001-05-14 00:09:36 -03:00
|
|
|
|
- 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
|
2001-05-14 10:53:38 -03:00
|
|
|
|
term, although the default encoding for that platform will be other than
|
2001-05-14 00:09:36 -03:00
|
|
|
|
'mbcs'.
|
2001-05-14 10:53:38 -03:00
|
|
|
|
|
|
|
|
|
On operating system that support non-ASCII filenames, it is common for
|
2001-05-14 00:09:36 -03:00
|
|
|
|
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
|
2001-05-14 04:05:58 -03:00
|
|
|
|
would attempt to use its default encoding (generally ASCII) rather than
|
|
|
|
|
the default encoding for the file system.
|
2001-05-14 10:53:38 -03:00
|
|
|
|
|
2001-05-14 04:05:58 -03:00
|
|
|
|
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.
|
2001-05-14 00:09:36 -03:00
|
|
|
|
See [????] for more details, including examples.
|
2001-05-01 17:45:31 -03:00
|
|
|
|
|
2001-05-08 12:43:37 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
Get rid of the superstitious "~" in dict hashing's "i = (~hash) & mask".
The comment following used to say:
/* We use ~hash instead of hash, as degenerate hash functions, such
as for ints <sigh>, can have lots of leading zeros. It's not
really a performance risk, but better safe than sorry.
12-Dec-00 tim: so ~hash produces lots of leading ones instead --
what's the gain? */
That is, there was never a good reason for doing it. And to the contrary,
as explained on Python-Dev last December, it tended to make the *sum*
(i + incr) & mask (which is the first table index examined in case of
collison) the same "too often" across distinct hashes.
Changing to the simpler "i = hash & mask" reduced the number of string-dict
collisions (== # number of times we go around the lookup for-loop) from about
6 million to 5 million during a full run of the test suite (these are
approximate because the test suite does some random stuff from run to run).
The number of collisions in non-string dicts also decreased, but not as
dramatically.
Note that this may, for a given dict, change the order (wrt previous
releases) of entries exposed by .keys(), .values() and .items(). A number
of std tests suffered bogus failures as a result. For dicts keyed by
small ints, or (less so) by characters, the order is much more likely to be
in increasing order of key now; e.g.,
>>> d = {}
>>> for i in range(10):
... d[i] = i
...
>>> d
{0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9}
>>>
Unfortunately. people may latch on to that in small examples and draw a
bogus conclusion.
test_support.py
Moved test_extcall's sortdict() into test_support, made it stronger,
and imported sortdict into other std tests that needed it.
test_unicode.py
Excluced cp875 from the "roundtrip over range(128)" test, because
cp875 doesn't have a well-defined inverse for unicode("?", "cp875").
See Python-Dev for excruciating details.
Cookie.py
Chaged various output functions to sort dicts before building
strings from them.
test_extcall
Fiddled the expected-result file. This remains sensitive to native
dict ordering, because, e.g., if there are multiple errors in a
keyword-arg dict (and test_extcall sets up many cases like that), the
specific error Python complains about first depends on native dict
ordering.
2001-05-12 21:19:31 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-06-11 22:22:22 -03:00
|
|
|
|
- Many other small changes to dicts were made, resulting in faster
|
|
|
|
|
operation along the most common code paths.
|
|
|
|
|
|
2001-05-01 17:54:30 -03:00
|
|
|
|
- Dictionary objects now support the "in" operator: "x in dict" means
|
|
|
|
|
the same as dict.has_key(x).
|
|
|
|
|
|
2001-06-26 17:12:50 -03:00
|
|
|
|
- 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())
|
|
|
|
|
|
2001-05-01 17:54:30 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-05-01 17:45:31 -03:00
|
|
|
|
- The following functions were generalized to work nicely with iterator
|
2002-09-30 12:23:01 -03:00
|
|
|
|
arguments::
|
2002-09-20 11:16:59 -03:00
|
|
|
|
|
2001-05-08 01:38:29 -03:00
|
|
|
|
map(), filter(), reduce(), zip()
|
2001-05-05 22:05:02 -03:00
|
|
|
|
list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API)
|
|
|
|
|
max(), min()
|
2001-05-26 16:37:54 -03:00
|
|
|
|
join() method of strings
|
|
|
|
|
extend() method of lists
|
2001-05-05 08:33:43 -03:00
|
|
|
|
'x in y' and 'x not in y' (PySequence_Contains() in C API)
|
|
|
|
|
operator.countOf() (PySequence_Count() in C API)
|
2002-09-20 11:16:59 -03:00
|
|
|
|
right-hand side of assignment statements with multiple targets, such as ::
|
2001-06-20 23:49:55 -03:00
|
|
|
|
x, y, z = some_iterable_object_returning_exactly_3_values
|
2001-05-05 08:33:43 -03:00
|
|
|
|
|
2001-05-11 18:51:48 -03:00
|
|
|
|
- Accessing module attributes is significantly faster (for example,
|
|
|
|
|
random.random or os.path or yourPythonModule.yourAttribute).
|
|
|
|
|
|
2001-05-08 01:38:29 -03:00
|
|
|
|
- Comparing dictionary objects via == and != is faster, and now works even
|
|
|
|
|
if the keys and values don't support comparisons other than ==.
|
|
|
|
|
|
2001-05-10 05:32:44 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-06-02 02:27:19 -03:00
|
|
|
|
- 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
|
2001-06-11 22:22:22 -03:00
|
|
|
|
d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x
|
2001-06-02 02:27:19 -03:00
|
|
|
|
faster now. Thanks to Christian Tismer for pointing out the cause and
|
|
|
|
|
the nature of an effective cure (last December! better late than never).
|
2001-05-27 04:39:22 -03:00
|
|
|
|
|
2001-06-16 02:42:57 -03:00
|
|
|
|
- repr() is much faster for large containers (dict, list, tuple).
|
|
|
|
|
|
|
|
|
|
|
2001-05-14 04:05:58 -03:00
|
|
|
|
Library
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-------
|
2001-05-14 04:05:58 -03:00
|
|
|
|
|
2001-07-20 15:38:26 -03:00
|
|
|
|
- The constants ascii_letters, ascii_lowercase. and ascii_uppercase
|
2002-08-19 11:25:03 -03:00
|
|
|
|
were added to the string module. These a locale-independent
|
2001-07-20 15:38:26 -03:00
|
|
|
|
constants, unlike letters, lowercase, and uppercase. These are now
|
|
|
|
|
use in appropriate locations in the standard library.
|
|
|
|
|
|
2001-07-18 13:17:16 -03:00
|
|
|
|
- The flags used in dlopen calls can now be configured using
|
|
|
|
|
sys.setdlopenflags and queried using sys.getdlopenflags.
|
|
|
|
|
|
2001-07-12 08:54:37 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-07-05 11:46:25 -03:00
|
|
|
|
- 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.
|
|
|
|
|
|
2001-06-06 03:25:40 -03:00
|
|
|
|
- A new function fnmatch.filter to filter lists of file names was added.
|
|
|
|
|
|
2001-05-22 13:00:10 -03:00
|
|
|
|
- calendar.py uses month and day names based on the current locale.
|
|
|
|
|
|
2001-05-14 23:14:44 -03:00
|
|
|
|
- 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).
|
|
|
|
|
|
2001-05-14 04:05:58 -03:00
|
|
|
|
- Cookie.py now sorts key+value pairs by key in output strings.
|
|
|
|
|
|
|
|
|
|
- pprint.isrecursive(object) didn't correctly identify recursive objects.
|
|
|
|
|
Now it does.
|
|
|
|
|
|
2001-05-14 15:39:41 -03:00
|
|
|
|
- pprint functions now much faster for large containers (tuple, list, dict).
|
|
|
|
|
|
2001-06-10 20:40:19 -03:00
|
|
|
|
- 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.
|
2001-06-11 22:22:22 -03:00
|
|
|
|
In standard mode, 'q' and 'Q' are supported on all platforms, and are
|
|
|
|
|
8-byte integral types.
|
2001-06-10 20:40:19 -03:00
|
|
|
|
|
2001-06-12 13:48:52 -03:00
|
|
|
|
- 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)'.
|
|
|
|
|
|
2001-05-14 04:05:58 -03:00
|
|
|
|
Tests
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-05-14 04:05:58 -03:00
|
|
|
|
|
|
|
|
|
- New test_mutants.py runs dict comparisons where the key and value
|
2002-08-19 11:25:03 -03:00
|
|
|
|
comparison operators mutate the dicts randomly during comparison. This
|
2001-05-14 04:05:58 -03:00
|
|
|
|
rapidly causes Python to crash under earlier releases (not for the faint
|
|
|
|
|
of heart: it can also cause Win9x to freeze or reboot!).
|
|
|
|
|
|
2002-08-19 11:25:03 -03:00
|
|
|
|
- New test_pprint.py verifies that pprint.isrecursive() and
|
2001-05-14 15:39:41 -03:00
|
|
|
|
pprint.isreadable() return sensible results. Also verifies that simple
|
|
|
|
|
cases produce correct output.
|
2001-05-14 04:05:58 -03:00
|
|
|
|
|
2001-05-28 19:30:08 -03:00
|
|
|
|
C API
|
2002-09-20 11:16:59 -03:00
|
|
|
|
-----
|
2001-05-28 19:30:08 -03:00
|
|
|
|
|
|
|
|
|
- Removed the unused last_is_sticky argument from the internal
|
|
|
|
|
_PyTuple_Resize(). If this affects you, you were cheating.
|
2002-09-20 11:16:59 -03:00
|
|
|
|
|
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
**(For information about older versions, consult the HISTORY file.)**
|