All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Tim Pambor <timpambor@gmail.com>
Cc: qemu-devel@nongnu.org, Hanna Reitz <hreitz@redhat.com>,
	qemu-block@nongnu.org, qemu-trivial@nongnu.org
Subject: Re: [PATCH] iotests: annotate TestRunner.shared_self for mypy 2.4
Date: Mon, 5 Oct 2026 12:23:07 +0200	[thread overview]
Message-ID: <asN6i85AhFG2-ORq@redhat.com> (raw)
In-Reply-To: <20261002-mypy-2-4-v1-1-185c406d1cbd@gmail.com>

Am 02.10.2026 um 09:04 hat Tim Pambor geschrieben:
> mypy 2.4.0 infers the unannotated class attribute "shared_self = None"
> as having type "None" and rejects the later assignment of a TestRunner
> instance in run_tests_pool():
> 
>   testrunner.py:126: error: Incompatible types in assignment
>   (expression has type "TestRunner", variable has type "None")
> 
> Earlier mypy versions treated the attribute as a partial type and
> accepted the assignment. Give the attribute an explicit
> Optional['TestRunner'] annotation so both old and new mypy agree.
> 
> Fixes tests/linters.py::TestLinters::test_mypy_iotests with mypy >= 2.4.
> 
> Signed-off-by: Tim Pambor <timpambor@gmail.com>
> ---
> CI run with mypy 2.4: https://gitlab.com/tpambor/qemu/-/pipelines/2905639361

Thanks, applied to the block branch.

Kevin



      reply	other threads:[~2026-10-05 10:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02  7:04 [PATCH] iotests: annotate TestRunner.shared_self for mypy 2.4 Tim Pambor
2026-10-05 10:23 ` Kevin Wolf [this message]

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=asN6i85AhFG2-ORq@redhat.com \
    --to=kwolf@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=timpambor@gmail.com \
    /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.