summaryrefslogtreecommitdiff
path: root/python/src/vectors.pxi
diff options
context:
space:
mode:
authorVictor Chahuneau <vchahune@cs.cmu.edu>2012-08-11 23:30:00 -0400
committerVictor Chahuneau <vchahune@cs.cmu.edu>2012-08-11 23:30:00 -0400
commit7527592aaf4245749845500aca6a7fcc97eb2f17 (patch)
treed8fdb627c657e7a4699baf0670ca749df1f7e972 /python/src/vectors.pxi
parentdad8da6f5f65e157476b3999257069bda7b8552e (diff)
[python] fix for new dict API
- TDConvert returns a string - various c_str fixes (make copies) - cleanup .gitignore
Diffstat (limited to 'python/src/vectors.pxi')
-rw-r--r--python/src/vectors.pxi4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/src/vectors.pxi b/python/src/vectors.pxi
index 989a6a7c..87780556 100644
--- a/python/src/vectors.pxi
+++ b/python/src/vectors.pxi
@@ -31,7 +31,7 @@ cdef class DenseVector:
def __iter__(self):
cdef unsigned fid
for fid in range(1, self.vector.size()):
- yield FDConvert(fid).c_str(), self.vector[0][fid]
+ yield str(FDConvert(fid).c_str()), self.vector[0][fid]
def dot(self, SparseVector other):
return other.dot(self)
@@ -69,7 +69,7 @@ cdef class SparseVector:
cdef unsigned i
try:
for i in range(self.vector.size()):
- yield (FDConvert(it[0].ptr().first).c_str(), it[0].ptr().second)
+ yield (str(FDConvert(it[0].ptr().first).c_str()), it[0].ptr().second)
pinc(it[0]) # ++it
finally:
del it