On Sun, Feb 12, 2017 at 2:27 PM, Steve D'Aprano
<steve+pyt...@pearwood.info> wrote:
>>
>> For example:
>>
>>    >>> ast.literal_eval("( 1.0, 3 )").__class__.__name__
>>    'tuple'
>
>
> In what way does returning a tuple match the requirement "return an int or a
> float or generate an error message"?

Easy. You just use a version of Python in which tuple is a subclass of int.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to