From e7e22669e9c3bfa9de43075a7905a702ff51cda2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 29 Nov 2018 00:19:34 +0100 Subject: [PATCH] System --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 454049b..86ec650 100644 --- a/README.md +++ b/README.md @@ -742,6 +742,7 @@ import threading ```python thread = threading.Thread(target=, args=(, )) thread.start() +... thread.join() ``` @@ -749,6 +750,7 @@ thread.join() ```python lock = threading.Rlock() lock.acquire() +... lock.release() ``` @@ -803,10 +805,10 @@ from itertools import * >>> islice([1, 2, 3], 1, None) # islice(, from_inclusive, to_exclusive) [2, 3] ->>> a = [{'id': 1, 'name': 'bob'}, - {'id': 2, 'name': 'bob'}, - {'id': 3, 'name': 'peter'}] ->>> {k: list(v) for k, v in groupby(a, key=lambda x: x['name'])} +>>> people = [{'id': 1, 'name': 'bob'}, + {'id': 2, 'name': 'bob'}, + {'id': 3, 'name': 'peter'}] +>>> {k: list(v) for k, v in groupby(people, key=lambda x: x['name'])} {'bob': [{'id': 1, 'name': 'bob'}, {'id': 2, 'name': 'bob'}], 'peter': [{'id': 3, 'name': 'peter'}]}