Re:Python's Type Checking Renaissance
by mixmastamyk on Thursday February 04, 2021 @10:32PM
(#26032777)
Lambada, the forbidden dance:
(
lambda x:
x
+
x
)(5)
But yes, not everything in Python is nice for working with fp code. Using tuples, coming from Clojure, is painful. Things like returning exceptions for `StopIteration`is annoying. Mutability of lists outside of a lexical scope without using deepcopy. Though functools and itertools makes it more bearable.
But I also don't think types is the answer. I think something like Racket's contracts or Clojure's spec is closer to what I'd prefer. Gradual typing is nice though.