Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp98555pxb; Thu, 14 Jan 2021 20:31:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzssMoWriKIOrlUzp8jDP7qeslCzW2yzsLn7WNPCpbqV0sxjkaIs/SsuW/nfnoVEu/R7apH X-Received: by 2002:a17:906:87c3:: with SMTP id zb3mr7621995ejb.244.1610685104770; Thu, 14 Jan 2021 20:31:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610685104; cv=none; d=google.com; s=arc-20160816; b=b13qukW91yz5ful4nV0clfh3I6Fpe0LHjNrT4UupRUTMe/3rA92gvK//35ItXOoN1u NhZnnqS6cWsjQyVV8L9Sst9yu1fjh25grfbflIsduIj/MUyEF3vhycdqQr5IVQ+9YXgo 120HiG/qQwePiXsO2DUzzQe9+rsg5fQj5E4Zs/kYTAZKGf14AKIapfi+zcR1K5Vvzhuh V28/qFkVAM2LTyBjUbSmShNzi/03VKF0AIIZz7bwl2XCfvgDsF1XVHuklRsLyuegC7X+ 7z41qb6jUIosJIie/My3LvMkn4Cl8cSVrc+Bs/aINDMti2VtSiQToDVFJXxtiSzqKlNT 7rpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/td70cr+yDErqlpQZSN0xSXqF6ggiQpM1ujSGmXKino=; b=vXjzIoJYJSG0LfsHLBR5qNccx/bY3Wa7flHMuqAaKUpZBWfULDbCLzOyg6Kc1GoiNO z0dKMPfDroiFXuOMrGIpFMp3bdKe2tP35VJPo8DqsSnXMrcNWVImKBBosCgDnJlCuQQd iyG7B4mleyg3+JDYaphRG/YOLvmDTr/PGT7aRd72RiHYn5YAuOCnZGvIZouWP9yosgrH XzJhwM1tlDW/tur8tTrOHIqmF2AYNR6rqZrZFCzLnLXy3oDe5OYyAd58PHkU2m5UlToy OkInFopmUVLC3khUHxavO8ttcKIK1EBY2T6k8GOGAIFp77Q47lsBhZuTEqHNVY4/zAFK z7yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="i/N5cWKJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si1313263eja.449.2021.01.14.20.31.21; Thu, 14 Jan 2021 20:31:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="i/N5cWKJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731451AbhAOAwg (ORCPT + 99 others); Thu, 14 Jan 2021 19:52:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727632AbhAOAwf (ORCPT ); Thu, 14 Jan 2021 19:52:35 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70421C0613C1 for ; Thu, 14 Jan 2021 16:51:55 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id md11so4104371pjb.0 for ; Thu, 14 Jan 2021 16:51:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/td70cr+yDErqlpQZSN0xSXqF6ggiQpM1ujSGmXKino=; b=i/N5cWKJMXR9btra/mDwceUyegdLU1QW5FEaQo0CjdYVdBB9TZvuR9iqkQ1eRJRVI0 lXuUAI7SzLYPjlhoLqHpHh6VCT2GltZ68W6UyKIBmoliHySInQzKXXIRQ5ep/LL4y82J KT14p6G0C4UXnNzB79Kejka9hHfn9R2ldxvsXcLvDjOy33V9H6Y/NToBD8UufmfpRZIw 79PeUhWP/p53KrniAUqZTyMypIKrA3z4quawrTn/MXHPOiu5ZLjMqv3fp87OkXm7Fnpc snC2Xo//XlOQo+qCL6dluFthhzQuPkPlt1oayeJC4ZKP4/eo+itEW2+SAu1qzuOGAMaO PrIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/td70cr+yDErqlpQZSN0xSXqF6ggiQpM1ujSGmXKino=; b=g/R7W/33UKp1ArS/Xaujp0gkrrS6eRuG9vrvaPrBMYgdKxicUcVbDmhHR2d2iJj08a X6iXYMqapXJiqQhicZcxBLrl3T/E4K2cDPaw9yoT+XLDuoncg34EY/oq/eZWxM4P3X/P QY3d9N+SqKEgnr/T65zEhb+tIrfIzLK6rihcb67eySE9YnvnvFhEPhmiE1hfmMmSNQPy XwkDfa+6HYl/UJkOEhLcveEQNjxhshSIo4/Th21uJBD5UUMrH/jn03ZfJx6Hi3O+b7Ec uFPkOUPv/pBgW3g4BrarTAYeT/PyUI3KmBCx4ZXq2VdTGsh6W4IOS2gbH8eLvwOzTRh2 aL5A== X-Gm-Message-State: AOAM533C4tzOF9v/TLPHbdroZ+hnvtMb7BSaFD/VE7CfLDF4ZsgRMSL3 +lHrxHtF2Ll/5hH16P+nfp6fAfVVz3GOsvXIMPYiCA== X-Received: by 2002:a17:90a:de03:: with SMTP id m3mr8009830pjv.20.1610671914862; Thu, 14 Jan 2021 16:51:54 -0800 (PST) MIME-Version: 1.0 References: <20210115003913.1406896-1-dlatypov@google.com> In-Reply-To: <20210115003913.1406896-1-dlatypov@google.com> From: Brendan Higgins Date: Thu, 14 Jan 2021 16:51:44 -0800 Message-ID: Subject: Re: [PATCH v4 1/3] kunit: tool: surface and address more typing issues To: Daniel Latypov Cc: David Gow , Linux Kernel Mailing List , "open list:KERNEL SELFTEST FRAMEWORK" , Shuah Khan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 14, 2021 at 4:39 PM Daniel Latypov wrote: > > The authors of this tool were more familiar with a different > type-checker, https://github.com/google/pytype. > > That's open source, but mypy seems more prevalent (and runs faster). > And unlike pytype, mypy doesn't try to infer types so it doesn't check > unanotated functions. > > So annotate ~all functions in kunit tool to increase type-checking > coverage. > Note: per https://www.python.org/dev/peps/pep-0484/, `__init__()` should > be annotated as `-> None`. > > Doing so makes mypy discover a number of new violations. > Exclude main() since we reuse `request` for the different types of > requests, which mypy isn't happy about. > > This commit fixes all but one error, where `TestSuite.status` might be > None. > > Signed-off-by: Daniel Latypov > Reviewed-by: David Gow Tested-by: Brendan Higgins Acked-by: Brendan Higgins