-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
In the following example, we set the locals()[42] as a string "abc" in a class A. Then it causes rustpython panicked.
test.py:
class A(object):
locals()[42] = 'abc'
Behavior on rustpython(rustpython 0.1.2):
thread 'main' panicked at 'dict has non-string keys: [PyObject PyInt { value: 42 }]', vm/src/builtins/dict.rs:537:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expected behavior(behavior on CPython 3.9.1):
work well on the Python interpreter
Step to reproduce:
type "cargo run --release test.py" on the console of Ubuntu 18.04 and MacOS Big Sur 11.7.1
rust version: rustc 1.65.0
Copilot
Metadata
Metadata
Assignees
Labels
No labels