From b16ccc6987e9f849236196ab07ebf014726aa1b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Mon, 24 Dec 2018 15:27:42 +0100 Subject: [PATCH] Set --- README.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index dd8ec19..4c37805 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,11 @@ List ---- ```python [from_inclusive : to_exclusive : step_size] -.append() -.extend() +.append() # Same as += [] +.extend() # Same as += +``` + +```python .sort() .reverse() = sorted() @@ -87,10 +90,10 @@ Set ``` ```python - = .union() - = .intersection() - = .difference() - = .symmetric_difference() + = .union() # Same as | + = .intersection() # Same as & + = .difference() # Same as - + = .symmetric_difference() # Same as ^ = .issubset() = .issuperset() ``` @@ -561,9 +564,9 @@ class (Enum): ``` ```python -list() # == [, , ...] -list(a.name for a in ) # == ['', '', ...] -random.choice(list()) # == random +list() # == [, , ...] +[a.name for a in ] # == ['', '', ...] +random.choice(list()) # == random ``` ### Inline @@ -1207,7 +1210,7 @@ duration = time() - start_time #### Times execution of the passed code: ```python from timeit import timeit -timeit('"-".join(str(n) for n in range(100))', number=1000000, , globals=globals()) +timeit('"-".join(str(n) for n in range(100))', number=1000000, globals=globals()) ``` #### Generates a PNG image of call graph and highlights the bottlenecks: