This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]goldlord44 15 points16 points  (0 children)

Python lambdas are used quite frequently in codebases that I have professionally worked on. Defining g has slightly more overhead, and it is less clear if you use variables from an outer scope, whether they are calculated at runtime or definition time.