~/talk

Life Under the A Guide to Python's Internal Conventions

Talkat PythonAsia 2026 · on Sunday, 2026-03-22· at 14:00· Pardo Hall (Secondary Hall)· [python]
links:none on file
slides:none on file

Demonstrates concrete behaviors: using single underscore as the REPL’s previous-result _, numeric separators for readable big integers, and underscore as a throwaway loop variable; overriding __add__ makes a numeric class concatenate strings instead of adding; double-underscore name mangling requires prepending the class name to access “private” attributes; __slots__ replaces per-instance __dict__ to reduce memory and speed attribute access but raises AttributeError when adding new attributes; implements __missing__ for safe dict-like lookup and contrasts data vs non-data descriptors where data descriptors force a getter/setter round trip.

AI-written summary · about

  1. 0:00Python’s internal conventions
  2. 1:50Underscore in interactive shell
  3. 4:15Throwaway variables in data science
  4. 9:12Single and double underscore
  5. 13:09Dunder methods overview
  6. 15:40Dunder __name__ and __main__
  7. 17:49Common dunder methods
  8. 19:40Context managers
  9. 21:30__slots__ for performance
  10. 23:28Safe dictionary access
  11. 25:13Making classes callable
  12. 26:59Data vs non-data descriptors
  13. 30:15Summary and resources
~/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.