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
|
from internal.types.strbuf import strbuf
|
||||||
n = self.__len__()
|
n = self.__len__()
|
||||||
if n == 0:
|
if n == 0:
|
||||||
return "{}"
|
return "set()"
|
||||||
else:
|
else:
|
||||||
buf = strbuf()
|
buf = strbuf()
|
||||||
buf.append("{")
|
buf.append("{")
|
||||||
|
|
|
@ -383,7 +383,7 @@ def test_set():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
assert repr({(1,2)}) == '{(1, 2)}'
|
assert repr({(1,2)}) == '{(1, 2)}'
|
||||||
assert repr(Set[int]()) == '{}'
|
assert repr(Set[int]()) == 'set()'
|
||||||
test_set()
|
test_set()
|
||||||
|
|
||||||
@test
|
@test
|
||||||
|
|
Loading…
Reference in New Issue