~/talk

JavaScript classes for the Python Programmer

Talkat PyCon AU 2023 · 2023-08-18..08-22· [javascript, python]
slides:none on file

Compares JavaScript and Python class semantics with concrete examples: this vs self and prototype lookup instead of type lookup, constructor vs initializer where JS constructors run in layered order and public fields are set before body runs, causing the subclass factor example to produce 2 instead of 5. Shows fixes: use Function.prototype.bind or call, reference this.constructor.staticName, and use static initializers (ES2015 classes) to build working enums and predictable subclassing.

AI-written summary · about

  1. 0:00Introduction
  2. 1:05Explicit classes
  3. 2:54Properties attributes
  4. 4:36Constructor
  5. 6:38Static methods
  6. 7:34Subclasses
  7. 8:49Initializers
  8. 10:04New
  9. 10:31Class Syntax
  10. 11:02subclassing
  11. 11:49static properties
  12. 12:13subclass overrides
  13. 12:41factor
  14. 14:31Static Constructor
  15. 15:20Static Initializers
  16. 17:27Static Initializers Example
  17. 18: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.