Skip to content
Myr

[svn] removed len() for context. wasn't there in jinja 1.0 and nobody uses it

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

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 88f69c6 · Browse files · 2 files+1 added−20 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+1 added−20 removed

  • other:+1 added−20 removed

2 files+1 added−20 removed

modified:jinja/_native.py-6 removed
85 unmodified lines
86 for layer in self.stack:87 if name in layer:88 return True89 return False9091 def __len__(self):92 """93 Size of the stack.94 """95 return len(self.stack)
modified:jinja/_speedups.c+1 added-14 removed
353 unmodified lines
354 PyErr_SetString(PyExc_TypeError, "expected string argument");355 return -1;356}357358/**359 * Size of the stack.360 */361static PyObject*362BaseContext_length(BaseContext *self)363{364 return PyInt_FromLong(self->stacksize);365}358367359static PyGetSetDef BaseContext_getsetters[] = {360 {"stack", (getter)BaseContext_getstack, NULL,361 "a read only copy of the internal stack", NULL},362 {"current", (getter)BaseContext_getcurrent, NULL,
29 unmodified lines
392 0 /* sq_inplace_repeat */393};394395static PyMappingMethods BaseContext_as_mapping[] = {405#if Py_VERSION_HEX < 0x02050000406 (inquiry)BaseContext_length,407#else408 (lenfunc)BaseContext_length,409#endif396 NULL,397 (binaryfunc)BaseContext_getitem,398 (objobjargproc)BaseContext_setitem399};400
67 unmodified lines