Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
var x = new Set<T>();
x := make(map[T]struct{})
x := make(map[T]bool)
let x = new Set();
class T(object):
pass
x = set(T())
class T:
...
s = set(T() for _ in range(x))
class T:
def __init__(self, x):
self.x = x
def __hash__(self):
return hash(self.x)
def __eq__(self, t):
return self.x == t.x
x = {T('abc'), T(123), T(lambda: ...)}
val x = Set[T]()