-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-33089: Add math.dist() for computing the Euclidean distance between two points #8561
Conversation
Modules/mathmodule.c
Outdated
|
||
} | ||
diffs = (double *) PyObject_Malloc(n * sizeof(double)); | ||
if (diffs == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces are required here (PEP7).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay.
Modules/mathmodule.c
Outdated
diffs = (double *) PyObject_Malloc(n * sizeof(double)); | ||
if (diffs == NULL) | ||
return NULL; | ||
for (i=0 ; i<n ; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always put spaces around assignment, Boolean and comparison operators (PEP7).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Historically, we haven't done this inside for-loops.
result = 0.0; | ||
goto done; | ||
} | ||
for (i=0 ; i<n ; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always put spaces around assignment, Boolean and comparison operators (PEP7).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Historically, we haven't done this inside for-loops.
Hi, thanks for a great language. Not sure if this is the right place to add this comment. Anyways, was adding other norms ever under consideration? For instance, |
https://bugs.python.org/issue33089