Should we optimize cookiecutter.XYZ == "y"?
See original GitHub issueI think we should move from this pattern:
{% cookiecutter.XYZ == "y" %}
to this pattern:
{% cookiecutter.XYZ.lower() in ["y", "yes"] %}
Thoughts?
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Boolean parameters parsed as String · Issue #1625 - GitHub
We want to add the ability to specify boolean parameters as "true" JSON booleans and naturally prompt for them. Thus the usage of...
Read more >Learn the Basics of Cookiecutter by Creating a Cookiecutter
With Cookiecutter, you can easily bootstrap a new project from a standard form, which means you skip all the usual mistakes when starting...
Read more >Cookie Cutter 3 Act Math Task | Area; Circles, Composite
Cookie Cutter 3 Act Math Task is a real world math problem requiring application of area of composite figures to find out how...
Read more >Marketing Data Science - Case Studies from Airbnb, Lyft ...
In this article we'll look at several case data science case studies from marketing optimization efforts at companies like Lyft, Airbnb, ...
Read more >How to Optimize Your Marketing Resume Like an SEO Pro
The job ad is like a keyword package handed down from the Almighty. Extract the most important keywords. These are usually marketing skills, ......
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
Hi there! 👋
Ideally we would move to a new context format which supports typed Cookiecutter variables.
Doing so would allow us to better separate the UI from the template code, meaning that as a template author I would not have to care about accepted input values for variables, but only about the value that Cookiecutter writes to the context for that particular type.
For instance
["y", "ye", "yes"]
might be all valid values for a Boolean variable, but will be stored asTrue
in the Cookiecutter context resulting in the following template code:I believe one of the reasons for Cookiecutter’s popularity and adoption in the Python community is that it uses the Jinja2 template engine and folks don’t have to learn yet another template language. So I’d prefer to not introduce any Cookiecutter specific APIs to templates.
Automatically closing after waiting for additional info. To re-open, please provide the additional information requested.