Skip to content

Comment on Functional Programming in Python

Comments

Why the lambdas at all in these examples...

  (lambda real_user: real_user.get_balance())
and not
  User.get_balance
(besides subclasses not getting their balance called...)

It's a bad example. You can of course do more with lambdas in python. Maybe "lambda real_user: real_user.get_balance()+1" or "lambda some_junk, real_user: real_user.get_balance()" would have been better.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.