From 3ac3f19323039f1fe1b97bedc6f8b6405e676834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Mon, 28 Jan 2019 10:00:29 +0100 Subject: [PATCH] Array and deque --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index b1d96e6..368f284 100644 --- a/README.md +++ b/README.md @@ -955,6 +955,30 @@ b'\x00\x01\x00\x02\x00\x00\x00\x03' * `'d'` - double (8) +Array +----- +**List that can only hold elements of predefined type. Available types are listed above.** + +```python +from array import array + = array( [, ]) +``` + + +Deque +----- +**Short for “double-ended queue” and pronounced “deck”. They are thread-safe lists with efficient appends and pops from either side.** + +```python +from collections import deque + = deque(, maxlen=None) +.appendleft() +.extendleft() # Collection gets reversed. + = .popleft() +.rotate(n=1) # Rotates elements to the right. +``` + + Hashlib ------- ```python