2018-07-12 | Paul Boddie | file changeset files shortlog | Support trailing data after attributes in objects, employed by float instances to store their double-precision numeric data which needs more space than single attributes on some systems. In order to initialise such instances statically, specific object types must be indicated instead of the generic __obj type. This then requires casting to __ref of direct references to objects. Added an underflow error. Added initial testing of floating point numbers. | trailing-data |
paul@601 | 1 | class C: |
paul@601 | 2 | def f(self): |
paul@601 | 3 | print self |
paul@601 | 4 | return self.value() |
paul@601 | 5 | |
paul@601 | 6 | def value(self): |
paul@601 | 7 | return 123 |
paul@601 | 8 | |
paul@601 | 9 | c = C() |
paul@601 | 10 | |
paul@601 | 11 | class D: |
paul@601 | 12 | f = c.f |
paul@601 | 13 | |
paul@601 | 14 | d = D() |
paul@601 | 15 | |
paul@601 | 16 | print c.f.__name__ # f |
paul@601 | 17 | print c.f() # <__main__.C instance> |
paul@601 | 18 | # 123 |
paul@601 | 19 | print d.f.__name__ # wrapper |
paul@601 | 20 | print d.f() # <__main__.C instance> |
paul@601 | 21 | # 123 |