◐ Shell
reader mode source ↗
Skip to content

gh-114894: add array.array.clear() method#114919

Merged
JelleZijlstra merged 14 commits into
python:mainfrom
mikeziminio:fix-issue-114894
Feb 10, 2024
Merged

gh-114894: add array.array.clear() method#114919
JelleZijlstra merged 14 commits into
python:mainfrom
mikeziminio:fix-issue-114894

Conversation

@mikeziminio

@mikeziminio mikeziminio commented Feb 2, 2024

Copy link
Copy Markdown
Contributor

@mikeziminio

Copy link
Copy Markdown
Contributor Author

@JelleZijlstra Jelle, I've added tests and documentation)

@JelleZijlstra JelleZijlstra self-requested a review February 2, 2024 19:28

@JelleZijlstra JelleZijlstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hide comment

Can you also add this to the What's New document for Python 3.13 (Doc/whatsnew/3.13.rst)?

@aisk

aisk commented Feb 3, 2024

Copy link
Copy Markdown
Member

In my personal view, according to the original issue, the intention behind adding the clear method is to allow array.array to implement collections.abc.MutableSequence, so we can add a test to test it and ensure we don't break it in the future.

There is already a relevant test case in

def test_MutableSequence(self):
, so what we need to do is simply include array.array in this existing test case.

mikeziminio and others added 4 commits February 6, 2024 09:32
Co-authored-by: AN Long <aisk@users.noreply.github.com>
…F-dSd.rst

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@mikeziminio

Copy link
Copy Markdown
Contributor Author

In my personal view, according to the original issue, the intention behind adding the clear method is to allow array.array to implement collections.abc.MutableSequence, so we can add a test to test it and ensure we don't break it in the future.

There is already a relevant test case in

def test_MutableSequence(self):

, so what we need to do is simply include array.array in this existing test case.

done

I added only the issubclass check (without isinstance), because for isinstance it would have to be check all typecodes.

@rhettinger rhettinger removed their request for review February 6, 2024 16:16
mikeziminio and others added 2 commits February 7, 2024 07:19
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@mikeziminio

Copy link
Copy Markdown
Contributor Author

@JelleZijlstra @aisk Guys, if I understand correctly, I made all the changes according to the reviews.
Please tell me what further steps are needed to merge the PR.

@aisk

aisk commented Feb 8, 2024

Copy link
Copy Markdown
Member

LGTM, I think the next step is to wait for a core member to approve and merge it.

@Jason-Y-Z

Copy link
Copy Markdown
Contributor

Thanks all for the efforts, sorry for tagging but gentle nudge to @vstinner who seems to have touched the relevant files recently (according to BLAME).

@bedevere-app bedevere-app Bot added awaiting merge and removed labels Feb 10, 2024
@JelleZijlstra JelleZijlstra merged commit 9d1a353 into python:main Feb 10, 2024
@Jason-Y-Z

Copy link
Copy Markdown
Contributor

Thanks!

fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request Feb 14, 2024
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants