Go First-class functions ✔ ∗ ✔ ✔ ✔ First class types ✔ ✔ Iterators ∗ ✔ ✔ ∗ Variable model reference value* value and reference reference value* and reference Type checking dynamic static static dynamic static Type expression structural nominal nominal structural structural Functions as objects Classes as objects
Python* First-class functions are very common in the standard library •The sorted built-in key argument is one example. 83 * Yes, this is subjective. I am talking about style!
is common in Python •nonlocal was added in Python 3 to support it better Callable objects are uniquely Pythonic •Graham Dumpleton recommends callable classes as the best way to code decorators 84
features Choose among alternative implementations Make good use of design patterns Emulate missing features when they are missing 89 Inspired by Programming Language Pragmatics Michael L. Scott *