[Bf-committers] Re: [Bf-blender-cvs] CVS commit:
blender/source/blender/src interface.c
Toni Alatalo
antont at kyperjokki.fi
Mon Dec 4 09:06:42 CET 2006
Martin Poirier kirjoitti:
> Word of warning: The normal Python operator logic applies, so if you type in 1 / 3, you'll get 0 and not 0.333. There's no going around that.
>
could we make the new/future style python division mode default there?
it makes the / operator a float op, and if you want int division you do //
In [1]: from __future__ import division
In [2]: 3 / 2
Out[2]: 1.5
In [3]: 3 // 2
Out[3]: 1
i think that is what makes sense for people and especially little
scripting in buttons - i guess is kept the old way in Py 2 only for bw
compat reasons and that Py 3000 will default to that. i dont know how to
initialize that context in c for the numbuts but probably it is
straightforward enough..
~Toni
More information about the Bf-committers
mailing list