From cd800530c927622aad74db9c1d60e176c24e4cc9 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 28 Apr 2007 14:57:29 +0200 Subject: [PATCH] [svn] removed len() for context. wasn't there in jinja 1.0 and nobody uses it --HG-- branch : trunk --- jinja/_native.py | 6 ------ jinja/_speedups.c | 15 +-------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/jinja/_native.py b/jinja/_native.py index 8d42c7a..ab7d1d3 100644 --- a/jinja/_native.py +++ b/jinja/_native.py @@ -87,9 +87,3 @@ class BaseContext(object): if name in layer: return True return False - - def __len__(self): - """ - Size of the stack. - """ - return len(self.stack) diff --git a/jinja/_speedups.c b/jinja/_speedups.c index 730433b..2a34359 100644 --- a/jinja/_speedups.c +++ b/jinja/_speedups.c @@ -355,15 +355,6 @@ error: return -1; } -/** - * Size of the stack. - */ -static PyObject* -BaseContext_length(BaseContext *self) -{ - return PyInt_FromLong(self->stacksize); -} - static PyGetSetDef BaseContext_getsetters[] = { {"stack", (getter)BaseContext_getstack, NULL, @@ -402,11 +393,7 @@ static PySequenceMethods BaseContext_as_sequence[] = { }; static PyMappingMethods BaseContext_as_mapping[] = { -#if Py_VERSION_HEX < 0x02050000 - (inquiry)BaseContext_length, -#else - (lenfunc)BaseContext_length, -#endif + NULL, (binaryfunc)BaseContext_getitem, (objobjargproc)BaseContext_setitem }; -- 2.26.2