tag:blogger.com,1999:blog-7176062489626496619.post7884865009758378351..comments2023-05-03T11:51:28.484-04:00Comments on Lazy Pythonista: What Python learned from economicsAlexhttp://www.blogger.com/profile/14054821112394577330noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-7176062489626496619.post-84611110637986376072008-11-20T01:38:00.000-05:002008-11-20T01:38:00.000-05:00I think a lot of the good you see in Python code c...I think a lot of the good you see in Python code comes from the the community. People (like Eric, above), know about the evils of unreadable code and when they write it, they usually say that it is bad.Paddy3118https://www.blogger.com/profile/06899509753521482267noreply@blogger.comtag:blogger.com,1999:blog-7176062489626496619.post-50766816702234523122008-11-19T02:57:00.000-05:002008-11-19T02:57:00.000-05:00I personally like this Fibonacci number calculator...I personally like this Fibonacci number calculator, written in Python of course:<BR/><BR/>fibonacci = lambda x:map(lambda o:(map(lambda c:map(lambda l:<BR/>o.__setslice__(l[0],l[1],l[2]),([o[2]+3,o[2]+4,[o[0]]],[0,3,[o[1],<BR/>reduce(lambda x,o:x+o,o[:2]),o[2]+1]])),range(x)),o)[1],[[1,1,0]+<BR/>range(x)])[0][3:]<BR/><BR/>I'm so glad Python forced me to write readable code! Just kidding :) After working in Perl for a summer, it's an absolute lifesaver to be able to count on the consistent readability of Python. Thanks for the article!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7176062489626496619.post-7025683046094904782008-11-18T18:29:00.000-05:002008-11-18T18:29:00.000-05:00> However, Python enforces doing things the rig...> However, Python enforces doing things the right way<BR/><BR/>Sorry, I think it is common knowledge that Python will let you get away with all sorts of shenanigans if you want to. (There is passing reference to this in one of the Python O'Reilly books).<BR/><BR/>Python is very hacker-friendly - please don't mistake top-notch syntax and good organization for imposing an ideological vision on users. For comparison, see this entry in the jargon file:<BR/><BR/>http://www.catb.org/jargon/html/B/bondage-and-discipline-language.html<BR/><BR/>Also, I wouldn't mention "best practices" in the same sentence as "Python" within spitting distance of c.l.p unless you want to risk getting slapped in the face with a wet fish.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7176062489626496619.post-1112087511853626982008-11-18T18:06:00.000-05:002008-11-18T18:06:00.000-05:00view logic can be written in Python too, and a lit...view logic can be written in Python too, and a little bit of that in templates is OK. django templates are too restrictive in this regard.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7176062489626496619.post-69078257556907241522008-11-18T17:20:00.000-05:002008-11-18T17:20:00.000-05:00While I'm glad you like it, I don't want to claim ...While I'm glad you like it, I don't want to claim credit falsely. The Luke/Yoda exchange didn't originate with me, I just adapted it. Here's the original:<BR/><BR/>http://www.python.org/doc/humor/#python-vs-perl-according-to-yoda<BR/><BR/>I'll add that link to my text.David Goodgerhttps://www.blogger.com/profile/06673699859175469861noreply@blogger.com