| Python Mastery |
Click to Hide |
| 1. Python Review |
A brief review of Python basics including syntax, core datatypes, file I/O, functions, error handling, and classes. |
| 2. Idiomatic Data Handling |
An introduction to various tools and techniques for effective data processing. Discusses different options for creating data structures and gives an inside look at how the built-in datatypes are put
together along with their performance and memory usage properties.
Students will also learn how to apply list, set, and dictionary comprehensions to various problems in data handling.
|
| 3. Classes and Objects |
An introduction to creating and using user-defined objects in Python.
Describes how to use the class statement to create new objects and presents details on various special methods that can be defined to customize object behavior. Commonly used object oriented programming techniques are also presented. |
| 4. Inside the Python Object Model |
A detailed tour of how the Python object system is implemented.
Topics include the definition of objects, object representation, attribute binding, inheritance, descriptors, properties, slots, private attributes, static methods, and class methods. Also covers
important details concerning Python memory management and garbage collection. |
| 5. Testing, debugging, and logging |
Coverage of how to test and debug Python programs with a focus on three major topics. First, testing Python programs with the doctest and unittest modules is described. Next, the Python
debugger and profiler are presented. Finally, the logging package is described. |
| 6. Packages and Distribution |
How to organize Python code into packages and how to distribute packages to users and programmers. Covers the underlying mechanics
of how packages are put together and the distutils module for creating distributions. Also covers more advanced packaging options such as Distribute and setuptools.
|
| 7. Iterators, Generators, Coroutines |
The section starts with a description of the iteration protocol and moves on to practical use of generators and coroutines. A major focus on this section is on the use of generators and coroutines to set up processing pipelines, much like pipes in Unix programming.
You will see how generators and coroutines can lead to very elegant programming abstractions for processing data and how such programs can be used to process huge datafiles and streaming I/O. |
| 8. Functional Programming |
Advanced details of how to program with functions in Python.
Discusses more advanced features of functions including variadic parameters, nested functions, closures, lazy evaluation, anonymous
functions (lambda), and function attributes. |
| 9. Metaprogramming |
Loosely defined, metaprogramming refers to programs that are able to manipulate their own program structure (functions, classes, etc.) or
the structure of other programs as data. This section introduces and covers practical examples of Python's metaprogramming features including function decorators, class decorators, metaclasses, and context managers. A major emphasis of this section is to understand how advanced programming frameworks utilize these features to provide a more rich programming environment for their end users. |
| 10. Extension Programming |
How to create C and C++ extensions to Python. Covers the absolute basics of the Python C API followed by some details on using the ctypes library and Swig code generator. A major focus of this section is on how to organize extension code so that it can more seamlessly integrate with the Python environment. Topics include memory
management, data handling, encapsulation, and common pitfalls. |
| 11. Concurrent Programming with Threads |
An introduction to programming with Python threads. Starts with the basics of using the threading library and dives into a variety of more
advanced topics including a survey of how and when to use the different thread synchronization primitives, queues, deadlock avoidance, and thread debugging. Also includes detailed information
on how the Python interpreter executes programs and properties of the global interpreter lock (GIL). |
| 12. Multiprocessing |
An introduction to the multiprocessing library that allows programs to distribute their work across independent processes or machines. Covers
processes, queues, pipes, connections, and process pools. |
| 13. Distributed Computing |
Details on how to use Python's built-in libraries to create distributed applications. Covers the XML-RPC module and advanced features of the
multiprocessing library. In addition, details on object serialization and data encoding/decoding is presented. |
| 14. Advanced I/O Handling |
An in-depth examination of the Python I/O system including text handling, binary data handling, and different I/O models such as blocking, non-blocking, and event-driven I/O. Includes details
on the struct, select, and ctypes libraries. |
| 15. Event-Driven Concurrency |
Many of Python's advanced third-party frameworks implement a form of concurrency based on event-driven I/O handling. Perhaps the most notable example is the Twisted framework, but there are countless other packages that implement similar schemes using combinations of asynchronous event handlers, coroutines, generators, tasklets, and
other such concepts. In this section, we'll look at the event-driven programming style and how it compares to more traditional concurrency
models involving threads and processes. This section will also dive into the details of using coroutines to implement a form of cooperative multitasking. |
| 16. Python 3 |
A look at new features added to Python 3 and migration strategies.
Topics include new data processing features such a set and dictionary comprehensions, function annotations, and metaclasses. In addition, details of the 2to3 conversion tool are presented. |
| 17. Alternative Python Implementations |
This section gives a tour of alternative implementations of the Python interpreter and discusses future directions of the language. Covers
Jython, IronPython, PyPy, Unladen Swallow, and other projects. |