[PATCH 2 of 2] py3: add utility to forward __str__() to __bytes__()

Yuya Nishihara yuya at tcha.org
Sat Jun 24 03:40:53 EDT 2017


On Sat, 24 Jun 2017 00:08:44 -0700, Martin von Zweigbergk wrote:
> On Fri, Jun 23, 2017 at 10:56 PM, Yuya Nishihara <yuya at tcha.org> wrote:
> > # HG changeset patch
> > # User Yuya Nishihara <yuya at tcha.org>
> > # Date 1498279684 -32400
> > #      Sat Jun 24 13:48:04 2017 +0900
> > # Node ID ce96efec81121eab1c8ee3ff223a924530322400
> > # Parent  24c0a9a7fa865cc6ff6f1a5b183bffe8a220dda6
> > py3: add utility to forward __str__() to __bytes__()
> 
> Queued, thanks.
> 
> Maybe I could use this for *matcher.__repr__ too.

Perhaps. It can be used as a decorator.

I have no concrete idea how to convert repr() back to bytes, though.


More information about the Mercurial-devel mailing list