mirror of https://github.com/go-python/gopy.git
Merge pull request #338 from richecr/fix/__next__
fix __next__ function
This commit is contained in:
commit
2dc64b7f09
|
@ -246,7 +246,11 @@ otherwise parameter is a python list that we copy from
|
|||
g.pywrap.Indent()
|
||||
g.pywrap.Printf("if self.index < len(self):\n")
|
||||
g.pywrap.Indent()
|
||||
g.pywrap.Printf("rv = _%s_elem(self.handle, self.index)\n", qNm)
|
||||
if esym.hasHandle() {
|
||||
g.pywrap.Printf("rv = %s(handle=_%s_elem(self.handle, self.index))\n", esym.pyPkgId(slc.gopkg), qNm)
|
||||
} else {
|
||||
g.pywrap.Printf("rv = _%s_elem(self.handle, self.index)\n", qNm)
|
||||
}
|
||||
g.pywrap.Println("self.index = self.index + 1")
|
||||
g.pywrap.Println("return rv")
|
||||
g.pywrap.Outdent()
|
||||
|
|
|
@ -593,7 +593,7 @@ slices.IntSum from Python list: 10
|
|||
slices.IntSum from Go slice: 10
|
||||
unsigned slice elements: 1 2 3 4
|
||||
signed slice elements: -1 -2 -3 -4
|
||||
struct slice: slices.Slice_Ptr_slices_S len: 3 handle: 11 [12, 13, 14]
|
||||
struct slice: slices.Slice_Ptr_slices_S len: 3 handle: 11 [slices.S{Name=S0, handle=12}, slices.S{Name=S1, handle=13}, slices.S{Name=S2, handle=14}]
|
||||
struct slice[0]: slices.S{Name=S0, handle=15}
|
||||
struct slice[1]: slices.S{Name=S1, handle=16}
|
||||
struct slice[2].Name: S2
|
||||
|
|
Loading…
Reference in New Issue