Replies: 1 comment 3 replies
-
Pyright is implementing What you're looking for here is |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm putting this here but maybe that could go into the typing repository.
Consider the following snippet:
My goal here is to "exclude" tuple from
_K
(which is currently not supported by Python). From my point-of-view,tuple[()] | tuple[_K, *_KS]
covers every possibletuple
, so I would think that_K
would be deduced as "not a tuple".I understand this is currently not the case (or maybe I'm missing something), so
_K
could not be deduced as "not a tuple"?pyright
without changes to Python typing itself?Beta Was this translation helpful? Give feedback.
All reactions