# Why not real anonymous functions?

**URL:** <https://discuss.python.org/t/why-not-real-anonymous-functions/44513>\
**Category:** Ideas\
**Created:** [January 30, 2024, 2:27am UTC](https://discuss.python.org/t/why-not-real-anonymous-functions/44513 "2024-01-30T02:27:09Z")\
**Posts on this page:** 1\
**Showing post:** 105

<div class="post-metadata">

**Author:** ![MegaIng](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/megaing/32/16162_2.png) [@MegaIng](https://discuss.python.org/u/MegaIng)\
**Post date:** [February 23, 2024, 10:22pm UTC](https://discuss.python.org/t/why-not-real-anonymous-functions/44513/105 "2024-02-23T22:22:47Z")

</div>

> [@drdavella](#):
>
> I definitely agree with you that this is the only meaningful objection, and it is a real one. However I also agree with @voidstar that there has been a decent amount of commentary on this thread that questions the justification for such a construct at all. I’m not sure how many developers realize that Python is the odd one out in most mainstream languages for not supporting fully expressive anonymous function literals.

Yes, commentary, because people disagree that this is useful. Even if people find a good syntax there is still quite a bit of work to do in convince the python community and the core devs that it is actually a good idea. But to quote once again what was already said before “as long as we don’t have a syntax, this discussion is not worth having”.

I am also personally not sure if multiline lambdas are useful. IMO the examples I showed above are perfectly acceptable solutions that already work, and solve 2/3 of the examples brought up. IMO the pattern of instantly calling a function literal is a stupid idiom in other languages that makes code less readable. I am also open to a “scope” statement suggestion in python, eliminating the need for the weird idiom. (and I am even opening to that being able to have a `return` to bind to a variable in the outer scope).

---

_[View the full topic](https://discuss.python.org/t/why-not-real-anonymous-functions/44513)._
