__len__ of fixed length tuples? #11054
anabelle2001
started this conversation in
Ideas
Replies: 1 comment
-
|
Pyright doesn't generally have special-case handling for The one place where pyright does special-case |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm a bit confused how pyright handles
__len__for fixed-length tuples. Here's a toy example:(edit: removed typescript example)
My first thought was that a finite-length tuple should have an overriden type for
__len__, such thattuple[int,int,int].__len__() -> Literal[3]. Is this a quirk of pyright's implementation, or is there a reason why pyright doesn't narrowx.__len__?Beta Was this translation helpful? Give feedback.
All reactions