From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80362 invoked by alias); 20 Sep 2016 17:11:20 -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 80343 invoked by uid 89); 20 Sep 2016 17:11:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=D*dell.com X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Sep 2016 17:11:09 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4EE393D95C; Tue, 20 Sep 2016 17:11:08 +0000 (UTC) Received: from localhost (ovpn-116-66.ams2.redhat.com [10.36.116.66]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8KHB7eL007296; Tue, 20 Sep 2016 13:11:07 -0400 Date: Tue, 20 Sep 2016 18:20:00 -0000 From: Jonathan Wakely To: Paul.Koning@dell.com Cc: palves@redhat.com, gdb-patches@sourceware.org Subject: Re: [PATCH] Implement floordiv operator for gdb.Value Message-ID: <20160920171107.GE5736@redhat.com> References: <20160920132633.GA897@redhat.com> <883c76d5-54e9-e8fe-5713-eec2c4010498@redhat.com> <20160920163556.GB5736@redhat.com> <1196FC25-F9EC-4A16-B675-19AA200E7B94@dell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1196FC25-F9EC-4A16-B675-19AA200E7B94@dell.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.7.0 (2016-08-17) X-SW-Source: 2016-09/txt/msg00235.txt.bz2 On 20/09/16 17:00 +0000, Paul.Koning@dell.com wrote: > >> On Sep 20, 2016, at 12:35 PM, Jonathan Wakely wrote: >> >>> ... >> >> This seems to be an existing property of gdb.Value, as even using the >> normal division operator (and without my patch) I see floats printed >> without a decimal part when they are an integer value: >> >> (gdb) python print (gdb.Value(5.0)/5.0) >> 1 >> (gdb) python print (5.0/5.0) >> 1.0 > >In all this, please keep in mind that this is one place where Python 2 and Python 3 differ: Right, see https://sourceware.org/ml/gdb-patches/2016-09/msg00221.html for a crazy idea that would make gdb.Value match the Python version it's built against. That wouldn't help for Python 2 using __future__ division though.