LMS Seminars

Why API and types matter

by Julian Geiger (PSI)

Europe/Zurich
OVGA/200

OVGA/200

Description

A library's API is the surface area every user touches, yet API design is rarely taught explicitly. In this seminar, we explore what makes a (Python) API good: flat imports, good defaults, custom exceptions, and progressive disclosure. We then show how Python's type system, TypedDict, Protocol, Generics, @overload, and more, turn function signatures into machine-checkable contracts that catch bugs, reveal design smells, and guide API evolution, as well-typed code is well-designed code. Throughout, we will look at examples (good and bad) from the aiida-core codebase.

Organised by

Laboratory for Materials Simulations (LMS)

Dr Matthias Krack