tomlkit
tomlkit copied to clipboard
Sign change when doing math gives invalid number
Bug:
>>> d = tomlkit.parse('x=-3.1415')
>>> d['x'] *= -1
>>> print(tomlkit.dumps(d))
returns:
a=+3.1415
>>> d['x'] *= -1
>>> print(tomlkit.dumps(d))
returns:
a=--3.1415
Subsequent parsing raises tomlkit.exceptions.InvalidNumberError
.
Of course there is an easy workaround using type conversion: d['x'] = float(d['x'])*-1
.