blob: 3d9f4189a79c0b76d93658a9462d6c21fa7f4b59 [file] [log] [blame]
Skip Montanaroe5d7f7f2002-09-20 14:16:59 +00001+++++++++++
2Python News
3+++++++++++
4
Anthony Baxterb0c66302004-11-04 05:23:17 +00005(editors: check NEWS.help for information about editing NEWS using ReST.)
6
Christian Heimesbc873412007-12-08 22:11:32 +00007What's New in Python 3.0a3?
8===========================
9
Georg Brandl52d168a2008-01-07 18:10:24 +000010*Release date: XX-XXX-2008*
Christian Heimesbc873412007-12-08 22:11:32 +000011
12Core and Builtins
13-----------------
14
Christian Heimesa156e092008-02-16 07:38:31 +000015- Issue #2115: Important speedup in setting __slot__ attributes. Also
16 prevent a possible crash: an Abstract Base Class would try to access a slot
17 on a registered virtual subclass.
18
19- Fixed repr() and str() of complex numbers with infinity or nan as real or
20 imaginary part.
21
22- Clear all free list during a gc.collect() of the highest generation in order
23 to allow pymalloc to free more arenas. Python may give back memory to the
24 OS earlier.
25
26- Issue #2045: Fix an infinite recursion triggered when printing a subclass of
27 collections.defaultdict, if its default_factory is set to a bound method.
28
29- Fixed a minor memory leak in dictobject.c. The content of the free
30 list was not freed on interpreter shutdown.
31
32- Limit free list of method and builtin function objects to 256 entries
33 each.
34
35- Patch #1953: Added ``sys._compact_freelists()`` and the C API functions
36 ``PyInt_CompactFreeList`` and ``PyFloat_CompactFreeList``
37 to compact the internal free lists of pre-allocted ints and floats.
38
39- Bug #1983: Fixed return type of fork(), fork1() and forkpty() calls.
40 Python expected the return type int but the fork familie returns pi_t.
41
42- Issue #1678380: Fix a bug that identifies 0j and -0j when they appear
43 in the same code unit.
44
Raymond Hettinger65baa342008-02-07 00:41:02 +000045- Issue #2025 : Add tuple.count() and tuple.index() methods to comply with
46 the collections.Sequence API.
47
Christian Heimesdfc12ed2008-01-31 15:16:38 +000048- Fixed multiple reinitialization of the Python interpreter. The small int
49 list in longobject.c has caused a seg fault during the third finalization.
50
Christian Heimesc04dac02008-01-30 11:27:57 +000051- Issue #1973: bytes.fromhex('') raises SystemError
52
Raymond Hettinger70b64fc2008-01-30 20:15:17 +000053- Issue #1771: remove cmp parameter from sorted() and list.sort()
54
Christian Heimes7b876152008-01-30 09:51:48 +000055- Issue #1969: split and rsplit in bytearray are inconsistent
56
Raymond Hettinger1dfde1d2008-01-22 23:25:35 +000057- map() and itertools.imap() no longer accept None for the first argument.
58 Use zip() instead.
59
Facundo Batista2336bdd2008-01-19 19:12:01 +000060- Issue #1769: Now int("- 1") is not allowed any more.
61
Christian Heimes386cd1e2008-01-15 02:01:20 +000062- Object/longobject.c: long(float('nan')) raises an OverflowError instead
63 of returning 0.
64
Christian Heimes3b06e532008-01-07 20:12:44 +000065- Issue #1762972: __file__ points to the source file instead of the pyc/pyo
66 file if the py file exists.
67
Guido van Rossumab078dd2008-01-06 00:09:11 +000068- Issue #1393: object_richcompare() returns NotImplemented instead of
69 False if the objects aren't equal, to give the other side a chance.
70
Guido van Rossume239b002008-01-06 00:44:20 +000071- Issue #1692: Interpreter was not displaying location of SyntaxError.
Kurt B. Kaiser43b15092008-01-05 04:32:22 +000072
Amaury Forgeot d'Arcbccd63c2008-01-04 01:21:27 +000073- Improve some exception messages when Windows fails to load an extension
74 module. Now we get for example '%1 is not a valid Win32 application' instead
75 of 'error code 193'. Also use Unicode strings to deal with non-English
76 locales.
77
Christian Heimesa3534a62007-12-11 19:56:40 +000078- Issue #1587: Added instancemethod wrapper for PyCFunctions. The Python C API
79 has gained a new type *PyInstanceMethod_Type* and the functions
80 *PyInstanceMethod_Check(o)*, *PyInstanceMethod_New(func)* and
81 *PyInstanceMethod_Function(im)*.
82
Amaury Forgeot d'Arcad8dcd52007-12-10 23:58:35 +000083- Constants gc.DEBUG_OBJECT and gc.DEBUG_INSTANCE have been removed from the
84 gc module; gc.DEBUG_COLLECTABLE or gc.DEBUG_UNCOLLECTABLE are now enough to
85 print the corresponding list of objects considered by the garbage collector.
86
Guido van Rossume239b002008-01-06 00:44:20 +000087- Issue #1573: Improper use of the keyword-only syntax makes the parser crash.
Christian Heimesbc873412007-12-08 22:11:32 +000088
Christian Heimes0ded5b52007-12-10 15:50:56 +000089- Issue #1564: The set implementation should special-case PyUnicode instead
Guido van Rossume239b002008-01-06 00:44:20 +000090 of PyString.
Christian Heimes0ded5b52007-12-10 15:50:56 +000091
Christian Heimes7131fd92008-02-19 14:21:46 +000092- Issue #1402: Fix a crash on exit, when another thread is still running, and
93 if the deallocation of its frames somehow calls the PyGILState_Ensure() /
94 PyGILState_Release() functions.
95
96- Expose the Py_Py3kWarningFlag as sys.py3kwarning.
97
98- Issue #1445: Fix a SystemError when accessing the ``cell_contents``
99 attribute of an empty cell object.
100
101- Issue #1460: The utf-7 incremental decoder did not accept truncated input.
102 It now correctly saves its state between chunks of data.
103
104- Patch #1739468: Directories and zipfiles containing a __main__.py file can
105 now be directly executed by passing their name to the interpreter. The
106 directory/zipfile is automatically inserted as the first entry in sys.path.
107
108- Issue #1265: Fix a problem with sys.settrace, if the tracing function uses a
109 generator expression when at the same time the executed code is closing a
110 paused generator.
111
112- sets and frozensets now have an isdisjoint() method.
113
114- optimize the performance of builtin.sum().
115
116- Fix warnings found by the new version of the Coverity checker.
117
118- The enumerate() builtin function is no longer bounded to sequences smaller
119 than LONG_MAX. Formerly, it raised an OverflowError. Now, automatically
120 shifts from ints to longs.
121
122- Issue #1686386: Tuple's tp_repr did not take into account the possibility of
123 having a self-referential tuple, which is possible from C code. Nor did
124 object's tp_str consider that a type's tp_str could do something that could
125 lead to an inifinite recursion. Py_ReprEnter() and Py_EnterRecursiveCall(),
126 respectively, fixed the issues.
127
128- Issue #1164: It was possible to trigger deadlock when using the 'print'
129 statement to write to a file since the GIL was not released as needed. Now
130 PyObject_Print() does the right thing along with various tp_print
131 implementations of the built-in types and those in the collections module.
132
133- Issue #1147: Exceptions were directly allowing string exceptions in their
134 throw() method even though string exceptions no longer allowed.
135
136- Issue #1096: Prevent a segfault from getting the repr of a very deeply nested
137 list by using the recursion counter.
138
139- Issue #1202533: Fix infinite recursion calls triggered by calls to
140 PyObject_Call() never calling back out to Python code to trigger recursion
141 depth updates/checks. Required the creation of a static RuntimeError
142 instance in case normalizing an exception put the recursion check value past
143 its limit. Fixes crashers infinite_rec_(1|2|4|5).py.
144
Guido van Rossumea6775b2008-02-21 20:16:31 +0000145- Patch #1031213: Decode source line in SyntaxErrors back to its
146 original source encoding.
Christian Heimes7131fd92008-02-19 14:21:46 +0000147
148- Patch #1673759: add a missing overflow check when formatting floats
149 with %G.
150
151- Prevent expandtabs() on string and unicode objects from causing a segfault
152 when a large width is passed on 32-bit platforms.
153
154- Bug #1733488: Fix compilation of bufferobject.c on AIX.
155
156- Bug #1722485: remove docstrings again when running with -OO.
157
158- Add new attribute names for function objects. All the func_* become
159 __*__ attributes. (Some already existed, e.g., __doc__ and __name__.)
160
161- Add -3 option to the interpreter to warn about features that are
162 deprecated and will be changed/removed in Python 3.0.
163
164- Patch #1686487: you can now pass any mapping after '**' in function
165 calls.
166
167- except clauses may now be spelled either "except E, target:" or
168 "except E as target:". This is to provide forwards compatibility with
169 Python 3.0.
170
171- Deprecate BaseException.message as per PEP 352.
172
173- Bug #1303614: don't expose object's __dict__ when the dict is
174 inherited from a builtin base.
175
176- When __slots__ are set to a unicode string, make it work the same as
177 setting a plain string, ie don't expand to single letter identifiers.
178
179- Request #1191699: Slices can now be pickled.
180
181- Request #1193128: str.translate() now allows a None argument for
182 translations that only remove characters without re-mapping the
183 remaining characters.
184
185- Patch #1682205: a TypeError while unpacking an iterable is no longer
186 masked by a generic one with the message "unpack non-sequence".
187
188- Remove unused file Python/fmod.c.
189
190- Bug #1683368: The object.__init__() and object.__new__() methods are
191 now stricter in rejecting excess arguments. The only time when
192 either allows excess arguments is when it is not overridden and the
193 other one is. For backwards compatibility, when both are
194 overridden, it is a deprecation warning (for now; maybe a Py3k
195 warning later). Also, type.__init__() insists on the same signature
196 as supported by type.__new__().
197
198- Patch #1675423: PyComplex_AsCComplex() now tries to convert an object
199 to complex using its __complex__() method before falling back to the
200 __float__() method. Therefore, the functions in the cmath module now
201 can operate on objects that define a __complex__() method.
202
203- Patch #1623563: allow __class__ assignment for classes with __slots__.
204 The old and the new class are still required to have the same slot names.
205
206- Patch #1642547: Fix an error/crash when encountering syntax errors in
207 complex if statements.
208
209- Patch #1462488: Python no longer segfaults when ``object.__reduce_ex__()``
210 is called with an object that is faking its type.
211
212- Patch #1680015: Don't modify __slots__ tuple if it contains an unicode
213 name.
214
215- Patch #1444529: the builtin compile() now accepts keyword arguments.
216
217- Bug #1678647: write a newline after printing an exception in any
218 case, even when converting the value to a string failed.
219
220- The dir() function has been extended to call the __dir__() method on
221 its argument, if it exists. If not, it will work like before. This allows
222 customizing the output of dir() in the presence of a __getattr__().
223
224- Patch #922167: Python no longer segfaults when faced with infinitely
225 self-recursive reload() calls (as reported by bug #742342).
226
227- Patch #1675981: remove unreachable code from ``type.__new__()`` method.
228
229- Patch #1491866: change the complex() constructor to allow parthensized
230 forms. This means complex(repr(x)) now works instead of raising a
231 ValueError.
232
233- Patch #703779: unset __file__ in __main__ after running a file. This
234 makes the filenames the warning module prints much more sensible when
235 a PYTHONSTARTUP file is used.
236
237- Variant of patch #697613: don't exit the interpreter on a SystemExit
238 exception if the -i command line option or PYTHONINSPECT environment
239 variable is given, but break into the interactive interpreter just like
240 on other exceptions or normal program exit.
241
242- Patch #1638879: don't accept strings with embedded NUL bytes in long().
243
244- Bug #1674503: close the file opened by execfile() in an error condition.
245
246- Patch #1674228: when assigning a slice (old-style), check for the
247 sq_ass_slice instead of the sq_slice slot.
248
249- When printing an unraisable error, don't print exceptions. before the name.
250 This duplicates the behavior whening normally printing exceptions.
251
252- Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
253
254- PEP 352: Raising a string exception now triggers a TypeError. Attempting to
255 catch a string exception raises DeprecationWarning.
256
257- Bug #1377858: Fix the segfaulting of the interpreter when an object created
258 a weakref on itself during a __del__ call for new-style classes (classic
259 classes still have the bug).
260
261- Bug #1579370: Make PyTraceBack_Here use the current thread, not the
262 frame's thread state.
263
264- patch #1630975: Fix crash when replacing sys.stdout in sitecustomize.py
265
266- Prevent seg fault on shutdown which could occur if an object
267 raised a warning.
268
269- Bug #1566280: Explicitly invoke threading._shutdown from Py_Main,
270 to avoid relying on atexit.
271
272- Bug #1590891: random.randrange don't return correct value for big number
273
274- Patch #1586791: Better exception messages for some operations on strings,
275 tuples and lists.
276
277- Bug #1067760: Deprecate passing floats to file.seek.
278
279- Bug #1591996: Correctly forward exception in instance_contains().
280
281- Bug #1588287: fix invalid assertion for `1,2` in debug builds.
282
283- Bug #1576657: when setting a KeyError for a tuple key, make sure that
284 the tuple isn't used as the "exception arguments tuple".
285
286- Bug #1565514, SystemError not raised on too many nested blocks.
287
288- Bug #1576174: WindowsError now displays the windows error code
289 again, no longer the posix error code.
290
291- Patch #1549049: Support long values in structmember, issue warnings
292 if the assigned value for structmember fields gets truncated.
293
294- Update the peephole optimizer to remove more dead code (jumps after returns)
295 and inline unconditional jumps to returns.
296
297- Bug #1545497: when given an explicit base, int() did ignore NULs
298 embedded in the string to convert.
299
300- Bug #1569998: break inside a try statement (outside a loop) is now
301 recognized and rejected.
302
303- list.pop(x) accepts any object x following the __index__ protocol.
304
305- A number of places, including integer negation and absolute value,
306 were fixed to not rely on undefined behaviour of the C compiler
307 anymore.
308
309- Bug #1566800: make sure that EnvironmentError can be called with any
310 number of arguments, as was the case in Python 2.4.
311
312- Patch #1567691: super() and new.instancemethod() now don't accept
313 keyword arguments any more (previously they accepted them, but didn't
314 use them).
315
316- Fix a bug in the parser's future statement handling that led to "with"
317 not being recognized as a keyword after, e.g., this statement:
318 from __future__ import division, with_statement
319
320- Bug #1557232: fix seg fault with def f((((x)))) and def f(((x),)).
321
322- Fix %zd string formatting on Mac OS X so it prints negative numbers.
323
324- Allow exception instances to be directly sliced again.
325
326- Bug #1551432: Exceptions do not define an explicit __unicode__ method. This
327 allows calling unicode() on exceptions classes directly to succeed.
328
329- Bug #1542051: Exceptions now correctly call PyObject_GC_UnTrack.
330 Also make sure that every exception class has __module__ set to
331 'exceptions'.
332
333- Bug #1550983: emit better error messages for erroneous relative
334 imports (if not in package and if beyond toplevel package).
335
336- Overflow checking code in integer division ran afoul of new gcc
337 optimizations. Changed to be more standard-conforming.
338
339- Patch #1542451: disallow continue anywhere under a finally.
340
341- Patch #1546288: fix seg fault in dict_equal due to ref counting bug.
342
343- The return tuple from str.rpartition(sep) is (tail, sep, head) where
344 head is the original string if sep was not found.
345
346- Bug #1520864: unpacking singleton tuples in list comprehensions and
347 generator expressions (x for x, in ... ) works again. Fixing this problem
348 required changing the .pyc magic number. This means that .pyc files
349 generated before 2.5c2 will be regenerated.
350
351- ``with`` and ``as`` are now keywords.
352
353- Bug #1664966: Fix crash in exec if Unicode filename can't be decoded.
354
355- Issue #1537: Changed GeneratorExit's base class from Exception to
356 BaseException.
357
358- Fix Issue #1703448: A joined thread could show up in the
359 threading.enumerate() list after the join() for a brief period until
360 it actually exited.
361
362
363Library
364-------
365
Christian Heimes09aaa882008-02-23 15:01:06 +0000366- inspect.getsource() includes the decorators again.
367
Christian Heimes7131fd92008-02-19 14:21:46 +0000368- Issue #1916. Added isgenerator() and isgeneratorfunction() to inspect.py.
369
370- #1224: Fixed bad url parsing when path begins with double slash.
371
372- ctypes instances that are not or do not contain pointers can now be
373 pickled.
374
375- Patch #1966: Break infinite loop in httplib when the servers
376 implements the chunked encoding incorrectly.
377
378- Rename rational.py to fractions.py and the rational.Rational class
379 to fractions.Fraction, to avoid the name clash with the abstract
380 base class numbers.Rational. See discussion in issue #1682.
381
382- The pickletools module now provides an optimize() function
383 that eliminates unused PUT opcodes from a pickle string.
384
385- #2021: Allow tempfile.NamedTemporaryFile and SpooledTemporaryFile
386 to be used in with statements by correctly supporting the context
387 management protocol.
388
389- #1979: Add rich comparisons to Decimal, and make Decimal comparisons
390 involving a NaN follow the IEEE 754 standard.
391
392- #2004: tarfile.py: Use mode 0700 for temporary directories and default
393 permissions for missing directories.
394
395- #175006: The debugger used to skip the condition of a "while" statement
396 after the first iteration. Now it correctly steps on the expression, and
397 breakpoints on the "while" statement are honored on each loop.
398
399- #1765140: add an optional delay argument to FileHandler and its
400 subclasses. Defaults to false (existing behaviour), but if true,
401 defers opening the file until the first call to emit().
402
403- The pprint module now supports sets and frozensets.
404
405- #1221598: add optional callbacks to ftplib.FTP's storbinary() and
406 storlines() methods. (Contributed by Phil Schwartz)
407
408- #1715: include sub-extension modules in pydoc's text output.
409
410- #1836: fix an off-by-one bug in TimedRotatingHandler's rollover
411 time calculation.
412
413- #1021: fix a bug to allow basicConfig to accept NOTSET as a level.
414
415- #932563: add LoggerAdapter convenience class to make it easier to add
416 contextual information in logging output.
417
418- #1760556: fix a bug to avoid FileHandler throwing an exception in
419 flush().
420
421- Bug #1530959: distutils' build command now uses different build directory
422 when building extension modules against versions of Python compiled
423 with ``--with-pydebug``.
424
425- #1555501: move plistlib from plat-mac directory to general library.
426
427- #1269: fix a bug in pstats.add_callers() and add a unit test file for
428 pstats.
429
430- #1669: don't allow shutil.rmtree() to be called on a symlink to a
431 directory.
432
433- #1664522: in urllib, don't read non-existing directories in ftp mode,
434 returning a 0-byte file -- raise an IOError instead.
435
436- #856047: respect the ``no_proxy`` environment variable when using the
437 ``http_proxy`` etc. environment variables in urllib.
438
439- #1178141: add a getcode() method to the addinfourls that urllib.open()
440 returns so that you can retrieve the HTTP status code.
441
442- Issue #1003: Fix zipfile decryption check, it would fail zip files
443 with extended local headers.
444
445- #1189216: Fix the zipfile module to work on archives with headers
446 past the 2**31 byte boundary.
447
448- #1336: fix a race condition in subprocess.Popen if the garbage
449 collector kicked in at the wrong time that would cause the process
450 to hang when the child wrote to stderr.
451
452- #1146: fix how textwrap breaks a long word that would start in the
453 last column of a line.
454
455- #1693149: trace.py --ignore-module - accept multiple comma-separated
456 modules to be given.
457
458- #1822: MIMEMultipart.is_multipart() behaves correctly for a just-created
459 (and empty) instance. Thanks Jonathan Share.
460
461- #1861: Added an attribute to the sched module which returns an ordered
462 list of upcoming events (displayed as named tuples).
463
464- #1837: The queue module now also supports a LIFO queue and a priority queue.
465
466- Patch #1048820: Add insert-mode editing to curses.textpad.Textbox
467 (patch by Stefan Wehr). Also, fix an off-by-one bug in
468 Textbox.gather().
469
470- Issue #1831: ctypes now raises a TypeError if conflicting positional
471 and named arguments are passed to a Structure or Union initializer.
472 When too many positional arguments are passed, also a TypeError is
473 raised instead of a ValueError.
474
475- Convert the internal ctypes array type cache to a WeakValueDict so
476 that array types do not live longer than needed.
477
478- Issue #1786: pdb should use its own stdin/stdout around an exec call
479 and when creating a recursive instance.
480
481- Issue #1698398 Zipfile.printdir() crashed because the format string
482 expected a tuple type of length six instead of time.struct_time object.
483
484- Issue #1780: The Decimal constructor now accepts arbitrary leading
485 and trailing whitespace when constructing from a string.
486 Context.create_decimal no longer accepts trailing newlines.
487
488- Decimal.as_tuple(), difflib.find_longest_match() and inspect functions
489 that returned a tuple now return a named tuple.
490
491- Doctest now returns results as a named tuple for readability:
492 (0, 7) --> TestResults(failed=0, attempted=7)
493
494- Issue #846388. re.match is interruptible now, which is particularly
495 good for long regular expression matches.
496
497- pyexpat, patch #1137: allow setting buffer_size attribute
498 on Parser objects to set the character data buffer size.
499
500- Issue #1757: The hash of a Decimal instance is no longer affected by
501 the current context.
502
503- Patch #467924: add ZipFile.extract() and ZipFile.extractall() in the
504 zipfile module.
505
506- Issue #1646: Make socket support the TIPC protocol.
507
508- Bug #1742: return os.curdir from os.path.relpath() if both arguments are
509 equal instead of raising an exception.
510
511- Patch #1637: fix urlparse for URLs like 'http://x.com?arg=/foo'.
512
513- Patch #1698: allow '@' in username parsed by urlparse.py.
514
515- Issue #1735: TarFile.extractall() now correctly sets directory permissions
516 and times.
517
Guido van Rossumea6775b2008-02-21 20:16:31 +0000518- Bug #1713: posixpath.ismount() claims symlink to a mountpoint is a
519 mountpoint.
Christian Heimes7131fd92008-02-19 14:21:46 +0000520
521- Bug #1687: Fxed plistlib.py restricts <integer> to Python int when writing
522
523- Issue #1700: Regular expression inline flags incorrectly handle certain
524 unicode characters.
525
526- Issue #1689: PEP 3141, numeric abstract base classes.
527
528- Tk issue #1851526: Return results from Python callbacks to Tcl as
529 Tcl objects.
530
531- Issue #1642: Fix segfault in ctypes when trying to delete attributes.
532
533- Issue #1727780: Support loading pickles of random.Random objects created
534 on 32-bit systems on 64-bit systems, and vice versa. As a consequence
535 of the change, Random pickles created by Python 2.6 cannot be loaded
536 in Python 2.5.
537
538- Issue #1455: The distutils package now supports VS 2005 and VS 2008 for
539 both the msvccompiler and cygwincompiler.
540
541- Issue #1531: tarfile.py: Read fileobj from the current offset, do not
542 seek to the start.
543
544- Issue #1534: Added a dictionary sys.float_info with information about the
545 internal floating point type to the sys module.
546
547- Issue 1429818: patch for trace and doctest modules so they play nicely
548 together.
549
550- doctest made a bad assumption that a package's __loader__.get_data()
551 method used universal newlines.
552
553- Issue #1705170: contextlib.contextmanager was still swallowing
554 StopIteration in some cases. This should no longer happen.
555
556- Issue #1292: On alpha, arm, ppc, and s390 linux systems the
557 --with-system-ffi configure option defaults to "yes".
558
559- IN module for FreeBSD 8 is added and preexisting FreeBSD 6 and 7
560 files are updated.
561
562- Issues #1181, #1287: unsetenv() is now called when the os.environ.pop()
563 and os.environ.clear() methods are used.
564
565- ctypes will now work correctly on 32-bit systems when Python is
566 configured with --with-system-ffi.
567
568- Patch #1203: ctypes now does work on OS X when Python is built with
569 --disable-toolbox-glue.
570
571- collections.deque() now supports a "maxlen" argument.
572
573- itertools.count() is no longer bounded to LONG_MAX. Formerly, it raised
574 an OverflowError. Now, automatically shifts from ints to longs.
575
576- Patch #1541463: optimize performance of cgi.FieldStorage operations.
577
578- Decimal is fully updated to the latest Decimal Specification (v1.66).
579
580- Bug #1153: repr.repr() now doesn't require set and dictionary items
581 to be orderable to properly represent them.
582
583- A 'c_longdouble' type was added to the ctypes module.
584
585- Bug #1709599: Run test_1565150 only if the file system is NTFS.
586
587- When encountering a password-protected robots.txt file the RobotFileParser
588 no longer prompts interactively for a username and password (bug 813986).
589
590- TarFile.__init__() no longer fails if no name argument is passed and
591 the fileobj argument has no usable name attribute (e.g. StringIO).
592
593- The functools module now provides 'reduce', for forward compatibility
594 with Python 3000.
595
596- Server-side SSL support and cert verification added, by Bill Janssen.
597
598- socket.ssl deprecated; use new ssl module instead.
599
600- uuid creation is now threadsafe.
601
602- EUC-KR codec now handles the cheot-ga-keut composed make-up hangul
603 syllables.
604
605- GB18030 codec now can encode additional two-byte characters that
606 are missing in GBK.
607
608- Add new codecs for UTF-32, UTF-32-LE and UTF-32-BE.
609
610- Bug #1704793: Return UTF-16 pair if unicodedata.lookup cannot
611 represent the result in a single character.
612
613- Bug #978833: Close https sockets by releasing the _ssl object.
614
615- Change location of the package index to pypi.python.org/pypi
616
617- Bug #1701409: Fix a segfault in printing ctypes.c_char_p and
618 ctypes.c_wchar_p when they point to an invalid location. As a
619 sideeffect the representation of these instances has changed.
620
621- tarfile.py: Added "exclude" keyword argument to TarFile.add().
622
623- Bug #1734723: Fix repr.Repr() so it doesn't ignore the maxtuple attribute.
624
625- The urlopen function of urllib2 now has an optional timeout parameter (note
626 that it actually works with HTTP, HTTPS, FTP and FTPS connections).
627
628- In ftplib, the FTP.ntransfercmd method, when in passive mode, now uses
629 the socket.create_connection function, using the timeout specified at
630 connection time.
631
632- Bug #1728403: Fix a bug that CJKCodecs StreamReader hangs when it
633 reads a file that ends with incomplete sequence and sizehint argument
634 for .read() is specified.
635
636- Bug #1730389: Change time.strptime() to use ``\s+`` instead of ``\s*`` when
637 matching spaces in the specified format argument.
638
639- SF 1668596/1720897: distutils now copies data files
640 even if package_dir is empty.
641
642- sha now raises a DeprecationWarning upon import.
643
644- md5 now raises a DeprecationWarning upon import.
645
646- Issue1385: The hmac module now computes the correct hmac when using hashes
647 with a block size other than 64 bytes (such as sha384 and sha512).
648
649- mimify now raises a DeprecationWarning upon import.
650
651- MimeWriter now raises a DeprecationWarning upon import.
652
653- tarfile.py: Improved unicode support. Unicode input names are now
654 officially supported. Added "errors" argument to the TarFile class.
655
656- urllib.ftpwrapper class now accepts an optional timeout.
657
658- shlex.split() now has an optional "posix" parameter.
659
660- The posixfile module now raises a DeprecationWarning.
661
662- Remove the gopherlib module. This also leads to the removal of gopher
663 support in urllib/urllib2.
664
665- Fix bug in marshal where bad data would cause a segfault due to
666 lack of an infinite recursion check.
667
668- Removed plat-freebsd2 and plat-freebsd3 directories (and IN.py in
669 the directories).
670
671- HTML-escape the plain traceback in cgitb's HTML output, to prevent
672 the traceback inadvertently or maliciously closing the comment and
673 injecting HTML into the error page.
674
675- The popen2 module and os.popen* are deprecated. Use the subprocess module.
676
677- Added an optional credentials argument to SMTPHandler, for use with SMTP
678 servers which require authentication.
679
680- Patch #1695948: Added optional timeout parameter to SocketHandler.
681
682- Bug #1652788: Minor fix for currentframe.
683
684- Patch #1598415: Added WatchedFileHandler to better support external
685 log file rotation using e.g. newsyslog or logrotate. This handler is
686 only useful in Unix/Linux environments.
687
688- Bug #1706381: Specifying the SWIG option "-c++" in the setup.py file
689 (as opposed to the command line) will now write file names ending in
690 ".cpp" too.
691
692- As specified in RFC 2616, an HTTP response like 2xx indicates that
693 the client's request was successfully received, understood, and accepted.
694 Now in these cases no error is raised in urllib (issue #1177) and urllib2.
695
696- Bug #1290505: time.strptime's internal cache of locale information is now
697 properly recreated when the locale is changed.
698
699- Patch #1685563: remove (don't add) duplicate paths in distutils.MSVCCompiler.
700
701- Added a timeout parameter to the constructor of other protocols
702 (telnetlib, ftplib, smtplib and poplib). This is second part of the
703 work started with create_connection() and timeout in httplib, and
704 closes patch #723312.
705
706- Patch #1676823: Added create_connection() to socket.py, which may be
707 called with a timeout, and use it from httplib (whose HTTPConnection
708 and HTTPSConnection now accept an optional timeout).
709
710- Bug #978833: Revert r50844, as it broke _socketobject.dup.
711
712- Bug #1675967: re patterns pickled with Python 2.4 and earlier can
713 now be unpickled with Python 2.5 and newer.
714
715- Patch #1630118: add a SpooledTemporaryFile class to tempfile.py.
716
717- Patch #1273829: os.walk() now has a "followlinks" parameter. If set to
718 True (which is not the default), it visits symlinks pointing to
719 directories.
720
721- Bug #1681228: the webbrowser module now correctly uses the default
722 GNOME or KDE browser, depending on whether there is a session of one
723 of those present. Also, it tries the Windows default browser before
724 trying Mozilla variants.
725
726- Patch #1339796: add a relpath() function to os.path.
727
728- Patch #1681153: the wave module now closes a file object it opened if
729 initialization failed.
730
731- Bug #767111: fix long-standing bug in urllib which caused an
732 AttributeError instead of an IOError when the server's response didn't
733 contain a valid HTTP status line.
734
735- Patch #957650: "%var%" environment variable references are now properly
736 expanded in ntpath.expandvars(), also "~user" home directory references
737 are recognized and handled on Windows.
738
739- Patch #1429539: pdb now correctly initializes the __main__ module for
740 the debugged script, which means that imports from __main__ work
741 correctly now.
742
743- The nonobvious commands.getstatus() function is now deprecated.
744
745- Patch #1393667: pdb now has a "run" command which restarts the debugged
746 Python program, optionally with different arguments.
747
748- Patch #1649190: Adding support for _Bool to ctypes as c_bool.
749
750- Patch #1530482: add pydoc.render_doc() which returns the documentation
751 for a thing instead of paging it to stdout, which pydoc.doc() does.
752
753- Patch #1533909: the timeit module now accepts callables in addition to
754 strings for the code to time and the setup code. Also added two
755 convenience functions for instantiating a Timer and calling its methods.
756
757- Patch #1537850: tempfile.NamedTemporaryFile now has a "delete" parameter
758 which can be set to False to prevent the default delete-on-close
759 behavior.
760
761- Patch #1581073: add a flag to textwrap that prevents the dropping of
762 whitespace while wrapping.
763
764- Patch #1603688: ConfigParser.SafeConfigParser now checks values that
765 are set for invalid interpolation sequences that would lead to errors
766 on reading back those values.
767
768- Added support for the POSIX.1-2001 (pax) format to tarfile.py. Extended
769 and cleaned up the test suite. Added a new testtar.tar.
770
771- Patch #1449244: Support Unicode strings in
772 email.message.Message.{set_charset,get_content_charset}.
773
774- Patch #1542681: add entries for "with", "as" and "CONTEXTMANAGERS" to
775 pydoc's help keywords.
776
777- Patch #1555098: use str.join() instead of repeated string
778 concatenation in robotparser.
779
780- Patch #1635454: the csv.DictWriter class now includes the offending
781 field names in its exception message if you try to write a record with
782 a dictionary containing fields not in the CSV field names list.
783
784- Patch #1668100: urllib2 now correctly raises URLError instead of
785 OSError if accessing a local file via the file:// protocol fails.
786
787- Patch #1677862: Require a space or tab after import in .pth files.
788
789- Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap
790 the IndexError caused by passing in an invalid breakpoint number.
791
792- Patch #1599845: Add an option to disable the implicit calls to server_bind()
793 and server_activate() in the constructors for TCPServer, SimpleXMLRPCServer
794 and DocXMLRPCServer.
795
796- Bug #1531963: Make SocketServer.TCPServer's server_address always
797 be equal to calling getsockname() on the server's socket. Fixed by
798 patch #1545011.
799
800- Patch #742598: Add .timeout attribute to SocketServer that calls
801 .handle_timeout() when no requests are received.
802
803- Bug #1651235: When a tuple was passed to a ctypes function call,
804 Python would crash instead of raising an error.
805
806- Bug #1646630: ctypes.string_at(buf, 0) and ctypes.wstring_at(buf, 0)
807 returned string up to the first NUL character.
808
809- Patch #957003: Implement smtplib.LMTP.
810
811- Patch #1481079: add support for HTTP_REFERER to CGIHTTPServer.
812
813- Patch #1675424: Added tests for uncovered code in the zipfile module.
814 The KeyError raised by Zipfile.getinfo for nonexistent names now has
815 a descriptive message.
816
817- Bug #1115886: os.path.splitext('.cshrc') gives now ('.cshrc', '').
818
819- unittest now verifies more of its assumptions. In particular, TestCase
820 and TestSuite subclasses (not instances) are no longer accepted in
821 TestSuite.addTest(). This should cause no incompatibility since it
822 never made sense with ordinary subclasses -- the failure just occurred
823 later, with a more cumbersome exception.
824
825- Patch #787789: allow to pass custom TestRunner instances to unittest's
826 main() function.
827
828- Patches #1550273, #1550272: fix a few bugs in unittest and add a
829 comprehensive test suite for the module.
830
831- Patch #1001604: glob.glob() now returns unicode filenames if it was
832 given a unicode argument and os.listdir() returns unicode filenames.
833
834- Patch #1673619: setup.py identifies extension modules it doesn't know how
835 to build and those it knows how to build but that fail to build.
836
837- Patch #912410: Replace HTML entity references for attribute values
838 in HTMLParser.
839
840- Patch #1663234: you can now run doctest on test files and modules
841 using "python -m doctest [-v] filename ...".
842
843- Patch #1121142: Implement ZipFile.open.
844
845- Taught setup.py how to locate Berkeley DB on Macs using MacPorts.
846
847- Added heapq.merge() for merging sorted input streams.
848
849- Added collections.namedtuple() for assigning field names to tuples.
850
851- Added itertools.izip_longest().
852
853- Have the encoding package's search function dynamically import using absolute
854 import semantics.
855
856- Patch #1647484: Renamed GzipFile's filename attribute to name.
857
858- Patch #1517891: Mode 'a' for ZipFile now creates the file if it
859 doesn't exist.
860
861- Patch #698833: Support file decryption in zipfile.
862
863- Patch #685268: Consider a package's __path__ in imputil.
864
865- Patch 1463026: Support default namespace in XMLGenerator.
866
867- Patch 1571379: Make trace's --ignore-dir facility work in the face of
868 relative directory names.
869
870- Bug #1600860: Search for shared python library in LIBDIR,
871 not lib/python/config, on "linux" and "gnu" systems.
872
873- Patch #1652681: tarfile.py: create nonexistent files in append mode and
874 allow appending to empty files.
875
876- Bug #1124861: Automatically create pipes if GetStdHandle fails in
877 subprocess.
878
879- Patch #1634778: add missing encoding aliases for iso8859_15 and
880 iso8859_16.
881
882- Patch #1638243: the compiler package is now able to correctly compile
883 a with statement; previously, executing code containing a with statement
884 compiled by the compiler package crashed the interpreter.
885
886- Bug #1643943: Fix time.strptime's support for the %U directive.
887
888- Patch #1507247: tarfile.py: use current umask for intermediate
889 directories.
890
891- Patch #1627441: close sockets properly in urllib2.
892
893- Bug #494589: make ntpath.expandvars behave according to its docstring.
894
895- Changed platform module API python_version_tuple() to actually
896 return a tuple (it used to return a list).
897
898- Added new platform module APIs python_branch(), python_revision(),
899 python_implementation() and linux_distribution().
900
901- Added support for IronPython and Jython to the platform module.
902
903- The sets module has been deprecated. Use the built-in set/frozenset types
904 instead.
905
906- Bug #1610795: make ctypes.util.find_library work on BSD systems.
907
908- Fixes for 64-bit Windows: In ctypes.wintypes, correct the
909 definitions of HANDLE, WPARAM, LPARAM data types. Make
910 parameterless foreign function calls work.
911
912- The version number of the ctypes package changed to "1.1.0".
913
914- Bug #1627575: logging: Added _open() method to FileHandler which can
915 be used to reopen files. The FileHandler instance now saves the
916 encoding (which can be None) in an attribute called "encoding".
917
918- Bug #411881: logging.handlers: bare except clause removed from
919 SMTPHandler.emit. Now, only ImportError is trapped.
920
921- Bug #411881: logging.handlers: bare except clause removed from
922 SocketHandler.createSocket. Now, only socket.error is trapped.
923
924- Bug #411881: logging: bare except clause removed from LogRecord.__init__.
925 Now, only ValueError, TypeError and AttributeError are trapped.
926
927- Patch #1504073: Fix tarfile.open() for mode "r" with a fileobj argument.
928
929- Patch #1182394 from Shane Holloway: speed up HMAC.hexdigest.
930
931- Patch #1262036: Prevent TarFiles from being added to themselves under
932 certain conditions.
933
934- Patch #1230446: tarfile.py: fix ExFileObject so that read() and tell()
935 work correctly together with readline().
936
937- Patch #1484695: The tarfile module now raises a HeaderError exception
938 if a buffer given to frombuf() is invalid.
939
940- Bug #1503765: Fix a problem in logging.config with spaces in comma-
941 separated lists read from logging config files.
942
943- Patch #1604907: Fix problems in logging.handlers caused at logging shutdown
944 when syslog handlers fail to initialize because of syslogd problems.
945
946- Patch #1608267: fix a race condition in os.makedirs() if the directory
947 to be created is already there.
948
949- Patch #1610437: fix a tarfile bug with long filename headers.
950
951- Patch #1371075: Make ConfigParser accept optional dict type
952 for ordering, sorting, etc.
953
954- Bug #1563807: _ctypes built on AIX fails with ld ffi error.
955
956- Bug #1598620: A ctypes Structure cannot contain itself.
957
958- Patch #1070046: Marshal new-style objects like InstanceType
959 in xmlrpclib.
960
961- cStringIO.truncate(-1) now raises an IOError, like StringIO and
962 regular files.
963
964- Patch #1472877: Fix Tix subwidget name resolution.
965
966- Patch #1594554: Always close a tkSimpleDialog on ok(), even
967 if an exception occurs.
968
969- Patch #1538878: Don't make tkSimpleDialog dialogs transient if
970 the parent window is withdrawn.
971
972- Bug #1597824: return the registered function from atexit.register()
973 to facilitate usage as a decorator.
974
975- Patch #1360200: Use unmangled_version RPM spec field to deal with
976 file name mangling.
977
978- Patch #1359217: Process 2xx response in an ftplib transfer
979 that precedes an 1xx response.
980
981- Patch #1355023: support whence argument for GzipFile.seek.
982
983- Patch #1065257: Support passing open files as body in
984 HTTPConnection.request().
985
986- Bug #1569790: mailbox.py: Maildir.get_folder() and MH.get_folder()
987 weren't passing the message factory on to newly created Maildir/MH
988 objects.
989
990- Patch #1514543: mailbox.py: In the Maildir class, report errors if there's
991 a filename clash instead of possibly losing a message. (Patch by David
992 Watson.)
993
994- Patch #1514544: Try to ensure that messages/indexes have been physically
995 written to disk after calling .flush() or .close(). (Patch by David
996 Watson.)
997
998- Patch #1592250: Add elidge argument to Tkinter.Text.search.
999
1000- Patch #838546: Make terminal become controlling in pty.fork()
1001
1002- Patch #1351744: Add askyesnocancel helper for tkMessageBox.
1003
1004- Patch #1060577: Extract list of RPM files from spec file in
1005 bdist_rpm
1006
1007- Bug #1586613: fix zlib and bz2 codecs' incremental en/decoders.
1008
1009- Patch #1583880: fix tarfile's problems with long names and posix/
1010 GNU modes.
1011
1012- Bug #1586448: the compiler module now emits the same bytecode for
1013 list comprehensions as the builtin compiler, using the LIST_APPEND
1014 opcode.
1015
1016- Fix codecs.EncodedFile which did not use file_encoding in 2.5.0, and
1017 fix all codecs file wrappers to work correctly with the "with"
1018 statement (bug #1586513).
1019
1020- Lib/modulefinder.py now handles absolute and relative imports
1021 correctly.
1022
1023- Patch #1567274: Support SMTP over TLS.
1024
1025- Patch #1560695: Add .note.GNU-stack to ctypes' sysv.S so that
1026 ctypes isn't considered as requiring executable stacks.
1027
1028- ctypes callback functions only support 'fundamental' data types as
1029 result type. Raise an error when something else is used. This is a
1030 partial fix for Bug #1574584.
1031
1032- Fix turtle so that time.sleep is imported for the entire library. Allows
1033 the demo2 function to be executed on its own instead of only when the
1034 module is run as a script.
1035
1036- Bug #813342: Start the IDLE subprocess with -Qnew if the parent
1037 is started with that option.
1038
1039- Bug #1565150: Fix subsecond processing for os.utime on Windows.
1040
1041- Support for MSVC 8 was added to bdist_wininst.
1042
1043- Bug #1446043: correctly raise a LookupError if an encoding name given
1044 to encodings.search_function() contains a dot.
1045
1046- Bug #1560617: in pyclbr, return full module name not only for classes,
1047 but also for functions.
1048
1049- Bug #1457823: cgi.(Sv)FormContentDict's constructor now takes
1050 keep_blank_values and strict_parsing keyword arguments.
1051
1052- Bug #1566602: correct failure of posixpath unittest when $HOME ends
1053 with a slash.
1054
1055- Bug #1565661: in webbrowser, split() the command for the default
1056 GNOME browser in case it is a command with args.
1057
1058- Made the error message for time.strptime when the data data and format do
1059 match be more clear.
1060
1061- Fix a bug in traceback.format_exception_only() that led to an error
1062 being raised when print_exc() was called without an exception set.
1063 In version 2.4, this printed "None", restored that behavior.
1064
1065- Make webbrowser.BackgroundBrowser usable in Windows (it wasn't because
1066 the close_fds arg to subprocess.Popen is not supported).
1067
1068- Reverted patch #1504333 to sgmllib because it introduced an infinite loop.
1069
1070- Patch #1553314: Fix the inspect.py slowdown that was hurting IPython & SAGE
1071 by adding smarter caching in inspect.getmodule()
1072
1073- Fix missing import of the types module in logging.config.
1074
1075- Patch #1550886: Fix decimal module context management implementation
1076 to match the localcontext() example from PEP 343.
1077
1078- Bug #1545341: The 'classifier' keyword argument to the Distutils setup()
1079 function now accepts tuples as well as lists.
1080
1081- Bug #1541863: uuid.uuid1 failed to generate unique identifiers
1082 on systems with low clock resolution.
1083
1084- Bug #1531862: Do not close standard file descriptors in subprocess.
1085
1086- idle: Honor the "Cancel" action in the save dialog (Debian bug #299092).
1087
1088- Fix utf-8-sig incremental decoder, which didn't recognise a BOM when the
Guido van Rossumea6775b2008-02-21 20:16:31 +00001089 first chunk fed to the decoder started with a BOM, but was longer than 3
1090 bytes.
Christian Heimes7131fd92008-02-19 14:21:46 +00001091
1092- The implementation of UnicodeError objects has been simplified (start and end
1093 attributes are now stored directly as Py_ssize_t members).
1094
1095- Issue829951: In the smtplib module, SMTP.starttls() now complies with
1096 RFC 3207 and forgets any knowledge obtained from the server not obtained
1097 from the TLS negotiation itself. Patch contributed by Bill Fenner.
1098
1099- Issue1339: The smtplib.SMTP class has been refactored a bit such
1100 that the SMTP.starttls() caller no longer needs to call ehlo()
1101 beforehand. SMTP.starttls() now raises an exception of the server
1102 does not claim to support starttls. Adds the SMTP.ehlo_or_helo_if_needed()
1103 method. Patch contributed by Bill Fenner.
1104
1105
Christian Heimesbc873412007-12-08 22:11:32 +00001106Extension Modules
1107-----------------
1108
Christian Heimes043d6f62008-01-07 17:19:16 +00001109- Issue #1762972: Readded the reload() function as imp.reload()
Guido van Rossumea6775b2008-02-21 20:16:31 +00001110
Christian Heimes7131fd92008-02-19 14:21:46 +00001111- #2112: mmap.error is now a subclass of EnvironmentError and not a
1112 direct EnvironmentError
1113
Christian Heimesa156e092008-02-16 07:38:31 +00001114- Bug #2111: mmap segfaults when trying to write a block opened with PROT_READ
1115
1116- #2063: correct order of utime and stime in os.times() result on Windows.
Christian Heimesbc873412007-12-08 22:11:32 +00001117
Christian Heimes7131fd92008-02-19 14:21:46 +00001118- Updated ``big5hkscs`` codec to the HKSCS revision of 2004.
1119
1120- #1940: make it possible to use curses.filter() before curses.initscr()
1121 as the documentation says.
1122
1123- Backport of _fileio module from Python 3.0.
1124
1125- #1087741: mmap.mmap is now a class, not a factory function. It is also
1126 subclassable now.
1127
1128- Patch #1648: added ``sys.getprofile()`` and ``sys.gettrace()``.
1129
1130- Patch #1663329: added ``os.closerange()`` function to quickly close a range
1131 of file descriptors without considering errors.
1132
1133- Patch 976880: ``mmap`` objects now have an ``rfind`` method that
1134 works as expected. ``mmap.find`` also takes an optional ``end``
1135 parameter.
1136
1137- _winreg's HKEY object has gained __enter__ and __exit__ methods to support
1138 the context manager protocol. The _winreg module also gained a new function
1139 ``ExpandEnvironmentStrings`` to expand REG_EXPAND_SZ keys.
1140
1141- itertools.starmap() now accepts any iterable input. Previously, it required
1142 the function inputs to be tuples.
1143
1144- Issue #1646: Make socket support TIPC. The socket module now has support
1145 for TIPC under Linux, see http://tipc.sf.net/ for more information.
1146
1147- Added interface for Windows' WSAIoctl to socket object and added an example
1148 for a simple network sniffer.
1149
1150- Bug #1301: Bad assert in _tkinter fixed.
1151
1152- Added bdist_wininst executable for VS 2008.
1153
1154- Bug #1604: collections.deque.__init__(iterable) now clears any prior contents
1155 before adding elements from the iterable. This fix brings the behavior into
1156 line with that for list.__init__().
1157
1158- Added wide char functions to msvcrt module: getwch, getwche, putwch and
1159 ungetwch. The functions accept or return unicode.
1160
1161- os.access now returns True on Windows for any existing directory.
1162
1163- Added warnpy3k function to the warnings module.
1164
1165- Marshal.dumps() now expects exact type matches for int, long, float, complex,
1166 tuple, list, dict, set, and frozenset. Formerly, it would silently miscode
1167 subclasses of those types. Now, it raises a ValueError instead.
1168
1169- Patch #1388440: Add set_completion_display_matches_hook and
1170 get_completion_type to readline.
1171
1172- Bug #1649098: Avoid declaration of zero-sized array declaration in
1173 structure.
1174
1175- Removed the rgbimg module; been deprecated since Python 2.5.
1176
1177- Bug #1721309: prevent bsddb module from freeing random memory.
1178
1179- Bug #1233: fix bsddb.dbshelve.DBShelf append method to work as
1180 intended for RECNO databases.
1181
1182- pybsddb.sf.net Bug #477182: Load the database flags at database open
1183 time so that opening a database previously created with the DB_DUP or
1184 DB_DUPSORT flag set will keep the proper behavior on subsequent opens.
1185 Specifically: dictionary assignment to a DB object will replace all
1186 values for a given key when the database allows duplicate values.
1187 DB users should use DB.put(k, v) when they want to store duplicates; not
1188 DB[k] = v.
1189
1190- Add the bsddb.db.DBEnv.lock_id_free method.
1191
1192- Bug #1686475: Support stat'ing open files on Windows again.
1193
1194- Patch #1185447: binascii.b2a_qp() now correctly quotes binary characters
1195 with ASCII value less than 32. Also, it correctly quotes dots only if
1196 they occur on a single line, as opposed to the previous behavior of
1197 quoting dots if they are the second character of any line.
1198
1199- Bug #1622896: fix a rare corner case where the bz2 module raised an
1200 error in spite of a succesful compression.
1201
1202- Patch #1654417: make operator.{get,set,del}slice use the full range
1203 of Py_ssize_t.
1204
1205- Patch #1646728: datetime.fromtimestamp fails with negative
1206 fractional times. With unittest.
1207
1208- Patch #1490190: posixmodule now includes os.chflags() and os.lchflags()
1209 functions on platforms where the underlying system calls are available.
1210
1211- Patch #1494140: Add documentation for the new struct.Struct object.
1212
1213- Patch #1432399: Support the HCI protocol for bluetooth sockets
1214
1215- Patch #1657276: Make NETLINK_DNRTMSG conditional.
1216
1217- Bug #1653736: Complain about keyword arguments to time.isoformat.
1218
1219- Bug #1486663: don't reject keyword arguments for subclasses of builtin
1220 types.
1221
1222- Patch #1610575: The struct module now supports the 't' code, for
1223 C99 _Bool.
1224
1225- Patch #1635058: ensure that htonl and friends never accept or
1226 return negative numbers, per the underlying C implementation.
1227
1228- Patch #1544279: Improve thread-safety of the socket module by moving
1229 the sock_addr_t storage out of the socket object.
1230
1231- Patch #1019808: fix bug that causes an incorrect error to be returned
1232 when a socket timeout is set and a connection attempt fails.
1233
1234- Speed up function calls into the math module.
1235
1236- Bug #1588217: don't parse "= " as a soft line break in binascii's
1237 a2b_qp() function, instead leave it in the string as quopri.decode()
1238 does.
1239
1240- Bug #1599782: Fix segfault on bsddb.db.DB().type().
1241
1242- Bug #1567666: Emulate GetFileAttributesExA for Win95.
1243
1244- Patch #1576166: Support os.utime for directories on Windows NT+.
1245
1246- Patch #1572724: fix typo ('=' instead of '==') in _msi.c.
1247
1248- Bug #1572832: fix a bug in ISO-2022 codecs which may cause segfault
1249 when encoding non-BMP unicode characters.
1250
1251- Bug #1556784: allow format strings longer than 127 characters in
1252 datetime's strftime function.
1253
1254- Fix itertools.count(n) to work with negative numbers again.
1255
1256- RLIMIT_SBSIZE was added to the resource module where available.
1257
1258- Bug #1551427: fix a wrong NULL pointer check in the win32 version
1259 of os.urandom().
1260
1261- Bug #1548092: fix curses.tparm seg fault on invalid input.
1262
1263- Patch #1114: fix curses module compilation on 64-bit AIX, & possibly
1264 other 64-bit LP64 platforms where attr_t is not the same size as a long.
1265 (Contributed by Luke Mewburn.)
1266
1267- Bug #1550714: fix SystemError from itertools.tee on negative value for n.
1268
1269- Fixed a few bugs on cjkcodecs:
1270 - gbk and gb18030 codec now handle U+30FB KATAKANA MIDDLE DOT correctly.
1271 - iso2022_jp_2 codec now encodes into G0 for KS X 1001, GB2312
1272 codepoints to conform the standard.
1273 - iso2022_jp_3 and iso2022_jp_2004 codec can encode JIS X 0213:2
1274 codepoints now.
1275
1276- Bug #1552726: in readline.c, avoid repeatedly polling in interactive
1277 mode by only placing a timeout on the select() if an input hook has
1278 been defined. This prevents an interactive Python from waking up 10
1279 times per second. Patch by Richard Boulton.
1280
1281- fixed a bug with bsddb.DB.stat: the flags and txn keyword arguments
1282 were transposed.
1283
1284- Added support for linking the bsddb module against BerkeleyDB 4.5.x
1285 and 4.6.x.
1286
1287- Bug #1633621: if curses.resizeterm() or curses.resize_term() is called,
1288 update _curses.LINES, _curses.COLS, curses.LINES and curses.COLS.
1289
1290- Fix an off-by-one bug in locale.strxfrm().
1291
1292- Fix libffi configure for hppa*-*-linux* | parisc*-*-linux*.
1293
1294- Build using system ffi library on arm*-linux*.
1295
1296- Bug #1372: zlibmodule.c: int overflow in PyZlib_decompress
1297
1298- bsddb module: Fix memory leak when using database cursors on
1299 databases without a DBEnv.
1300
1301Tests
1302-----
1303
1304- Refactor test_logging to use doctest.
1305
1306- Refactor test_profile and test_cprofile to use the same code to profile.
1307
1308- Make test_runpy reentrant by fixing _check_module to clear out any module
1309 being tested. Was causing an error by __import__ doing a reload on the
1310 second run and thus suppressing bytecode recreation.
1311
1312- Capture socket connection resets and timeouts in test_socket_ssl and
1313 test_urllib2net and raise test.test_support.ResourceDenied.
1314
1315- Patch #1559413: Fix test_cmd_line if sys.executable contains a space.
1316
1317- Added test.test_support.TransientResource which is a context manager to
1318 surround calls to resources that are not guaranteed to work even if
1319 test.test_support.requires says that the resource should exist.
1320
1321- Added a test for slicing of an exception.
1322
1323- Added test.test_support.EnvironmentVarGuard. It's a class that provides a
1324 context manager so that one can temporarily set or unset environment
1325 variables.
1326
1327- Added some tests for modulefinder.
1328
1329- Converted test_imp to use unittest.
1330
1331- Fix bsddb test_basics.test06_Transactions to check the version
1332 number properly.
1333
1334- test.test_support.catch_warning is a new context manager that can be used
1335 to catch the warnings issued by the warning framework.
1336
1337
1338Tools
1339-----
1340
1341- Tools/scripts/reindent.py now creates the backup file using shutil.copy
1342 to preserve user/group and permissions. Added also a --nobackup option
1343 to not create the backup if the user is concerned regarding this. Check
1344 issue 1050828 for more details.
1345
1346- Tools/scripts/win_add2path.py was added. The simple script modifes the
1347 PATH environment var of the HKCU tree and adds the python bin and script
1348 directory.
1349
1350- Tools/18n/pygettext.py was added to the list of scripts installed by
1351 Tools/scripts/setup.py (tracker item 642309).
1352
1353- Added IronPython and Jython support to pybench (part of which
1354 was patch #1563844)
1355
1356- Made some minor changes to pybench output to allow the user
1357 to see which Python version is running pybench
1358
1359- Added support for the new platform module feature
1360 platform.python_implementation(); this will now be saved
1361 in the benchmark pickle
1362
1363
1364Documentation
1365-------------
1366
1367- RFE #1765140: Updated documentation on FileHandler and subclasses to
1368 include new optional delay argument.
1369
1370- Bug #932563: Added section on getting contextual information into logging
1371 output, and added documentation for the new LoggerAdapter class.
1372
1373- Bug #1295: Added information about caching of formatted exception
1374 information in the LogRecord by Formatter.format().
1375
1376- Bug #1637365: add subsection about "__name__ == __main__" to the
1377 Python tutorial.
1378
1379- Patch #1698768: updated the "using Python on the Mac" intro.
1380
1381- Bug #1569057: Document that calling file.next() when the file is open for
1382 writing is undefined.
1383
1384- Patch #1489771: the syntax rules in Python Reference Manual were
1385 updated to reflect the current Python syntax.
1386
1387- Patch #1686451: Fix return type for
1388 PySequence_{Count,Index,Fast_GET_SIZE}.
1389
1390- Patch #1679379: add documentation for fnmatch.translate().
1391
1392- Bug #1629566: clarify the docs on the return values of parsedate()
1393 and parsedate_tz() in email.utils and rfc822.
1394
1395- Patch #1671450: add a section about subclassing builtin types to the
1396 "extending and embedding" tutorial.
1397
1398- Bug #1629125: fix wrong data type (int -> Py_ssize_t) in PyDict_Next
1399 docs.
1400
1401- Bug #1565919: document set types in the Language Reference.
1402
1403- Bug #1546052: clarify that PyString_FromString(AndSize) copies the
1404 string pointed to by its parameter.
1405
1406- Bug #1566663: remove obsolete example from datetime docs.
1407
1408- Bug #1541682: Fix example in the "Refcount details" API docs.
1409 Additionally, remove a faulty example showing PySequence_SetItem applied
1410 to a newly created list object and add notes that this isn't a good idea.
1411
1412
1413Tools/Demos
1414-----------
1415
1416- Patch #1552024: add decorator support to unparse.py demo script.
1417
1418- Make auto-generated python.vim file list built-ins and exceptions in
1419 alphatbetical order. Makes output more deterministic and easier to tell if
1420 the file is stale or not.
1421
1422- Bug #1546372: Fixed small bugglet in pybench that caused a missing
1423 file not to get reported properly.
1424
1425
1426Build
1427-----
1428
1429- Have the search path for building extensions follow the declared order in
1430 $CPPFLAGS and $LDFLAGS when adding directories from those environment
1431 variables.
1432
1433- Bug #1983: Added a check to pyport to verify that sizeof(pid_t) is
1434 smaller or equal sizeof(long).
1435
1436- Bug #1234: Fixed semaphore errors on AIX 5.2
1437
1438- Issue #1726: Remove Python/atof.c from PCBuild/pythoncore.vcproj
1439
1440- Removed PCbuild8/ directory and added a new build directory for VS 2005
1441 based on the VS 2008 build directory to PC/VS8.0. The script
1442 PCbuild/vs8to9.py was added to sync changes from PCbuild to PC/VS8.0.
1443
1444- Moved PCbuild/ directory for VS 2003 to PC/VS7.1 and renamed PCBuild9/
1445 directory to PCBuild/.
1446
1447- Bug #1699: Define _BSD_SOURCE only on OpenBSD.
1448
1449- Bug #1608: use -fwrapv when GCC supports it. This is important,
1450 newer GCC versions may optimize away overflow buffer overflow checks
1451 without this option!
1452
1453- Patch #1418: Make the AC_REPLACE_FUNCS object files actually work.
1454
1455- Add a FAST_LOOPS build option that speeds-up looping by trading away
1456 periodic threadstate and signal checking in tight loops. By default,
1457 this option is turned-off. It should only be enabled in debugged,
1458 performance critical applications.
1459
1460- Patch #786737: Allow building in a tree of symlinks pointing to
1461 a readonly source.
1462
1463- Bug #1737210: Change Manufacturer of Windows installer to PSF.
1464
1465- Bug #1746880: Correctly install DLLs into system32 folder on Win64.
1466
1467- Define _BSD_SOURCE, to get access to POSIX extensions on OpenBSD 4.1+.
1468
1469- Stop supporting AtheOS and cause a build error in configure for the platform.
1470
1471- Bug #1655392: don't add -L/usr/lib/pythonX.Y/config to the LDFLAGS
1472 returned by python-config if Python was built with --enable-shared
1473 because that prevented the shared library from being used.
1474
1475- Patch #1569798: fix a bug in distutils when building Python from a
1476 directory within sys.exec_prefix.
1477
1478- Bug #1675511: Use -Kpic instead of -xcode=pic32 on Solaris/x86.
1479
1480- Disable _XOPEN_SOURCE on NetBSD 1.x.
1481
1482- configure now checks whether gcc supports the PyArg_ParseTuple format
1483 attribute.
1484
1485- Bug #1578513: Cross compilation was broken by a change to configure.
1486 Repair so that it's back to how it was in 2.4.3.
1487
1488- Patch #1576954: Update VC6 build directory; remove redundant
1489 files in VC7.
1490
1491- Bug #1568842: Fix test for uintptr_t.
1492
1493- Patch #1540470, for OpenBSD 4.0.
1494
1495- Fix build failure on kfreebsd and on the hurd.
1496
1497- Fix the build of the library reference in info format.
1498
1499- Allow Emacs 22 for building the documentation in info format.
1500
1501- Makefile.pre.in(buildbottest): Run an optional script pybuildbot.identify
1502 to include some information about the build environment.
1503
1504
1505C API
1506-----
1507
1508- Unified naming convention for free lists and their limits. All free lists
1509 in Object/ are named ``free_list``, the counter ``numfree`` and the upper
1510 limit is a macro ``PyName_MAXFREELIST`` inside an #ifndef block.
1511
1512- ``PySet_Add()`` can now modify a newly created frozenset. Similarly to
1513 ``PyTuple_SetItem``, it can be used to populate a brand new frozenset; but
1514 it does not steal a reference to the added item.
1515
1516- Added ``PySet_Check()`` and ``PyFrozenSet_Check()`` to the set API.
1517
1518- Backport of PyUnicode_FromString(), _FromStringAndSize(), _Format and
1519 _FormatV from Python 3.0. Made PyLong_AsSsize_t and PyLong_FromSsize_t
1520 public functions.
1521
1522- Patch #1720595: add T_BOOL to the range of structmember types.
1523
1524- Issue #1534: Added ``PyFloat_GetMax()``, ``PyFloat_GetMin()`` and
1525 ``PyFloat_GetInfo()`` to the float API.
1526
1527- Issue #1521: On 64bit platforms, using PyArgs_ParseTuple with the t# of w#
1528 format code incorrectly truncated the length to an int, even when
1529 PY_SSIZE_T_CLEAN is set. The str.decode method used to return incorrect
1530 results with huge strings.
1531
1532- Issue #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE
1533 and Py_REFCNT.
1534
1535- PEP 3123: Provide forward compatibility with Python 3.0, while keeping
1536 backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
1537 PyVarObject_HEAD_INIT.
1538
1539- Py_ssize_t fields work in structmember when HAVE_LONG_LONG is not defined.
1540
1541- Patch #1733960: Allow T_LONGLONG to accept ints.
1542
1543- T_PYSSIZET can now be used in PyMemberDef lists for Py_ssize_t members.
1544
1545- Added a new API function ``PyImport_ImportModuleNoBlock``.
1546
1547- Bug #1637022: Prefix AST symbols with _Py_.
1548
1549- Fix some leftovers from the conversion from int to Py_ssize_t
1550 (relevant to strings and sequences of more than 2**31 items).
1551
1552- Make _PyGILState_NoteThreadState() static, it was not used anywhere
1553 outside of pystate.c and should not be necessary.
1554
1555- ``PyImport_Import`` and ``PyImport_ImportModule`` now always do absolute
1556 imports. In earlier versions they might have used relative imports under
1557 some conditions.
1558
1559- Added case insensitive comparison methods ``PyOS_stricmp(char*, char*)``
1560 and ``PyOS_strnicmp(char*, char*, Py_ssize_t)``.
1561
1562- Bug #1542693: remove semi-colon at end of PyImport_ImportModuleEx macro
1563 so it can be used as an expression.
1564
1565
1566Windows
1567-------
1568
1569- Patch #1706: Drop support for Win9x, WinME and NT4. Python now requires
1570 Windows 2000 or greater. The _WINVER and NTDDI_VERSION macros are set to
1571 Win2k for x86/32bit builds and WinXP for AMD64 builds.
1572
1573- Conditionalize definition of _CRT_SECURE_NO_DEPRECATE
1574 and _CRT_NONSTDC_NO_DEPRECATE.
1575
1576- Bug #1216: Restore support for Visual Studio 2002.
1577
1578
1579Mac
1580---
1581
1582- cfmfile now raises a DeprecationWarning.
1583
1584- buildtools now raises a DeprecationWarning.
1585
1586- Removed the macfs module. It had been deprecated since Python 2.5. This
1587 lead to the deprecation of macostools.touched() as it relied solely on macfs
1588 and was a no-op under OS X.
1589
1590
1591What's New in Python 2.5 release candidate 1?
1592=============================================
1593
1594*Release date: 17-AUG-2006*
1595
1596Core and builtins
1597-----------------
1598
1599- Unicode objects will no longer raise an exception when being
1600 compared equal or unequal to a string and a UnicodeDecodeError
1601 exception occurs, e.g. as result of a decoding failure.
1602
1603 Instead, the equal (==) and unequal (!=) comparison operators will
1604 now issue a UnicodeWarning and interpret the two objects as
1605 unequal. The UnicodeWarning can be filtered as desired using
1606 the warning framework, e.g. silenced completely, turned into an
1607 exception, logged, etc.
1608
1609 Note that compare operators other than equal and unequal will still
1610 raise UnicodeDecodeError exceptions as they've always done.
1611
1612- Fix segfault when doing string formatting on subclasses of long.
1613
1614- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines
1615 with new-style classes.
1616
1617- Fix bug related to __len__ functions returning negative values with
1618 classic classes.
1619
1620- Patch #1538606, Fix __index__() clipping. There were some problems
1621 discovered with the API and how integers that didn't fit into Py_ssize_t
1622 were handled. This patch attempts to provide enough alternatives
1623 to effectively use __index__.
1624
1625- Bug #1536021: __hash__ may now return long int; the final hash
1626 value is obtained by invoking hash on the long int.
1627
1628- Bug #1536786: buffer comparison could emit a RuntimeWarning.
1629
1630- Bug #1535165: fixed a segfault in input() and raw_input() when
1631 sys.stdin is closed.
1632
1633- On Windows, the PyErr_Warn function is now exported from
1634 the Python dll again.
1635
1636- Bug #1191458: tracing over for loops now produces a line event
1637 on each iteration. Fixing this problem required changing the .pyc
1638 magic number. This means that .pyc files generated before 2.5c1
1639 will be regenerated.
1640
1641- Bug #1333982: string/number constants were inappropriately stored
1642 in the byte code and co_consts even if they were not used, ie
1643 immediately popped off the stack.
1644
1645- Fixed a reference-counting problem in property().
1646
1647
Christian Heimesbc873412007-12-08 22:11:32 +00001648Library
1649-------
1650
Raymond Hettinger48b8b662008-02-05 01:53:00 +00001651- Weakref dictionaries now inherit from MutableMapping.
1652 XXX their API still needs to be modernized (i.e. eliminate the iter methods).
1653
1654- Created new UserDict class in collections module. This one inherits from and
Raymond Hettingerb3a65f82008-02-21 22:11:37 +00001655 complies with the MutableMapping ABC. Also, moved UserString and UserList
1656 to the collections module. The MutableUserString class was removed.
Raymond Hettinger48b8b662008-02-05 01:53:00 +00001657
Guido van Rossumea6775b2008-02-21 20:16:31 +00001658- Removed UserDict.DictMixin. Replaced all its uses with
1659 collections.MutableMapping.
Raymond Hettingeredf3b732008-02-04 22:07:15 +00001660
Guido van Rossume239b002008-01-06 00:44:20 +00001661- Issue #1703: getpass() should flush after writing prompt.
Christian Heimesfc5aa9d2007-12-11 09:00:01 +00001662
Guido van Rossume239b002008-01-06 00:44:20 +00001663- Issue #1585: IDLE uses non-existent xrange() function.
1664
1665- Issue #1578: Problems in win_getpass.
1666
1667
Georg Brandl52d168a2008-01-07 18:10:24 +00001668Build
1669-----
1670
1671- Renamed --enable-unicode configure flag to --with-wide-unicode, since
1672 Unicode strings can't be disabled anymore.
1673
1674
Guido van Rossume239b002008-01-06 00:44:20 +00001675C API
1676-----
1677
1678- Issue #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE,
1679 Py_TYPE and Py_REFCNT.
1680
1681- New API PyImport_ImportModuleNoBlock(), works like PyImport_ImportModule()
1682 but won't block on the import lock (returning an error instead).
Christian Heimes0ec88b32007-12-10 17:02:00 +00001683
Christian Heimesbc873412007-12-08 22:11:32 +00001684
Fred Drake0e474a82007-10-11 18:01:43 +00001685What's New in Python 3.0a2?
Christian Heimesbc873412007-12-08 22:11:32 +00001686===========================
Fred Drake0e474a82007-10-11 18:01:43 +00001687
Guido van Rossum99533a92007-12-06 05:07:41 +00001688*Release date: 07-Dec-2007*
1689
1690(Note: this list is incomplete.)
Fred Drake0e474a82007-10-11 18:01:43 +00001691
Guido van Rossum40d20bc2007-10-22 00:09:51 +00001692Core and Builtins
1693-----------------
1694
Brett Cannon37f7e6e2007-10-26 05:42:09 +00001695- str8 now has the same construction signature as bytes.
1696
Brett Cannon40430012007-10-22 20:24:51 +00001697- Comparisons between str and str8 now return False/True for ==/!=. sqlite3
1698 returns str8 when recreating on object from it's __conform__ value. The
1699 struct module returns str8 for all string-related formats. This was true
1700 before this change, but becomes more apparent thanks to string comparisons
1701 always being False.
1702
Guido van Rossum40d20bc2007-10-22 00:09:51 +00001703- Replaced `PyFile_FromFile()` with `PyFile_FromFd(fd, name. mode, buffer,
1704 encoding, newline)`
1705
1706- Fixed `imp.find_module()` to obey the -*- coding: -*- header.
1707
1708- Changed `__file__` and `co_filename` to unicode. The path names are decoded
1709 with `Py_FileSystemDefaultEncoding` and a new API method
1710 `PyUnicode_DecodeFSDefault(char*)` was added.
1711
Guido van Rossum2dced8b2007-10-30 17:27:30 +00001712- io.open() and _fileio.FileIO have grown a new argument closefd. A false
1713 value disables the closing of the file descriptor.
1714
Guido van Rossum98297ee2007-11-06 21:34:58 +00001715- Added a new option -b to issues warnings (-bb for errors) about certain
1716 operations between bytes/buffer and str like str(b'') and comparsion.
1717
Christian Heimes58cb1b82007-11-13 02:19:40 +00001718- The standards streams sys.stdin, stdout and stderr may be None when the
1719 when the C runtime library returns an invalid file descriptor for the
1720 streams (fileno(stdin) < 0). For now this happens only for Windows GUI
1721 apps and scripts started with `pythonw.exe`.
1722
Christian Heimesbce52be2007-11-17 19:08:41 +00001723- Added PCbuild9 directory for VS 2008.
1724
1725- Renamed structmember.h WRITE_RESTRICTED to PY_WRITE_RESTRICTED to work
1726 around a name clash with VS 2008 on Windows.
1727
Christian Heimesff737952007-11-27 10:40:20 +00001728- Unbound methods are gone for good. ClassObject.method returns an ordinary
1729 function object, instance.method still returns a bound method object.
1730 The API of bound methods is cleaned up, too. The im_class attribute is
1731 removed and im_func + im_self are renamed to __func__ and __self__. The
1732 factory PyMethod_New takes only func and instance as argument.
1733
Christian Heimesf78b1c62007-12-02 16:52:32 +00001734- intobject.h is no longer included by Python.h. The remains were moved
1735 to longobject.h. It still exists to define several aliases from PyInt_
1736 to PyLong_ functions.
1737
Christian Heimesa37d4c62007-12-04 23:02:19 +00001738- Removed sys.maxint, use sys.maxsize instead.
1739
Christian Heimesbce52be2007-11-17 19:08:41 +00001740
Fred Drake0e474a82007-10-11 18:01:43 +00001741Extension Modules
1742-----------------
1743
1744- The `hotshot` profiler has been removed; use `cProfile` instead.
1745
1746
Brett Cannone9fd2312007-10-12 19:18:19 +00001747Library
1748-------
1749
1750- When loading an external file using testfile(), the passed-in encoding
1751 argument was being ignored if __loader__ is defined and forcing the source to
1752 be UTF-8.
1753
Guido van Rossum687b9c02007-10-25 23:18:51 +00001754- The methods `os.tmpnam()`, `os.tempnam()` and `os.tmpfile()` have been
1755 removed in favor of the tempfile module.
1756
Christian Heimesc9543e42007-11-28 08:28:28 +00001757- Removed the 'new' module.
1758
1759- Removed all types from the 'types' module that are easily accessable through
1760 builtins.
Brett Cannone9fd2312007-10-12 19:18:19 +00001761
Georg Brandl52d168a2008-01-07 18:10:24 +00001762
Guido van Rossum4405cf32007-08-30 17:16:55 +00001763What's New in Python 3.0a1?
Guido van Rossum45aecf42006-03-15 04:58:47 +00001764==========================
Thomas Wouters4d70c3d2006-06-08 14:42:34 +00001765
Guido van Rossum4405cf32007-08-30 17:16:55 +00001766*Release date: 31-Aug-2007*
Neal Norwitz4886cc32006-08-21 17:06:07 +00001767
1768Core and Builtins
1769-----------------
1770
Martin v. Löwis47383402007-08-15 07:32:56 +00001771- PEP 3131: Support non-ASCII identifiers.
1772
Martin v. Löwis447d33e2007-07-29 18:10:01 +00001773- PEP 3120: Change default encoding to UTF-8.
1774
Martin v. Löwis9f2e3462007-07-21 17:22:18 +00001775- PEP 3123: Use proper C inheritance for PyObject.
1776
Guido van Rossumcd16bf62007-06-13 18:07:49 +00001777- Removed the __oct__ and __hex__ special methods and added a bin()
1778 builtin function.
1779
1780- PEP 3127: octal literals now start with "0o". Old-style octal literals
1781 are invalid. There are binary literals with a prefix of "0b".
1782 This also affects int(x, 0).
1783
Guido van Rossume7ba4952007-06-06 23:52:48 +00001784- None, True, False are now keywords.
1785
Guido van Rossum29478ef2007-05-29 00:39:44 +00001786- PEP 3119: isinstance() and issubclass() can be overridden.
1787
Guido van Rossumebe3e162007-05-17 18:20:34 +00001788- Remove BaseException.message.
1789
Guido van Rossum1bc535d2007-05-15 18:46:22 +00001790- Remove tuple parameter unpacking (PEP 3113).
1791
Kurt B. Kaiser2c7f3142007-08-30 21:52:19 +00001792- Remove the f_restricted attribute from frames. This naturally leads to the
Guido van Rossuma8add0e2007-05-14 22:03:55 +00001793 removal of PyEval_GetRestricted() and PyFrame_IsRestricted().
1794
Guido van Rossum0368b722007-05-11 16:50:42 +00001795- PEP 3132 was accepted. That means that you can do ``a, *b = range(5)``
1796 to assign 0 to a and [1, 2, 3, 4] to b.
1797
Guido van Rossum805365e2007-05-07 22:24:25 +00001798- range() now returns an iterator rather than a list. Floats are not allowed.
1799 xrange() is no longer defined.
1800
Nick Coghlan650f0d02007-04-15 12:05:43 +00001801- Patch #1660500: hide iteration variable in list comps, add set comps
1802 and use common code to handle compilation of iterative expressions
1803
Guido van Rossume27dc722007-03-27 22:37:34 +00001804- By default, != returns the opposite of ==, unless the latter returns
1805 NotImplemented.
1806
Collin Winter670e6922007-03-21 02:57:17 +00001807- Patch #1680961: sys.exitfunc has been removed and replaced with a private
1808 C-level API.
1809
Georg Brandl801dd732007-03-18 20:18:31 +00001810- PEP 3115: new metaclasses: the metaclass is now specified as a
1811 keyword arg in the class statement, which can now use the full syntax of
1812 a parameter list. Also, the metaclass can implement a __prepare__ function
1813 which will be called to create the dictionary for the new class namespace.
1814
Georg Brandl428f0642007-03-18 18:35:15 +00001815- The long-deprecated argument "pend" of PyFloat_FromString() has been
1816 removed.
1817
Georg Brandle32b4222007-03-10 22:13:27 +00001818- The dir() function has been extended to call the __dir__() method on
1819 its argument, if it exists. If not, it will work like before. This allows
1820 customizing the output of dir() in the presence of a __getattr__().
Brett Cannonba7bf492007-02-27 00:15:55 +00001821
Neal Norwitz8dfc4a92007-08-11 06:39:53 +00001822- Removed support for __members__ and __methods__.
1823
Georg Brandle32b4222007-03-10 22:13:27 +00001824- Removed indexing/slicing on BaseException.
Neal Norwitz2633c692007-02-26 22:22:47 +00001825
Georg Brandle32b4222007-03-10 22:13:27 +00001826- input() became raw_input(): the name input() now implements the
Guido van Rossum0240b922007-02-26 21:23:50 +00001827 functionality formerly known as raw_input(); the name raw_input()
1828 is no longer defined.
1829
Brett Cannon39590462007-02-26 22:01:14 +00001830- Classes listed in an 'except' clause must inherit from BaseException.
Brett Cannonf74225d2007-02-26 21:10:16 +00001831
Guido van Rossumcc2b0162007-02-11 06:12:03 +00001832- PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
Guido van Rossumcf1be882007-08-30 22:07:17 +00001833 and .keys(), .items(), .values() return dict views, which behave
1834 like sets.
Guido van Rossumcc2b0162007-02-11 06:12:03 +00001835
Guido van Rossum8b545362007-02-09 23:52:14 +00001836- PEP 3105: print is now a function. Also (not in the PEP) the
1837 'softspace' attribute of files is now gone (since print() doesn't use
1838 it). A side effect of this change is that you can get incomplete
1839 output lines in interactive sessions:
1840
1841 >>> print(42, end="")
Kurt B. Kaiser2c7f3142007-08-30 21:52:19 +00001842 42>>>
Guido van Rossum8b545362007-02-09 23:52:14 +00001843
1844 We may be able to fix this after the I/O library rewrite.
Guido van Rossum4502c802007-02-09 05:42:38 +00001845
Brett Cannon398db8b2007-01-29 23:44:37 +00001846- PEP 3102: keyword-only arguments.
1847
Guido van Rossumd4588c12007-02-13 19:55:23 +00001848- Int/Long unification is complete. The 'long' built-in type
Guido van Rossumec7027f2007-01-30 00:00:40 +00001849 and literals with trailing 'L' or 'l' have been removed.
1850 Performance may be sub-optimal (haven't really benchmarked).
Guido van Rossumab186842007-01-14 03:42:30 +00001851
1852- 'except E, V' must now be spelled as 'except E as V' and deletes V
1853 at the end of the except clause; V must be a simple name.
1854
Neal Norwitzc1505362006-12-28 06:47:50 +00001855- Added function annotations per PEP 3107.
1856
Jeremy Hyltona4f9fc62007-02-27 15:53:28 +00001857- Added nonlocal declaration from PEP 3104
1858
1859 >>> def f(x):
1860 ... def inc():
1861 ... nonlocal x
1862 ... x += 1
1863 ... return x
1864 ... return inc
1865 ...
1866 >>> inc = f(0)
1867 >>> inc()
1868 1
1869 >>> inc()
1870 2
1871
Georg Brandl66a796e2006-12-19 20:50:34 +00001872- Moved intern() to sys.intern().
1873
1874- exec is now a function.
1875
1876- Renamed nb_nonzero to nb_bool and __nonzero__ to __bool__.
Jack Diederich4dafcc42006-11-28 19:15:13 +00001877
Neal Norwitz4886cc32006-08-21 17:06:07 +00001878- Classic classes are a thing of the past. All classes are new style.
1879
1880- Exceptions *must* derive from BaseException.
1881
1882- Integer division always returns a float. The -Q option is no more.
1883 All the following are gone:
1884 * PyNumber_Divide and PyNumber_InPlaceDivide
1885 * __div__, __rdiv__, and __idiv__
1886 * nb_divide, nb_inplace_divide
1887 * operator.div, operator.idiv, operator.__div__, operator.__idiv__
1888 (Only __truediv__ and __floordiv__ remain, not sure how to handle them
1889 if we want to re-use __div__ and friends. If we do, it will make
1890 it harder to write code for both 2.x and 3.x.)
1891
1892- 'as' and 'with' are keywords.
1893
1894- Absolute import is the default behavior for 'import foo' etc.
1895
Neal Norwitz378b2c92006-08-29 07:57:22 +00001896- Removed support for syntax:
Guido van Rossumd59da4b2007-05-22 18:11:13 +00001897 backticks (ie, `x`), <>
Neal Norwitz378b2c92006-08-29 07:57:22 +00001898
Neal Norwitz4886cc32006-08-21 17:06:07 +00001899- Removed these Python builtins:
Neal Norwitz01688022007-08-12 00:43:29 +00001900 apply(), callable(), coerce(), execfile(), file(), reduce(), reload()
Neal Norwitz4886cc32006-08-21 17:06:07 +00001901
Neal Norwitz378b2c92006-08-29 07:57:22 +00001902- Removed these Python methods:
1903 {}.has_key
1904
Guido van Rossumd59da4b2007-05-22 18:11:13 +00001905- Removed these opcodes:
1906 BINARY_DIVIDE, INPLACE_DIVIDE, UNARY_CONVERT
1907
1908- Remove C API support for restricted execution.
1909
Guido van Rossumcf1be882007-08-30 22:07:17 +00001910- zip(), map() and filter() now return iterators, behaving like their
1911 itertools counterparts. This also affect map()'s behavior on
1912 sequences of unequal length -- it now stops after the shortest one
1913 is exhausted.
Guido van Rossumd59da4b2007-05-22 18:11:13 +00001914
1915- Additions:
Guido van Rossumcf1be882007-08-30 22:07:17 +00001916 set literals, set comprehensions, ellipsis literal.
Guido van Rossumd59da4b2007-05-22 18:11:13 +00001917
1918- Added class decorators per PEP 3129.
1919
1920
1921Extension Modules
1922-----------------
1923
1924- Remove the imageop module. Obsolete long with its unit tests becoming
1925 useless from the removal of rgbimg and imgfile.
Neal Norwitz4886cc32006-08-21 17:06:07 +00001926
1927- Removed these attributes from Python modules:
Guido van Rossumd59da4b2007-05-22 18:11:13 +00001928 * operator module: div, idiv, __div__, __idiv__, isCallable, sequenceIncludes
Guido van Rossume7ba4952007-06-06 23:52:48 +00001929 * sys module: exc_clear(), exc_type, exc_value, exc_traceback
Guido van Rossumd59da4b2007-05-22 18:11:13 +00001930
1931
1932Library
1933-------
1934
1935- Remove the compiler package. Use of the _ast module and (an eventual)
1936 AST -> bytecode mechanism.
1937
1938- Removed these modules:
Guido van Rossum33d26892007-08-05 15:29:28 +00001939 * audiodev, Bastion, bsddb185, exceptions, linuxaudiodev,
1940 md5, MimeWriter, mimify, popen2,
1941 rexec, sets, sha, stringold, strop, sunaudiodev, timing, xmllib.
1942
1943- Moved these modules to Tools/Demos:
1944 * toaiff
Guido van Rossumd59da4b2007-05-22 18:11:13 +00001945
1946- Remove obsolete IRIX modules: al/AL, cd/CD, cddb, cdplayer, cl/CL, DEVICE,
1947 ERRNO, FILE, fl/FL, flp, fm, GET, gl/GL, GLWS, IN, imgfile, IOCTL, jpeg,
1948 panel, panelparser, readcd, sgi, sv/SV, torgb, WAIT.
1949
1950- Remove obsolete functions:
1951 * commands.getstatus(), os.popen*,
1952
Martin v. Löwis967f1e32007-08-14 09:23:10 +00001953- Remove functions in the string module that are also string methods;
1954 Remove string.{letters, lowercase, uppercase}.
Guido van Rossumd59da4b2007-05-22 18:11:13 +00001955
1956- Remove support for long obsolete platforms: plat-aix3, plat-irix5.
1957
1958- Remove xmlrpclib.SlowParser. It was based on xmllib.
1959
1960- Patch #1680961: atexit has been reimplemented in C.
1961
Walter Dörwald41980ca2007-08-16 21:55:45 +00001962- Add new codecs for UTF-32, UTF-32-LE and UTF-32-BE.
1963
Guido van Rossumd59da4b2007-05-22 18:11:13 +00001964
1965Build
1966-----
1967
1968C API
1969-----
1970
1971- Removed these Python slots:
1972 __coerce__, __div__, __idiv__, __rdiv__
Neal Norwitz4886cc32006-08-21 17:06:07 +00001973
Neal Norwitz4886cc32006-08-21 17:06:07 +00001974- Removed these C APIs:
Neal Norwitz8dfc4a92007-08-11 06:39:53 +00001975 PyNumber_Coerce(), PyNumber_CoerceEx(), PyMember_Get, PyMember_Set
Neal Norwitz4886cc32006-08-21 17:06:07 +00001976
1977- Removed these C slots/fields:
1978 nb_divide, nb_inplace_divide
1979
1980- Removed these macros:
Neal Norwitz30d1c512007-08-19 22:48:23 +00001981 staticforward, statichere, PyArg_GetInt, PyArg_NoArgs, _PyObject_Del
Neal Norwitz4886cc32006-08-21 17:06:07 +00001982
1983- Removed these typedefs:
1984 intargfunc, intintargfunc, intobjargproc, intintobjargproc,
Neal Norwitz8dfc4a92007-08-11 06:39:53 +00001985 getreadbufferproc, getwritebufferproc, getsegcountproc, getcharbufferproc,
1986 memberlist
Neal Norwitz4886cc32006-08-21 17:06:07 +00001987
Raymond Hettinger4901a1f2004-12-02 08:59:14 +00001988
Raymond Hettinger4901a1f2004-12-02 08:59:14 +00001989Tests
1990-----
1991
Brett Cannonced04e02005-02-13 22:53:22 +00001992Documentation
1993-------------
1994
Raymond Hettinger4901a1f2004-12-02 08:59:14 +00001995Mac
1996---
1997
Guido van Rossume7ba4952007-06-06 23:52:48 +00001998- The cfmfile was removed.
1999
2000
Guido van Rossum845702c2007-08-30 18:44:53 +00002001Platforms
2002---------
2003
2004- Support for BeOS and AtheOS was removed (according to PEP 11).
2005
2006- Support for RiscOS, Irix, Tru64 was removed (alledgedly).
2007
Hye-Shik Chang4e422812005-07-17 02:36:59 +00002008
Raymond Hettinger4901a1f2004-12-02 08:59:14 +00002009Tools/Demos
2010-----------
2011
Skip Montanaroe5d7f7f2002-09-20 14:16:59 +00002012**(For information about older versions, consult the HISTORY file.)**