From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 91F1A3871036; Thu, 28 Sep 2023 20:56:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 91F1A3871036 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695934613; bh=rL+lhGLvJYti9EDUUujYitMcGQNZkEizxhTcLmSCup0=; h=From:To:Subject:Date:From; b=dIeYibSBSFWG3Ma1HNM+TbZKcS7YE8hjy0EeTfyJJtY8AxpFSD8uUmRJ/Mex9zJ5C V97EaRFFZC0OMqGJKxNC8hAwdtdloByXM27jrip4tLeclO5vTRyeMzS2iq0x8YAlfq qZ/nsUIdSbvRkTH1YBOOvVbxtQ+IZwDR4oirk6rk= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Tom Tromey To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-4323] libstdc++: Use Python "not in" operator X-Act-Checkin: gcc X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 860b284e3eea49e5bd49e6fe07c66e53faebb893 X-Git-Newrev: 202810947ca793b17653658e584008fb151e0937 Message-Id: <20230928205653.91F1A3871036@sourceware.org> Date: Thu, 28 Sep 2023 20:56:53 +0000 (GMT) List-Id: https://gcc.gnu.org/g:202810947ca793b17653658e584008fb151e0937 commit r14-4323-g202810947ca793b17653658e584008fb151e0937 Author: Tom Tromey Date: Wed Sep 27 09:26:01 2023 -0600 libstdc++: Use Python "not in" operator flake8 warns about code like not something in "whatever" Ordinarily in Python this should be written as: something not in "whatever" This patch makes this change. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (Printer.add_version) (add_one_template_type_printer) (FilteringTypePrinter.add_one_type_printer): Use Python "not in" operator. Diff: --- libstdc++-v3/python/libstdcxx/v6/printers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index e530cfc0e3a..23efbd171ec 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -2355,7 +2355,7 @@ class Printer(object): # Add a name using _GLIBCXX_BEGIN_NAMESPACE_VERSION. def add_version(self, base, name, function): self.add(base + name, function) - if _versioned_namespace and not '__cxx11' in base: + if _versioned_namespace and '__cxx11' not in base: vbase = re.sub('^(std|__gnu_cxx)::', r'\g<0>%s' % _versioned_namespace, base) self.add(vbase + name, function) @@ -2527,7 +2527,7 @@ def add_one_template_type_printer(obj, name, defargs): printer = TemplateTypePrinter('std::__debug::' + name, defargs) gdb.types.register_type_printer(obj, printer) - if _versioned_namespace and not '__cxx11' in name: + if _versioned_namespace and '__cxx11' not in name: # Add second type printer for same type in versioned namespace: ns = 'std::' + _versioned_namespace # PR 86112 Cannot use dict comprehension here: @@ -2628,7 +2628,7 @@ class FilteringTypePrinter(object): def add_one_type_printer(obj, template, name, targ1=None): printer = FilteringTypePrinter('std::' + template, 'std::' + name, targ1) gdb.types.register_type_printer(obj, printer) - if _versioned_namespace and not '__cxx11' in template: + if _versioned_namespace and '__cxx11' not in template: ns = 'std::' + _versioned_namespace printer = FilteringTypePrinter(ns + template, ns + name, targ1) gdb.types.register_type_printer(obj, printer)