~/talk

Subclassing, Composition, Python, and You

Talkat PyCon US 2023 · 2023-04-19..04-27· [python]
slides:none on file

Covers the trade-offs between subclassing and composition in Python, distinguishing different kinds of subclassing and when each is appropriate. Uses concrete, Python-centric patterns and examples to show how to choose between inheritance and composition so code becomes clearer and more idiomatic.

AI-written summary · about

  1. 0:00Start
  2. 1:41Subclassing
  3. 2:19@dataclass class Base
  4. 4:32Composition
  5. 16:29Nominal Subtyping
  6. 18:38Structural Subtyping
  7. 26:55class Question (django.db.models.Model)
  8. 36:40Exceptions
  9. 38:21E-Mail Addresses
  10. 39:56Create One Class, Make Fields Optional
~/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.