Steven,
thanks for a nice explanation.

I am trying to experiment a little bit with new-style class and I am
confused why following example always returns 0 (zero). I was
expecting <generator object> will return values from 0 to 9 and finaly
an Exception.

class GenExample(object):

    def getInfo(self):
        for no in range(10):
            yield no

    myNo=property(getInfo)

gen=GenExample()
print gen.myNo.next()
print gen.myNo.next()
.
.
print gen.myNo.next()

--
Petr Jakes
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to