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

toml_value_to_labelset converter should cast list elements to str #126

Closed
NickleDave opened this issue Apr 2, 2020 · 0 comments
Closed

Comments

@NickleDave
Copy link
Collaborator

NickleDave commented Apr 2, 2020

either by doing

labelset = set([str(element) for element in toml_value)

or

labelset = set(''.join(toml_value))

trying to figure out if either can cause / avoid errors.
Option one is more readable I think. Option two joins everything into one string before passing it to set which will then split it up into individual characters again.

Probably there should be a validator on labelset that makes sure it's actually a set?

toml arrays have to be "homogenous" (all elements same type) right now AFAI can tell
toml-lang/toml#553

NickleDave added a commit that referenced this issue Apr 2, 2020
…to-str-#126

Labelset converter cast list to str #126
NickleDave added a commit that referenced this issue Aug 8, 2020
…to-str-#126

Labelset converter cast list to str #126
NickleDave added a commit that referenced this issue Aug 8, 2020
…to-str-#126

Labelset converter cast list to str #126
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