pycon logo

PyCon 2011 Atlanta

March 9th–17th

Log in or Sign Up

Mastering Python 3 I/O

log in to bookmark this presentaton

Experienced / Tutorial
March 10th 9 a.m. – 12:20 p.m.
As most Python programmers know, Python 3 breaks backwards compatibility with Python 2. One of the most significant changes concerns the new I/O system. In this tutorial, we're going to take a top-to-bottom tour of the entire Python 3 I/O system and provide practical advice for programmers porting code from Python 2 to Python 3.

Abstract

As most Python programmers know, Python 3 breaks backwards compatibility with Python 2 in a number of significant ways. Although guides to Python 3 tend to focus on superficial incompatibilities such as the new print function, changes to exception handling, or new language features, the most substantial changes concern the strict separation of Unicode and bytes as well as the new I/O stack. Not only do these changes have far-reaching effects throughout the standard library, but changes to I/O are likely to be the most major source of problems for anyone porting an existing Python application to Python 3. In this tutorial, we're going to take a top-to-bottom tour of the entire Python 3 I/O system. We'll focus on how to properly handle both text and binary data, changes to standard library modules, examine advanced features such as the buffer API, perform some performance experiments, and end with practical advice for programmers working on porting applications from Python 2 to 3.

The following major topics will be covered:

- Introducing Python 3 (with a focus on I/O) - Text Processing - Binary Data Handling - Dealing with System Interfaces and External Programs - The New io library - Network programming - Porting from Python 2 to 3.