Skip to content

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

Merged
serhiy-storchaka merged 1 commit intopython:masterfrom
serhiy-storchaka:tests-ndarray-readonly-bool
Jul 26, 2018
Merged

bpo-34201: Make ndarray.readonly a bool and use stricter tests in test_buffer.#8414
serhiy-storchaka merged 1 commit intopython:masterfrom
serhiy-storchaka:tests-ndarray-readonly-bool

Conversation

@serhiy-storchaka
Copy link
Copy Markdown
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
Comment thread Lib/test/test_buffer.py
itemsize, fmt, readonly,
ndim, shape, strides,
lst, sliced=False, cast=False):
# Verify buffer contents against expected values. Default values
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread Lib/test/test_buffer.py

# 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
Copy Markdown
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