#4087·altair

Use `Sequence` type hints in `.transform_...()` methods of `TopLevelMixin`

Author: AntyosCreated Jul 28, 2026Updated Jul 28, 2026
Labelsbugneeds-triage

What happened?

I have noticed that several methods use list type hints instead of Sequence (which is covariant). For example:

https://github.com/vega/altair/blob/58661c64a2747f13c7def38cf2ecc288c82ee831/altair/vegalite/v6/api.py#L2696-L2701

What would you like to happen instead?

All instances of list in type hints for various mixins should be replaced with Sequence (or potentially Collection, if applicable).

I think there is some level of codegen involved for the files in vegalite/v6/, so I'm not so sure where to start if I were to make a PR.

Which version of Altair are you using?

main branch