De ontwikkelaars van Python hebben enkele dagen geleden de eerste release candidate van versie 3.1 uitgebracht. Python is een objectgeoriënteerde programmeertaal die gebruikt kan worden om eenvoudige tot complexe platform-onafhankelijke applicaties te ontwikkelen. De 3.x-serie is niet meer backwards compatible met de voorgaande versietakken, omdat de Python-ontwikkelaars de taal hebben ontdaan van oude code en enkele aanwezige ontwerpfouten. Een overzicht van de verschillen tussen 3.1 en 3.0 is op deze pagina na te lezen. De bijbehorende lijst met veranderingen ziet er als volgt uit:
What's New in Python 3.1 release candidate 1?
Core and Builtins:
- Issue #6097: Escape UTF-8 surrogates resulting from mbstocs conversion of the command line.
- Issue #6012: Add cleanup support to O& argument parsing.
- Issue #6089: Fixed str.format with certain invalid field specifiers that would raise SystemError.
- Issue #5982: staticmethod and classmethod now expose the wrapped function with __func__.
- Added support for multiple context managers in the same with-statement. Deprecated contextlib.nested() which is no longer needed.
- Issue #5829: complex("1e500") no longer raises OverflowError. This makes it consistent with float("1e500") and interpretation of real and imaginary literals.
- Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.
- Issue #5994: the marshal module now has docstrings.
- Issue #5981: Fix three minor inf/nan issues in float.fromhex: (1) inf and nan strings with trailing whitespace were incorrectly rejected; (2) parsing of strings representing infinities and nans was locale aware; and (3) the interpretation of fromhex('-nan') didn't match that of float('-nan').
- Issue #4859: Implement PEP 383 for pwd, spwd, and grp.
- smtplib 'login' and 'cram-md5' login are also fixed (see Issue #5259).
- Issue #6121: pydoc now ignores leading and trailing spaces in the argument to the 'help' function.
- Issue #6118: urllib.parse.quote_plus ignored the encoding and errors arguments for strings with a space in them.
- collections.namedtuple() was not working with the following field names: cls, self, tuple, itemgetter, and property.
- In unittest, using a skipping decorator on a class is now equivalent to skipping every test on the class. The ClassTestSuite class has been removed.
- Issue #6050: Don't fail extracting a directory from a zipfile if the directory already exists.
- Issue #1309352: fcntl now converts its third arguments to a C `long` rather than an int, which makes some operations possible under 64-bit Linux (e.g. DN_MULTISHOT with F_NOTIFY).
- Issue #5761: Add the name of the underlying file to the repr() of various IO objects.
- Issue #5259: smtplib plain auth login no longer gives a traceback. Fix by Musashi Tamura, tests by Marcin Bachry.
- Issue #1983: Fix functions taking or returning a process identifier to use the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have a process identifier type wider than the standard C integer type.
- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. Patch by Farhan Ahmad, test by Marcin Bachry.
- Issue #2116: Weak references and weak dictionaries now support copy()ing and deepcopy()ing.
- Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr.
- Issue #5918: Fix a crash in the parser module.
- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr.
- Issue #5006: Better handling of unicode byte-order marks (BOM) in the io library. This means, for example, that opening an UTF-16 text file in append mode doesn't add a BOM at the end of the file if the file isn't empty.
- Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source' file is a binary. Patch by Brodie Rao, tests by Daniel Diniz. This fix corrects a pydoc regression.
- Issue 5955: aifc's close method did not close the file it wrapped, now it does. This also means getfp method now returns the real fp.
- Issue #6047: fullinstall has been removed because Python 3's executable will now be known as python3.
- Lib/smtpd.py is no longer installed as a script.
- Issue #3061: Use wcsftime for time.strftime where available.
- Issue #4873: Fix resource leaks in error cases of pwd and grp.
- Issue #6093: Fix off-by-one error in locale.strxfrm.
- The _functools and _locale modules are now built into the libpython shared library instead of as extension modules.
- Issue #3585: Add pkg-config support. It creates a python-2.7.pc file and a python3.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by Clinton Roy.
- Issue 5442: Tests for importlib were not properly skipping case-sensitivity tests on darwin even when the OS was installed on a case-sensitive filesystem. Also fixed tests that should not be run when sys.dont_write_bytecode is true.