Help us!

Take some time to transcribe PyCon 2014 talks! Click on the "Share" button below the video and then "Subtitle" to get started.

Fun with Python's Newer Tools

Summary

Spend ten minutes each learning to work with Counters, named tuples, new string formatting, and the LRU cache. Learn the basic API, see how it works under the hood, enjoy a simple example, and then have fun pushing it to the limit in interesting ways.

Description

Look at how a Counter is implemented. See a simple word count example. Use a counter for unittests. Implement a sparse matrix.

Show how named tuples are created, combined, subclassed, and extended. See how to implement an Enum class and how to create default values.

Learn the basics of the new string formatting syntax. See how to use it for templating.

Show everyday uses for an LRU cache, look at the underlying implementation, and see how to use it to trivially solve a dynamic programming problem.