Andrew Koenig wrote:
> Can anyone think of an easy technique for creating an object that acts like
> a generator but has additional methods?

Perhaps the enable_attributes() recipe will help:

    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/164044

The recipe imbues generators with classlike attribute reads and writes.
 It shouldn't be hard to adapt the technique for attaching methods.


Raymond

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

Reply via email to