mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Bug #1719995: don't use deprecated method in sets example.
(backport from rev. 55383)
This commit is contained in:
parent
5ece2fb0d1
commit
4043a6bbd6
1 changed files with 3 additions and 3 deletions
|
@ -187,13 +187,13 @@ backwards compatibility. Programmers should prefer the
|
||||||
>>> engineers.add('Marvin') # add element
|
>>> engineers.add('Marvin') # add element
|
||||||
>>> print engineers
|
>>> print engineers
|
||||||
Set(['Jane', 'Marvin', 'Janice', 'John', 'Jack'])
|
Set(['Jane', 'Marvin', 'Janice', 'John', 'Jack'])
|
||||||
>>> employees.issuperset(engineers) # superset test
|
>>> employees.issuperset(engineers) # superset test
|
||||||
False
|
False
|
||||||
>>> employees.union_update(engineers) # update from another set
|
>>> employees.update(engineers) # update from another set
|
||||||
>>> employees.issuperset(engineers)
|
>>> employees.issuperset(engineers)
|
||||||
True
|
True
|
||||||
>>> for group in [engineers, programmers, managers, employees]:
|
>>> for group in [engineers, programmers, managers, employees]:
|
||||||
... group.discard('Susan') # unconditionally remove element
|
... group.discard('Susan') # unconditionally remove element
|
||||||
... print group
|
... print group
|
||||||
...
|
...
|
||||||
Set(['Jane', 'Marvin', 'Janice', 'John', 'Jack'])
|
Set(['Jane', 'Marvin', 'Janice', 'John', 'Jack'])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue