[svn] removed len() for context. wasn't there in jinja 1.0 and nobody uses it
authorArmin Ronacher <armin.ronacher@active-4.com>
Sat, 28 Apr 2007 12:57:29 +0000 (14:57 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sat, 28 Apr 2007 12:57:29 +0000 (14:57 +0200)
--HG--
branch : trunk

jinja/_native.py
jinja/_speedups.c

index 8d42c7a80f899343e140efa483f5d3bce2f30d0f..ab7d1d3937171269b0ebc92f80b4857d9b993a6d 100644 (file)
@@ -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)
index 730433b344f04f6577405d23741189ff20e073f5..2a34359f6bd8827040d701486330a290bc556194 100644 (file)
@@ -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
 };