inheritance - Is there a better way to write this code to alter an object inheriting from `list` in python? -


In my reply, I am now thinking that there is a good way to improve the following code:

< Pre> square circle (list): def insertextend (self, index, other, reverse = fail): "" "Increase the circle by inserting an instance into the given position." "Index" = index (self) if reverse: super (cycling, self) .__ init __ (self [: index] + list (reverse (other)) + self [index:]) Other: super (cycling, self) .__ init __ (self [: index] + other + self [index:])

Any idea how I can remove super (cycle, self) .__ init __ (...) ?

  def insertextend (self, index, other , Reverse = fail): "" "Extend the cycle by inserting a frequency in the given position. "Reverse": reverse = other = reverse (other) self [index: index] = other  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -