Message336451
Following https://blog.lerner.co.il/pythons-str-isdigit-vs-str-isnumeric/, we have this:
Python 3.8.0a1+ (heads/master:001fee14e0, Feb 20 2019, 08:28:02)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> '一二三四五'.isnumeric()
True
>>> int('一二三四五')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '一二三四五'
>>> float('一二三四五')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: could not convert string to float: '一二三四五'
I think Reuven is right, these should be accepted as input. I just wonder if we should do the same for f.i. roman numerics... |
|
Date |
User |
Action |
Args |
2019-02-24 09:02:22 | StyXman | set | recipients:
+ StyXman |
2019-02-24 09:02:22 | StyXman | set | messageid: <1550998942.15.0.168903018656.issue36100@roundup.psfhosted.org> |
2019-02-24 09:02:22 | StyXman | link | issue36100 messages |
2019-02-24 09:02:22 | StyXman | create | |
|