Why Python 3?

Chris Angelico rosuav at gmail.com
Sat Apr 19 21:28:28 EDT 2014


On Sun, Apr 20, 2014 at 11:06 AM, Gregory Ewing
<greg.ewing at canterbury.ac.nz> wrote:
> Chris Angelico wrote:
>>
>> I'd rather have to explicitly request floating-point division;
>
>
> When you write / in Python 3, you *are* explicitly requesting
> floating-point division.
>
> Similarly, when you write // you're explicitly requesting
> integer division.
>
> I don't see the problem. You write whatever you mean and it
> does what you tell it to do.

Truncating vs true is not the same as int vs float. If you mean to
explicitly request float division, you call float() on one or both
arguments. You're being explicit about something different.

ChrisA



More information about the Python-list mailing list