Modify ↓
Ticket #7 (closed defect: fixed)
doubles represented as .nan
| Reported by: | anonymous | Owned by: | xi |
|---|---|---|---|
| Priority: | normal | Component: | pyyaml |
| Severity: | normal | Keywords: | |
| Cc: |
Description
in python2.3.5: yaml.dump(10.24) will provide .nan
the source of it lay in the python 2.3 .nan handling, it is equal to any float:
inf_value = 1e300000 nan = inf_value/inf_value
nan == 5.6 and nan = 5006.78 --> True
after i did change a line in representer.py
from: elif data == self.nan_value or data != data:
to: elif str(data) == str(self.nan_value) or data != data:
yaml.dump -- provide correct handling of floats.
thanks ....
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

Thanks for the report and the idea for the fix. Fixed in [150].