Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for a list containing multiple elements #12

Open
suminb opened this issue Jun 30, 2016 · 0 comments
Open

Check for a list containing multiple elements #12

suminb opened this issue Jun 30, 2016 · 0 comments

Comments

@suminb
Copy link

suminb commented Jun 30, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant