Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] Use __future__ to enable floating-point division of integers in Python 2.
Date: Mon, 11 Aug 2014 21:06:43
Message-Id: 20140811230619.12acc2d0@pomiot.lan
In Reply to: [gentoo-portage-dev] [PATCH] Use __future__ to enable floating-point division of integers in Python 2. by "Michał Górny"
1 Dnia 2014-08-06, o godz. 19:26:08
2 Michał Górny <mgorny@g.o> napisał(a):
3
4 > In Python 2, the division ('/') operator defaults to integer
5 > (truncating) division when given integer argument. In Python 3, it
6 > performs floating-point division unconditionally instead. To overcome
7 > this difference and get a consistent behavior, integers were converted
8 > to floats explicitly in a few places.
9 >
10 > Instead, use a simpler 'from __future__ import division' statement that
11 > enables floating-point division globally in Python 2.
12
13 The updated patch is in git now.
14
15 --
16 Best regards,
17 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature