Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Would be nice to warn about omitting the "yield from" from a call #18

@GoogleCodeExporter

Description

@GoogleCodeExporter
Sometimes you write foo() instead of yield from foo().  If you use the result, 
you probably get a type error pretty quickly.  But if you don't use the result, 
you have a pretty nasty quiet failure on your hand.

Maybe we can solve this by having a __del__ method in a wrapper object that 
checks whether the generator has been consumed at all, and a similar __del__ 
method on Future.  It would have to log an error.

Similarly, it would also be useful if a Future that completed with an exception 
logged an error if it was garbage-collected before anybody looked at the error. 
 (I tried to do this once but I couldn't get it to work right; see attached 
EXCEPT.diff.)

Original issue reported on code.google.com by gvanrossum@gmail.com on 21 Mar 2013 at 2:10

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions