Author gvanrossum
Recipients gvanrossum, pfalcon, vstinner, yselivanov
Date 2015-06-14.18:47:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1434307662.23.0.25067753859.issue24449@psf.upfronthosting.co.za>
In-reply-to
Content
Most people actually are better off with just write(), and an API with more choices is not necessarily better. I'm sure this has come up before, I could've sworn it was you, sorry if it wasn't.

Here's one reason why I don't like your proposed API. The read() and write() calls *aren't* symmetric: When you call read(), you are interested in the return value. If you forget the "yield from" (or 'async') your use of the return value will most likely raise an exception immediately, so you will notice (and pinpoint) the bug in your code instantly. But with write() there is no natural return value, so if write() was a coroutine, the common mistake (amongst beginners) of forgetting the "yield from" or 'async' would be much harder to debug -- your program happily proceeds, but now it's likely hung, waiting for a response that it won't get (because the other side didn't get what you meant to write) or perhaps you get a cryptic error (because the other side saw the thing you wrote next).
History
Date User Action Args
2015-06-14 18:47:42gvanrossumsetrecipients: + gvanrossum, pfalcon, vstinner, yselivanov
2015-06-14 18:47:42gvanrossumsetmessageid: <1434307662.23.0.25067753859.issue24449@psf.upfronthosting.co.za>
2015-06-14 18:47:42gvanrossumlinkissue24449 messages
2015-06-14 18:47:42gvanrossumcreate