Skip to content

MNT: Rename check_getitem to getitem_checked#31082

Merged
QuLogic merged 1 commit intomatplotlib:mainfrom
timhoffm:getitem_checked
Feb 5, 2026
Merged

MNT: Rename check_getitem to getitem_checked#31082
QuLogic merged 1 commit intomatplotlib:mainfrom
timhoffm:getitem_checked

Conversation

@timhoffm
Copy link
Member

@timhoffm timhoffm commented Feb 5, 2026

Extracted from #31071 (comment)

check_getitem() is somewhat different from the other check_* methods. Both do some form of input validation and error out with a nice error message. But while the check_* only do an assertion, check_getitem() retrieves a value. It's also the only function that has a return value.

A function named check_... should not return something (or if it returns something, it'd intuitively return the result of the check). I therefore propose that re rename check_getitem() to getitem_checked() or similar.

@QuLogic QuLogic added this to the v3.11.0 milestone Feb 5, 2026
@QuLogic QuLogic merged commit c1e4831 into matplotlib:main Feb 5, 2026
36 of 39 checks passed
@timhoffm timhoffm deleted the getitem_checked branch February 5, 2026 12:49
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.

3 participants