3 ms·
“let” in python (2014)
- hatmatrix 11y agoComing from lisp, I was looking for a "let" in python. Found a recent reddit discussion here: https://www.reddit.com/r/Python/comments/41yr58/let_statement_in_python_2014/ https://www.reddit.com/r/Python/comments/41yr58/let_statemen... I especially find myself wishing for a let in these instances: https://www.reddit.com/r/Python/comments/41yr58/let_statement_in_python_2014/cz6gpzc https://www.reddit.com/r/Python/comments/41yr58/let_statemen... While the canonical answer is to assign to a local variable within a function, sometimes I abhor writing functions for such small tasks.
- dozzie 11y agoSmart hack, but IMO gives too little for me to be bothered to add a dependency.