Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MAINT: Remove duplicated logic between array_wrap and array_prepare#10459

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mhvk merged 1 commit intonumpy:masterfromeric-wieser:func_lookup_deduplicate
Jan 25, 2018

Conversation

@eric-wieser
Copy link
Member

@eric-wiesereric-wieser commentedJan 23, 2018
edited
Loading

This behaves exactly as before

Part of the cleanup needed to fix#10450

Copy link
Contributor

@mhvkmhvk left a comment

Choose a reason for hiding this comment

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

Only a question about whether you'd not rather check for a tuple here as well. Fine to do that in a follow-up PR, though.

Copy link
Contributor

Choose a reason for hiding this comment

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

You are on purpose not yet checking whether theout argument is a tuple, correct?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'm on purpose just leaving it as it was - I want to push theout argument parsing way upstream

@eric-wieser
Copy link
MemberAuthor

Actually, I should try to keep the comments from the function I removed - so don't merge this yet

@eric-wieser
Copy link
MemberAuthor

Updated with comments and slightly more efficient code.

Copy link
Contributor

Choose a reason for hiding this comment

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

There are now three times in which you have the incref and return ofinput_method. How about inverting the logic, and move the next two lines to the very end, as the fall-back opion, i.e.,

PyObject *ometh;if obj != Py_None` {    if (PyArrayCheckExact(obj)) {        return Py_RETURN_NONE;    }    ometh = ...    if (ometh) {        if(PyCallable_Check(ometh)) {            return ometh;        }        else {            Py_DECREF(ometh);        }    }    else {        PyErr_Clear();    }}Py_XINCREF(input_method);return input_method;

@eric-wieser
Copy link
MemberAuthor

Should be ready

@mhvk
Copy link
Contributor

All OK now, merging!

@mhvkmhvk merged commit9404833 intonumpy:masterJan 25, 2018
eric-wieser added a commit to eric-wieser/numpy that referenced this pull requestJan 26, 2018
…lt to inherit the output's maskThis brings `np.add(a, b, out)` in line with  `np.add(a, b, out=out)`.These previously differed becausenumpygh-10459 causes them to call __array_wrap__ in different ways (with and without the output argument in the context tuple, respectively).Since the data in the `out` argument is never used by ufuncs, it seems consistent that the mask should not be either.
charris pushed a commit to charris/numpy that referenced this pull requestFeb 9, 2018
Currently, this causes the result to inherit the output's mask.This brings `np.add(a, b, out)` in line with  `np.add(a, b, out=out)`.These previously differed becausenumpygh-10459 causes them to call__array_wrap__ in different ways (with and without the output argumentin the context tuple, respectively).Since the data in the `out` argument is never used by ufuncs, it seemsconsistent that the mask should not be either.
hanjohn pushed a commit to hanjohn/numpy that referenced this pull requestFeb 15, 2018
…lt to inherit the output's maskThis brings `np.add(a, b, out)` in line with  `np.add(a, b, out=out)`.These previously differed becausenumpygh-10459 causes them to call __array_wrap__ in different ways (with and without the output argument in the context tuple, respectively).Since the data in the `out` argument is never used by ufuncs, it seems consistent that the mask should not be either.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@mhvkmhvkmhvk approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@eric-wieser@mhvk

[8]ページ先頭

©2009-2025 Movatter.jp