Closed kmr-srbh closed 6 months ago
In the code example shared in the issue description, you need not import set
from the lpython
module as set
is predefined in cpython
. You also need not import i32
as it is unused. So the example in the issue description can be simplified to:
s: set[str] = {"a", "b", "c", "a"}
s.add("d")
Declaring a set in the global scope fails. This however is not the case with a local scope like a function.
As it turns out, the error message is not clear too.