Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative Integer values -x in tables cycle through +x, --x, x, -x, ... when multiplied by -1 #346

Closed
JamesParrott opened this issue May 7, 2024 · 0 comments

Comments

@JamesParrott
Copy link

JamesParrott commented May 7, 2024

The bug is in Tomlkit 0.12

>python -ic "import tomlkit as tk"
>>> import sys
>>> sys.version_info
sys.version_info(major=3, minor=12, micro=1, releaselevel='final', serial=0)
>>> tk.__version__
'0.12.0'
>>> d =  tk.parse('x=-3')
>>> for __ in range(12):
...   d['x'] *= -1; print(tk.dumps(d))
...
x=+3
x=--3
x=3
x=-3
x=+3
x=--3
x=3
x=-3
x=+3
x=--3
x=3
x=-3

Tomlkit 0.11.8 shows the expected behaviour (in Python 3.11):

>python -ic "import tomlkit as tk"
>>> import sys
>>> sys.version_info
sys.version_info(major=3, minor=11, micro=4, releaselevel='final', serial=0)
>>> tk.__version__
'0.11.8'
>>> d =  tk.parse('x=-3')
>>> for __ in range(12):
...   d['x'] *= -1; print(tk.dumps(d))
...
x=3
x=-3
x=3
x=-3
x=3
x=-3
x=3
x=-3
x=3
x=-3
x=3
x=-3

Both on Windows 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant