mirror of https://github.com/python/cpython
Bug #1719995: don't use deprecated method in sets example.
This commit is contained in:
parent
fa155111b4
commit
f1135f30f8
|
@ -189,13 +189,13 @@ backwards compatibility. Programmers should prefer the
|
|||
>>> engineers.add('Marvin') # add element
|
||||
>>> print engineers
|
||||
Set(['Jane', 'Marvin', 'Janice', 'John', 'Jack'])
|
||||
>>> employees.issuperset(engineers) # superset test
|
||||
>>> employees.issuperset(engineers) # superset test
|
||||
False
|
||||
>>> employees.union_update(engineers) # update from another set
|
||||
>>> employees.update(engineers) # update from another set
|
||||
>>> employees.issuperset(engineers)
|
||||
True
|
||||
>>> for group in [engineers, programmers, managers, employees]:
|
||||
... group.discard('Susan') # unconditionally remove element
|
||||
... group.discard('Susan') # unconditionally remove element
|
||||
... print group
|
||||
...
|
||||
Set(['Jane', 'Marvin', 'Janice', 'John', 'Jack'])
|
||||
|
|
Loading…
Reference in New Issue