Open rebcabin opened 7 months ago
@Shaikh-Ubaid , this error does not occur on the latest main
. Could you please verify it?
@kmr-srbh There would be no error with lpython
, but there will be error with cpython
, I think.
Oh! I am sorry I overlooked this. I am trying to figure out the cause of the issue. The bug exists for the other types as well. Thank you @Shaikh-Ubaid!
The bug exists for the other types as well.
Yes, it would.
In python, you need to assign to a variable in order for the variable to be declared. In the above example, we do not have an assignment, but we just have a mention of the variable and its type.
Specifying a variable with its type leads to variable declaration in lpython
, but I think it is just ignored by cpython
.
Exactly @Shaikh-Ubaid ! This is something where we differ from being a subset of CPython in a significant way.