How the Python data model makes objects and idiomatic language play well together
This excerpt from Luciano Ramalho's Oriole online tutorial illustrates special methods in the data model with a French card deck class example.
This is a free video excerpt from Fluent Python: The Power of Special Methods, an Oriole online tutorial presented by Luciano Ramalho. The full version includes all of the examples Luciano references in the excerpt, as well as step-by-step video, text, and runnable code.
Be sure to also check out Luciano’s book, Fluent Python.