lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.5k stars 157 forks source link

Unexpected output for string method on whitespace characters #2490

Closed advikkabra closed 5 months ago

advikkabra commented 7 months ago

When I run the following code:

def f():
    b: str = " \t\n\v\f\r"
    print(b.isspace())
    print(b.islower())
    print(b.isupper())

f()

In Python:

True
False
False

In LPython:

False
True
False

Hence there is a bug in both the isspace() and the islower() methods.