~/talk

Learning Parseltongue: Wizardry in Python

Talkat PyCon Australia 2013 · 2013-07-05..07-07· [python]
links:none on file
slides:none on file

Covers concrete Python magic methods and metaprogramming with working examples: a file wrapper that closes on __del__, word objects compared by length using functools.total_ordering, context managers that open and close connections via __enter__/__exit__, descriptors implementing get and set, custom pickling with __getstate__/__setstate__ to store history, and metaclasses created with type(name, bases, dict) plus __prepare__ using OrderedDict, including registry, final class and singleton patterns and a note that these work but can confuse readers.

AI-written summary · about

  1. 0:00Intro
  2. 1:04MAGIC METHODS?!
  3. 1:27CONSTRUCTION AND INITIALIZATION
  4. 2:53COMPARISON MAGIC METHODS
  5. 4:38NORMAL ARITHMETIC OPERATORS
  6. 4:54REFLECTED ARITHMETIC OPERATORS
  7. 5:26AUGMENTED ASSIGNMENT .
  8. 5:40TYPE CONVERSION MAGIC METHODS
  9. 6:03REPRESENTING CUSTOM CLASSES
  10. 6:37ATTRIBUTE ACCESS
  11. 8:25CONTAINER MAGIC METHODS
  12. 9:26CONTEXT MANAGERS
  13. 10:42COPYING OBJECTS
  14. 11:24PICKLING
  15. 12:18ABSTRACT BASE CLASSES
  16. 14:28CUSTOM METACLASSES
  17. 15:15REGISTERING SUBCLASSES
  18. 18:21QUESTIONS?
~/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.