Python's yield keyword is rarely useful for laziness. I've only taken advantage of lazy computation a handful of times, e.g. dealing with paginated APIs.
The main advantage is syntactic sugar for producing iterables. Yield is much nicer than appending to a list and returning it!
miniblog.
Related Posts
What's the best string representation of a function? Comparing with other PLs:
Python: <function __main__.add_one()>
JS: [Function: addOne]
Clojure: #function[user/add-one]
Scheme: #<procedure add-one (x)>
I'm currently thinking about <fun add_one() foo.gdn:123>
I've released difftastic 0.68! A smaller update, but still worth upgrading:
* Improved Bash, C, Go, Lua, Nix, Perl, Python, Rust, Scala, Swift and YAML parsing.
* Minor display and git compatibility fixes.
Writing type params with <> (e.g. List<Int>) seems the most natural to me: probably because I encountered that syntax first.
Between C++, Java and TypeScript I think it's the most common too.
List[Int] seems to be next most common (Scala, Python) but TIL Gleam uses List(Int)!

