Commit f1135f30 authored by Georg Brandl's avatar Georg Brandl

Bug #1719995: don't use deprecated method in sets example.

parent fa155111
...@@ -189,13 +189,13 @@ backwards compatibility. Programmers should prefer the ...@@ -189,13 +189,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'])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment