From nobody Tue Feb 10 03:44:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676419316; cv=none; d=zohomail.com; s=zohoarc; b=H4DbzDrGBncI7NVRADC8wbEbceMlE1g089VVnsDazm9hbh3yROonqI8lb80p0vwVJ5KE2qBInqlRvfkKtMPgYxOE9j8loMmQUI6f9Nl7rtb7U7QtR29YA47E0lfefg8PjYGJIfMsQKXrhy4RRyrZRrqkwQ3N0TUxcJbb47JX44c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676419316; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HU1jeQLkV0DEsvjcwUl8N0bkBEMQ1Qv9AWQ1zKgfnzo=; b=aa7bKzmpnV9mw+rrVemNUf4t+mMmMhVGNFdasO0gQpR+BHhQ2t3Dbdx1/c/uTp0JyetTU+IhLDMCzrgn4QmcpzLuGAPcukR4MHM8k9fzKpHA5nWmMRTlLUxA/erghLKHOsR2g0RucOTYM8nZ1niDaD9Qz6QefIRQxMcGZEzHZzU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676419316698105.48839825006633; Tue, 14 Feb 2023 16:01:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pS5E0-0006FU-2O; Tue, 14 Feb 2023 19:00:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pS5Df-0006CE-9A for qemu-devel@nongnu.org; Tue, 14 Feb 2023 19:00:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pS5Dd-00076U-4T for qemu-devel@nongnu.org; Tue, 14 Feb 2023 19:00:18 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-675-o4VyHOg1N5qCFFE1580Fgw-1; Tue, 14 Feb 2023 19:00:13 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E70CD3C0E463; Wed, 15 Feb 2023 00:00:12 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.16.119]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA54B2166B26; Wed, 15 Feb 2023 00:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676419216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HU1jeQLkV0DEsvjcwUl8N0bkBEMQ1Qv9AWQ1zKgfnzo=; b=ZeHvU+9bpnE9ProVBR4GAFCy0t8HvX6hGwCGx4iyNUFdmpAx+lUbR0vDHAu4ZEhjS9phRw rHu8Rz02s7lQW64P/8YEaGerccr4r7a9ICY4IxVSmOc/ZSDsfcCuEis6Bh4BhOgIJ1UqTv qTRw0Yb1Npp3BAgTqgB0z0SVu3+tOyw= X-MC-Unique: o4VyHOg1N5qCFFE1580Fgw-1 From: John Snow To: qemu-devel@nongnu.org Cc: Markus Armbruster , Michael Roth , John Snow Subject: [PATCH v4 5/6] qapi: remove _JSONObject Date: Tue, 14 Feb 2023 19:00:10 -0500 Message-Id: <20230215000011.1725012-6-jsnow@redhat.com> In-Reply-To: <20230215000011.1725012-1-jsnow@redhat.com> References: <20230215000011.1725012-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676419317246100001 Content-Type: text/plain; charset="utf-8" We can remove this alias as it only has two usages now, and no longer pays for the confusion of "yet another type". Signed-off-by: John Snow Reviewed-by: Markus Armbruster --- scripts/qapi/expr.py | 13 +++---------- scripts/qapi/parser.py | 5 ++--- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index 52153a2eec5..fc4defecc8e 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -48,14 +48,6 @@ from .source import QAPISourceInfo =20 =20 -# Deserialized JSON objects as returned by the parser. -# The values of this mapping are not necessary to exhaustively type -# here (and also not practical as long as mypy lacks recursive -# types), because the purpose of this module is to interrogate that -# type. -_JSONObject =3D Dict[str, object] - - # See check_name_str(), below. valid_name =3D re.compile(r'(__[a-z0-9.-]+_)?' r'(x-)?' @@ -192,7 +184,7 @@ def check_defn_name_str(name: str, info: QAPISourceInfo= , meta: str) -> None: info, "%s name should not end in 'List'" % meta) =20 =20 -def check_keys(value: _JSONObject, +def check_keys(value: Dict[str, object], info: QAPISourceInfo, source: str, required: Sequence[str], @@ -256,7 +248,8 @@ def check_flags(expr: QAPIExpression) -> None: expr.info, "flags 'allow-oob' and 'coroutine' are incompatible= ") =20 =20 -def check_if(expr: _JSONObject, info: QAPISourceInfo, source: str) -> None: +def check_if(expr: Dict[str, object], + info: QAPISourceInfo, source: str) -> None: """ Validate the ``if`` member of an object. =20 diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 50906e27d49..d570086e1a9 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -42,9 +42,8 @@ _ExprValue =3D Union[List[object], Dict[str, object], str, bool] =20 =20 -# FIXME: Consolidate and centralize definitions for _ExprValue, -# JSONValue, and _JSONObject; currently scattered across several -# modules. +# FIXME: Consolidate and centralize definitions for _ExprValue and +# JSONValue; currently scattered across several modules. =20 =20 class QAPIExpression(Dict[str, object]): --=20 2.39.0