diff options
author | Anthon van der Neut <anthon@mnt.org> | 2017-08-21 17:50:19 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2017-08-21 17:50:19 +0200 |
commit | a3ebcf7603851375fb882717f1697c9813b262cf (patch) | |
tree | 919811658adf8c43973e2e2737a3e9365b1475fd /representer.py | |
parent | a0f924806ef8d20caf7a91171b7e631a7d74d47a (diff) | |
download | ruamel.yaml-a3ebcf7603851375fb882717f1697c9813b262cf.tar.gz |
fix issue #149: operated on ScalarFloat cannot be dumped.0.15.32
Thanks for reporting
I "fixed" this by making the operators return a normal (bare) float, as the preservation is
mostly there for round-trips without operations.
Contrary to ScalarInt you cannot as easily preserve the style, and that needs a lot more testing,
and probably much smarter code (i.e. 1.23e4 *= 10 should probably give 1.23e5 and not 12.3e4).
*If this change makes things work again without your explicit convert to bare float, please
**Close** this issue.*
Diffstat (limited to 'representer.py')
-rw-r--r-- | representer.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/representer.py b/representer.py index 2279897..70746bc 100644 --- a/representer.py +++ b/representer.py @@ -653,7 +653,7 @@ class RoundTripRepresenter(SafeRepresenter): def __init__(self, default_style=None, default_flow_style=None, dumper=None): # type: (Any, Any, Any) -> None if not hasattr(dumper, 'typ') and default_flow_style is None: - default_flow_style = False + default_flow_style = False SafeRepresenter.__init__(self, default_style=default_style, default_flow_style=default_flow_style, dumper=dumper) |