2017-03-10 | Paul Boddie | file changeset files shortlog | Prevent __data__ accesses via anonymous accessors from trying to find the attribute on classes since __data__ is always provided by the immediate object and because the check_and_load_via_any operation uses a null value internally to detect failure that can be confused with a genuine __data__ attribute with a zero value (such as the integer zero). |
paul@351 | 1 | class C: |
paul@351 | 2 | def __init__(self): |
paul@351 | 3 | self.x = 1 |
paul@351 | 4 | def f(self): |
paul@351 | 5 | return self.x |
paul@351 | 6 | |
paul@351 | 7 | class D(C): |
paul@351 | 8 | pass |
paul@351 | 9 | |
paul@351 | 10 | class E(C): |
paul@351 | 11 | def __init__(self, x): |
paul@351 | 12 | self.x = x |
paul@351 | 13 | |
paul@351 | 14 | d = D() |
paul@351 | 15 | print d.f() |
paul@351 | 16 | |
paul@351 | 17 | e = E(2) |
paul@351 | 18 | print e.f() |