mirror of https://github.com/exaloop/codon.git
Fix empty set repr
parent
74bc584393
commit
ea48d68dc5
|
@ -133,7 +133,7 @@ class Set:
|
|||
from internal.types.strbuf import strbuf
|
||||
n = self.__len__()
|
||||
if n == 0:
|
||||
return "{}"
|
||||
return "set()"
|
||||
else:
|
||||
buf = strbuf()
|
||||
buf.append("{")
|
||||
|
|
|
@ -383,7 +383,7 @@ def test_set():
|
|||
pass
|
||||
|
||||
assert repr({(1,2)}) == '{(1, 2)}'
|
||||
assert repr(Set[int]()) == '{}'
|
||||
assert repr(Set[int]()) == 'set()'
|
||||
test_set()
|
||||
|
||||
@test
|
||||
|
|
Loading…
Reference in New Issue