[Distutils] PEP 517 again

Guido van Rossum guido at python.org
Fri Aug 25 22:17:06 EDT 2017


I don't have any context here, but "return NotImplemented" is a very narrow
idiom intended only for binary operators (e.g. __add__) when the
interpreter should give the other operand a chance (e.g. __radd__) or use a
default implementation.

In pretty much any other context, if you have an operation that returns an
regular value or an error value, the error value should be None.
(Exceptions include e.g. returning a non-negative int or -1 for errors, or
True for success and False for errors.)

On Fri, Aug 25, 2017 at 6:53 PM, xoviat <xoviat at gmail.com> wrote:

> Oh, BDFL, will you settle whether we should raise an exception or return
> Notimplemented?
>
> On Aug 25, 2017 8:28 PM, "Greg Ewing" <greg.ewing at canterbury.ac.nz> wrote:
>
> xoviat wrote:
>
>> I mean how is opening a file different than attempting to build an sdist?
>>
>
> 1. Opening a file is a very common operation.
>
> 2. Most file opens are expected to succeed, and if one doesn't,
> the appropriate place to deal with that is almost never at the
> site of the open call, but somewhere further up.
>
> In contrast, there's probably only about one place in any
> given frontend where the backend's build_sdist method gets
> invoked, and it's unlikely the ability to let a not-implemented
> exception bubble up from that point would be of great use.
>
>
> --
> Greg
>
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> https://mail.python.org/mailman/listinfo/distutils-sig
>
>
>


-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20170825/2aabdf3c/attachment.html>


More information about the Distutils-SIG mailing list