Created
November 19, 2010 07:53
-
-
Save mazurov/706243 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# t.test() - segmentation fault. Using push_back(c1). cN local for __init__. | |
class Test(): | |
def __init__(self): | |
c1 = Hlt.Candidate() | |
c2 = Hlt.Candidate() | |
c3 = Hlt.Candidate() | |
self.candidates = Hlt.Candidate.ConstVector() | |
self.candidates.push_back (c1) | |
self.candidates.push_back (c2) | |
self.candidates.push_back (c3) | |
#self.c1.addToStages(self.stage1) | |
#self.c2.addToStages(self.stage2) | |
#self.c3.addToStages(self.stage3) | |
def test(self): | |
for c in self.candidates: | |
print c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t = Test() | |
t.test() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using self.cN | |
class Test(): | |
def __init__(self): | |
self.c1 = Hlt.Candidate() | |
self.c2 = Hlt.Candidate() | |
self.c3 = Hlt.Candidate() | |
self.candidates = Hlt.Candidate.ConstVector() | |
self.candidates.push_back (self.c1) | |
self.candidates.push_back (self.c2) | |
self.candidates.push_back (self.c3) | |
#self.c1.addToStages(self.stage1) | |
#self.c2.addToStages(self.stage2) | |
#self.c3.addToStages(self.stage3) | |
def test(self): | |
for c in self.candidates: | |
print c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment