keith-packard / snek

Snek programming language for tiny systems
GNU General Public License v3.0
294 stars 30 forks source link

input() of empty string results in None instead of '' #64

Closed mobluse closed 1 year ago

mobluse commented 1 year ago

If I do: s = input() And just press Enter I expect s == '' i.e. the empty string, but if I do: print(s) it prints None and isn't equal to ''. This is not how Python works, because there s == ''. s == None is 1 i.e. True. I think it would be better if s == '' than s == None since that is how Python works. None is not defined in the manual on https://sneklang.org/doc/snek.html , but it is mentioned in Appendix K.

keith-packard commented 1 year ago

Thanks for catching this bug!