4 ms·
How is a 5 line class with 2 underscore methods more pythonic than a nested lambda?
by pavelludiq 18y ago
How is a 5 line class with 2 underscore methods more pythonic than a nested lambda?
- yummyfajitas 18y agoWhile python supports some basic functional programming, it's primarily a procedural/object oriented language. And it shows. As the article demonstrates, using nested lambda's doesn't work the way you expect for closures. Using an object does. edit: update. I found the presentation where guido talks about how he dislikes all the functional stuff, including lambda. http://74.125.93.104/search?q=cache:2QztD1KncJgJ:www.python.org/doc/essays/ppt/regrets/PythonRegrets.ppt+OSCON+%22python+regrets%22&cd=1&hl=en&ct=clnk&gl=us* http://74.125.93.104/search?q=cache:2QztD1KncJgJ:www.python....
- tptacek 18y agoDoes it make you sad that this is the same answer you'd have given if the language in question was Java? Just rubbing it in.