[Python-Dev] PEP 461 - Adding % and {} formatting to bytes (original) (raw)
Steven D'Aprano steve at pearwood.info
Thu Jan 16 01:03:45 CET 2014
- Previous message: [Python-Dev] PEP 461 - Adding % and {} formatting to bytes
- Next message: [Python-Dev] PEP 461 - Adding % and {} formatting to bytes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Jan 15, 2014 at 10:34:48PM +0000, Mark Lawrence wrote:
On 15/01/2014 22:22, Brett Cannon wrote: > > > >On Wed, Jan 15, 2014 at 5:00 PM, Steven D'Aprano <steve at pearwood.info_ _><mailto:steve at pearwood.info>> wrote: > > On Thu, Jan 16, 2014 at 10:55:31AM +1300, Greg Ewing wrote: > > Neil Schemenauer wrote: > > >Objects that implement str can also implement bytes if they > > >can guarantee that ASCII characters are always returned, > > _> > I think ascii would be a better name. I'd expect > > a method called bytes on an int to return some > > version of its binary value. > > +1 > > >If we are going the route of a new magic method then ascii or >bytesformat 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 textsignature now). >
bytesformat gets my vote as it's blatantly obvious what it does.
What precisely does it do? If it's so obvious, why is this thread so long?
I'm against ascii as I'd automatically associate that with ascii in the same way that I associate str with str and repr with repr.
That's a good point. I forgot about ascii().
-- Steven
- Previous message: [Python-Dev] PEP 461 - Adding % and {} formatting to bytes
- Next message: [Python-Dev] PEP 461 - Adding % and {} formatting to bytes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]