~/talk

Object Oriented Python Using functools.partial

Talkat PyOhio 2020 · 2020-07-25..07-26· [python]
slides:none on file

Builds a minimal chess engine without classes by using functools.partial to simulate inheritance and types.SimpleNamespace to get dot-attribute access over underlying dicts. Returns piece and board objects as namespaces, initializes full starting positions, and renders an emoji board string. Movement logic never gets implemented, so no legal-move checking or checkmate detection is shown, and the author warns the pattern is messy and not recommended for production despite demonstrating that functions can act like objects.

AI-written summary · about

  1. 0:00Start
  2. 0:23Notation
  3. 2:45Review of Object-Oriented Programming
  4. 4:30Functools Partial
  5. 6:47Set Up Our Game Board to an Initial State
  6. 8:39Recap
  7. 9:38Additional 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.