From: Armin Ronacher Date: Sat, 28 Apr 2007 12:57:29 +0000 (+0200) Subject: [svn] removed len() for context. wasn't there in jinja 1.0 and nobody uses it X-Git-Tag: 2.0rc1~336 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cd800530c927622aad74db9c1d60e176c24e4cc9;p=jinja2.git [svn] removed len() for context. wasn't there in jinja 1.0 and nobody uses it --HG-- branch : trunk --- 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 };