~/talk

Under and Dunder - Python secret functions

Talkat PyCon India 2020 · 2020-10-02..10-05· [python]
slides:none on file

Covers Python’s single-underscore convention and double-underscore name mangling, shows how dir() exposes attributes, and demonstrates concrete dunder methods: implementing __getitem__, __len__, __iter__ and __next__ to make a custom Sequence class that returns squares for indexing, reports length as 999, and yields the value seven repeatedly until a counter triggers StopIteration. Live notebook examples show how secret methods get renamed, when they can be called internally, and how iterator protocols actually drive for-loops.

AI-written summary · about

  1. 0:00Intro
  2. 0:18Welcome
  3. 0:38About me
  4. 2:40Python internal functions
  5. 11:40Object attributes
  6. 14:10List
  7. 16:40Length
  8. 18:30Iterator
  9. 24:30Conclusion
~/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.