Skip to content

Add missing methods to collections classes#6388

Merged
Akuli merged 9 commits into
python:masterfrom
AlexWaygood:patch-1
Nov 26, 2021
Merged

Add missing methods to collections classes#6388
Akuli merged 9 commits into
python:masterfrom
AlexWaygood:patch-1

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Nov 26, 2021

Copy link
Copy Markdown
Member

These were all discovered by running the stubtest_stdlib test without the --ignore-missing-stub option.

  • ChainMap.copy() and ChainMap.fromkeys() appear to have been there since at least Python 3.6 (cpython source code for the class here).

  • Counter.total() was added in 3.10.

  • UserString.isascii() appears to have been added in Python 3.7; it doesn't appear in the ChangeLog, but you can see it was added in this commit here.

These were all discovered by running the `stubtest_stdlib` test without the `--ignore-missing-stub` option.

`ChainMap.copy()` and `ChainMap.fromkeys()` appear to have been there since at least Python 3.6 (cpython source code for the class here: https://github.com/python/cpython/blob/2c56c97f015a7ea81719615ddcf3c745fba5b4f3/Lib/collections/__init__.py#L853).

`Counter.total()` was added in 3.10: https://docs.python.org/3/library/collections.html#collections.Counter.total.

`UserString.isascii()` appears to have been added in Python 3.7; it doesn't appear in the ChangeLog, but you can see it was added in this commit here: python/cpython#5342.
@github-actions

This comment has been minimized.

Comment thread stdlib/collections/__init__.pyi Outdated
Comment thread stdlib/collections/__init__.pyi Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@AlexWaygood AlexWaygood requested a review from Akuli November 26, 2021 18:03
Comment thread tests/stubtest_allowlists/py3_common.txt Outdated
Comment thread stdlib/collections/__init__.pyi Outdated
Comment thread stdlib/collections/__init__.pyi
AlexWaygood and others added 2 commits November 26, 2021 19:43
Co-authored-by: Akuli <akuviljanen17@gmail.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>

@Akuli Akuli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@github-actions

This comment has been minimized.

@Akuli Akuli merged commit 2dade81 into python:master Nov 26, 2021
@AlexWaygood AlexWaygood deleted the patch-1 branch November 26, 2021 19:53
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

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.

2 participants