[Python-ideas] Yield-From Example 2: Scheduler

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Feb 20 22:09:07 CET 2009

Adam Olsen wrote:

> It's more of a gut instinct thing.  It'd be hard to make ignored
> returns into an error,

But why would you even *want* to make ignored returns
into errors?

Some people like to run lint over their C code and
get it to warn about unused return values that haven't
been cast away, but that's because C uses return values
to signal errors, and not paying attention to them can
cause real problems.

But Python uses exceptions for errors, so ignoring
return values is usually harmless. If you igore something
that you shouldn't have ignored, you will usually find
out about it pretty quickly, because your program will
produce incorrect results.

Maybe this is where your gut instinct is coming from?


More information about the Python-ideas mailing list