[Python-ideas] Allow __bytes__ to return NotImplemented

Émanuel Barry vgr255 at live.ca
Mon Jun 6 15:00:10 EDT 2016


> From: Guido van Rossum
> Subject: Re: [Python-ideas] Allow __bytes__ to return NotImplemented
> 
> To invoke the default behavior just return super().__bytes().

Well, object.__bytes__() doesn't exist, so that would just be another unhelpful error.

> 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

-Emanuel


More information about the Python-ideas mailing list