2014-03-17 | Paul Boddie | raw files shortlog changelog graph | Added another test of "for" and attribute usage. | syspython-as-target |
tests/for_usage.py (file) |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/for_usage.py Mon Mar 17 22:37:22 2014 +0100 1.3 @@ -0,0 +1,19 @@ 1.4 +#!/usr/bin/env python 1.5 + 1.6 +class C: 1.7 + def m(self): 1.8 + pass 1.9 + 1.10 +class D: 1.11 + pass 1.12 + 1.13 +def f(x): 1.14 + for i in x: 1.15 + if i.m: 1.16 + return 1 1.17 + return 0 1.18 + 1.19 +c = C() 1.20 +result_1 = f([c]) 1.21 + 1.22 +# vim: tabstop=4 expandtab shiftwidth=4