Brussels / 2 & 3 February 2013

schedule

Astonishing python tricks


Most of us are writing python during our days or nights and we're still discovering new and impressive ways of using the language quite often. This talk is a attempt to gather together interesting patterns I've seen in the code I'm reading or writing since I'm doing python, that are not well-known in the community.

Most of us are writing python during our days or nights and we're still discovering new and impressive ways of using the language quite often. This talk is a attempt to gather together interesting patterns I've seen in the code I'm reading or writing since I'm doing python, that are not well-known in the community.

Did you knew that descriptors are the mechanism that python uses internally to define its methods and classes, combined with metaclasses?

Since I learned python a bunch of years ago, each time I come across a python hacker I try to spend some time with them asking the same question: "what was the last thing you found impressive with python". (Note how I'm pretty sure people found some incredible value in python itself).

This talk gather all of these together. You'll see a lot of python code in this presentation, and me trying to explain to you what this is doing, and why it's impressive.

If you also have some interesting thoughts or python tips to share, bring them with you, they're welcome!

I plan to propose tips related to the following stdlib parts: working with iterables using itertools using the AST to rewrite some statements (like this is done for assert by some testing frameworks) A bunch of comprehensive examples to explain what python is doing behind the scenes with descriptors How to use function annotations to typecheck arguments How is it possible to do pattern matching with python How metaclasses can be used to provide a simple plugin mechanism How django / sqla / others use metaclasses to ease the declaration of models etc.

This is not a complete list of what I intend to propose, the talk is still being written :)

(This talk could also had been named "an advanced tour of the python standard library")

Speakers

Alexis MĂ©taireau