This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Carl Ekerot, loewis, serhiy.storchaka, xiang.zhang
Date 2016-11-04.20:58:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478293087.39.0.576792095851.issue28563@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2016-11-04 20:58:07serhiy.storchakasetrecipients: + serhiy.storchaka, loewis, xiang.zhang, Carl Ekerot
2016-11-04 20:58:07serhiy.storchakasetmessageid: <1478293087.39.0.576792095851.issue28563@psf.upfronthosting.co.za>
2016-11-04 20:58:07serhiy.storchakalinkissue28563 messages
2016-11-04 20:58:07serhiy.storchakacreate