We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This:
from numba import typeof, types from numba.core.typing import Context x = types.literal('string literal') print(x, type(x)) print("conversion:", x.can_convert_to(Context(), types.unicode_type))
does this:
Literal[str](string literal) <class 'numba.core.types.misc.StringLiteral'> conversion: None
I think it should be possible to convert a StringLiteral to a unicode_type but not the converse.
StringLiteral
unicode_type
A can_convert_to() method needs adding to this class:
can_convert_to()
numba/numba/core/types/misc.py
Lines 40 to 41 in 3461bcb
xref: https://numba.discourse.group/t/how-to-pass-string-argument-to-numba-njit-python-function-from-inside-another-whilst-specifying-signature-type/663 which hits this bug.
The text was updated successfully, but these errors were encountered:
Would fixing this also fix #6897?
Sorry, something went wrong.
Add type conversion for StringLiteral to unicode_type and test.
0ae7d9a
As title. Fixes numba#6907
638ed0d
cf78441
Successfully merging a pull request may close this issue.
Reporting a bug
visible in the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
i.e. it's possible to run as 'python bug.py'.
This:
does this:
I think it should be possible to convert a
StringLiteral
to aunicode_type
but not the converse.A
can_convert_to()
method needs adding to this class:numba/numba/core/types/misc.py
Lines 40 to 41 in 3461bcb
xref: https://numba.discourse.group/t/how-to-pass-string-argument-to-numba-njit-python-function-from-inside-another-whilst-specifying-signature-type/663 which hits this bug.
The text was updated successfully, but these errors were encountered: