You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ee...@apache.org on 2011/03/19 03:09:40 UTC
svn commit: r1083127 - /cassandra/trunk/drivers/py/cql/results.py
Author: eevans
Date: Sat Mar 19 02:09:39 2011
New Revision: 1083127
URL: http://svn.apache.org/viewvc?rev=1083127&view=rev
Log:
len and getitem magic methods for Row instances
Patch by eevans
Modified:
cassandra/trunk/drivers/py/cql/results.py
Modified: cassandra/trunk/drivers/py/cql/results.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/py/cql/results.py?rev=1083127&r1=1083126&r2=1083127&view=diff
==============================================================================
--- cassandra/trunk/drivers/py/cql/results.py (original)
+++ cassandra/trunk/drivers/py/cql/results.py Sat Mar 19 02:09:39 2011
@@ -43,6 +43,12 @@ class Row(object):
def __iter__(self):
return iter(self.columns)
+
+ def __getitem__(self, idx):
+ return self.columns[idx]
+
+ def __len__(self):
+ return len(self.columns)
class ColumnsProxy(object):
def __init__(self, columns, keyspace, cfam, decoder):