Last active
March 27, 2017 15:20
-
-
Save Arfey/649cbcb29d44cbb48df6c060c07583a5 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
| 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