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

Convert an table to inline table, the comment is preserved unexpectedly #30

Closed
frostming opened this issue Nov 9, 2018 · 0 comments
Closed

Comments

@frostming
Copy link
Contributor

frostming commented Nov 9, 2018

Suppose we have following toml:

[site.user]
name = "John"  # Inline comment
age = 28

I want to convert site.user to an inline table:

v = parsed['site']['user']
table = tomlkit.inline_table()
table.update(v)
print(table.as_string())
{age = 21,name = "John"# Inline comment}

What is weird is that even with:

table.update(dict(v))

The bug still exists.

The expected behavior should be dropping all comments of original table.

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