All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org,  michael.roth@amd.com,  jsnow@redhat.com
Subject: Re: [PATCH] qapi/parser: Fix type hints
Date: Tue, 16 May 2023 07:22:34 +0200	[thread overview]
Message-ID: <87sfbwx339.fsf@pond.sub.org> (raw)
In-Reply-To: <cb6582b2-9542-4ebb-d188-34287f9fb3dd@linaro.org> (Richard Henderson's message of "Mon, 15 May 2023 17:30:04 -0700")

Richard Henderson <richard.henderson@linaro.org> writes:

> On 5/11/23 04:17, Markus Armbruster wrote:
>> Fixes: 3e32dca3f0d1 (qapi: Rewrite parsing of doc comment section symbols and tags)
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>   scripts/qapi/parser.py | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>> diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
>> index 4923a59d60..9315412ab2 100644
>> --- a/scripts/qapi/parser.py
>> +++ b/scripts/qapi/parser.py
>> @@ -563,11 +563,11 @@ def end_comment(self) -> None:
>>           self._switch_section(QAPIDoc.NullSection(self._parser))
>>         @staticmethod
>> -    def _match_at_name_colon(string: str) -> re.Match:
>> +    def _match_at_name_colon(string: str) -> Optional[re.Match[str]]:
>>           return re.match(r'@([^:]*): *', string)
>>         @staticmethod
>> -    def _match_section_tag(string: str) -> re.Match:
>> +    def _match_section_tag(string: str) -> Optional[re.Match[str]]:
>>           return re.match(r'(Returns|Since|Notes?|Examples?|TODO): *', string)
>>         def _append_body_line(self, line: str) -> None:
>
> Doesn't work:
>
> https://gitlab.com/qemu-project/qemu/-/jobs/4289613692#L574
>
>   File "/builds/qemu-project/qemu/scripts/qapi/parser.py", line 566, in QAPIDoc
>     def _match_at_name_colon(string: str) -> Optional[re.Match[str]]:
> TypeError: 'type' object is not subscriptable

Life's too short for wrestling with such pigs.  Unless John has better
ideas, I'll *remove* these return type annotations.  Maybe these pigs
will behave after John's Python venv work lands.



  reply	other threads:[~2023-05-16  5:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 11:17 [PATCH] qapi/parser: Fix type hints Markus Armbruster
2023-05-16  0:30 ` Richard Henderson
2023-05-16  5:22   ` Markus Armbruster [this message]
2023-05-16 13:29     ` Richard Henderson
2023-05-17  6:19       ` Markus Armbruster
2023-05-17 17:14     ` Paolo Bonzini
2023-05-22  7:51       ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfbwx339.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.