Python is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days. Many Python programmers report substantial productivity gains and feel the language encourages the development of higher quality, more maintainable code.

- Issue #4935: The overflow checking code in the expandtabs() method common to str, bytes and bytearray could be optimized away by the compiler, letting the interpreter segfault instead of raising an error.

- Issue #4910: Builtin int() function and PyNumber_Long/PyNumber_Int API function no longer attempt to call the __long__ slot to convert an object to an integer. Only the __int__ and __trunc__ slots are examined.

- Issue #4604: Some objects of the I/O library could still be used after having been closed (for instance, a read() call could return some previously buffered data). Patch by Dmitry Vasiliev.

- Issue #4705: Fix the -u ("unbuffered binary stdout and stderr") command-line flag to work properly. Furthermore, when specifying -u, the text stdout and stderr streams have line-by-line buffering enabled (the default being to buffer arbitrary chunks of data).

- Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the file has been renamed, moved, or if it is accessed through different paths). Patch by Ziga Seilnacht and Jean-Paul Calderone.

- Issue #4580: Fix slicing of memoryviews when the item size is greater than one byte. Also fixes the meaning of len() so that it returns the number of items, rather than the size in bytes.

- Issue #4589: Fixed exception handling when the __exit__ function of a context manager returns a value that cannot be converted to a bool.

- Issue #4533: File read operation was dreadfully slow due to a slowly growing read buffer. Fixed by using the same growth rate algorithm as Python 2.x.

- Issue #4509: Various issues surrounding resize of bytearray objects to which there are buffer exports (e.g. memoryview instances).

- Issue #4569: Interpreter crash when mutating a memoryview with an item size larger than 1.

Library-------

- Issue #4998: The memory saving effect of __slots__ had been lost on Fractions which inherited from numbers.py which did not have __slots__ defined. The numbers hierarchy now has its own __slots__ declarations.

- Issue #3321: _multiprocessing.Connection() doesn't check handle; added checks for *nix machines for negative handles and large int handles. Without this check it is possible to segfault the interpreter.

- Issue #4449: AssertionError in mp_benchmarks.py, caused by an underlying issue in sharedctypes.py.

- Issue #5008: When a file is opened in append mode with the new IO library, do an explicit seek to the end of file (so that e.g. tell() returns the file size rather than 0). This is consistent with the behaviour of the traditional 2.x file object.

- Issue #5013: Fixed a bug in FileHandler which occurred when the delay parameter was set.

- Issue #3826 and #4791: The socket module now closes the underlying socket appropriately when it is being used via socket.makefile() objects rather than delaying the close by waiting for garbage collection to do it.

- Issue #4998: Decimal no longer subclasses from or is registered to numbers.Real. Instead, it is registered to numbers.Number so that isinstance(d, Number) will work.

- Issue #4867: Fixed a crash in ctypes when passing a string to a function without defining argtypes.

- Restore Python 2.3 compatibility for decimal.py.

- Issue #3638: Remove functions from _tkinter module level that depend on TkappObject to work with multiple threads.

- Issue #4718: Adapt the wsgiref package so that it actually works with Python 3.x, in accordance with the `official amendments of the spec`_.

- Issue #4197: doctests in modules loaded via zipimport (or any other PEP 302 conformant loader) will now work correctly in most cases (they are still subject to the constraints that exist for all code running from inside a module loaded via a PEP 302 loader and attempting to perform IO operations based on __file__). Original patch by Alexander Belopolsky.

- Issues #4082 and #4512: Add runpy support to zipimport in a manner that allows backporting to maintenance branches. Original patch by Alexander Belopolsky.

- Issue #4616: TarFile.utime(): Restore directory times on Windows.

- Issue #4021: tokenize.detect_encoding() now raises a SyntaxError when the codec cannot be found. This is for compatibility with the builtin behavior.

- Issue #4084: Fix max, min, max_mag and min_mag Decimal methods to give correct results in the case where one argument is a quiet NaN and the other is a finite number that requires rounding.