On 1/27/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > Orri, > > > Eh you mean to say that in next Python versions someone could decide > > to change cmp(x,0) to another meaning? I bet my countryman (I'm from > > Holland too ;-) ) will veto that! Or else I'll pay him a visit :D > > Its not another meaning, its the current meaning. > Kent is just pointing out that while the default cmp currently > returns -1,0,1 > there is nothing to stop a user defined cmp fom returning any negative or > positive number instead of -1,1. And cmp() calls any user defined cmp > under the hood. > > In theory the standard cmp could be changed in future although its > unlikely.. > So while it is a nice trick it cannot be relied upon since it depends on a > detail of implementation. In practice I suspect you are fairly safe :-) > > Alan G > >
Ok. Well I needed it to reflect -, 0 or + anyways so I should be safe. I needed it to find out the direction of a chessmove so pawns could not walk back and with that and the MIN and the MAX function I could do with 1 for+while loops per direction (hor, vert or diag). Oh, I am now on 32 hours of coding and started with 0 knowledge of Python, PIL and/or Pygame and the 1st release should be out soon :-) Just need to fix castling, promotion and en passant and I'm done! I LOVE PYTHON. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor