Re: Print a float value
Thanks Stéphane. This clarified why the results were different. I was also wondering why the 2nd print outputs 2.3333333333333335, where the last digit is not 3 but 5.
From: email@example.com <firstname.lastname@example.org> On Behalf Of Stéphane Lozier
Sent: March 22, 2020 10:45 AM
Subject: Re: [ironpython] Print a float value
In the first case you're printing the float, in the second case you're printing a tuple of floats. In both cases the `__str__` function is called, however in the case of the tuple, `__str__` and `__repr__` are the same so it's like calling `__repr__` of each of its items.
>>> class test(object):
Hope this makes sense.
On Sat, Mar 21, 2020 at 7:08 PM Hailiang Shen <hailiang@...> wrote: