E-TE0007 — Could not infer the element type of an empty list
Error Type |
|
|---|---|
Phase |
type checking the model |
Python exception |
|
Message
Could not infer the element type of an empty list.
Possible fix: annotate the expected type or use a non-empty list.
Cause
An empty list literal appears in a position where the element type cannot be deduced from context; an empty list alone carries no information about what its elements would be.
Fix
Use a non-empty list so the element type can be inferred from its elements. If the list is intentionally empty, restructure the expression so the surrounding context fixes the element type (for example, use it where a value of known type is expected).