Over a million developers have joined DZone.

Python 3.3 Offers Improved Performance, Bug Fixes, and New Features Galore

· Web Dev Zone

Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud, brought to you in partnership with IBM.

Python 3.3 alpha 1 is here, and as you would expect, this latest update offers bug fixes and new features galore.  Previously a source of great frustration for many developers, Python users will be happy to hear that Python 3.3 offers a new memoryview implementation, featuring a PEP-3118 compliant getbufferproc():


The new memoryview implementation comprehensively fixes all ownership and lifetime issues of dynamically allocated fields in the Py_buffer struct that led to multiple crash reports.  Additionally, several functions that crashed or returned incorrect results for non-contiguous or multi-dimensional input have been fixed.

-- Python.org


There are also some major performance improvements, thanks to PEP 393, which changed the Unicode string type to support multiple internal representations, allowing for space-efficient representation in most cases, while still providing access to full UCS-4 on all systems.


Other changes thanks to PEP 393 include:

  • Provides full support of all Unicode code points, including non-BMP ones.
  • Eliminates narrow builds, even in Windows, and thereby eliminates narrow build-specific problems.

The following features are also new to Python 3.3:

  • All native single character format specifiers in struct module syntax (optionally prefixed with '@') are now supported.
  • Multi-dimensional list representations are supported for any array type.
  • All array types are hash able if the exporting object is hash able and the view is read-only.
  • API Changes
    • The maximum number of dimensions is officially limited to 64.
    • The representation of empty shape, strides, and sub offsets is now an empty tuple instead of None.
-- Python.org


Other interesting improvements:

PEP 3151: Reworking the OS and IO Exception Hierarchy - exception types have been condensed down to one: OSError, while other exceptions have been kept as aliases for compatibility reasons.

PEP 409: Suppressing Exception Context - disables the display of the chained exception context, providing better error messages.


There is also a long list of New and Improved Modules for Python 3.3 you can browse through here.

Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud, brought to you in partnership with IBM.

Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}