virejdasani/pythOwO

can't compare strings.

Closed this issue · 1 comments

I cant compare strings in conditional statements. for example this code produces an error:

pwease baka = "hewwo"
pwease awoo = "hewwo"
IF awoo==baka THWEN pwint("they are equal ") EWSE pwint("twy again")

the error message is

Traceback (most recent call last):
File test.pyowo, line 4, in
owo, whats this? Runtime Error? Oh nwo! : Illegal operation
IF awoo==baka THWEN pwint("yay") EWSE pwint("twy again")
__^^^^^^^^^^

Looks like Strings don't have the comparison operators implemented. They're defaulting to Value's implementation that returns an illegal operation error.

This can be fixed by overriding the Value comparison operators with an implementation around here.