Why Python 3?

Chris Angelico rosuav at gmail.com
Mon Apr 21 00:43:59 EDT 2014


On Mon, Apr 21, 2014 at 1:43 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
>> Explicitly choosing float division:
>>
>> x / float(y)
>
> But here you're not choosing an *operator*, you're choosing a *type*.
> With this model, how do I distinguish between floor division and true
> division using, say, Fractions?

Earlier it was said that having both / and // lets you explicitly
choose whether you want a float result or an int by picking an
operator. I'm saying that's not so; the operator and the type aren't
quite orthogonal, but close to.

ChrisA



More information about the Python-list mailing list