code: def _setFlags(self):
  		
  		self.atEnd = not self.gametree.variations and (self.index + 1 == len(self.gametree))
  		self.atStart = not self.stack and (self.index == 0)
docs: Sets up the flags 'self.atEnd' and 'self.atStart'.