Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Michael J Gruber <michaeljgruber@fa...> - 2004-10-14 09:09:52
|
Joerg Lehmann venit, vidit, dixit 2004-10-11 18:04: >>I submitted code which did that a while ago. I remember it was refused >>because this would force implicit "conversion of the units", i.e. >>application of scale factors at the time when __div__ is used. I'm not >>sure why this is a problem, but I'm not sure either whether I understand >>the lengths in PyX ;) > > > Yes, I remember that you've suggested the same some time ago and that we > have rejected your patch because of the implicit conversion which is > necessary to calculate the ratio. But thinking about it again, I'm not > sure whether this is a real problem. In fact, I don't think it is one. > The only thing which clearly doesn't make sense is the multiplication > of two lengths. > > So feel free to submit your patch again. Joerg Lehmann venit, vidit, dixit 2004-10-13 18:34: > I see, but still: supporting length divisions is probably a good idea. OK OK :) A diff to current CVS is attached. It uses isinstance, so it's not polymorphic - that would require a bit more code, since the return type of __div__ must depend on the input types (we don't want lengthparam/numberparam to result in lengthparam/length(numberparam) ). Cheers, Michael |