python3: 'where' keyword

AdSR adsr at poczta.onet.pl
Sat Jan 8 11:30:57 CET 2005


Nick Coghlan wrote:
> 
> 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"

Hey, this is super-elegant!

AdSR



More information about the Python-list mailing list