Thanks everyone. I'm not going to try to be too cute, and will just change
my test case. I'm leaving Python 2 behind in this particular case for now
anyway. I can always return to the issue if I decide I need Python 2.7
support at some point in the future.
Skip
--
https://mail.python.org/mailman/
On 12.10.16 04:30, Skip Montanaro wrote:
https://docs.python.org/3/whatsnew/3.1.html
It's the third hit when searching for 'float'. Assuming I understand
what it's saying. ;)
Thanks. Is that the "David Gay's algorithm"? That seems to apply only to
repr(), while the change I observed was in
On 10/11/2016 9:30 PM, Skip Montanaro wrote:
https://docs.python.org/3/whatsnew/3.1.html
It's the third hit when searching for 'float'. Assuming I understand
what it's saying. ;)
Thanks. Is that the "David Gay's algorithm"? That seems to apply only to
repr(), while the change I observed was
On 10/11/2016 06:30 PM, Skip Montanaro wrote:
https://docs.python.org/3/whatsnew/3.1.html
It's the third hit when searching for 'float'. Assuming I understand what it's
saying. ;)
Thanks. Is that the "David Gay's algorithm"? That seems to apply only to
repr(), while the change I observed wa
Skip Montanaro writes:
> > Only that one should not rely on ‘str’ preserving the value accurately,
> > as documented in Python 2.
>
> Sure, but this choice is out of my hands. It's csv.writerow that calls
> str(), not me.
Ah, good old ‘csv’.
If the implementation is leaking an abstraction and y
On 10/11/2016 8:59 PM, Skip Montanaro wrote:
I'm trying to port some code from Python 2 to 3, and beyond the usual
mechanical stuff, I've encountered a difference between the str() of
floats. Here's an example. In Python 3 I get:
print(repr(27.04 - 0.01))
27.028
print(str(27.04 -
> Only that one should not rely on ‘str’ preserving the value accurately,
> as documented in Python 2.
Sure, but this choice is out of my hands. It's csv.writerow that calls
str(), not me. I could probably subclass csv.writer and csv.DictWriter, and
override the writerow method, but I would prefer
> https://docs.python.org/3/whatsnew/3.1.html
>
> It's the third hit when searching for 'float'. Assuming I understand
what it's saying. ;)
Thanks. Is that the "David Gay's algorithm"? That seems to apply only to
repr(), while the change I observed was in str().
Skip
--
https://mail.python.or
Skip Montanaro writes:
> >>> print repr(27.04 - 0.01)
> 27.028
> >>> print str(27.04 - 0.01)
> 27.03
>
> My test case writes through a csv writer, which writes the str() of each
> element to the output.
For Python 2, that's a mistake:
str(object='')
Return a string containi
On 10/11/2016 05:59 PM, Skip Montanaro wrote:
Is there documentation of this particular change? My searching turned up
documentation of plenty of other changes, but not this particular one.
3.1 What's new:
https://docs.python.org/3/whatsnew/3.1.html
It's the third hit when searching for 'f
I'm trying to port some code from Python 2 to 3, and beyond the usual
mechanical stuff, I've encountered a difference between the str() of
floats. Here's an example. In Python 3 I get:
>>> print(repr(27.04 - 0.01))
27.028
>>> print(str(27.04 - 0.01))
27.028
but in Python 2
11 matches
Mail list logo