Re: [Mesa-dev] [PATCH 10/26] python: Use explicit integer divisions

2018-07-05 Thread Dylan Baker
How about using future division (ala from __future__ import division), which makes division behave like python 3 division, So that >>> 32 / 4 8.0 >>> 32 // 4 8 (I'm really a fan of python 3's explicit integer and float division operators) Quoting Mathieu Bridon (2018-07-05 06:17:41) > In Pytho

Re: [Mesa-dev] [PATCH 10/26] python: Use explicit integer divisions

2018-07-05 Thread Eric Engestrom
On Thursday, 2018-07-05 15:17:41 +0200, Mathieu Bridon wrote: > In Python 2, divisions return an integer: > > >>> 32 / 4 > 8 > > In Python 3 though, they return floats: > > >>> 32 / 4 > 8.0 > > Explicitly converting to integers make the scripts compatible with both > Python 2 an

[Mesa-dev] [PATCH 10/26] python: Use explicit integer divisions

2018-07-05 Thread Mathieu Bridon
In Python 2, divisions return an integer: >>> 32 / 4 8 In Python 3 though, they return floats: >>> 32 / 4 8.0 Explicitly converting to integers make the scripts compatible with both Python 2 and 3. Signed-off-by: Mathieu Bridon --- src/gallium/auxiliary/util/u_format_pack.py