~/talk

The Wizardry of Metaprogramming

Talkat PyCon AU 2017 · 2017-08-03..08-08· [python]
links:none on file
slides:none on file

Explains how Python’s type is the default metaclass so classes are constructed dynamically, shows that metaclasses can override __new__/__init__ (Django’s ModelBase sets field attributes via __new__), and demonstrates descriptors implementing __get__/__set__ descriptors to validate (SmallInt) or lazily load (deferred ORM fields) values. Uses Django and six as concrete examples, shows the mechanics work, and cautions that metaprogramming is powerful but rarely needed outside frameworks like ORMs.

AI-written summary · about

  1. 0:00Introduction
  2. 1:00Type
  3. 4:00Objects
  4. 14:05New Instances
  5. 16:05Method Resolution Order
  6. 19:15Descriptors
~/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.