[gpgme] python3.4 codegen of gpg/gpgme.py is corrupted
Justus Winter
justus at g10code.com
Wed Mar 29 12:33:45 CEST 2017
Alon Bar-Lev <alon.barlev at gmail.com> writes:
> On 29 March 2017 at 12:36, Justus Winter <justus at g10code.com> wrote:
>> Alon Bar-Lev <alon.barlev at gmail.com> writes:
>>
>>> Hi,
>>>
>>> When building using python2.7 gpg/gpgme.py is generated ok.
>>>
>>> When building using python3.4 it is corrupted, examples:
>>> ---
>>> def gpgme_err_make(source: 'gpgme_err_source_t', code:
>>> 'gpgme_err_code_t') -> "gpgme_error_t":
>>> """gpgme_err_make(source, code) -> gpgme_error_t"""
>>> return _gpgme.gpgme_err_make(source, code)
>>>
>>> def gpgme_error(code: 'gpgme_err_code_t') -> "gpgme_error_t":
>>> """gpgme_error(code) -> gpgme_error_t"""
>>> return _gpgme.gpgme_error(code)
>>>
>>> def gpgme_err_code(err: 'gpgme_error_t') -> "gpgme_err_code_t":
>>> """gpgme_err_code(err) -> gpgme_err_code_t"""
>>> return _gpgme.gpgme_err_code(err)
>>> ---
>>>
>>> Please advise.
>>
>> What makes you say the code is corrupted? I assume that your MUA
>> introduced linebreaks, but otherwise this looks ok.
>>
>
> I do not think:
> """
> def gpgme_err_code(err: 'gpgme_error_t') -> "gpgme_err_code_t"
> """
> Is valid python, also python does not think so... :)
Yes it is. This is a type hint.
https://www.python.org/dev/peps/pep-0484/
The pep suggests it is fully implemented in Python3.5, but the
documentation for Python3.4 suggests that this particular annotation is
supported too:
https://docs.python.org/3.4/reference/compound_stmts.html#function-definitions
Are you actually having a problem or did it just look weird to you?
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/20170329/5669419d/attachment.sig>
More information about the Gnupg-devel
mailing list