# HG changeset patch # User Paul Boddie # Date 1395092242 -3600 # Node ID 78f31936f4e19bf4dfcfa2510e690cc1dda9775c # Parent e2792f749a136344d1664f40ad039c88164ee38e Added another test of "for" and attribute usage. diff -r e2792f749a13 -r 78f31936f4e1 tests/for_usage.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/for_usage.py Mon Mar 17 22:37:22 2014 +0100 @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +class C: + def m(self): + pass + +class D: + pass + +def f(x): + for i in x: + if i.m: + return 1 + return 0 + +c = C() +result_1 = f([c]) + +# vim: tabstop=4 expandtab shiftwidth=4