How is the Python with keyword expressed in lambda functions? Consider the following:
def cat (filename): with open(filename, 'r') as f: return f.read()
Failed to try lambda:
cat = lambda filename: with open(filename, 'r') as f: return f.read()
source share