[Python-porting] porting %s for bytes

Ethan Furman ethan at stoneleaf.us
Sat May 10 17:14:46 CEST 2014


On 04/29/2014 01:31 PM, Buck Golemon wrote:
>
> B) Implement modulo substitution for bytes in python3. I see that
> this operation is making a reappearance in python3.5, so this
> seems fairly reasonable:
>
>  http://legacy.python.org/dev/peps/pep-0461/

There will be a backport (eventually ;), but as long as your implementation conforms to the PEP you should be fine.


> I'm using the `future` package to do the port, and am very pleased
>  with the result, but it doesn't handle this one rough spot. Can I
>  request a 2+3 implementation of bytes.__mod__?  Or, has anyone seen
>  a currently-existing implementation of this function?

As I recall there was a functional function implementation somewhere in the PEP460-461 threads that may work well 
enough.  I /think/ it was Terry Reedy that offered it (but I could easily be wrong).

--
~Ethan~


More information about the Python-porting mailing list