-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
I understand a list containing a single element can be checked as the document states as follows:
A list containing a single element, requiring that the value be a list of values, all matching the type signature of that element. For example, a type signature specifying a list of integers would be [int].
I was wondering if it is possible to check for a list containing multiple elements. For example, if a function expects a 2D coordinate, it would require the following type:
[int, int]
More precisely, I would like to check for the following type:
typedecorator.Union((int, int), [int, int])
but that does not seem possible as I'm getting TypeError: Invalid type signature. If I change my code a bit like:
typedecorator.Union((int, int), list)
it seems working okay but that's not quite what I want.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels