[Tutor] Problem with division in Python22
dman
dsh8290@rit.edu
Tue, 22 Jan 2002 10:34:28 -0500
On Tue, Jan 22, 2002 at 08:13:14AM +0100, Gregor Lingl wrote:
| Thanks, this works!
|
| But hasn't this to be considered as a bug,
| as it breaks code developed for up to 2.2?
Not a bug, but an incompatible change. The whole "true division"
thing is an incompatible change, so apparently the magic method name
has changed correspondingly.
Taking a look at the PEP shows the following snippets :
During the transitional phase, we have to support *three* division
operators within the same program:
<...>
In Python 3.0, the classic division semantics will be removed; the
classic division APIs will become synonymous with true division.
So yeah, old code will break, but it almost surely would have broken
anyways and at least this way you get an exception to tell you.
-D
--
"GUIs normally make it simple to accomplish simple actions and
impossible to accomplish complex actions."
--Doug Gwyn (22/Jun/91 in comp.unix.wizards)