Multiple and Predicative Dispatch
summary
A Python library called Nosis dispatch implements multiple and predicative dispatch, letting the same function name have many implementations chosen by argument types and boolean predicates (e.g., place.ISO3 == 'PH'). Example namespace reports 16 functions bound to 1,348 implementations; demographic queries route to a Philippine API, a Malaysian DB, or a specified source object depending on signature. Numeric examples choose different primality algorithms by integer range. Code and working examples live on the project GitHub.
AI-written summary · about
chapters (8)
- 0:00Multiple and predicative dispatch
- 2:34Use multiple dispatch
- 8:55Nations namespace object
- 14:38Multiple dispatch beyond Python
- 17:28Data types as predicates
- 20:58Custom data types with predicates
- 23:27Practical is_prime example
- 26:37Summary and resources
related talks
07mUnderstanding API dispatch in Scientific Python eco-systems
43mThe Zen of Polymorphism: Choosing between isinstance(), methods, and @singledispatch
29mUnderstanding API Dispatching in NetworkX
29mMore Powerful Multimethods
48mAncestry of Polymorphism in Clojure
32mNim for Pythonistas
29mInterpretable Anomaly Detection for Numerical Data in Python Using PyNomaly
27m100x Faster NetworkX: Dispatching to GraphBLAS
