-
Notifications
You must be signed in to change notification settings - Fork 170
BLOCKER: LPython can't find dict key, but CPython can find it #2011
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
Comments
Here is a minimal reproducible example: from lpython import i32
def main():
d: dict[str, i32] = {
'2': 2, '3': 3,
'4': 4, '5': 5, '6': 6, '7': 7,
'8': 8, '9': 9,
'a': 10, 'b': 11, 'c': 12, 'd': 13,
'A': 10, 'B': 11, 'C': 12, 'D': 13,
'e': 14, 'f': 15,
'E': 14, 'F': 15}
print(d['a'])
main() Gives: $ PYTHONPATH=src/runtime/lpython python a.py
10
$ lpython a.py
KeyError: The dict does not contain the specified key
$ lpython --backend=c a.py
10 If I remove any more keys from the dictionary, then it passes. It only happens in the LLVM backend, C works. |
@czgdp1807 do you think you could please have a look at this? This looks like a bug in our dictionary implementation. |
thanks for jumping on this :) you guys are great! |
verified ! :) |
Keep reporting bugs! |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
repro: https://github.com/rebcabin/lpython/tree/brian-lasr/lasr/LP-pycharm/Issue2011
offending code:
runs:
The text was updated successfully, but these errors were encountered: