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

matcher() builtin, like joiner() and cycler() #90

Open
miracle2k opened this issue Jan 21, 2012 · 2 comments
Open

matcher() builtin, like joiner() and cycler() #90

miracle2k opened this issue Jan 21, 2012 · 2 comments

Comments

@miracle2k
Copy link

Any interest in including something like this:

https://github.com/miracle2k/jinja2utils/blob/master/src/jinja2utils/match.py

I have just written this code a second time, needing it again and not remembering I had already implemented it once.

It seems to fit very well alongside joiner() and cycler(), and presumably is a common usecase.

@mitsuhiko
Copy link
Contributor

Not a bad idea. Though the default should probably be undefined for consistency with the inline if expression.

@miracle2k
Copy link
Author

Which value specifically do you suggest should default to undefined?

I have implemented the code as-is here:

https://github.com/miracle2k/jinja2/compare/90-matcher

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

2 participants