-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Comment not parsed when value is boolean #119
Comments
Yes, the boolean value is a real |
@frostming so is there any other way of getting the comment for it? |
v2 = d['foo'].value.item('baz')
print(v2.trivia.comment) |
@frostming thanks for the quick reply! Spent an hour trying to figure it out on my own but gave up. I think, the problem is the lack of documentation on the topic. I.e. ".value" was never mentioned in the README.md, and I haven't found any other documentation for tomlkit. I think, there should be a small section on manually extracting all information from tables that mentions how "value" actually has the "item" method. Also, there's the issue of Bool being not json-serializable. |
I've just tried to set up comment parsing in a TOML config file to see if I could use it for documentation, and it seems like it'll work except for when the configured value is a boolean.
When I drop into a debugger and look at the attributes of the parsed value:
and then tab complete to show the attributes, the dict
x
has atrivia
attribute but the valuey
does not:x.trivia.comment
but there's nothing theretrivia.comment
attributeIs this a bug, or should I be looking for the comment in another place?
To minimally reproduce:
⇣
The text was updated successfully, but these errors were encountered: