Skip to content

Check the contents of Counter annotations - #575

Open
RavSinghChandan wants to merge 1 commit into
agronholm:masterfrom
RavSinghChandan:check-counter-contents
Open

Check the contents of Counter annotations#575
RavSinghChandan wants to merge 1 commit into
agronholm:masterfrom
RavSinghChandan:check-counter-contents

Conversation

@RavSinghChandan

Copy link
Copy Markdown

Counter has no checker registered:

check_type(Counter({1: 2}), Counter[str])  # passes
check_type({"a": 1}, Counter[str])         # passes - a plain dict

It takes a single argument for the key rather than the two check_mapping unpacks, since the values are always counts, so it gets its own checker

Counter had no checker registered, so it fell through to a plain isinstance:
Counter[str] accepted a counter keyed by ints, and a plain dict passed as a
Counter.

It takes a single argument for the key rather than the two check_mapping
unpacks, since the values are always counts, so it gets its own checker.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 94.862% (+0.03%) from 94.83% — RavSinghChandan:check-counter-contents into agronholm:master

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