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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 8BB62C433DB for ; Thu, 25 Feb 2021 15:29:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EFBC964F18 for ; Thu, 25 Feb 2021 15:29:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFBC964F18 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:54304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFIZg-0007AN-Tl for qemu-devel@archiver.kernel.org; Thu, 25 Feb 2021 10:29:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFIYp-0006EQ-PG for qemu-devel@nongnu.org; Thu, 25 Feb 2021 10:28:17 -0500 Received: from oxygen.pond.sub.org ([94.130.129.15]:46756) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFIYk-0004qH-3W for qemu-devel@nongnu.org; Thu, 25 Feb 2021 10:28:14 -0500 Received: from blackfin.pond.sub.org (p200300d36f2e0300dacb8afffee0c842.dip0.t-ipconnect.de [IPv6:2003:d3:6f2e:300:dacb:8aff:fee0:c842]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by oxygen.pond.sub.org (Postfix) with ESMTPSA id 522AC2087B; Thu, 25 Feb 2021 16:28:06 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8892F113860F; Thu, 25 Feb 2021 16:28:02 +0100 (CET) From: Markus Armbruster To: John Snow Subject: Re: [PATCH v3 15/16] qapi/expr.py: move related checks inside check_xxx functions References: <20210223003408.964543-1-jsnow@redhat.com> <20210223003408.964543-16-jsnow@redhat.com> Date: Thu, 25 Feb 2021 16:28:02 +0100 Message-ID: <87r1l488vx.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=94.130.129.15; envelope-from=armbru@pond.sub.org; helo=oxygen.pond.sub.org X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Roth , Cleber Rosa , qemu-devel@nongnu.org, Eduardo Habkost Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" John Snow writes: > There's not a big obvious difference between the types of checks that > happen in the main function versus the kind that happen in the > functions. Now they're in one place for each of the main types. > > As part of the move, spell out the required and optional keywords so > they're obvious at a glance. Use tuples instead of lists for immutable > data, too. > > Signed-off-by: John Snow > Reviewed-by: Cleber Rosa No objection to changing read-only lists to tuples (applies to previous patch, too). No objection to turning positional into keyword arguments where that improves clarity. I have doubts on the code motion. Yes, the checks for each type are now together. On the other hand, the check_keys() are now separate. I can no longer see all the keys at a glance.