python3: 'where' keyword
Andrey Tatarinov
elephantum at dezcom.mephi.ru
Sat Jan 8 06:44:44 EST 2005
Nick Coghlan wrote:
>> It also allows the necessary but uninteresting setup for an expression
>> to be moved "out of the way", bringing the expression that does the
>> real work to prominence.
> Killer app for this keyword:
>
> class C(object):
>
> x = property(get, set) where:
> def get(self):
> return "Silly property"
> def set(self, val):
> self.x = "Told you it was silly"
oh, that's great! I can't imagine prettier example
More information about the Python-list
mailing list