~/talk

API design: Lessons Learned

Talkat EuroPython 2011 · 2011-06-20..06-26· [api-design, python]
slides:none on file

Practical, code-level takeaways: when building APIs use double-underscore to protect internals so subclasses can’t break invariants, expose extension points instead of hardwiring behavior (provide hooks not hardwired behavior), prefer multiple constructors via classmethods for different call patterns, avoid over-eager coercion of input types (floats-as-indices), use decorators like recursive_repr to handle edge cases, design an async protocol rather than a concrete implementation, and avoid global state like setlocale.

AI-written summary · about

  1. 0:00Introduction
  2. 2:55API design principles
  3. 13:37Balancing forces
  4. 19:24Subclassing and extensibility
  5. 27:30Open-closed principle
  6. 33:22Double underscore methods
  7. 40:26Ask forgiveness not permission
  8. 44:48Hiding internals
  9. 50:51Decorators and recursion
  10. 57:16Recognizable behavior
  11. 1:00:05Context-dependent design
  12. 1:01:29Multiple constructors
  13. 1:07:23Design failures
  14. 1:13:07Async core protocol
  15. 1:14:51Global state pitfalls
  16. 1:17:00Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.