Support unavailable
Please try again later

Practical uses for function annotations

by Manuel Ceron for

Function annotations (PEP 3107) are a powerful and interesting feature of Python that no one is using. This talk presents three practical use cases that can make developer’s life better.

  • Type annotations for better tooling support and early error detection. Code analyzers, linters and IDEs can use type annotations to make smarter suggestions and show errors just after typing.

  • Logic predicate annotations and design by contract. Adding preconditions and postconditions to your functions in an expressive way.

  • Documentation consistency and auto-documentation. By enforcing annotations, it’s possible to check the consistency of docstrings or even create them automatically.

Here is a small library I wrote implementing some of the concepts I will discuss in the talk: typeannotations

in on Wednesday 3 July at 15:30 See schedule


  1. Gravatar
    You may want to include a pointer to the PEP, since I think most readers won't know what you are talking about, and Java programmers may assume you're talking about decorators. Hope you get in, looking forward to the talk!
  2. Gravatar
    Thanks Fredrik, I just added a link to PEP 3107.

New comment

60 minutes (inc Q&A)

Tagged as

programminglanguage type-cheking
Our Sponsors
Python Experts
SSL Matrix
Wanna sponsor?