Anelok: next round of case parts 1/2: fixing issues

Werner Almesberger werner at almesberger.net
Sun Jan 25 05:56:43 UTC 2015


Bas Wijnen wrote:
> If you want to be future-proof, you probably want to use python3, in
> which 3/2 == 1.5 (and 4/2 == 2.0, not 2); you have to specify integer
> division explicitly as 3//2 there.

Oooh, that explains everything. That's a pretty fundamental change to
make in a widely deployed language.

I had found the // (and I'm using it at a place where I need integer
division) and then foolishly assumed that / was just general-purpose
division, since they had the integer case already covered.

I didn't relize that this is a mix with a Python 3-ism.

Thanks for the explanation !

I'd prefer to not require specific language versions, also because
others - e.g., FreeCAD - may make that choice for me. I guess I'll be
fine with either version if I just stick to explicit floating-point
numbers, e.g., 3.0 / 2

Hmm, just saw that they removed (converted) the print statement in
version 3. And I thought the gcc folks were reckless ;-)

- Werner



More information about the discussion mailing list


interactive