On 5/18/06, Edward Loper <[EMAIL PROTECTED]> wrote: > Collin Winter wrote: > > So, reasoning by analogy would point to something like > > Generator(is_sent=int, yields=int). > > You'd probably want this to be Iterator(...) instead of Generator(...), > since the *return value* is an iterator. (It's the function itself > that's a generator function, not its return value.)
No, it should be Generator, since you can't send() values to arbitrary iterables; I'm specifically trying to find a way to typecheck the objects coming in via send(). Also, the function's return value most certainly is a generator: """ >>> def foo(): yield 5 ... >>> f = foo() >>> type(f) <type 'generator'> >>> """ Collin Winter _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
