Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
_callcc
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
_callcc
11y ago
IIRC the change is related to the change in `iter` which in python2 returns `None` after exhausting a list but in python3 will raise `StopIteration`. Very annoying TBH. I had some really nice list chunking functions using `map` on python2 t
32.
▲
by
_callcc
11y ago
Just use pgadmin, ipython+pandas, or pgweb.
33.
▲
by
_callcc
12y ago
It was cobbled together more or less from scratch mainly based on stackoverflow questions and wikipedia articles. To be honest, it was still somewhat opaque to me (hence the extraordinarily long comments--trying to explain it to myself) but
34.
▲
by
_callcc
12y ago
This was the worst thing about switching to Python 3. `map` and `filter` are annoyingly "lazy" and `reduce` is basically shunned. I wonder if the real reason this was changed was to discourage the use of `map` and `filter`... wrap
35.
▲
by
_callcc
12y ago
...re-reading this I realize the comments are a bit of a mess... basically, it's a decorator that uses the y-combinator to get around the recursion depth problem by "suspending" the evaluation at each step (I'm sure ther
36.
▲
by
_callcc
12y ago
I noticed the implicit y combinator as well... here's something I wrote in python some time ago to play with the idea: def tco(fn): """ tco --- Usage: Functions