[issue18740] str is number methods don't recognize '.'

2013-08-16 Thread Ezio Melotti
Ezio Melotti added the comment: > it seems try/except is still the best way. :-/ Indeed: http://docs.python.org/dev/glossary#term-eafp -- nosy: +ezio.melotti stage: -> committed/rejected ___ Python tracker _

[issue18740] str is number methods don't recognize '.'

2013-08-14 Thread Brett Cannon
Brett Cannon added the comment: Feel free to submit an issue suggesting better docstrings as that sounds like it could stand to get some TLC. -- ___ Python tracker ___ _

[issue18740] str is number methods don't recognize '.'

2013-08-14 Thread Ron Adam
Ron Adam added the comment: I get the same resluts if I make the string by str(123.0). I was thinking it should test True for the isdecimal case for that. It seems I missunderstood their purpose/use. This seems like it would be a very common misunderstanding. It appears, (Because it isn't s

[issue18740] str is number methods don't recognize '.'

2013-08-14 Thread Brett Cannon
Brett Cannon added the comment: Ned is right, everything is working as documented and intended: as a way to avoid using a regex to test a simple case instead of trying to do anything fancy like identify a number. -- nosy: +brett.cannon resolution: -> rejected status: open -> closed _

[issue18740] str is number methods don't recognize '.'

2013-08-14 Thread Ned Deily
Ned Deily added the comment: isdecimal() is working as documented, isn't it? A period character serving as a decimal point is not the same as a decimal character. "Return true if all characters in the string are decimal characters and there is at least one character, false otherwise. Decimal

[issue18740] str is number methods don't recognize '.'

2013-08-14 Thread Ron Adam
New submission from Ron Adam: Shouldn't at least isdecimal return True? >>> '123.0'.isdecimal() False >>> '123.0'.isalnum() False >>> '123.0'.isnumeric() False >>> '123.0'.isdigit() False -- components: Interpreter Core messages: 195186 nosy: ron_adam priority: normal severity: normal s