From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D952FC433E0 for ; Mon, 11 Jan 2021 21:16:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E85A22571 for ; Mon, 11 Jan 2021 21:16:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728715AbhAKVQJ (ORCPT ); Mon, 11 Jan 2021 16:16:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbhAKVQI (ORCPT ); Mon, 11 Jan 2021 16:16:08 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8952C06179F for ; Mon, 11 Jan 2021 13:15:27 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id u4so309889pjn.4 for ; Mon, 11 Jan 2021 13:15:27 -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=mS2w+DBB5fq5FWrKRFlEi4QLtkNj5g+2gEs0VX75X7c=; b=n9wWaEdHykBtIwCE4rgA2mQ2kNrhCBy2DCUqJ/kYfiJpUuXJ5WP/9o9mQJOo8QF96t SmuqaEfeYNkLVoh4oxeVC+7gGDg449euxtpqecjwXks0O0OB/RkMeTNmhbcR1ti6v6k+ fRY4MxGv9Bx96adln74uEhMRyk7+Uyzv8OIB4UpcRkh2HabTkIYeUGVOxvddUg8XUMlG UD5UhvdLAHVyr6kUmxZzUtUaDAz9eaWB1o7g0UOCaLp3Vfko/aSqyjct1AgSu6FwBVuE amqPIvUWb+s/15N9WyXbYT7xw2vEu3NNJqPY2F22YOadO6yqIX8PgwTUATGWXKzHhS+F OcaA== 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=mS2w+DBB5fq5FWrKRFlEi4QLtkNj5g+2gEs0VX75X7c=; b=CONWcQvUtJnABnzhRfjn8PGIjRAKCafzEdZ0UpS79QWRB/ohyhMBZXEbCM/0ad59tX lfOyUpbSYQECm+WZoV3bXbK9T+SX8hgUZ2/mwhldF5k05fI4JaTlpuwMbb7q9KTDH/GM 2HdKLMrZpWHQpxvBJyMKuQmGXcMvTmloKepyYl27vpQNNxCJyUUjU4pWLcWf6fO2j+wb PJC/x3TSg5Il+nzZhqr7g+PySsiZMKhEoj6fmzaAjORhUuN8vLRVeNcVCylyIUZBVVjN dkdcthKmTgLGyzdAZ58nRY1FrqbZVlU1Be6FrqgD2x+ktHLvefXKIlkZj31ZVOSLu1LN NaiQ== X-Gm-Message-State: AOAM532y+H/rLEDvVJRVTmkljrzQV+a4zOCpUBb2/9qXuZF6ABfsso6g fPtl9Wb5+rKAq9XJxHbvQBHeOvfI94JNklKlETErrA== X-Google-Smtp-Source: ABdhPJzE1mrw7DKtcQjeXzBPHlASp6nM1YDJMJYW41Elq59fts2qz6S0s858oobAohAIkz/AexgwIQwUcz+aE0pDOIU= X-Received: by 2002:a17:90a:de03:: with SMTP id m3mr867055pjv.20.1610399727186; Mon, 11 Jan 2021 13:15:27 -0800 (PST) MIME-Version: 1.0 References: <20210107234803.1096592-1-dlatypov@google.com> In-Reply-To: <20210107234803.1096592-1-dlatypov@google.com> From: Brendan Higgins Date: Mon, 11 Jan 2021 13:15:15 -0800 Message-ID: Subject: Re: [PATCH v3 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 7, 2021 at 3:48 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 Acked-by: Brendan Higgins