[PATCH] python: Make Context have a repr method.

Justus Winter justus at g10code.com
Thu Dec 1 17:50:13 CET 2016


Tobias Mueller <muelli at cryptobitch.de> writes:

> * lang/python/gpg/core.py (Context.__repr__): added

Merged, many thanks!

I did some editorial changes.  It is customary to write 'New X.' in the
ChangeLog-style section when adding stuff.

> To look nicer in a REPL

We prefer whole sentences.

> +    def __repr__(self):
> +        return "".join((
> +            "Context(armor={0.armor}, ",
> +            "textmode={0.textmode}, offline={0.offline}, ",
> +            "signers={0.signers}, pinentry_mode={0.pinentry_mode}, ",
> +            "protocol={0.protocol}",
> +            ")")).format(self)
> +

This is an odd construct.  Python actually joins adjacent strings like
C.


Cheers,
Justus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: </pipermail/attachments/20161201/a26c0414/attachment.sig>


More information about the Gnupg-devel mailing list