Add unwrap method to recursive convert to plain old python objects#187
Merged
Conversation
frostming
requested changes
Apr 16, 2022
Contributor
Author
|
Ok I think I just need to add tests for
|
frostming
requested changes
Apr 30, 2022
frostming
reviewed
May 2, 2022
7 tasks
1712acc to
69a0c8a
Compare
frostming
reviewed
May 21, 2022
| def unwrap(self) -> str: | ||
| unwrapped = [] | ||
| for t in self._body: | ||
| if is_tomlkit(t): |
Contributor
There was a problem hiding this comment.
Also, a child of an array can't be a container. isinstance(t, Item) is enough for this case. But this also works
frostming
approved these changes
May 22, 2022
Contributor
Author
|
@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 |
capuanob
pushed a commit
to capuanob/tomlkit
that referenced
this pull request
Mar 1, 2023
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds methods to convert TOMLKit objects to plain python methods
Fixes #43