mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
satisfy the tabnanny (thanks to MH for noticing the problem)
This commit is contained in:
parent
0dd7507e51
commit
772dd417f7
4 changed files with 196 additions and 196 deletions
|
@ -11,25 +11,25 @@ def flatten(tup):
|
|||
|
||||
class Set:
|
||||
def __init__(self):
|
||||
self.elts = {}
|
||||
self.elts = {}
|
||||
def __len__(self):
|
||||
return len(self.elts)
|
||||
def add(self, elt):
|
||||
self.elts[elt] = elt
|
||||
self.elts[elt] = elt
|
||||
def items(self):
|
||||
return self.elts.keys()
|
||||
return self.elts.keys()
|
||||
def has_elt(self, elt):
|
||||
return self.elts.has_key(elt)
|
||||
return self.elts.has_key(elt)
|
||||
def remove(self, elt):
|
||||
del self.elts[elt]
|
||||
|
||||
class Stack:
|
||||
def __init__(self):
|
||||
self.stack = []
|
||||
self.pop = self.stack.pop
|
||||
self.stack = []
|
||||
self.pop = self.stack.pop
|
||||
def __len__(self):
|
||||
return len(self.stack)
|
||||
def push(self, elt):
|
||||
self.stack.append(elt)
|
||||
self.stack.append(elt)
|
||||
def top(self):
|
||||
return self.stack[-1]
|
||||
return self.stack[-1]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue