Message280084
> It doesn't solve the case when an identifier or number is used as a function:
In the first case we should convert an argument to integer.
ns = {}
exec('''if True:
def func(arg):
n = int(arg)
return {}
'''.format(plural), ns)
return ns['func']
Or raise an exception if argument is not integer.
In the second case I think we can just left it as is. This is not valid C expression.
Or we can add try/except in above code and convert TypeError to ValueError if this is more preferable exception. |
|
Date |
User |
Action |
Args |
2016-11-04 20:58:07 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, loewis, xiang.zhang, Carl Ekerot |
2016-11-04 20:58:07 | serhiy.storchaka | set | messageid: <1478293087.39.0.576792095851.issue28563@psf.upfronthosting.co.za> |
2016-11-04 20:58:07 | serhiy.storchaka | link | issue28563 messages |
2016-11-04 20:58:07 | serhiy.storchaka | create | |
|