Created
April 26, 2014 18:44
-
-
Save donaldpminer/11327755 to your computer and use it in GitHub Desktop.
This file contains 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
class _SlowList(list): | |
# this really needs to be replaced by something... not... slow. | |
def append(self, item): | |
# appends, then sorts the list | |
list.append(self, item) | |
list.sort(self) | |
def extend(self, items): | |
list.extend(self, items) | |
list.sort(self) | |
def index(self, item): | |
# change default behavior to be binary search | |
return _binary_search(self, item) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment