.. title: Discovering Descriptors
.. slug: discovering-descriptors
.. date: 2017-06-09 20:21:27 UTC+02:00
.. tags: talks, python, descriptors
.. category:
.. link:
.. description:
.. type: text
This talk was presented at `PyCon CZ 2017 `_ and
`EuroPython 2017`_. Here are the references and resources for the presentation.
The code used for the talk, is available `here
`_ and
contains some explanations along with the examples.
.. TEASER_END
Slides
^^^^^^
.. raw:: html
Video
^^^^^
This is the recording of the talk presented at `EuroPython 2017`_.
.. youtube:: TAuC086NNmo
References
^^^^^^^^^^
To learn more about descriptors, you could check some of the following
references, used as base for the talk:
* `Fluent Python - by Luciano Ramalho
`_: This book has a great
cover of all topics of Python, and descriptors is no exception. Starting the
section V of meta-programming, the chapter 20 contains a profound
explanation of the internals of descriptors and how they work.
* `Python cookbook (3rd edition) - David Beazley & Brian Jones
`_: Contains great examples
of Python code, that help explaining advanced topics, such as descriptors,
decorators, and more.
* `Python descriptors HowTo
`_: The nicest thing about
this guide is not only that helps a lot on the understanding of descriptors,
but also that here you can find equivalent implementations of many built-in
descriptors in Python, for example those for ``@property``, ``@classmethod``,
etc. This helps a lot on the understanding of the internals of Python, and
illustrates a part of the code that is implemented in ``C`` in ``CPython``.
* `Python data model
`_: has a
section explaining the methods of the *descriptor protocol*, and how they're
invoked.
* `PEP-487 `_ introduces
``__set_name__``.
.. _EuroPython 2017: https://ep2017.europython.eu/conference/talks/discovering-descriptors