[Python-ideas] Allow __bytes__ to return NotImplemented
Michael Selik
michael.selik at gmail.com
Mon Jun 6 18:13:13 EDT 2016
On Mon, Jun 6, 2016 at 3:01 PM Émanuel Barry <vgr255 at live.ca> wrote:
> > From: Guido van Rossum
>
> > Right. NotImplemented is frequently misunderstood (and it doesn't help
> > that there's also a completely unrelated exception
> > NotImplementedError). If you want to contribute some docs about this
> > we'd be delighted! (bugs.python.org)
>
> Done! http://bugs.python.org/issue27242
"The appropriate way to signal that an operation is unsupported is to leave
the relevant method undefined."
+1
Thanks for writing that. It's unfortunate that some folks see things like
__hash__ returning None and they assume that's the appropriate pattern for
signaling an operation is not supported.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160606/70d4089f/attachment-0001.html>
More information about the Python-ideas
mailing list