Skip to content

Instantly share code, notes, and snippets.

@Arfey
Last active March 27, 2017 15:20
Show Gist options
  • Select an option

  • Save Arfey/649cbcb29d44cbb48df6c060c07583a5 to your computer and use it in GitHub Desktop.

Select an option

Save Arfey/649cbcb29d44cbb48df6c060c07583a5 to your computer and use it in GitHub Desktop.
def __init__(self, initlist=None):
self.data = []
if initlist is not None:
# XXX should this accept an arbitrary sequence?
if type(initlist) == type(self.data):
self.data[:] = initlist
elif isinstance(initlist, UserList):
self.data[:] = initlist.data[:]
else:
self.data = list(initlist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment