~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_static_tuple_c.c

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-11 11:47:36 UTC
  • mfrom: (5200.3.8 lock_return)
  • Revision ID: pqm@pqm.ubuntu.com-20100511114736-mc1sq9zyo3vufec7
(lifeless) Provide a consistent interface to Tree, Branch,
 Repository where lock methods return an object with an unlock method to
 unlock the lock. This breaks the API for Branch,
 Repository on their lock_write methods. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
703
703
    return 0;
704
704
}
705
705
 
706
 
 
707
 
static PyObject *
708
 
StaticTuple_sizeof(StaticTuple *self)
709
 
{
710
 
        Py_ssize_t res;
711
 
 
712
 
        res = _PyObject_SIZE(&StaticTuple_Type) + (int)self->size * sizeof(void*);
713
 
        return PyInt_FromSsize_t(res);
714
 
}
715
 
 
716
 
 
717
 
 
718
706
static char StaticTuple_doc[] =
719
707
    "C implementation of a StaticTuple structure."
720
708
    "\n This is used as StaticTuple(item1, item2, item3)"
734
722
     "Create a StaticTuple from a given sequence. This functions"
735
723
     " the same as the tuple() constructor."},
736
724
    {"__reduce__", (PyCFunction)StaticTuple_reduce, METH_NOARGS, StaticTuple_reduce_doc},
737
 
    {"__sizeof__",  (PyCFunction)StaticTuple_sizeof, METH_NOARGS}, 
738
725
    {NULL, NULL} /* sentinel */
739
726
};
740
727