~/talk

A Deep-Dive Into Python Classes

Talkat EuroPython 2011 · 2011-06-20..06-26· [python]
linkedin:bedmondmark
slides:none on file

Deep dive into Python's object model covers __new__/__init__/__del__ lifecycle, garbage collection quirks with circular references and gc.collect, and concrete benchmarks showing slots save about 6x memory (million objects × 16 attrs) with only ~10% speed change. Explains descriptors and property implementation, how functions become bound methods via the descriptor protocol (method = descriptor binding), getattr/__getattribute__ lookup order, abstract base classes in collections, and practical patterns like storing instance state in parallel lists.

AI-written summary · about

  1. 0:00Start
  2. 3:13Objects in PERL
  3. 7:01What is a Class?
  4. 8:13Instance Lifecycle
  5. 15:50_slots__ Memory
  6. 16:20Obtaining Attributes
  7. 17:05A Diamond Inheritance
  8. 18:06Resolution Order
  9. 19:29Inheritance Magic
  10. 20:59Virtual Subclasses
  11. 22:17Subclass Yourself
  12. 23:05Method Calling
  13. 23:44Methods in Classes & Instances
  14. 25:17Calling Methods
  15. 26:51Instances Don't Contain Methods
  16. 27:38Executing Code on Attribute Access
  17. 30:29Instance Methods Provided by the Descriptor
  18. 31:10Functions are Descriptors
  19. 32:09@property Decorator
  20. 32:42@property2 Definition
  21. 33:39@property2 Test
  22. 34:10Descriptor Protocol
  23. 35:51Tack On a Class Method
  24. 39:34Test Instance Method II
  25. 40:24Questions?
~/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.