Skip to content

Check the contents of deque annotations - #572

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

Check the contents of deque annotations#572
RavSinghChandan wants to merge 1 commit into
agronholm:masterfrom
RavSinghChandan:check-deque-contents

Conversation

@RavSinghChandan

Copy link
Copy Markdown

collections.deque has no checker registered, so it falls through to a plain isinstance and the item type is dropped:

check_type(deque(["a"]), Deque[int])
check_sequence would have covered the contents, but it accepts any Sequence, which would let a plain list through as a Deque. The new checker mirrors check_list and tests for deque itself.

collections.deque had no checker registered, so it fell through to a plain
isinstance and the item type was dropped: Deque[int] accepted a deque of
strings without complaint.

check_sequence would have covered the contents, but it accepts any Sequence,
which would let a list through as a Deque. The new checker mirrors check_list
and tests for deque itself.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 94.862% (+0.03%) from 94.83% — RavSinghChandan:check-deque-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