~/talk

Everything you need to know but were afraid to ask about Data Classes

Talkat DjangoCon US 2019 · 2019-09-22..09-27· [python]
slides:none on file

Dataclasses provide a mutable, named‑tuple–like class that auto-generated __init__/__repr__/__eq__ saves lots of boilerplate, can be frozen for immutability, and supports optional type annotations (not enforced at runtime). They derive design and tradeoffs from attrs, offer a backport to 3.6, and a Damla Altun tool reveals the actual generated code. Watch for inheritance overwriting base fields, optional __slots__ for memory savings, and a real example: Pursued PyBear uses dataclasses for its event system and it works in practice.

AI-written summary · about

  1. 0:00Intro
  2. 2:13Unwrapping the story
  3. 4:44Context
  4. 5:10Dot Notation
  5. 6:05Outers Project
  6. 7:29Dunder
  7. 9:46Wallet
  8. 13:56Data Classes
  9. 19:16Inheritance
  10. 21:31State Objects
  11. 24:24Type annotations
~/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.