~/talk

Descriptors: attribute access redefined

Talkat PyCon Australia 2014 · 2014-08-01..08-05· [python]
slides:none on file

Descriptors replace or augment default attribute access and are shown implemented as reusable objects: a type-constraint descriptor that type-checks on set and stores per-instance data in a weakref.WeakKeyDictionary (or alternatively in an instance __elk_attrs keyed by id), non-data versus data behavior, and that one descriptor instance is shared by all class instances. A working Elk object system (inspired by Moose) uses descriptors plus metaclasses to supply lazy init required attrs validation and generated constructors; performance is unexplored.

AI-written summary · about

  1. 0:00Start
  2. 0:52Motivation
  3. 2:30Descriptors in standard library
  4. 3:31Descriptor protocol
  5. 4:38Example: type constraints
  6. 9:56Example: classmethod
  7. 12:16Implementation: when keys collide
  8. 13:41Implementation: storing values
  9. 15:09Descriptors and metaclasses
  10. 18:14Elk - example
  11. 20:12Elk - ElkAttribute
  12. 25:16Summary
  13. 25:59Resources
~/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.