Skip to content
Myr

Cleanup and changelog entry for new contextfunction behavior

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 9952041 · Browse files · 2 files+6 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−5 removed

  • other:+6 added−5 removed

2 files+6 added−5 removed

modified:jinja2/runtime.py+5 added-5 removed
169 unmodified lines
170 :func:`environmentfunction`.171 """172 if __debug__:173 __traceback_hide__ = True174 174175 # Allow callable classes to take a context176 if hasattr(__obj, '__call__'):177 fn = __obj.__call__178 for fn_type in ('contextfunction', 179 'evalcontextfunction', 178 for fn_type in ('contextfunction',179 'evalcontextfunction',180 'environmentfunction'):181 if hasattr(fn, fn_type):182 __obj = fn183 break;184 183 break184185 if isinstance(__obj, _context_function_types):186 if getattr(__obj, 'contextfunction', 0):187 args = (__self,) + args188 elif getattr(__obj, 'evalcontextfunction', 0):
384 unmodified lines
modified:CHANGES+1 added
13 unmodified lines
14 URL safe usage with utf-8 as only supported encoding. If applications15 want to change this encoding they can override the filter.16- Accessing `last` on the loop context no longer causes the iterator17 to be consumed into a list.18- Allow `contextfunction` and other decorators to be applied to `__call__`.1920Version 2.621-----------22(codename Convolution, released on July 24th 2011)
263 unmodified lines