| Tor Norbye | 3a2425a | 2013-11-04 10:16:08 -0800 | [diff] [blame^] | 1 | def deco(fun): |
| 2 | return fun # valid | ||||
| 3 | |||||
| 4 | class FooClass: | ||||
| 5 | staticField = deco | ||||
| 6 | globs = globals() | ||||
| 7 | def __init__(self): | ||||
| 8 | self.instanceField = 2 | ||||
| 9 | |||||
| 10 | @deco | ||||
| 11 | def fooFunction(fooParam1, fooParam2=0) : | ||||
| 12 | notAField = 3 | ||||
| 13 | pass | ||||
| 14 | |||||
| 15 | def topLevelFunction(tlfp1, tlfp2) : | ||||
| 16 | pass | ||||
| 17 | |||||
| 18 | top1 = 1 | ||||
| 19 | if True: | ||||
| 20 | top2 = 2 | ||||
| 21 | |||||
| 22 | class BarClass(object): | ||||
| 23 | __value = 0 | ||||
| 24 | |||||
| 25 | def __get(self): | ||||
| 26 | return self.__value | ||||
| 27 | |||||
| 28 | def __set(self, val): | ||||
| 29 | self.__value = val | ||||
| 30 | |||||
| 31 | value = property(__get) | ||||
| 32 | setvalue = property(fset=__set) | ||||
| 33 | |||||
| 34 | class BazClass(object): | ||||
| 35 | __x = 1 | ||||
| 36 | |||||
| 37 | @property | ||||
| 38 | def x(self): | ||||
| 39 | return self.__x | ||||
| 40 | |||||
| 41 | @x.setter | ||||
| 42 | def x(self, v): | ||||
| 43 | self.__x = v | ||||
| 44 | |||||
| 45 | |||||