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

Type checking fails when enum not available #65

Closed
FilipeMaia opened this issue Mar 2, 2016 · 0 comments
Closed

Type checking fails when enum not available #65

FilipeMaia opened this issue Mar 2, 2016 · 0 comments
Milestone

Comments

@FilipeMaia
Copy link
Contributor

The current workaround for enums, when the enum package is not available fails in certain situation, e.g.:

import arrayfire
arrayfire.pow(arrayfire.randu(3,3),3) 

/Library/Python/2.7/site-packages/arrayfire-3.3.0-py2.7.egg/arrayfire/array.pyc in constant_array(val, d0, d1, d2, d3, dtype)
     71             dtype = ct.c_int(dtype.value)
     72         else:
---> 73             raise TypeError("Invalid dtype")
     74
     75     out = ct.c_void_p(0)

TypeError: Invalid dtype

The reason for this is that isinstance(dtype, Dtype) == False if enum is not present and True otherwise.

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

2 participants