You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two questions regarding comments in multiline arrays (for which I couldn't find documentation).
I'm using tomlkit 0.12.4.
Consider the following code:
import tomlkit
content = """[foo]
bar = [
"one", # comment one
"two", # comment two
]
"""
data = tomlkit.loads(content)
Is there a way to read the comments with respect to the array entries?
I was expecting data["foo"]["bar"][0].trivia, but this doesn't have information about the comment (neither does data["foo"]["bar"].trivia).
I know I can do data["foo"]["bar"].as_string() but there I'd have to parse them myself from the string.
(How) can I write multiline arrays with comments?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hello
I have two questions regarding comments in multiline arrays (for which I couldn't find documentation).
I'm using tomlkit 0.12.4.
Consider the following code:
I was expecting
data["foo"]["bar"][0].trivia
, but this doesn't have information about the comment (neither doesdata["foo"]["bar"].trivia
).I know I can do
data["foo"]["bar"].as_string()
but there I'd have to parse them myself from the string.Thanks in advance!
The text was updated successfully, but these errors were encountered: