From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fencepost.gnu.org (fencepost.gnu.org [IPv6:2001:470:142:3::e]) by sourceware.org (Postfix) with ESMTPS id 29CD4395B403; Mon, 14 Jun 2021 18:12:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 29CD4395B403 Received: from pool-96-233-64-159.bstnma.fios.verizon.net ([96.233.64.159]:58486 helo=pdslaptop.home.arpa) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsr4T-0006bD-Sb; Mon, 14 Jun 2021 14:12:25 -0400 Message-ID: <027d6c9f6afd6b64a279cb698454309c1898f6a1.camel@gnu.org> Subject: [PATCH 2/2] libstdc++: Use template form for pretty-printing tuple elements From: Paul Smith Reply-To: psmith@gnu.org To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Date: Mon, 14 Jun 2021 14:12:25 -0400 Organization: GNU's Not UNIX! Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2021 18:12:27 -0000 std::tuple elements are retrieved via std::get<> (template) not [] (array); have the generated output string match this. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (StdTuplePrinter): Use <> not []. --- The previous patch seems uncontroversial to me. I don't know about this one: I'm not sure if there's any precedent for this type of output although to me it looks better since tuples cannot be retrieved via array indexing. libstdc++-v3/python/libstdcxx/v6/printers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index 14a6d998690..0063a3185a6 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -567,7 +567,7 @@ class StdTuplePrinter: if len (fields) > 0 and fields[0].name == "_M_head_impl": impl = impl['_M_head_impl'] - out = '[%d]' % self.count + out = '<%d>' % self.count self.count = self.count + 1 return (out, impl) -- 2.28.0