Type hinting in doc.spans not working #13850
Unanswered
ghinch
asked this question in
Help: Coding & Implementations
Replies: 1 comment
-
Use
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using
doc.spans
(ie. SpanGroups) to store some spans for reference later in my project. However, Pyright is throwing type errors on the values when I try to iterate through one of the SpanGroups, saying the type of the item is unknown. I can solve this usingtyping.cast
, but it's not ideal to have to do this everywhere I want to use the spans. It seems like the type of the items in a span group should be known already.Here is a basic example to illustrate the issue:
Am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions