-
-
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
Add unwrap method to recursive convert to plain old python objects #187
Conversation
Ok I think I just need to add tests for
|
1712acc
to
69a0c8a
Compare
tomlkit/items.py
Outdated
def unwrap(self) -> str: | ||
unwrapped = [] | ||
for t in self._body: | ||
if is_tomlkit(t): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, a child of an array can't be a container. isinstance(t, Item)
is enough for this case. But this also works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@frostming Is it OK if I make a PR to bump the version? If so which version? 0.11.0 or 0.10.3? I am trying to use the version of tomlkit with these changes in a PR |
…ython-poetry#187) * add as_ppo method for elementary types * rename as_popo to unwrap; add recursive arg * add unwrap methods to collection types + Null * remove dangling 'def' * Container loops through items() instead of _body * add Integer and Item unit tests * added passing tests for everything up to Array * remove recursive option * remove unused is_ppo function * refactor Container unwrap to reuse code * add AbstractTable test * add string, null, and aot tests * add test for Container * type(..) to isinstance(..) in Container unwrap * try/catch ensure v has unwrap in Container.unwrap * replace 'type' with 'isinstance' in test_items.py * refactor assert_is_ppo to pass only ppo type * refactory test_document_is_a_dict to not call 'type' * remove elementary_fail function * minor change in Container unwrap method * use isinstance not is_tomlkit in AoT.unwrap * run pre-commit
Adds methods to convert TOMLKit objects to plain python methods
Fixes #43