-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2779 from advikkabra/empty-set
Add `set()` for creating an empty set
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
def test_empty_set(): | ||
a: set[i32] = set() | ||
assert len(a) == 0 | ||
a.add(2) | ||
a.remove(2) | ||
a.add(3) | ||
assert a.pop() == 3 | ||
|
||
b: set[str] = set() | ||
|
||
assert len(b) == 0 | ||
b.add('a') | ||
b.remove('a') | ||
b.add('b') | ||
assert b.pop() == 3 | ||
|
||
test_empty_set() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters