Skip to content

Conversation

@rhettinger
Copy link
Contributor

@rhettinger rhettinger commented Sep 14, 2019

… function.

While the _statistics helper is private and not intended to be called
directly, it is possible to do so.  That would bypass the parameter
validation checks in the pure python calling code.

Accordingly, we need to add parameter checks to avoid undefined
behavior (division by zero) or errors in the underlying functions
(negative square root or non-positive argument for logarithm).
Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhettinger LGTM for the code.
2 questions for this PR.

  1. Don't we have to add this logic for pure python version?

    def _normal_dist_inv_cdf(p, mu, sigma):

  2. We don't need unit tests for _normal_dist_inv_cdf with error handling?

@corona10
Copy link
Member

@rhettinger
When I think about it, the two cases above seem to be no problem
It's good to go :)

@rhettinger rhettinger merged commit 6e27a0d into python:master Sep 15, 2019
@rhettinger rhettinger deleted the statistics_undefined branch September 15, 2019 16:36
@bedevere-bot
Copy link

@rhettinger: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-16160 is a backport of this pull request to the 3.8 branch.

rhettinger added a commit that referenced this pull request Sep 15, 2019
… function. (GH-16149) (GH-16160)

(cherry picked from commit 6e27a0d)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants