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

BUG: fix wrong error checks of PyBytes_AsStringAndSize#5088

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
charris merged 1 commit intonumpy:masterfromjuliantaylor:not-fix
Sep 19, 2014

Conversation

@juliantaylor
Copy link
Contributor

The check in ufunc_type_resolution.c is broken due to a spurious not and
a few cases of TypeError being overwritten without clearing.
Also change all of these error checks to a negative check for
consistency.

@juliantaylor
Copy link
ContributorAuthor

rebased for backport

@charris
Copy link
Member

Certainly not wrong, but the< 0 check for negative error returns seems equally correct to me and is a common C construct.

@juliantaylor
Copy link
ContributorAuthor

its not wrong with current python, but the function is documented to return -1 not negative. As this type of error handling is so common its pretty much impossible python could change that but as I fixed one of them that was wrong my OCD forced me to fix all :)

@juliantaylor
Copy link
ContributorAuthor

currently numpy is half == -1 and half < 0, we alternatively could change all to < 0, that would make me happy too ;)

@charris
Copy link
Member

OCD is a common trait in programmers. It is a good thing :) I kind of like the< 0, but that may just be familiarity speaking. There are some numpy functions that can return various negative errors, so maybe<0 can be understood asany error and the== -1 as aspecific error.

The check in ufunc_type_resolution.c is broken due to a spurious not anda few cases of TypeError being overwritten without clearing.Also change all of these error checks to a negative check forconsistency.
@juliantaylor
Copy link
ContributorAuthor

changed all to < 0

charris added a commit that referenced this pull requestSep 19, 2014
BUG: fix wrong error checks of PyBytes_AsStringAndSize
@charrischarris merged commit2e3778a intonumpy:masterSep 19, 2014
@charris
Copy link
Member

Looks good, thanks Julian.

juliantaylor added a commit that referenced this pull requestSep 24, 2014
BUG: fix wrong error checks of PyBytes_AsStringAndSize
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@juliantaylor@charris

[8]ページ先頭

©2009-2025 Movatter.jp