<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 15, 2014 at 5:00 PM, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Jan 16, 2014 at 10:55:31AM +1300, Greg Ewing wrote:<br>
> Neil Schemenauer wrote:<br>
> >Objects that implement __str__ can also implement __bytes__ if they<br>
> >can guarantee that ASCII characters are always returned,<br>
><br>
> I think __ascii_ would be a better name. I'd expect<br>
> a method called __bytes__ on an int to return some<br>
> version of its binary value.<br>
<br>
</div>+1<br></blockquote><div><br></div><div>If we are going the route of a new magic method then __ascii__ or __bytes_format__ get my vote as long as they only return bytes (I see no need to abbreviate to __bformat__ or __formatb__ when we have method names as long as __text_signature__ now).</div>

</div></div></div>