Message310754
int() and str.is*** functions accepts other than ASCII.
But we want to accept only ASCII in some cases. (e.g. ipaddress module)
We can use try-except to check ASCII, but it's inefficient.
try:
s.encode('ascii')
except UnicodeEncodeError:
ascii = False
else:
ascii = True
CPython can check string is ASCII efficiently.
(Voting on python-ideas ML now) |
|
Date |
User |
Action |
Args |
2018-01-26 11:09:08 | methane | set | recipients:
+ methane |
2018-01-26 11:09:08 | methane | set | messageid: <1516964948.19.0.467229070634.issue32677@psf.upfronthosting.co.za> |
2018-01-26 11:09:08 | methane | link | issue32677 messages |
2018-01-26 11:09:08 | methane | create | |
|