From d3c58780a0d30fa09ea90d7b2e1fd9bc063b07ce Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Wed, 10 Aug 2016 17:20:23 +0200 Subject: [PATCH] Added __len__ function do OBIViews that returns the line count --- python/obitools3/obidms/_obidms.pyx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/obitools3/obidms/_obidms.pyx b/python/obitools3/obidms/_obidms.pyx index db75f56..0da902c 100644 --- a/python/obitools3/obidms/_obidms.pyx +++ b/python/obitools3/obidms/_obidms.pyx @@ -449,6 +449,10 @@ cdef class OBIView : return (column_name in self.columns) + def __len__(self): + return(self.pointer.infos.line_count) + + def __str__(self) : cdef OBIView_line line cdef str to_print