New submission from Hrvoje Abraham :
>>> from decimal import Decimal
>>> round(Decimal('-123.49'))
-124.0
I would expect -123.0, even considering Py2 rounding convention details (away
from zero), Decimal rounding
Hrvoje Abraham added the comment:
I believe this is the issue. ast.literal_eval sets support can not be
considered complete until it also handles empty sets. I do not consider it
valid for me to explicitly handle this case in my projects using some weird
hacks.
Python community settled on
Hrvoje Abraham added the comment:
I use communication protocol based on Python literals and ast.literal_eval for
deserialization. I'm avoiding sets because empty set value is not supported in
a clean consistent manner on language level.
If I write repr(set()) i get 'set()', thi
Hrvoje Abraham added the comment:
For now I'll implement my_literal_eval via AST filtering, reproducing
ast.literal_eval + 'set()' functionality.
--
___
Python tracker
<http://bugs.pyt
New submission from Hrvoje Abraham:
repr of -nan value should contain the sign so the round-trip could be assured.
NaN value sign (bit) could be seen as not relevant or even uninterpretable
information, but it is actually used in real-life situations, the fact
substantiated by section 6.3 of
Hrvoje Abraham added the comment:
Reported issue was created in 64-bit Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6
2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32.
Now I noticed that in Py 2.7 even copysign part does not work as expected.
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015
Hrvoje Abraham added the comment:
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit
(AMD64)] on win32:
>>> import struct
>>> x=float("-nan")
>>> struct.pack
Hrvoje Abraham added the comment:
Regarding NaN sign bit, IEEE-754 states:
"Note, however, that operations on bit strings—copy, negate, abs,
copySign—specify the sign bit of a NaN result, sometimes based upon the sign
bit of a NaN operand. The logical predicate totalOrder is also affect
Hrvoje Abraham added the comment:
Sage:
http://doc.sagemath.org/html/en/reference/rings_numerical/sage/rings/complex_number.html
>>> log(ComplexNumber(NaN,1))
NaN - NaN*I
--
___
Python tracker
<http://bugs.python.or
Hrvoje Abraham added the comment:
IEEE & C/C++ standards allow and explicitly mention it, some people and
projects are using it, many compilers preserve it...
I believe it's reasonable to support it despite the fact it does not have
standardized semantic meaning. Mayb
10 matches
Mail list logo