All apps
Operators are methods
About this app
Which method does a * b call? A flow diagram shows the two stations a.__mul__(b) and b.__rmul__(a) with the exits result, NotImplemented and error. With numbers, strings, lists, fractions in four stages (isinstance, __rmul__, __eq__) and runs with and without __lt__: why 3 * Bruch(1, 2) first fails at the int and then ends up in __rmul__.
Subject: Computer science
More from Computer science
- Ackermann function
- Elevator simulator
- Binary workshop
- Binary versus linear search
- The Collatz problem
- Inside a CPU
- Swap the inside
- Function rooms in 3D
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps