Skip to content

Commit cf305a7

Browse files
committed
Change __repr__ to use list literal notation
A little clearer than using tuple notation, but still roundtrips. Add comment stating that we want to roundtrip.
1 parent e2b654d commit cf305a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/techcable/orderedset/_orderedset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ def copy(self) -> OrderedSet[T]:
212212

213213
@override
214214
def __repr__(self) -> str:
215-
return f"OrderedSet(({', '.join(map(repr, self))}))"
215+
# by convention, this should roundtrip through eval
216+
return f"OrderedSet([{', '.join(map(repr, self))}])"
216217

217218
@override
218219
def __str__(self) -> str:

0 commit comments

Comments
 (0)