evaluation question

Muttley at dastardlyhq.com Muttley at dastardlyhq.com
Mon Jan 30 04:41:03 EST 2023


On Sun, 29 Jan 2023 23:57:51 -0500
Thomas Passin <list1 at tompassin.net> wrote:
>On 1/29/2023 4:15 PM, elvis-85792 at notatla.org.uk wrote:
>> On 2023-01-28, Louis Krupp <lkrupp at invalid.pssw.com.invalid> wrote:
>>> On 1/27/2023 9:37 AM, Muttley at dastardlyhq.com wrote:
>> 
>> 
>>>>>>> eval("print(123)")
>>>> 123
>> 
>> 
>> Does OP expect the text to come from the eval or from the print?
>> 
>>>>> x = print( [i for i in range(1, 10)] )
>> [1, 2, 3, 4, 5, 6, 7, 8, 9]
>> 
>>>>> x
>>   (nothing printed)
>
>Because print() returns nothing (i.e., the statement x is None is True). 

I don't understand this. What was the point of the upheaval of converting
the print command in python 2 into a function in python 3 if as a function
print() doesn't return anything useful? Surely even the length of the 
formatted string as per C's sprintf() function would be helpful?



More information about the Python-list mailing list