There is nothing wrong with the other two answers, but they can be a bit high. So here is version 101:
lambda
Although this is in their C # documentation, I think Microsoft really has a better explanation of the concept of lambda:
A lambda expression is an anonymous function that can contain expressions and statements
, CS, , " ", , . Python:
lambda [argument]: [expression]
[argument] , - [expression] - , , . @Jordan , , , :
def encoding(self):
return self.file.encoding
self - , , (self.file.encoding) .
property "" "", , . "" - . , , , . . , , , .
Python OOP . , -, . , Python property "" - . :
def get_foo(self):
return self.bar
def set_foo(self, value):
self.bar = value
foo = property(get_foo, set_foo)
, instance.foo ( ) instance.foo = 'something'. , foo .
, , , . encoding file.encoding.