question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature] Support list type as option value

See original GitHub issue

For those cases where more than one value is possible for an option, it would be great accepting a list and as its value. For instance:

class FooConan(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    options = {"shared": [True, False], "instructions": [None, "ANY"]}
    default_options = {"shared": False, "instructions": ["avx", "sse2", "sse4"]}

The instructions will be converted to a string, as it will be a PackageOption which converts any content to a string, so we would need to convert again to a list in the code in case need to access one of those values.

So far we can’t use such feature, we need to create a single option for each value, which seems be too much, depending the situation. The OptionValue is smart enough right now to support boolean, string and integer, right now.

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
czoidocommented, Dec 19, 2022

I’m closing this as it looks that in the end we all agree on not implementing.

1reaction
czoidocommented, Dec 15, 2022

In my personal opinion, although I agree with @uilianries that it would be a nice feature that would improve some recipes I also think adding types support for Options would be too much increase in complexity (for all the reasons already mentioned) to just save some lines of code in a small percentage of recipes… so I would opt to not implement this until there’s a significant amount of recipes that need this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The HTML Option element - MDN Web Docs - Mozilla
The HTML element is used to define an item contained in a , an , or a element. As such, can represent menu...
Read more >
HTML select form with option to enter custom value
HTML5 has a built-in combo box. You create a text input and a datalist . Then you add a list attribute to the...
Read more >
HTML5 Datalist: What You Need To Know | The Jotform Blog
The autocomplete attribute tells the browser whether to give a user options for completion based on previous input and whether to store the ......
Read more >
typing — Support for type hints — Python 3.11.1 documentation
The Python runtime does not enforce function and variable type annotations. They can be used by third party tools such as type checkers,...
Read more >
HTML datalist Tag - W3Schools
The <datalist> tag is used to provide an "autocomplete" feature for <input> elements. Users will see a drop-down list of pre-defined options as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found