mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
change name of Set method: items -> elements (avoids confusion with
dict)
This commit is contained in:
parent
dee86c644e
commit
e4d6293383
2 changed files with 2 additions and 2 deletions
|
|
@ -16,7 +16,7 @@ class Set:
|
||||||
return len(self.elts)
|
return len(self.elts)
|
||||||
def add(self, elt):
|
def add(self, elt):
|
||||||
self.elts[elt] = elt
|
self.elts[elt] = elt
|
||||||
def items(self):
|
def elements(self):
|
||||||
return self.elts.keys()
|
return self.elts.keys()
|
||||||
def has_elt(self, elt):
|
def has_elt(self, elt):
|
||||||
return self.elts.has_key(elt)
|
return self.elts.has_key(elt)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class Set:
|
||||||
return len(self.elts)
|
return len(self.elts)
|
||||||
def add(self, elt):
|
def add(self, elt):
|
||||||
self.elts[elt] = elt
|
self.elts[elt] = elt
|
||||||
def items(self):
|
def elements(self):
|
||||||
return self.elts.keys()
|
return self.elts.keys()
|
||||||
def has_elt(self, elt):
|
def has_elt(self, elt):
|
||||||
return self.elts.has_key(elt)
|
return self.elts.has_key(elt)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue