On Jan 22, 6:20 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> For a simple greenlet/tasklet/microthreading experiment I found myself in
> the need to ask the question
>
> isgenerator(v)
>
> but didn't find any implementation in the usual suspects - builtins or
> inspect.

types.GeneratorType exists in newer Pythons, but I'd suggest just
checking for a send method. ;)
That way, you can use something that emulates the interface without
being forced to use a generator.

hasattr(ob, 'send')..
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to