On Wed, Aug 22, 2018 at 12:48 PM, Abe Dillon <abedil...@gmail.com> wrote: > [Steven D'Aprano] >> >> Replacing the keyword: >> results = map(def a, b=2, c=3: a ** b / c, sequence) >> widget.register(callback=def: spam.eggs()) >> Doesn't look so attractive now, I wager. Using "def" inside an >> expression looks strange. And this looks outright disturbing: >> def method(self, arg, callback=def arg: arg+1): >> pass > > > Eh... I think they look fine. Which is worse: > > def method(self, arg, callback=def arg: arg+1): > pass > > or > > lambda arg, callback=lambda arg: arg+1: None > > because the second one makes me go cross-eyed...
If you have a use-case for a lambda function that takes a callback and has a default value for that callback, please submit it to The Daily WTF. In Steve's example, the main function was created with a statement. ChrisA _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/