This class assumes that you already know the basics of writing
simple Python programs and that you are generally familiar with
Python's core features (functions, classes, modules, common
library modules, etc.).
Next Course Date:
[ Register |
More Information | FAQ]
- A printed copy of the course notes.
- A copy of the "Python Essential Reference, 4th Ed."
- Lunch at local restaurants
Advanced Python Mastery
[4.5 days] So you learned Python from an online tutorial, a
training course, or from a book, but you want to learn more. Then
this is the course for you. Designed for working programmers who
want to take their understanding to a whole new level, you'll
learn what really makes Python tick. The course starts out by
looking at subtle aspects of the Python code you are already writing, but then
dives into a wide variety of advanced topics
including the object model, data encapsulation, descriptors,
generators, coroutines, context managers, decorators, metaclasses,
packages, closures, and more. By the end of the course, you'll not
only know what these features are, but how they can be applied to
a wide range of practical programming problems.
Includes a 325 page guidebook and more than 50
hands on exercises.
Note: A suggested prerequisite is my
Practical Python Programming course.
Detailed Course Outline
- Python Review.
An accelerated review of the Python language focused on features
that you should already know. Covers the basic language statements, program
structure, common datatypes, functions, exceptions, modules, and classes.
- Idiomatic Data Handling. An in-depth look at data handling
and data structures. A major focus of this section is on Python's
built-in container types (tuples, lists, sets, dicts, etc.) with an
eye towards studying their performance properties and resource
use. Also covers important programming data-processing idioms such as
the use of list comprehensions and generator expressions.
- Classes and Objects.
A review of the class statement and how to define new objects in Python.
A major focus is on how to properly encapsulate data,
and when to use features such as static methods, class methods, and properties.
Concludes with a review of some common object-oriented programming techniques
and advanced topics including mixin classes and weak references.
- Inside Python Objects. A look at how the
Python object system is put together under the covers. Major topics
include instance and class representation, attribute binding, inheritance,
attribute access methods, and the descriptor protocol.
- Testing, Logging, and Debugging.
Learn how to test and debug your code. Covers the doctest, unittest, and logging modules. Information on assertions, optimized run mode, the debugger,
and profiler is also presented.
- Packaging and Distributing Python Programs.
This section covers the basics of how to organize programs so that they
can be more easily be given to others. Covers packages and basic
use of the distutils module.
- Working with Functions.
A detailed look at more advanced aspects of Python functions.
Topics include variable argument functions, anonymous functions (lambda),
scoping rules, nested functions, function introspection, closures, delayed-evaluation, and partial function application.
Finally understand the secret techniques used by the Python
framework builders. This section covers features that allow
you to manipulate code. Topics include decorators, class decorators,
context managers, and metaclasses.
- Iterators, Generators, and Coroutines.
Covers the iteration protocol, generator functions, and coroutines. A
major focus of this section is on applying generators and coroutines to
problems in data processing. You will learn how to apply these features
to large data files and data streams.
- Extending Python with C and C++.
An overview of basic techniques for building C extension modules
to Python. Covers the process of writing a hand-written
extension module, using the ctypes library, and wrapping C libraries
Students will receive a bound fully indexed set of lecture notes along with a complete set class exercises (distributed
electronically). All class exercises come with solution code for later study and for use during the class.