Skip to content

TYP: Spelling alignment for array flag literal#22447

Merged
charris merged 1 commit intonumpy:mainfrom
knappa:writeable-v-writable
Oct 17, 2022
Merged

TYP: Spelling alignment for array flag literal#22447
charris merged 1 commit intonumpy:mainfrom
knappa:writeable-v-writable

Conversation

@knappa
Copy link
Copy Markdown
Contributor

@knappa knappa commented Oct 17, 2022

The documentation for array flags and _GetItemKeys in numpy/core/multiarray.pyi use the spelling WRITEABLE while _SetItemKeys in numpy/core/multiarray.pyi uses WRITABLE. This PR adds an E.

@knappa
Copy link
Copy Markdown
Contributor Author

knappa commented Oct 17, 2022

The reason this came up was because of mypy giving the error:

error: Invalid index type "Literal['WRITEABLE']" for "flagsobj"; expected type "Literal['A', 'ALIGNED', 'W', 'WRITABLE', 'X', 'WRITEBACKIFCOPY']"

on my code:

vertex.flags['WRITEABLE'] = False

@charris charris merged commit ac39f38 into numpy:main Oct 17, 2022
@charris
Copy link
Copy Markdown
Member

charris commented Oct 17, 2022

Thanks @knappa, this seems consistent with the other *.pyi files. It also got me searching WRITABLE vs WRITEABLE, and, wouldn't you know it, cpython defines both PyBUF_WRITABLE and PyBUF_WRITEABLE with the latter an alias of the first. We use both versions in our code, that's just crazy :(

@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Oct 17, 2022
@charris charris added this to the 1.23.5 release milestone Oct 17, 2022
@knappa knappa deleted the writeable-v-writable branch October 20, 2022 20:30
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Nov 15, 2022
@charris charris removed this from the 1.23.5 release milestone Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants