rerun
rerun copied to clipboard
Typehint for AnnotationContext not accepting tuple with varying lengths despite working fine
Describe the bug
annotation_context = [
(0, "", (30, 30, 30)),
(1, "Location"),
(2, "Person"),
(3, "Organization"),
(4, "Miscellaneous"),
]
rr.log("/", rr.AnnotationContext(annotation_context))
works as expected but mypy complains with
Argument 1 to "AnnotationContext" has incompatible type "list[tuple[object, ...]]"; expected "AnnotationContext | ClassDescription | Sequence[ClassDescription | AnnotationInfo | int | tuple[int, str] | tuple[int, str, Rgba32 | int | Sequence[int | float] | ndarray[Any, dtype[unsignedinteger[_8Bit] | floating[_32Bit] | floating[_64Bit]]]]] | Sequence[ClassDescriptionMapElem | ClassDescription | AnnotationInfo | int | tuple[int, str] | tuple[int, str, Rgba32 | int | Sequence[int | float] | ndarray[Any, dtype[unsignedinteger[_8Bit] | floating[_32Bit] | floating[_64Bit]]]]]" [arg-type]
This happens when color is only specified for one of the tuples.