Project: | Elk |
Descriptors are a powerful feature of Python that can be used to
augment or replace traditional attribute access with arbitrary
behaviours. Such versatility makes the descriptor protocol a
valuable tool for any Python programmer, yet although most of us
have used descriptors, fewer have implemented one.
This presentation will explain the what, why and how of descriptors,
and mistakes to avoid. We will begin with an overview of the
descriptor protocol and some descriptors with which audience members
are likely already familiar.
An in-depth, interactive look at the implementation of some simple
descriptors will follow. Finally, the presentation will conclude
with a look at Elk_ - a declarative object system authored by the
presenter and inspired by Perl's Moose_ - and the descriptors that
power it.
.. _Elk: https://frasertweedale.github.io/elk/
.. _Moose: https://metacpan.org/module/Moose
Fraser is a former Perl Monger who missed Moose so much he ported it
to Python. Apart from an all-too-brief stint working on a financial
application in Python, he has mainly done Web Things in a variety of
other languages. Although he is increasingly a believer in strong
type systems (of the Haskell kind), Fraser considers Python the most
interesting and enjoyable dynamically typed language.
Since April, Fraser works at Red Hat on the FreeIPA project, a
security information management suite.