From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32506 invoked by alias); 7 Mar 2017 15:27:54 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 32488 invoked by uid 89); 7 Mar 2017 15:27:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*MI:sk:9676A09 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Mar 2017 15:27:51 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 89ABB2945F; Tue, 7 Mar 2017 10:27:50 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id twS8rCs-XFlF; Tue, 7 Mar 2017 10:27:50 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 60A25291DE; Tue, 7 Mar 2017 10:27:50 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 03311603C0; Tue, 7 Mar 2017 10:27:50 -0500 (EST) Date: Tue, 07 Mar 2017 15:27:00 -0000 From: Joel Brobecker To: "Wiederhake, Tim" Cc: "Jose E. Marchesi" , Yao Qi , "gdb-patches@sourceware.org" Subject: Re: MemoryView missing from Python 2.4 and 2.6 Message-ID: <20170307152749.qqy6gbktvv3uygll@adacore.com> References: <87o9xsx38r.fsf@oracle.com> <20170223225946.snir4ab6twc7vo7n@localhost> <9676A094AF46E14E8265E7A3F4CCE9AF9417D1@irsmsx105.ger.corp.intel.com> <86h93j7evn.fsf@gmail.com> <9676A094AF46E14E8265E7A3F4CCE9AF941DE1@irsmsx105.ger.corp.intel.com> <87wpca8onq.fsf@oracle.com> <20170307002119.ri3xv4cfxfkrb4gm@adacore.com> <9676A094AF46E14E8265E7A3F4CCE9AF9428CB@irsmsx105.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9676A094AF46E14E8265E7A3F4CCE9AF9428CB@irsmsx105.ger.corp.intel.com> User-Agent: Mutt/1.6.2-neo (2016-08-21) X-SW-Source: 2017-03/txt/msg00072.txt.bz2 > > It looks like the patch is also removing the feature from users of > > Python 2.7.x, though, is it not? > > The patch (see > https://sourceware.org/ml/gdb-patches/2017-03/msg00039.html) does not > remove any feature. The patch changes the return type of one function > from "memoryview" to "buffer" for Python 2.7 and below. Both types > support the "in" keyword, indexed access, length etc. and behave very > similar. Granted, memoryview has some additional functions that lets > the user inspect the stride and size of the elements in the buffer, > but this is a feature we do not use here anyway. > > I chose 2.7 as a parting point because that is how it is handled in > infpy_read_memory in py-inferior.c. Personally, I would leave it that > way because with "buffer" exposed with Python 2.7 as well as Python > 2.6 and below, I guess it gets more exposure and testing and won't > suffer bit-rot as easily. > > The patch is tested with Python 2.7 and Python 3.6. I cannot test it > with Python 2.6 but that should not be necessary as these two versions > already check both different return types. OK, that seems sensible for me indeed. Thanks for taking the time to explain! -- Joel