News for hackers. Stuff that matters.
Re:Convert any Python file into a single line of code by mrks_ on Tuesday August 25, 2015 @10:32AM (#10116729)
On what occasion would a one-liner be useful? I'm genuinely curious, because I can't think of any such case, but I wouldn't doubt there being a few.
Re:Convert any Python file into a single line of code by gknoy on Tuesday August 25, 2015 @11:06AM (#10117004)
Command line use. You grep some files, and think, "man, this really needs this ONE LITTLE FILTER". So, you pipe it to `perl -e "..."`, and soon have a very short program that you iterate on a few times to make sure you have right, and then you pipe it through the rest of the toolchain.

I don't write Perl much anymore, but that was far and away my __favorite__ way to use it. I love coding in Python now, more than I ever liked programming in any language (except perhaps lisp), but I still don't feel I can use it on the command line that way.

In the context of a Python program, I can't see the value of a Lovecraftian lambda (unless maybe in code golf comments?), but I found this article very appealing mainly because it's quite a feat. Doing anything nontrivial in a lambda is a pain in the ass, so the fact that someone wrote a tool to do it is awesome.

Re:Convert any Python file into a single line of code by rplnt on Tuesday August 25, 2015 @10:57AM (#10116950)
Read the previous sentence :)