[feature] Support list type as option value
See original GitHub issueFor 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.
- I’ve read the CONTRIBUTING guide.
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m closing this as it looks that in the end we all agree on not implementing.
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.