Validity of collections.deque
as typing.Sequence
#12047
Labels
stubs: false negative
Type checkers do not report an error, but should
Hi
Based on this discussion on pyright: microsoft/pyright#7989 (comment)
A
collections.deque
is a validtyping.Sequence
. However,typing.Sequence
allows being sliceable, while acollections.deque
does not support slicing. This makes room to make errors that is not caught by static type checkers like pyright and mypy.It seems like this normally would be reported, but the errors are suppressed by type-ignore comments found here.
Is there any other way of handling this so that trying to slice a deque would result in a type-error?
The text was updated successfully, but these errors were encountered: