Skip to content

bpo-34201: Make ndarray.readonly a bool and use stricter tests in test_buffer. #8414

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

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jul 23, 2018

@serhiy-storchaka serhiy-storchaka merged commit e0d67f1 into python:master Jul 26, 2018
@serhiy-storchaka serhiy-storchaka deleted the tests-ndarray-readonly-bool branch July 26, 2018 10:23
def verify(self, result, *, obj,
itemsize, fmt, readonly,
ndim, shape, strides,
lst, sliced=False, cast=False):
# Verify buffer contents against expected values. Default values
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment that gives the rationale for the curious initialization no longer applies.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in #8481.

@@ -978,7 +978,7 @@ def match(req, flag):
lst = nd.tolist()

# The consumer may have requested default values or a NULL format.
ro = 0 if match(req, PyBUF_WRITABLE) else ex.readonly
ro = not match(req, PyBUF_WRITABLE) and ex.readonly
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please use the previous version, just replacing 0 with False?

I can accept not p or q for implication, but this goes too far IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants