En Sun, 04 May 2008 01:08:34 -0300, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> escribió:
> On Sat, 03 May 2008 16:39:43 -0700, castironpi wrote: > >> I'm actually curious if there's a way to write a generator function >> (not a generator expression) in C, or what the simplest way to do it >> is... besides link the Python run-time. > > The reference implementation of Python is written in C, so obviously there > must be a way to write something like generators in C. Yes and no. Generators are tied to frames, and frames execute Python code, not C. There is no simple way to write generators in C, but there are some generator-like examples in the itertools module. See this thread http://groups.google.com/group/comp.lang.python/browse_thread/thread/5f42f72f2d0e88fc/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list