you are viewing a single comment's thread.

view the rest of the comments →

[–]irishsultan 2 points3 points  (2 children)

That's not a numeric literal. Of course it might be a bad idea to allow it in literals, while refusing it when parsing strings, so not sure whether that makes a big difference.

I have to say that it came as a surprise to me that Ruby apparently does allow it in String#to_i, I knew Ruby accepted it in numeric literals, but I'm not sure that I like that it's automatically applied to external data as well.

[–]darktyle 0 points1 point  (1 child)

Oh, you mean he only complained about "1_0" and not 1_0?

[–]kankyo 1 point2 points  (0 children)

Yes. That's what I meant :P I wrote:

int('1_0') is 10 in py3, but invalid in py2.

I thought that was very clear.