KraftDiner wrote:
> Is there a cleaner way to implement this code?
> 
>                       if len(self.listOfObjects) == 0:
>                               self.listOfObjects.append(self.currentObject)
>                       elif:
>                               self.listOfObjects[self.currentSlice] = 
> self.currentObject
> 
> listOfObjects is a list of lists....
> If the listOfObjects is [] then I have to use append to add the first
> list
> otherwise I can access each list using the index into the list.
> 
It appears you are trying to do two different things in one if
statement and it is unclear where self.currentSlice comes from.
You also need a condition on your elif.  Perhaps more explanation
is needed (at least for me to help).

-Larry Bates


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to