Support unavailable
Please try again later

Advanced Python

by Mike Müller for

Special Training

This two-day training differs from the other trainings in several ways was:

  1. it’s longer: two days.
  2. it’s offered on Saturday (9am-6pm) and Sunday (8am-3pm), after the talk days and in parallel to the sprints, and
  3. it’s charged for separately, and requires a separate registration fee of €242 (VAT included) for individuals, and €400+VAT for companies: buy now!

Target Audience

This course targets medium level Python programmers who would like to dive deeper into the language. Alternatively, participants can attend the course Python for Programmers to be able to take full advantage of this advanced course.

Motivation

The Python programming language is relatively easy to learn and allows to solve real-world problem with a just a few concepts.

But it also offers several advanced features that can help to greatly improve the programming experience. The latest releases of Python 2.x and 3.x add interesting features that can be used passively without deeper understanding about how they work. The course teaches how these features work and provides details about meta-programming and other advanced techniques.

Comprehensions

The principle comes from the functional language Haskell but integrates very well into Python. After list comprehension came generator expressions followed by dictionary and set comprehensions.

The course introduces this style of programming with examples focusing on advantages and disadvantages for certain tasks. Iterators and Generators

Iterators and generator make lazy evaluation, that is generating an object just when it is needed, very convenient. The concept of yielding instead of returning plays a central role. The course shows how to use generators to simplify programming tasks. Furthermore, coroutines will be used to implement concurrent solutions. An overview over the itertools module shows how to elegantly solve iteration tasks.

Decorators

Decorator provide a very useful method to add functionality to existing functions and classes. The course uses examples for caching, proxying, and checking of arguments to demonstrate how decorators can improve code readability and can simplify solutions.

Context Managers

The with statement helps to make code more robust by simplifying exception handling. The course shows how to use the with statement with the standard library and how to write your own objects that take advantage of with. The contextlib from the standard library helps to make this easier.

Descriptors

Descriptors determine how attribute of object are accessed. The course uses examples to show how descriptors work and how they can be used to customize attribute access.

Metaclasses

Metaclasses offer a powerful way to change how classes in Python behave. While being an advanced feature that should be used sparingly, it can provide interesting help for complex problems. The course shows how to apply metaclasses and gives examples where they can be useful.

Patterns

Python comes with batteries included. The language is very expressive an therefore many problems that are solved with help of certain patterns do not exist in the first place. Nevertheless, a few patterns offer pythonic solutions and are presented in this course.

"It’s easier to ask for forgiveness than permission (EFAP)" One pythonic principle is “It’s easier to ask for forgiveness than permission (EFAP)”. Opposed to the approach to look before you leap, this principle states that you should first try an action and if it fails react appropriately.

Singelton Singeltons are objects of which only one instance is supposed to exist. Python provides several ways to implement singeltons.

Null Objects Null objects can be used instead of the type None to avoid tests for None. Implementation, usage as well as advantages and disadvantages are covered.

Proxy Proxies stand for other objects. Setup and usage of proxies are covered.

Observer The observer pattern allows several objects to have access to the same data. The principles of this pattern are shown with a comprehensive example.

Constructor Parameters of constructors are often assigned to instance variables. This pattern can replace a many lines of manual assignment with only one line of code.

Exercises

The participants can follow all steps directly on their computers. There are exercises at the end of each unit providing ample opportunity to apply the freshly learned knowledge.

Course Material

Every participant receives comprehensive printed materials that cover the whole course content as wells as all source codes and used software.

Questions

Please ask Mike Müller (mmueller [at] python-academy [dot] de) about the course content.

in on Saturday 6 July at 09:00 See schedule

Do you have some questions on this talk? Leave a comment to the speaker!

New comment

Language
EN
Duration
Full day (8h)
Our Sponsors
Spotify
Python Experts
SSL Matrix
Wanna sponsor?