~/talk

Dynamic Pattern Matching with Python

Talkat DLS 2020 · 2020-11-17..11-20· [python]
links:none on file
links:none on file
links:none on file
links:none on file
slides:none on file

Claims a concrete design and prototype to add structural pattern matching to Python via a match statement with multiple case clauses, treating patterns as constructors and introducing a projection Pi to map rich objects to pattern slots. It defines a passive mapping (a tuple of attribute names) and an active mapping (a static match method that returns a tuple or failure, optionally parameterized with square brackets). Examples include an AST simplifier that collapses --x and drops *1 multiplications. A PEP encodes the core elements and a prototype targets Python 3.10.

AI-written summary · about

  1. 0:00Intro
  2. 1:25Example: abstract syntax tree
  3. 2:04Example: filter and extract data
  4. 2:44Example: select a pattern and extract data
  5. 3:15Example: syntax of pattern matching
  6. 6:19Objects vs tagged tuples
  7. 7:04Patterns matching objects to patterns
  8. 8:39Explicit mapping
  9. 9:41Passive mapping
  10. 10:12Active mapping
  11. 12:06The objective of pattern matching
  12. 13:01Parametrise the mapping
  13. 14:13Parametrised patterns
  14. 14:33Summary
~/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.