[issue13355] random.triangular error when low = high=mode

2011-11-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: 3.2 doc entry: random.triangular(low, high, mode) Return a random floating point number N such that low <= N <= high and with the specified mode between those bounds. The low and high bounds default to zero and one. The mode argument defaults to the midpoint

[issue13355] random.triangular error when low = high=mode

2011-11-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've got this one. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue13355] random.triangular error when low = high=mode

2013-02-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +easy nosy: +serhiy.storchaka versions: +Python 3.4 ___ Python tracker ___ ___ Python-bugs-

[issue13355] random.triangular error when low = high=mode

2013-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue13355] random.triangular error when low = high=mode

2013-02-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue13355] random.triangular error when low = high=mode

2013-02-06 Thread Mark Dickinson
Mark Dickinson added the comment: > Here is a patch. Where? :-) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue13355] random.triangular error when low = high=mode

2013-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Now it is here. -- Added file: http://bugs.python.org/file28975/random_triangular.patch ___ Python tracker ___ ___

[issue13355] random.triangular error when low = high=mode

2013-02-06 Thread Mark Dickinson
Mark Dickinson added the comment: Looks fine to me. Raymond: can this be applied? -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue13355] random.triangular error when low = high=mode

2013-02-06 Thread Mark Dickinson
Mark Dickinson added the comment: One minor comment: I'd prefer it if the second test were "elif low == high:", since that more obviously guards against the division by zero. -- ___ Python tracker

[issue13355] random.triangular error when low = high=mode

2013-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > One minor comment: I'd prefer it if the second test were "elif low == > high:", since that more obviously guards against the division by zero. It is written deliberately. What if low == high != mode? -- ___ Pytho

[issue13355] random.triangular error when low = high=mode

2013-02-06 Thread Mark Dickinson
Mark Dickinson added the comment: > What if low == high != mode? Then we've got garbage in, garbage out; that case doesn't worry me. -- ___ Python tracker ___ _

[issue13355] random.triangular error when low = high=mode

2013-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: An exception is better than a garbage result. But I agree, triangular() currently is not protectet against a situation when mode is not in low--high range. -- ___ Python tracker

[issue13355] random.triangular error when low = high=mode

2013-02-06 Thread Mark Dickinson
Mark Dickinson added the comment: > An exception is better than a garbage result. Agreed. And ZeroDivisionError is the wrong exception, too---ValueError would be better. But I'm content that the current patch fixes the immediate issue. -- ___ Pyth

[issue13355] random.triangular error when low = high=mode

2013-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'll look at the patch shortly. At first glance, it looks over-engineered to me. -- ___ Python tracker ___

[issue13355] random.triangular error when low = high=mode

2013-04-07 Thread Yuriy Senko
Yuriy Senko added the comment: Added validation of input data. Check whether low <= mode <= high. If low == high return low as a result. -- nosy: +Chaka_bum, asvetlov Added file: http://bugs.python.org/file29709/issue_13355.patch ___ Python tracker

[issue13355] random.triangular error when low = high=mode

2013-04-11 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- versions: -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue13355] random.triangular error when low = high=mode

2013-04-11 Thread Andrew Svetlov
Andrew Svetlov added the comment: Test for the issue_13355.patch is incorrect, please fix. -- ___ Python tracker ___ ___ Python-bugs-l

[issue13355] random.triangular error when low = high=mode

2013-04-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset c40e36a49033 by Andrew Svetlov in branch '3.3': Issue #13355: Raise ValueError on random.triangular call with invalid params. http://hg.python.org/cpython/rev/c40e36a49033 New changeset 613eb432b152 by Andrew Svetlov in branch 'default': Issue #1335

[issue13355] random.triangular error when low = high=mode

2013-04-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1062c66e9bdc by Andrew Svetlov in branch '2.7': Issue #13355: Raise ValueError on random.triangular call with invalid params. http://hg.python.org/cpython/rev/1062c66e9bdc -- ___ Python tracker

[issue13355] random.triangular error when low = high=mode

2013-04-12 Thread Andrew Svetlov
Andrew Svetlov added the comment: Pushed. Yuriy Senko, thanks for patch. But, please, be more accurate with tests for another one. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue13355] random.triangular error when low = high=mode

2013-04-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: I haven't had a chance to look at this one yet and am reopening. The triangular code was originally written so that low and high could be reversed and it would still work. I don't want to break any code that might be relying on that. Andrew Svetlov, this

[issue13355] random.triangular error when low = high=mode

2013-04-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: Andrew Svetlov, please revert the commit. It breaks code that may have been working before the commit. Also, I don't want to change the exceptions being raised in old versions of Python. -- resolution: fixed -> _

[issue13355] random.triangular error when low = high=mode

2013-04-13 Thread Mark Dickinson
Mark Dickinson added the comment: I agree that the issue_13355.patch commit should be reverted: the code used to work fine in the case high < mode < low, and now does not. (Similarly, a call to random.uniform(2.0, 1.0) works as expected at the moment.) Really, I think all that's needed here i

[issue13355] random.triangular error when low = high=mode

2013-04-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset e948154af406 by Andrew Svetlov in branch '3.3': Revert changes for #13355 by request from Raymond Hettinger http://hg.python.org/cpython/rev/e948154af406 New changeset 39bbbf5d7b01 by Andrew Svetlov in branch 'default': Revert changes for #13355 by

[issue13355] random.triangular error when low = high=mode

2013-04-13 Thread Andrew Svetlov
Andrew Svetlov added the comment: Reverted. Sorry. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue13355] random.triangular error when low = high=mode

2013-04-26 Thread Mark Dickinson
Mark Dickinson added the comment: Raymond: have you had time to look at this yet? -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue13355] random.triangular error when low = high=mode

2013-04-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: Soonish -- priority: normal -> low ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue13355] random.triangular error when low = high=mode

2013-05-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: committed/rejected -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue13355] random.triangular error when low = high=mode

2013-05-28 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: -mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma