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 Link: | |
"""A linked list.""" | |
empty = () | |
def __init__(self, first, rest=empty): | |
assert rest is Link.empty or isinstance(rest, Link) | |
self.first = first | |
self.rest = rest | |
def __repr__(self): |