1/2 evaluates to 0

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Oct 12 07:56:27 EDT 2011


Nobody wrote:
> On 2011年10月12日 13:28:35 +0200, Laurent wrote:
>>>>>>> from __future__ import division
>>>>>> 1/2
>>> 0.5
>>>>>>> Wohaw. This means that this behavior is going to be default in a
>> foreseeable future ?
>> It's the default in 3.x. I can't imagine it ever being the default in 2.x.

2.7 is now in "bug-fix only" mode, so no new features, and there won't be a
2.8, so true division will never be the default in 2.x. 
-- 
Steven


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /