Conversation:
Notices
-
Some fun tips for writing python code. https://blog.michaelckennedy.net/2016/10/10/pythonic-code-by-example-in-5-videos-video-series/
- Joshua Judson Rosen likes this.
- Joshua Judson Rosen repeated this.
-
He's a pythonaut after my own heart, but be careful not to follow his examples too literally: a number of them are either counterproductive by the metrics used in the others, or contrary to modern #Python standards.
-
@steve, I ♥ !lambda, but they can kill your performance in #Python because there's so much overhead in Python's procedure-call implementation. So #Guido would say you're supposed to use list comprehensions for that stuff at this point.
-
@steve, #Guido actually *really* wanted to drop !lambda in #Python 3: https://www.artima.com/weblogs/viewpost.jsp?thread=98196
-
@steve, the lambda in things like "lambda w: w.lower()" is also typically superfluous, because you can just pass the *class method* directly, e.g.: sort(…, key=str.lower)
-
@steve, I liked the `don't use lists, use dicts' lesson, but the next step after that for many algorithms is actually `don't use dicts, use sets' ☺ https://www.python.org/dev/peps/pep-0218/
-
Hmm. @steve, I think Chirp dropped all of my responses to you last night: http://status.hackerposse.com/conversation/105211
-
!lambda: the Ultimate #GOTO: Debunking the 'Expensive Procedure Call' Myth, or, Procedure Call Implementations #ConsideredHarmful http://dspace.mit.edu/handle/1721.1/5753