2012-10-22 | Paul Boddie | raw files shortlog changelog graph | Added another test of attribute usage deductions. | |
tests/attribute_access_type_restriction_simple.py (file) |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/attribute_access_type_restriction_simple.py Mon Oct 22 00:11:06 2012 +0200 1.3 @@ -0,0 +1,17 @@ 1.4 +#!/usr/bin/env python 1.5 + 1.6 +class C: 1.7 + def test(self): 1.8 + return 3 1.9 + 1.10 +x = 2 1.11 +y = 2 1.12 + 1.13 +if y: 1.14 + c = C() # attributes: {test} or {} 1.15 + if x: 1.16 + y = c.test() # targets: {C.test} 1.17 + 1.18 +result_3 = y 1.19 + 1.20 +# vim: tabstop=4 expandtab shiftwidth=4