Skip to content

Accept histogram count pairs in boltons formatting stub - #16958

Open
Lushiyao5 wants to merge 1 commit into
python:mainfrom
Lushiyao5:fix-boltons-histogram-counts-type
Open

Lushiyao5 wants to merge 1 commit into
python:mainfrom
Lushiyao5:fix-boltons-histogram-counts-type

Conversation

@Lushiyao5

Copy link
Copy Markdown
Contributor

Stats.get_histogram_counts() returns (bin, count) pairs and explicitly documents passing them to format_histogram_counts(). The latter currently expects a list of numbers in the stub. Accept a sequence of pairs and tie the label formatter argument to the bin type. The implementation makes multiple passes over the pairs and converts each formatted label to text.

I verified the documented round trip and formatting a tuple of named bins. Mypy rejects these inputs with the current stub and passes on the examples and updated stub after the patch.

This patch was prepared with assistance from OpenAI Codex.

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

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

This branch has not been deployed

No deployments
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.

1 participant