Today I think about lambda in Python and what if we introduce the new syntax: ```python def lock(*args, closure): # Do some stuff closure() # Call closure # Finish stuff
if __name__ == '__main__': lock(): # Do some things here is thread safe ``` This feature could be very similar as in `Kotlin` inline functions https://kotlinlang.org/docs/reference/inline-functions.html _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/HAIFGFE5YUCGLEWFPT3K2N3H6WBK4KQ7/ Code of Conduct: http://python.org/psf/codeofconduct/