Debian Codegraph @

mypyc/doc/set_operations.rst

raw
1 .. _set-ops:
2
3 Native set operations
4 ======================
5
6 These ``set`` operations have fast, optimized implementations. Other
7 set operations use generic implementations that are often slower.
8
9 Construction
10 ------------
11
12 Construct set with specific items:
13
14 * ``{item0, ..., itemN}``
15
16 Construct empty set:
17
18 * ``set()``
19
20 Construct set from iterable:
21
22 * ``set(x: Iterable)``
23
24 Set comprehensions:
25
26 * ``{... for ... in ...}``
27 * ``{... for ... in ... if ...}``
28
29 Operators
30 ---------
31
32 * ``item in s``
33
34 Methods
35 -------
36
37 * ``s.add(item)``
38 * ``s.remove(item)``
39 * ``s.discard(item)``
40 * ``s.update(x: Iterable)``
41 * ``s.clear()``
42 * ``s.pop()``
43
44 Functions
45 ---------
46
47 * ``len(s: set)``